| 1 |
;; This test checks if we generate a single builtin variable for the following |
| 2 |
;; LLVM IR. |
| 3 |
;; @__spirv_BuiltInLocalInvocationId - A global variable |
| 4 |
;; %3 = tail call i64 @_Z12get_local_idj(i32 0) - A function call |
| 5 |
|
| 6 |
; RUN: llc -verify-machineinstrs -O0 -mtriple=spirv64-unknown-unknown %s -o - | FileCheck %s |
| 7 |
; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv64-unknown-unknown %s -o - -filetype=obj | spirv-val %} |
| 8 |
|
| 9 |
; CHECK: OpName %[[#]] "__spirv_BuiltInLocalInvocationId" |
| 10 |
; CHECK-NOT: OpName %[[#]] "__spirv_BuiltInLocalInvocationId.1" |
| 11 |
|
| 12 |
@__spirv_BuiltInLocalInvocationId = external dso_local local_unnamed_addr addrspace(1) constant <3 x i64>, align 32 |
| 13 |
|
| 14 |
declare spir_func i64 @_Z12get_local_idj(i32) local_unnamed_addr |
| 15 |
|
| 16 |
define spir_kernel void @test(i32 %a) { |
| 17 |
entry: |
| 18 |
%builtin_call = tail call i64 @_Z12get_local_idj(i32 0) |
| 19 |
ret void |
| 20 |
} |