| 1 |
; REQUIRES: spirv-as |
| 2 |
; RUN: spirv-as --target-env spv1.0 -o %t.spv %s |
| 3 |
; RUN: spirv-val %t.spv |
| 4 |
|
| 5 |
; RUN: llvm-spirv -r -emit-opaque-pointers %t.spv -o %t.bc |
| 6 |
; RUN: llvm-dis %t.bc -o - | FileCheck %s |
| 7 |
|
| 8 |
; Verify that an OpTypeArray with an OpSpecConstantOp length is supported. |
| 9 |
|
| 10 |
; CHECK: @var = common addrspace(1) global [8 x i32] zeroinitializer, align 4 |
| 11 |
|
| 12 |
OpCapability Addresses |
| 13 |
OpCapability Linkage |
| 14 |
OpCapability Kernel |
| 15 |
OpMemoryModel Physical32 OpenCL |
| 16 |
OpEntryPoint Kernel %15 "foo" |
| 17 |
OpName %var "var" |
| 18 |
OpName %entry "entry" |
| 19 |
OpDecorate %var LinkageAttributes "var" Export |
| 20 |
OpDecorate %var Alignment 4 |
| 21 |
%void = OpTypeVoid |
| 22 |
%14 = OpTypeFunction %void |
| 23 |
%uint = OpTypeInt 32 0 |
| 24 |
%uint_4 = OpConstant %uint 4 |
| 25 |
%uint_8 = OpSpecConstantOp %uint IAdd %uint_4 %uint_4 |
| 26 |
%arr = OpTypeArray %uint %uint_8 |
| 27 |
%ptr_arr = OpTypePointer CrossWorkgroup %arr |
| 28 |
|
| 29 |
%var = OpVariable %ptr_arr CrossWorkgroup |
| 30 |
|
| 31 |
%15 = OpFunction %void Pure %14 |
| 32 |
%entry = OpLabel |
| 33 |
OpReturn |
| 34 |
OpFunctionEnd |