| 1 |
; RUN: llvm-spirv %s -to-binary -o %t.spv |
| 2 |
; RUN: spirv-val %t.spv |
| 3 |
; RUN: llvm-spirv -r %t.spv -o %t.bc |
| 4 |
; RUN: llvm-dis %t.bc |
| 5 |
; RUN: FileCheck < %t.ll %s |
| 6 |
|
| 7 |
; CHECK: %[[StructTy:[0-9a-z.]+]] = type { float, i32 } |
| 8 |
; CHECK: %[[#StructPtr:]] = alloca %[[StructTy]] |
| 9 |
; CHECK: %[[GEP:[0-9a-z.]+]] = getelementptr inbounds %[[StructTy]], ptr %[[#StructPtr]], i32 0, i32 0 |
| 10 |
; CHECK: store float %[[#]], ptr %[[GEP]] |
| 11 |
; CHECK: %[[GEP1:[0-9a-z.]+]] = getelementptr inbounds %[[StructTy]], ptr %[[#StructPtr]], i32 0, i32 1 |
| 12 |
; CHECK: store i32 %[[#]], ptr %[[GEP1]] |
| 13 |
; CHECK: %[[LoadStr:[0-9a-z.]+]] = load %[[StructTy]], ptr %[[#StructPtr]] |
| 14 |
; CHECK: ret %[[StructTy]] %[[LoadStr]] |
| 15 |
|
| 16 |
119734787 65536 393230 23 0 |
| 17 |
2 Capability Addresses |
| 18 |
2 Capability Linkage |
| 19 |
2 Capability Kernel |
| 20 |
5 ExtInstImport 1 "OpenCL.std" |
| 21 |
3 MemoryModel 2 2 |
| 22 |
3 Source 0 0 |
| 23 |
5 Name 2 "structtype" |
| 24 |
9 Name 6 "non_constant_struct_fields" |
| 25 |
11 Decorate 6 LinkageAttributes "non_constant_struct_fields" Export |
| 26 |
4 Decorate 9 Alignment 4 |
| 27 |
4 Decorate 11 Alignment 4 |
| 28 |
4 TypeInt 4 32 0 |
| 29 |
4 Constant 4 17 0 |
| 30 |
4 Constant 4 20 1 |
| 31 |
3 TypeFloat 3 32 |
| 32 |
4 TypeStruct 2 3 4 |
| 33 |
|
| 34 |
3 TypeFunction 5 2 |
| 35 |
4 TypePointer 8 7 4 |
| 36 |
4 TypePointer 10 7 3 |
| 37 |
|
| 38 |
5 Function 2 6 0 5 |
| 39 |
|
| 40 |
2 Label 7 |
| 41 |
4 Variable 8 9 7 |
| 42 |
4 Variable 10 11 7 |
| 43 |
4 Load 4 12 9 |
| 44 |
4 Load 3 13 11 |
| 45 |
5 CompositeConstruct 2 14 13 12 |
| 46 |
2 ReturnValue 14 |
| 47 |
|
| 48 |
1 FunctionEnd |