Debian Codegraph @

llvm-project/llvm/projects/llvm-spirv/test/builtin_duplicate.ll

raw
1 ;; This test checks if we generate a single builtin variable for the following
2 ;; LLVM IR.
3 ;; @__spirv_BuiltInLocalInvocationId - A global variable
4 ;; %lid = tail call i64 @_Z12get_local_idj(i32 0) - A function call
5
6 ; RUN: llvm-as %s -o %t.bc
7 ; RUN: llvm-spirv %t.bc -o %t.spv
8 ; RUN: llvm-spirv %t.bc -spirv-text -o %t.txt
9 ; RUN: FileCheck < %t.txt %s --check-prefix=CHECK-SPIRV
10 ; RUN: spirv-val %t.spv
11
12 target datalayout = "e-p:32:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024"
13 target triple = "spir-unknown-unknown"
14
15 %opencl.event_t = type opaque
16
17 ; CHECK-SPIRV: {{[0-9]+}} Name {{[0-9]+}} "__spirv_BuiltInLocalInvocationId"
18 ; CHECK-SPIRV-NOT: {{[0-9]+}} Name {{[0-9]+}} "__spirv_BuiltInLocalInvocationId.1"
19
20 @__spirv_BuiltInLocalInvocationId = external dso_local local_unnamed_addr addrspace(1) constant <3 x i64>, align 32
21
22 declare spir_func i64 @_Z12get_local_idj(i32) local_unnamed_addr
23
24 ; Function Attrs: nounwind
25 define spir_kernel void @test_fn(i32 %a) {
26 entry:
27 %lid = tail call i64 @_Z12get_local_idj(i32 0)
28 ret void
29 }
30
31 !spirv.Source = !{!0}
32
33 !0 = !{i32 6, i32 100000}