Debian Codegraph @

llvm-project/llvm/projects/llvm-spirv/test/DebugInfo/SourceLanguageLLVMToSPIRV.ll

raw
1 ; Test checks that DW_LANG_C99 and DW_LANG_OpenCL are mapped to OpenCL C
2 ; in the SourceLanguage enum, and also that DW_LANG_C_plus_plus and
3 ; DW_LANG_C_plus_plus_14 are mapped to C++ for OpenCL.
4
5 ; LLVM does not yet define DW_LANG_C_plus_plus_17. A test case that
6 ; checks DW_LANG_C_plus_plus_17 is mapped to C++ for OpenCL should be
7 ; added once this is defined.
8
9 ; RUN: sed -e 's/INPUT_LANGUAGE/DW_LANG_C99/' %s | llvm-as - -o %t.bc
10 ; RUN: llvm-spirv -spirv-text %t.bc -o - | FileCheck %s --check-prefix=CHECK-OPENCLC
11
12 ; RUN: sed -e 's/INPUT_LANGUAGE/DW_LANG_OpenCL/' %s | llvm-as - -o %t.bc
13 ; RUN: llvm-spirv -spirv-text %t.bc -o - | FileCheck %s --check-prefix=CHECK-OPENCLC
14
15 ; RUN: sed -e 's/INPUT_LANGUAGE/DW_LANG_C_plus_plus/' %s | llvm-as - -o %t.bc
16 ; RUN: llvm-spirv -spirv-text %t.bc -o - | FileCheck %s --check-prefix=CHECK-CPP4OPENCL
17
18 ; RUN: sed -e 's/INPUT_LANGUAGE/DW_LANG_C_plus_plus_14/' %s | llvm-as - -o %t.bc
19 ; RUN: llvm-spirv -spirv-text %t.bc -o - | FileCheck %s --check-prefix=CHECK-CPP4OPENCL
20
21 target datalayout = "e-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024"
22 target triple = "spir64-unknown-unknown"
23
24 define dso_local spir_kernel void @func() local_unnamed_addr !dbg !7 !kernel_arg_addr_space !2 !kernel_arg_access_qual !2 !kernel_arg_type !2 !kernel_arg_base_type !2 !kernel_arg_type_qual !2 {
25 entry:
26 ret void
27 }
28
29 !llvm.dbg.cu = !{!0}
30 !llvm.module.flags = !{!3, !4, !5}
31
32 !0 = distinct !DICompileUnit(language: INPUT_LANGUAGE, file: !1)
33 !1 = !DIFile(filename: "test.cl", directory: "/tmp", checksumkind: CSK_MD5, checksum: "18aa9ce738eaafc7b7b7181c19092815")
34 !2 = !{}
35 !3 = !{i32 7, !"Dwarf Version", i32 5}
36 !4 = !{i32 2, !"Debug Info Version", i32 3}
37 !5 = !{i32 1, !"wchar_size", i32 4}
38 !6 = !{i32 2, i32 0}
39 !7 = distinct !DISubprogram(name: "func", scope: !8, file: !8, line: 1, scopeLine: 2, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !2)
40 !8 = !DIFile(filename: "test.cl", directory: "/tmp", checksumkind: CSK_MD5, checksum: "18aa9ce738eaafc7b7b7181c19092815")
41
42 ; CHECK-OPENCLC: DebugCompilationUnit {{[0-9]+}} {{[0-9]+}} {{[0-9]+}} 3
43 ; CHECK-CPP4OPENCL: DebugCompilationUnit {{[0-9]+}} {{[0-9]+}} {{[0-9]+}} 6