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 ; SCHECK-NEXT: OpCapability ImageBuffer
6 ; CHECK-NEXT: OpCapability StorageTexelBufferArrayDynamicIndexing
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]] Buffer 2 0 0 2 R32i {{$}}
14 ; CHECK-DAG: [[BufferPtrType:%[0-9]+]] = OpTypePointer UniformConstant [[BufferType]]
15 ; CHECK-DAG: [[ArraySize:%[0-9]+]] = OpConstant [[int]] 3
16 ; CHECK-DAG: [[One:%[0-9]+]] = OpConstant [[int]] 1
17 ; CHECK-DAG: [[Zero:%[0-9]+]] = OpConstant [[int]] 0
18 ; CHECK-DAG: [[BufferArrayType:%[0-9]+]] = OpTypeArray [[BufferType]] [[ArraySize]]
19 ; CHECK-DAG: [[ArrayPtrType:%[0-9]+]] = OpTypePointer UniformConstant [[BufferArrayType]]
20 ; CHECK-DAG: [[Var]] = OpVariable [[ArrayPtrType]] UniformConstant
22 ; CHECK: {{%[0-9]+}} = OpFunction {{%[0-9]+}} DontInline {{%[0-9]+}}
24 define void @void() #0 {
25 ; CHECK: [[ac:%[0-9]+]] = OpAccessChain [[BufferPtrType]] [[Var]] [[Zero]]
26 ; CHECK: [[buffer:%[0-9]+]] = OpLoad [[BufferType]] [[ac]]
27 %buffer0 = call target("spirv.Image", i32, 5, 2, 0, 0, 2, 24)
28 @llvm.spv.handle.fromBinding.tspirv.Image_f32_5_2_0_0_2_24(
29 i32 3, i32 4, i32 3, i32 0, i1 false)
31 ; CHECK: [[ac:%[0-9]+]] = OpAccessChain [[BufferPtrType]] [[Var]] [[One]]
32 ; CHECK: [[buffer:%[0-9]+]] = OpLoad [[BufferType]] [[ac]]
33 %buffer1 = call target("spirv.Image", i32, 5, 2, 0, 0, 2, 24)
34 @llvm.spv.handle.fromBinding.tspirv.Image_f32_5_2_0_0_2_24(
35 i32 3, i32 4, i32 3, i32 1, i1 false)
39 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" }