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