| 1 |
; REQUIRES: spirv-as |
| 2 |
; RUN: spirv-as --target-env spv1.4 -o %t.spv %s |
| 3 |
; RUN: spirv-val %t.spv |
| 4 |
; RUN: llvm-spirv -r -o - %t.spv | llvm-dis | FileCheck %s |
| 5 |
|
| 6 |
; SPIR-V |
| 7 |
; Version: 1.4 |
| 8 |
; Generator: Khronos LLVM/SPIR-V Translator; 14 |
| 9 |
; Bound: 40 |
| 10 |
; Schema: 0 |
| 11 |
OpCapability Addresses |
| 12 |
OpCapability Linkage |
| 13 |
OpCapability Kernel |
| 14 |
OpMemoryModel Physical64 OpenCL |
| 15 |
OpEntryPoint Kernel %kernel "test" |
| 16 |
; Note: this is decorating a variable in the function storage class, which |
| 17 |
; is not actually valid according to the SPIR-V spec, but is processed by |
| 18 |
; the SPIR-V LLVM Translator and not rejected by spirv-val. |
| 19 |
OpDecorateString %temp UserSemantic "foo" |
| 20 |
; CHECK: [[STR:@[0-9_.]+]] = {{.*}}foo |
| 21 |
; CHECK: call void @llvm.var.annotation.p0.p0(ptr %{{.*}}, ptr [[STR]], ptr undef, i32 undef, ptr undef) |
| 22 |
%uint = OpTypeInt 32 0 |
| 23 |
%void = OpTypeVoid |
| 24 |
%kernel_sig = OpTypeFunction %void %uint |
| 25 |
%ptr_uint = OpTypePointer Function %uint |
| 26 |
%kernel = OpFunction %void None %kernel_sig |
| 27 |
%a = OpFunctionParameter %uint |
| 28 |
%entry = OpLabel |
| 29 |
%temp = OpVariable %ptr_uint Function |
| 30 |
%add = OpIAdd %uint %a %a |
| 31 |
OpStore %temp %add Aligned 4 |
| 32 |
OpReturn |
| 33 |
OpFunctionEnd |