| 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 OpCopyMemorySized with a nested OpSpecConstantOp size is supported. |
| 9 |
|
| 10 |
; CHECK: @src = common addrspace(1) global [8 x i32] zeroinitializer, align 4 |
| 11 |
; CHECK: @dst = common addrspace(1) global [8 x i32] zeroinitializer, align 4 |
| 12 |
; CHECK: call void @llvm.memcpy.p1.p1.i32({{.*}}, i32 8, i1 false) |
| 13 |
|
| 14 |
OpCapability Addresses |
| 15 |
OpCapability Linkage |
| 16 |
OpCapability Kernel |
| 17 |
OpMemoryModel Physical32 OpenCL |
| 18 |
OpEntryPoint Kernel %15 "foo" |
| 19 |
OpName %src "src" |
| 20 |
OpName %dst "dst" |
| 21 |
OpName %entry "entry" |
| 22 |
OpDecorate %src LinkageAttributes "src" Export |
| 23 |
OpDecorate %dst LinkageAttributes "dst" Export |
| 24 |
OpDecorate %src Alignment 4 |
| 25 |
OpDecorate %dst Alignment 4 |
| 26 |
%void = OpTypeVoid |
| 27 |
%14 = OpTypeFunction %void |
| 28 |
%uint = OpTypeInt 32 0 |
| 29 |
%uint_2 = OpConstant %uint 2 |
| 30 |
%uint_4 = OpSpecConstantOp %uint IMul %uint_2 %uint_2 |
| 31 |
%uint_8 = OpSpecConstantOp %uint IAdd %uint_4 %uint_4 |
| 32 |
%arr = OpTypeArray %uint %uint_8 |
| 33 |
%ptr = OpTypePointer CrossWorkgroup %arr |
| 34 |
|
| 35 |
%src = OpVariable %ptr CrossWorkgroup |
| 36 |
%dst = OpVariable %ptr CrossWorkgroup |
| 37 |
|
| 38 |
%15 = OpFunction %void Pure %14 |
| 39 |
%entry = OpLabel |
| 40 |
OpCopyMemorySized %dst %src %uint_8 Aligned 4 |
| 41 |
OpReturn |
| 42 |
OpFunctionEnd |