1 ; RUN: llc -O0 -mtriple=spirv32-unknown-unknown %s -o - | FileCheck %s --check-prefix=CHECK-SPIRV
3 ; CHECK-SPIRV: OpDecorate %[[#Id:]] BuiltIn GlobalLinearId
4 ; CHECK-SPIRV: %[[#Id:]] = OpVariable %[[#]]
6 @__spirv_BuiltInGlobalLinearId = external addrspace(1) global i32
8 define spir_kernel void @f(i32 addrspace(1)* nocapture %order) {
10 %0 = load i32, i32 addrspace(4)* addrspacecast (i32 addrspace(1)* @__spirv_BuiltInGlobalLinearId to i32 addrspace(4)*), align 4
11 ;; Need to store the result somewhere, otherwise the access to GlobalLinearId
13 store i32 %0, i32 addrspace(1)* %order, align 4