1 ; RUN: llc -O0 -mtriple=spirv64v1.4-unknown-unknown %s -o - | FileCheck %s
2 ; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv64v1.4-unknown-unknown %s -o - -filetype=obj | spirv-val %}
4 ; CHECK-DAG: OpName %[[#GV:]] "v"
5 ; CHECK-DAG: OpName %[[#FunBar:]] "bar"
6 ; CHECK-DAG: OpDecorate %[[#GV]] LinkageAttributes "v" Export
7 ; CHECK-DAG: OpDecorate %[[#GV]] Constant
8 ; CHECK-DAG: OpDecorate %[[#Idx:]] UserSemantic "SemanticValue"
9 ; CHECK: %[[#FunBar]] = OpFunction
10 ; CHECK: %[[#Idx]] = OpInBoundsPtrAccessChain
12 @v = addrspace(1) global i32 0, !spirv.Decorations !0
14 define spir_kernel void @foo() {
16 %pv = load ptr addrspace(1), ptr addrspace(1) @v
17 store i32 3, ptr addrspace(1) %pv
21 define spir_kernel void @bar(ptr addrspace(1) %arg) {
23 %idx = getelementptr inbounds i32, ptr addrspace(1) %arg, i64 1, !spirv.Decorations !3
28 !1 = !{i32 22} ; 22 is Constant decoration
29 !2 = !{i32 41, !"v", i32 0} ; 41 is LinkageAttributes decoration with 2 extra operands
31 !4 = !{i32 5635, !"SemanticValue"} ; 5635 is UserSemantic decoration