| 1 |
; Tests translation of GlobalVariable with DebugInfoNone type |
| 2 |
|
| 3 |
; REQUIRES: spirv-as |
| 4 |
|
| 5 |
; RUN: spirv-as %s --target-env spv1.1 -o %t.spv |
| 6 |
; RUN: llvm-spirv -r -o %t.rev.bc %t.spv |
| 7 |
; RUN: llvm-dis %t.rev.bc -o %t.rev.ll |
| 8 |
; RUN: FileCheck %s --input-file %t.rev.ll --check-prefix CHECK-LLVM |
| 9 |
|
| 10 |
; CHECK-LLVM: distinct !DIGlobalVariable(name: "i", linkageName: "_ZL1i", scope: ![[#]], file: ![[#]], line: 1, type: ![[#Type:]], isLocal: true, isDefinition: true) |
| 11 |
; CHECK-LLVM: ![[#Type]] = !DIBasicType(tag: DW_TAG_unspecified_type, name: "SPIRV unknown type") |
| 12 |
|
| 13 |
; SPIR-V |
| 14 |
; Version: 1.1 |
| 15 |
; Generator: Khronos LLVM/SPIR-V Translator; 14 |
| 16 |
; Bound: 24 |
| 17 |
; Schema: 0 |
| 18 |
OpCapability Addresses |
| 19 |
OpCapability Linkage |
| 20 |
OpCapability Kernel |
| 21 |
%1 = OpExtInstImport "OpenCL.std" |
| 22 |
%2 = OpExtInstImport "OpenCL.DebugInfo.100" |
| 23 |
OpMemoryModel Physical64 OpenCL |
| 24 |
%8 = OpString "/tmp/global.cpp" |
| 25 |
%13 = OpString "int" |
| 26 |
%17 = OpString "main" |
| 27 |
%18 = OpString "" |
| 28 |
%21 = OpString "i" |
| 29 |
%22 = OpString "_ZL1i" |
| 30 |
OpSource Unknown 0 |
| 31 |
OpName %main "main" |
| 32 |
OpName %entry "entry" |
| 33 |
OpModuleProcessed "Debuginfoproducer:clangversion3.4" |
| 34 |
OpDecorate %main LinkageAttributes "main" Export |
| 35 |
%uint = OpTypeInt 32 0 |
| 36 |
%uint_0 = OpConstant %uint 0 |
| 37 |
%uint_32 = OpConstant %uint 32 |
| 38 |
%4 = OpTypeFunction %uint |
| 39 |
%void = OpTypeVoid |
| 40 |
%10 = OpExtInst %void %2 DebugInfoNone |
| 41 |
%11 = OpExtInst %void %2 DebugSource %8 |
| 42 |
%12 = OpExtInst %void %2 DebugCompilationUnit 65536 3 %11 CPP_for_OpenCL |
| 43 |
%15 = OpExtInst %void %2 DebugTypeBasic %13 %uint_32 Signed |
| 44 |
%16 = OpExtInst %void %2 DebugTypeFunction None %15 |
| 45 |
%19 = OpExtInst %void %2 DebugInfoNone |
| 46 |
%20 = OpExtInst %void %2 DebugFunction %17 %16 %11 2 0 %12 %18 FlagIsDefinition|FlagPrototyped|FlagIsOptimized 2 %main %19 |
| 47 |
%23 = OpExtInst %void %2 DebugGlobalVariable %21 %10 %11 1 0 %12 %22 %19 FlagIsLocal|FlagIsDefinition |
| 48 |
%main = OpFunction %uint None %4 |
| 49 |
%entry = OpLabel |
| 50 |
%24 = OpExtInst %void %2 DebugScope %20 |
| 51 |
OpLine %8 4 0 |
| 52 |
OpReturnValue %uint_0 |
| 53 |
OpFunctionEnd |
| 54 |
|