1; RUN: llvm-as < %s | llvm-spirv -spirv-text -o %t 2; RUN: FileCheck < %t %s 3 4; CHECK: 119734787 {{[0-9]*}} {{[0-9]*}} {{[0-9]*}} 0 5; CHECK-NEXT: {{[0-9]*}} Capability 6; CHECK: {{[0-9]*}} ExtInstImport 7; CHECK-NEXT: {{[0-9]*}} MemoryModel 8; CHECK-NEXT: {{[0-9]*}} EntryPoint 9; CHECK-NEXT: {{[0-9]*}} Source 10 11; CHECK-NOT: {{[0-9]*}} Capability 12; CHECK-NOT: {{[0-9]*}} ExtInstImport 13; CHECK-NOT: {{[0-9]*}} MemoryModel 14; CHECK-NOT: {{[0-9]*}} EntryPoint 15; CHECK-NOT: {{[0-9]*}} Source 16; CHECK-NOT: {{[0-9]*}} Decorate 17; CHECK-NOT: {{[0-9]*}} Type 18; CHECK-NOT: {{[0-9]*}} Variable 19; CHECK-NOT: {{[0-9]*}} Function 20 21; CHECK: {{[0-9]*}} Name 22 23; CHECK-NOT: {{[0-9]*}} Capability 24; CHECK-NOT: {{[0-9]*}} ExtInstImport 25; CHECK-NOT: {{[0-9]*}} MemoryModel 26; CHECK-NOT: {{[0-9]*}} EntryPoint 27; CHECK-NOT: {{[0-9]*}} Source 28; CHECK-NOT: {{[0-9]*}} Type 29; CHECK-NOT: {{[0-9]*}} Variable 30; CHECK-NOT: {{[0-9]*}} Function 31 32; CHECK: {{[0-9]*}} Decorate 33 34; CHECK-NOT: {{[0-9]*}} Capability 35; CHECK-NOT: {{[0-9]*}} ExtInstImport 36; CHECK-NOT: {{[0-9]*}} MemoryModel 37; CHECK-NOT: {{[0-9]*}} EntryPoint 38; CHECK-NOT: {{[0-9]*}} Source 39; CHECK-NOT: {{[0-9]*}} Name 40; CHECK-NOT: {{[0-9]*}} Variable 41; CHECK-NOT: {{[0-9]*}} Function 42 43; CHECK: {{[0-9]*}} TypeForwardPointer [[AFwdPtr:[0-9]+]] 44; CHECK: {{[0-9]*}} TypeInt [[TypeInt:[0-9]+]] 45; CHECK: {{[0-9]*}} Constant [[TypeInt]] [[Two:[0-9]+]] 2 46; CHECK: {{[0-9]*}} TypeFloat [[TypeFloat:[0-9]+]] 47; CHECK: {{[0-9]*}} TypeArray [[TypeArray:[0-9]+]] [[TypeFloat]] [[Two]] 48; CHECK: {{[0-9]*}} TypeVector [[TypeVectorInt3:[0-9]+]] [[TypeInt]] 3 49; CHECK: {{[0-9]*}} TypeStruct [[BID:[0-9]+]] {{[0-9]+}} [[AFwdPtr]] 50; CHECK: {{[0-9]*}} TypeStruct [[CID:[0-9]+]] {{[0-9]+}} [[BID]] 51; CHECK: {{[0-9]*}} TypeStruct [[AID:[0-9]+]] {{[0-9]+}} [[CID]] 52; CHECK: {{[0-9]*}} TypePointer [[AFwdPtr]] {{[0-9]*}} [[AID]] 53; CHECK: {{[0-9]*}} TypeVoid [[Void:[0-9]+]] 54; CHECK: {{[0-9]*}} TypePointer [[Int3Ptr:[0-9]+]] {{[0-9]+}} [[TypeVectorInt3]] 55; CHECK: {{[0-9]*}} TypeFunction [[TypeBar1:[0-9]+]] [[Void]] [[Int3Ptr]] 56 57; CHECK-NOT: {{[0-9]*}} Capability 58; CHECK-NOT: {{[0-9]*}} ExtInstImport 59; CHECK-NOT: {{[0-9]*}} MemoryModel 60; CHECK-NOT: {{[0-9]*}} EntryPoint 61; CHECK-NOT: {{[0-9]*}} Source 62; CHECK-NOT: {{[0-9]*}} Name 63; CHECK-NOT: {{[0-9]*}} Decorate 64 65; CHECK: {{[0-9]*}} Variable 66 67; CHECK-NOT: {{[0-9]*}} Capability 68; CHECK-NOT: {{[0-9]*}} ExtInstImport 69; CHECK-NOT: {{[0-9]*}} MemoryModel 70; CHECK-NOT: {{[0-9]*}} EntryPoint 71; CHECK-NOT: {{[0-9]*}} Source 72; CHECK-NOT: {{[0-9]*}} Name 73; CHECK-NOT: {{[0-9]*}} Type 74; CHECK-NOT: {{[0-9]*}} Decorate 75 76; CHECK: {{[0-9]*}} Function 77; CHECK: {{[0-9]*}} FunctionParameter 78; CHECK-NOT: {{[0-9]*}} Return 79; CHECK: {{[0-9]*}} FunctionEnd 80 81; CHECK-NOT: {{[0-9]*}} Capability 82; CHECK-NOT: {{[0-9]*}} ExtInstImport 83; CHECK-NOT: {{[0-9]*}} MemoryModel 84; CHECK-NOT: {{[0-9]*}} EntryPoint 85; CHECK-NOT: {{[0-9]*}} Source 86; CHECK-NOT: {{[0-9]*}} Name 87; CHECK-NOT: {{[0-9]*}} Type 88; CHECK-NOT: {{[0-9]*}} Decorate 89; CHECK-NOT: {{[0-9]*}} Variable 90 91; CHECK: {{[0-9]*}} Function 92; CHECK: {{[0-9]*}} FunctionParameter 93; CHECK: {{[0-9]*}} FunctionParameter 94; CHECK-NOT: {{[0-9]*}} Return 95; CHECK: {{[0-9]*}} FunctionEnd 96 97; CHECK-NOT: {{[0-9]*}} Capability 98; CHECK-NOT: {{[0-9]*}} ExtInstImport 99; CHECK-NOT: {{[0-9]*}} MemoryModel 100; CHECK-NOT: {{[0-9]*}} EntryPoint 101; CHECK-NOT: {{[0-9]*}} Source 102; CHECK-NOT: {{[0-9]*}} Name 103; CHECK-NOT: {{[0-9]*}} Type 104; CHECK-NOT: {{[0-9]*}} Decorate 105; CHECK-NOT: {{[0-9]*}} Variable 106 107; CHECK: {{[0-9]*}} Function 108; CHECK: {{[0-9]*}} FunctionParameter 109; CHECK: {{[0-9]*}} Label 110; CHECK: {{[0-9]*}} FunctionCall 111; CHECK: {{[0-9]*}} FunctionCall 112; CHECK: {{[0-9]*}} Return 113; CHECK: {{[0-9]*}} FunctionEnd 114 115; CHECK-NOT: {{[0-9]*}} Capability 116; CHECK-NOT: {{[0-9]*}} ExtInstImport 117; CHECK-NOT: {{[0-9]*}} MemoryModel 118; CHECK-NOT: {{[0-9]*}} EntryPoint 119; CHECK-NOT: {{[0-9]*}} Source 120; CHECK-NOT: {{[0-9]*}} Name 121; CHECK-NOT: {{[0-9]*}} Type 122; CHECK-NOT: {{[0-9]*}} Decorate 123; CHECK-NOT: {{[0-9]*}} Variable 124 125; ModuleID = 'layout.bc' 126target datalayout = "e-p:32:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024" 127target triple = "spir" 128 129%struct.A = type { i32, %struct.C } 130%struct.C = type { i32, %struct.B } 131%struct.B = type { i32, %struct.A addrspace(4)* } 132 133@f = addrspace(2) constant [2 x float] zeroinitializer, align 4 134@b = external addrspace(2) constant <3 x i32> 135@a = common addrspace(1) global %struct.A zeroinitializer, align 4 136 137; Function Attrs: nounwind 138define spir_kernel void @foo(<3 x i32> addrspace(1)* %a) #0 { 139entry: 140 call spir_func void @bar1(<3 x i32> addrspace(1)* %a) 141 %loadVec4 = load <4 x i32>, <4 x i32> addrspace(2)* bitcast (<3 x i32> addrspace(2)* @b to <4 x i32> addrspace(2)*) 142 %extractVec = shufflevector <4 x i32> %loadVec4, <4 x i32> undef, <3 x i32> <i32 0, i32 1, i32 2> 143 call spir_func void @bar2(<3 x i32> addrspace(1)* %a, <3 x i32> %extractVec) 144 ret void 145} 146 147declare spir_func void @bar1(<3 x i32> addrspace(1)*) #1 148 149declare spir_func void @bar2(<3 x i32> addrspace(1)*, <3 x i32>) #1 150 151attributes #0 = { nounwind "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-realign-stack" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" } 152attributes #1 = { "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-realign-stack" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" } 153 154!opencl.kernels = !{!0} 155!opencl.enable.FP_CONTRACT = !{} 156!opencl.spir.version = !{!6} 157!opencl.ocl.version = !{!7} 158!opencl.used.extensions = !{!8} 159!opencl.used.optional.core.features = !{!8} 160!opencl.compiler.options = !{!8} 161 162!0 = !{void (<3 x i32> addrspace(1)*)* @foo, !1, !2, !3, !4, !5} 163!1 = !{!"kernel_arg_addr_space", i32 1} 164!2 = !{!"kernel_arg_access_qual", !"none"} 165!3 = !{!"kernel_arg_type", !"int3*"} 166!4 = !{!"kernel_arg_base_type", !"int3*"} 167!5 = !{!"kernel_arg_type_qual", !""} 168!6 = !{i32 1, i32 2} 169!7 = !{i32 2, i32 0} 170!8 = !{} 171 172