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: ShaderNonUniform
6 ; CHECK-NEXT: OpCapability SampledImageArrayNonUniformIndexing
7 ; CHECK-NOT: OpCapability
9 ; CHECK-DAG: OpDecorate [[Var:%[0-9]+]] DescriptorSet 3
10 ; CHECK-DAG: OpDecorate [[Var]] Binding 4
11 ; CHECK: OpDecorate [[Zero:%[0-9]+]] NonUniform
12 ; CHECK: OpDecorate [[ac0:%[0-9]+]] NonUniform
13 ; CHECK: OpDecorate [[ld0:%[0-9]+]] NonUniform
14 ; CHECK: OpDecorate [[One:%[0-9]+]] NonUniform
15 ; CHECK: OpDecorate [[ac1:%[0-9]+]] NonUniform
16 ; CHECK: OpDecorate [[ld1:%[0-9]+]] NonUniform
18 ; CHECK-DAG: [[int:%[0-9]+]] = OpTypeInt 32 0
19 ; CHECK-DAG: [[SamplerType:%[0-9]+]] = OpTypeSampler
20 ; CHECK-DAG: [[SamplerPtrType:%[0-9]+]] = OpTypePointer UniformConstant [[SamplerType]]
21 ; CHECK-DAG: [[ArraySize:%[0-9]+]] = OpConstant [[int]] 3
22 ; CHECK-DAG: [[One]] = OpConstant [[int]] 1
23 ; CHECK-DAG: [[Zero]] = OpConstant [[int]] 0
24 ; CHECK-DAG: [[SamplerArrayType:%[0-9]+]] = OpTypeArray [[SamplerType]] [[ArraySize]]
25 ; CHECK-DAG: [[ArrayPtrType:%[0-9]+]] = OpTypePointer UniformConstant [[SamplerArrayType]]
26 ; CHECK-DAG: [[Var]] = OpVariable [[ArrayPtrType]] UniformConstant
28 ; CHECK: {{%[0-9]+}} = OpFunction {{%[0-9]+}} DontInline {{%[0-9]+}}
30 define void @main() #0 {
31 ; CHECK: [[ac0]] = OpAccessChain [[SamplerPtrType]] [[Var]] [[Zero]]
32 ; CHECK: [[ld0]] = OpLoad [[SamplerType]] [[ac0]]
33 %buffer0 = call target("spirv.Sampler")
34 @llvm.spv.handle.fromBinding.tspirv.Image(
35 i32 3, i32 4, i32 3, i32 0, i1 true)
37 ; CHECK: [[ac1:%[0-9]+]] = OpAccessChain [[SamplerPtrType]] [[Var]] [[One]]
38 ; CHECK: [[ld1]] = OpLoad [[SamplerType]] [[ac1]]
39 %buffer1 = call target("spirv.Sampler")
40 @llvm.spv.handle.fromBinding.tspirv.Image(
41 i32 3, i32 4, i32 3, i32 1, i1 true)
45 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" }