Debian Codegraph @

llvm-project/llvm/projects/llvm-spirv/test/builtin-globals.ll

raw
1 ; RUN: llvm-as %s -o %t.bc
2 ; RUN: llvm-spirv %t.bc -spirv-text -o %t
3 ; RUN: llvm-spirv -r %t -spirv-text --spirv-target-env=SPV-IR --spirv-builtin-format=function -o %t2_rev.bc
4 ; RUN: llvm-spirv -r %t -spirv-text --spirv-target-env=SPV-IR --spirv-builtin-format=global -o %t3_rev.bc
5 ; RUN: llvm-spirv -r %t -spirv-text --spirv-builtin-format=function -o %t2_rev_ocl.bc
6 ; RUN: llvm-dis < %t2_rev.bc | FileCheck --check-prefix=CHECK-FUNCTION-FORMAT-REV %s
7 ; RUN: llvm-dis < %t3_rev.bc | FileCheck --check-prefix=CHECK-GLOBAL-FORMAT-REV %s
8 ; RUN: llvm-dis < %t2_rev_ocl.bc | FileCheck --check-prefix=CHECK-FUNCTION-FORMAT-OCL-REV %s
9 ; RUN: llvm-spirv %t.bc -o %t.spv
10 ; RUN: spirv-val %t.spv
11 ; RUN: llvm-spirv %t.bc --spirv-builtin-format=function -o %t2.spv
12 ; RUN: spirv-val %t2.spv
13 ; RUN: llvm-spirv %t.bc --spirv-builtin-format=global -o %t3.spv
14 ; RUN: spirv-val %t3.spv
15
16 ; CHECK-FUNCTION-FORMAT-REV: declare spir_func i64 @_Z26__spirv_BuiltInWorkgroupIdi(i32)
17 ; CHECK-FUNCTION-FORMAT-OCL-REV: declare spir_func i64 @_Z12get_group_idj(i32)
18
19 ; CHECK-GLOBAL-FORMAT-REV: @__spirv_BuiltInWorkgroupId = external addrspace(1) constant <3 x i64>, align 32
20
21 ; ModuleID = 'test.bc'
22 target datalayout = "e-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-n8:16:32:64"
23 target triple = "spir64-unknown-unknown"
24
25 @__spirv_BuiltInWorkgroupId = external dso_local local_unnamed_addr addrspace(1) constant <3 x i64>, align 32
26
27 ; Function Attrs: convergent norecurse nounwind
28 define weak_odr dso_local spir_kernel void @foo() {
29 entry:
30 %0 = load i64, i64 addrspace(1)* getelementptr inbounds (<3 x i64>, <3 x i64> addrspace(1)* @__spirv_BuiltInWorkgroupId, i64 0, i64 0), align 32
31 ret void
32 }