Debian Codegraph @

llvm-project/llvm/projects/llvm-spirv/test/DebugInfo/InvalidSourceLanguageSPIRVtoLLVM.spvasm

raw
1 ; This test checks that any invalid source language in the Compilation Unit instruction is mapped to
2 ; DW_LANG_OpenCL and the original literal value is retained in the "Source Lang Literal" LLVM module flag metadata.
3
4 ; REQUIRES: spirv-as
5
6 ; RUN: spirv-as --target-env spv1.3 %s -o %t.spv
7 ; RUN: llvm-spirv -r -emit-opaque-pointers %t.spv -o - | llvm-dis | FileCheck %s
8
9 ; SPIR-V
10 ; Version: 1.1
11 ; Generator: Khronos LLVM/SPIR-V Translator; 14
12 ; Bound: 16
13 ; Schema: 0
14 OpCapability Addresses
15 OpCapability Kernel
16 %1 = OpExtInstImport "OpenCL.std"
17 %2 = OpExtInstImport "OpenCL.DebugInfo.100"
18 OpMemoryModel Physical64 OpenCL
19 OpEntryPoint Kernel %5 "func"
20 %7 = OpString "kernel_arg_type.func."
21 %8 = OpString "/tmp/test.cl"
22 %9 = OpString "//__CSK_MD5:18aa9ce738eaafc7b7b7181c19092815"
23 %12 = OpString "func"
24 %14 = OpString ""
25 OpSource Unknown 0
26 OpName %entry "entry"
27 OpModuleProcessed "Debug info producer: "
28 %void = OpTypeVoid
29 %4 = OpTypeFunction %void
30 %10 = OpExtInst %void %2 DebugSource %8 %9
31 %11 = OpExtInst %void %2 DebugCompilationUnit 65536 5 %10 !0x0000002A
32 %13 = OpExtInst %void %2 DebugInfoNone
33 %15 = OpExtInst %void %2 DebugFunction %12 %13 %10 1 0 %11 %14 FlagIsDefinition|FlagPrototyped|FlagIsOptimized 2 %5 %13
34 %5 = OpFunction %void None %4
35 %entry = OpLabel
36 OpReturn
37 OpFunctionEnd
38
39 ; CHECK: {{![0-9]+}} = !{i32 2, !"Source Lang Literal", [[LIST:![0-9]+]]}
40 ; CHECK: [[LIST]] = !{[[ENTRY:![0-9]+]]}
41 ; CHECK: [[ENTRY]] = !{[[CU:![0-9]+]], i32 42}
42 ; CHECK: [[CU]] = distinct !DICompileUnit(language: DW_LANG_OpenCL