| 1 |
; RUN: llvm-as -opaque-pointers=0 %s -o %t.bc |
| 2 |
; RUN: llvm-spirv %t.bc -opaque-pointers=0 -o %t.spv |
| 3 |
; RUN: llvm-spirv %t.spv -to-text -o - | FileCheck %s --check-prefix=CHECK-SPIRV |
| 4 |
; RUN: spirv-val %t.spv |
| 5 |
; RUN: llvm-spirv -r -emit-opaque-pointers %t.spv -o %t.out.bc |
| 6 |
; RUN: llvm-dis %t.out.bc -o - | FileCheck %s --check-prefix=CHECK-OCL-IR |
| 7 |
; RUN: llvm-spirv -r -emit-opaque-pointers %t.spv --spirv-target-env=SPV-IR -o %t.out.bc |
| 8 |
; RUN: llvm-dis %t.out.bc -o - | FileCheck %s --check-prefix=CHECK-SPV-IR |
| 9 |
|
| 10 |
; Check that produced builtin-call-based SPV-IR is recognized by the translator |
| 11 |
; RUN: llvm-spirv -spirv-text %t.out.bc -o - | FileCheck %s --check-prefix=CHECK-SPIRV |
| 12 |
|
| 13 |
; CHECK-SPIRV: Decorate [[Id:[0-9]+]] BuiltIn 28 |
| 14 |
; CHECK-SPIRV: Variable {{[0-9]+}} [[Id:[0-9]+]] |
| 15 |
|
| 16 |
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" |
| 17 |
target triple = "spir-unknown-unknown" |
| 18 |
|
| 19 |
@__spirv_BuiltInGlobalInvocationId = external dso_local local_unnamed_addr addrspace(1) constant <3 x i64>, align 32 |
| 20 |
|
| 21 |
; Function Attrs: nounwind readnone |
| 22 |
define spir_kernel void @f() { |
| 23 |
entry: |
| 24 |
%0 = load i64, i64 addrspace(1)* getelementptr (<3 x i64>, <3 x i64> addrspace(1)* @__spirv_BuiltInGlobalInvocationId, i64 0, i64 0), align 32 |
| 25 |
; CHECK-OCL-IR: %[[#ID1:]] = call spir_func i64 @_Z13get_global_idj(i32 0) |
| 26 |
|
| 27 |
; CHECK-SPV-IR: %[[#ID1:]] = call spir_func i64 @_Z33__spirv_BuiltInGlobalInvocationIdi(i32 0) |
| 28 |
|
| 29 |
ret void |
| 30 |
} |