xref: /llvm-project/llvm/test/CodeGen/SPIRV/logical-access-chain.ll (revision 83c1d003118a2cb8136fe49e2ec43958c93d9d6b)
1; RUN: llc -O0 -mtriple=spirv-unknown-unknown %s -o - | FileCheck %s
2
3; CHECK-DAG:      [[uint:%[0-9]+]] = OpTypeInt 32 0
4; CHECK-DAG:     [[uint2:%[0-9]+]] = OpTypeVector [[uint]] 2
5; CHECK-DAG:    [[uint_1:%[0-9]+]] = OpConstant [[uint]] 1
6; CHECK-DAG:  [[ptr_uint:%[0-9]+]] = OpTypePointer Function [[uint]]
7; CHECK-DAG: [[ptr_uint2:%[0-9]+]] = OpTypePointer Function [[uint2]]
8
9define void @main() #1 {
10entry:
11  %0 = alloca <2 x i32>, align 4
12; CHECK: [[var:%[0-9]+]] = OpVariable [[ptr_uint2]] Function
13
14  %1 = getelementptr <2 x i32>, ptr %0, i32 0, i32 1
15; CHECK: {{%[0-9]+}} = OpAccessChain [[ptr_uint]] [[var]] [[uint_1]]
16
17  ret void
18}
19
20attributes #1 = { "hlsl.numthreads"="4,8,16" "hlsl.shader"="compute" }
21