1 ; RUN: llc -O0 -verify-machineinstrs -mtriple=spirv1.5-vulkan-library %s -o - | FileCheck %s
2 ; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv1.5-vulkan-library %s -o - -filetype=obj | spirv-val %}
4 ; CHECK: OpCapability Shader
5 ; CHECK-NEXT: OpCapability SampledImageArrayDynamicIndexing
6 ; CHECK-NEXT: OpCapability Sampled1D
7 ; CHECK-NOT: OpCapability
9 ; CHECK-DAG: OpDecorate [[Var:%[0-9]+]] DescriptorSet 3
10 ; CHECK-DAG: OpDecorate [[Var]] Binding 4
12 ; CHECK-DAG: [[int:%[0-9]+]] = OpTypeInt 32 0
13 ; CHECK-DAG: [[BufferType:%[0-9]+]] = OpTypeImage [[int]] 1D 2 0 0 1 R32i {{$}}
14 ; CHECK-DAG: [[CombindedType:%[0-9]+]] = OpTypeSampledImage [[BufferType]]
15 ; CHECK-DAG: [[BufferPtrType:%[0-9]+]] = OpTypePointer UniformConstant [[CombindedType]]
16 ; CHECK-DAG: [[ArraySize:%[0-9]+]] = OpConstant [[int]] 3
17 ; CHECK-DAG: [[One:%[0-9]+]] = OpConstant [[int]] 1
18 ; CHECK-DAG: [[Zero:%[0-9]+]] = OpConstant [[int]] 0
19 ; CHECK-DAG: [[BufferArrayType:%[0-9]+]] = OpTypeArray [[CombindedType]] [[ArraySize]]
20 ; CHECK-DAG: [[ArrayPtrType:%[0-9]+]] = OpTypePointer UniformConstant [[BufferArrayType]]
21 ; CHECK-DAG: [[Var]] = OpVariable [[ArrayPtrType]] UniformConstant
23 ; CHECK: {{%[0-9]+}} = OpFunction {{%[0-9]+}} DontInline {{%[0-9]+}}
25 define void @main() #0 {
26 ; CHECK: [[ac:%[0-9]+]] = OpAccessChain [[BufferPtrType]] [[Var]] [[Zero]]
27 ; CHECK: [[buffer:%[0-9]+]] = OpLoad [[CombindedType]] [[ac]]
28 %buffer0 = call target("spirv.SampledImage", i32, 0, 2, 0, 0, 1, 24)
29 @llvm.spv.handle.fromBinding.tspirv.Image_f32_0_2_0_0_1_24(
30 i32 3, i32 4, i32 3, i32 0, i1 false)
32 ; CHECK: [[ac:%[0-9]+]] = OpAccessChain [[BufferPtrType]] [[Var]] [[One]]
33 ; CHECK: [[buffer:%[0-9]+]] = OpLoad [[CombindedType]] [[ac]]
34 %buffer1 = call target("spirv.SampledImage", i32, 0, 2, 0, 0, 1, 24)
35 @llvm.spv.handle.fromBinding.tspirv.Image_f32_0_2_0_0_1_24(
36 i32 3, i32 4, i32 3, i32 1, i1 false)
40 attributes #0 = { convergent noinline norecurse "frame-pointer"="all" "hlsl.numthreads"="1,1,1" "hlsl.shader"="compute" "no-trapping-math"="true" "stack-protector-buffer-size"="8" }