Debian Codegraph @

llvm-project/llvm/projects/llvm-spirv/test/builtin-functions.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(7) constant <3 x i64>
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 ; Function Attrs: nounwind
26 declare spir_func i64 @_Z26__spirv_BuiltInWorkgroupIdi(i32) #0
27
28 ; Function Attrs: convergent norecurse nounwind
29 define weak_odr dso_local spir_kernel void @foo() {
30 entry:
31 %0 = call spir_func i64 @_Z26__spirv_BuiltInWorkgroupIdi(i32 0) #0
32 ret void
33 }