| 1 |
; REQUIRES: spirv-as |
| 2 |
|
| 3 |
; RUN: spirv-as %s --target-env spv1.2 -o %t.spv |
| 4 |
; RUN: spirv-val %t.spv |
| 5 |
; RUN: llvm-spirv -r -o %t.rev.bc %t.spv |
| 6 |
; RUN: llvm-dis %t.rev.bc -o - | FileCheck %s |
| 7 |
|
| 8 |
OpCapability Addresses |
| 9 |
OpCapability Linkage |
| 10 |
OpCapability Kernel |
| 11 |
OpMemoryModel Physical64 OpenCL |
| 12 |
OpEntryPoint Kernel %fn "testAlignmentId" |
| 13 |
OpName %p "p" |
| 14 |
OpDecorate %x LinkageAttributes "x" Export |
| 15 |
OpDecorateId %x AlignmentId %al |
| 16 |
OpDecorateId %p AlignmentId %al_spec |
| 17 |
%void = OpTypeVoid |
| 18 |
%uint = OpTypeInt 32 0 |
| 19 |
%ptr = OpTypePointer CrossWorkgroup %uint |
| 20 |
%fnTy = OpTypeFunction %void %ptr |
| 21 |
%al = OpConstant %uint 16 |
| 22 |
%al_spec = OpSpecConstantOp %uint IAdd %al %al |
| 23 |
%uint_42 = OpConstant %uint 42 |
| 24 |
; Verify alignment of variable. |
| 25 |
; CHECK: @x = addrspace(1) global i32 42, align 16 |
| 26 |
%x = OpVariable %ptr CrossWorkgroup %uint_42 |
| 27 |
|
| 28 |
%fn = OpFunction %void None %fnTy |
| 29 |
; Verify alignment of function parameter. |
| 30 |
; CHECK: define spir_kernel void @testAlignmentId(ptr addrspace(1) align 32 %p) |
| 31 |
%p = OpFunctionParameter %ptr |
| 32 |
%entry = OpLabel |
| 33 |
OpReturn |
| 34 |
OpFunctionEnd |