| 1 |
; RUN: cat %s > %t.spvasm |
| 2 |
; RUN: llvm-spirv %t.spvasm --to-binary -o %t.spv |
| 3 |
; RUN: llvm-spirv -r -emit-opaque-pointers %t.spv -o - | llvm-dis | FileCheck %s |
| 4 |
|
| 5 |
; SPIR-V generated via: |
| 6 |
; clang -cc1 input.cl -triple spir -disable-llvm-passes -debug-info-kind=standalone -emit-llvm-bc -o - | ./bin/llvm-spirv -spirv-mem2reg -o input.spv; llvm-spirv input.spv --to-text -o - |
| 7 |
; where input.cl is: |
| 8 |
; struct Foo { |
| 9 |
; int e; |
| 10 |
; }; |
| 11 |
; void foo() { |
| 12 |
; struct Foo f; |
| 13 |
; } |
| 14 |
; |
| 15 |
; The resulting SPIR-V was then tweaked to have the DebugTypeComposite use a |
| 16 |
; DebugInfoNone (%7) instead of the real size (%18). The resulting debug info |
| 17 |
; then contains a DICompositeType with no size information. |
| 18 |
|
| 19 |
; CHECK: {{![0-9]*}} = !DICompositeType(tag: DW_TAG_structure_type, name: "Foo", file: {{![0-9]*}}, line: 1, elements: {{![0-9]*}}) |
| 20 |
|
| 21 |
119734787 65536 393230 8 0 |
| 22 |
2 Capability Addresses |
| 23 |
2 Capability Linkage |
| 24 |
2 Capability Kernel |
| 25 |
5 ExtInstImport 1 "OpenCL.std" |
| 26 |
5 ExtInstImport 2 "SPIRV.debug" |
| 27 |
3 MemoryModel 1 2 |
| 28 |
6 String 9 "/tmp/<stdin>" |
| 29 |
3 String 14 "Foo" |
| 30 |
6 String 15 "/tmp/input.cl" |
| 31 |
3 String 19 "e" |
| 32 |
3 String 20 "int" |
| 33 |
3 String 25 "foo" |
| 34 |
3 String 26 "" |
| 35 |
3 String 28 "f" |
| 36 |
3 Source 3 100000 |
| 37 |
3 Name 5 "foo" |
| 38 |
4 Name 6 "entry" |
| 39 |
5 Name 30 "struct.Foo" |
| 40 |
5 Decorate 5 LinkageAttributes "foo" Export |
| 41 |
4 TypeInt 17 32 0 |
| 42 |
4 Constant 17 18 32 |
| 43 |
4 Constant 17 22 0 |
| 44 |
2 TypeVoid 3 |
| 45 |
3 TypeFunction 4 3 |
| 46 |
3 TypeStruct 30 17 |
| 47 |
4 TypePointer 31 7 30 |
| 48 |
3 Undef 31 32 |
| 49 |
|
| 50 |
|
| 51 |
5 ExtInst 3 7 2 DebugInfoNone |
| 52 |
7 ExtInst 3 10 2 DebugSource 9 7 |
| 53 |
9 ExtInst 3 11 2 DebugCompilationUnit 65536 0 10 12 |
| 54 |
7 ExtInst 3 12 2 DebugTypeFunction 0 7 |
| 55 |
7 ExtInst 3 16 2 DebugSource 15 7 |
| 56 |
8 ExtInst 3 21 2 DebugTypeBasic 20 18 4 |
| 57 |
14 ExtInst 3 23 2 DebugTypeMember 19 21 16 2 0 13 22 18 0 |
| 58 |
15 ExtInst 3 13 2 DebugTypeComposite 14 1 16 1 0 11 7 7 0 23 |
| 59 |
16 ExtInst 3 27 2 DebugFunction 25 12 16 4 0 11 26 8328 4 5 7 |
| 60 |
12 ExtInst 3 29 2 DebugLocalVariable 28 13 16 5 0 27 0 |
| 61 |
5 ExtInst 3 33 2 DebugExpression |
| 62 |
|
| 63 |
5 Function 3 5 0 4 |
| 64 |
|
| 65 |
2 Label 6 |
| 66 |
6 ExtInst 3 34 2 DebugScope 27 |
| 67 |
4 Line 15 5 0 |
| 68 |
8 ExtInst 3 8 2 DebugDeclare 29 32 33 |
| 69 |
4 Line 15 6 0 |
| 70 |
1 Return |
| 71 |
|
| 72 |
1 FunctionEnd |