1; RUN: llc -O0 -mtriple=spirv32-unknown-unknown %s -o - | FileCheck %s --check-prefix=CHECK-SPIRV 2; 3; CHECK-SPIRV-DAG: %[[#i8:]] = OpTypeInt 8 0 4; CHECK-SPIRV-DAG: %[[#i32:]] = OpTypeInt 32 0 5; CHECK-SPIRV-DAG: %[[#one:]] = OpConstant %[[#i32]] 1 6; CHECK-SPIRV-DAG: %[[#two:]] = OpConstant %[[#i32]] 2 7; CHECK-SPIRV-DAG: %[[#three:]] = OpConstant %[[#i32]] 3 8; CHECK-SPIRV-DAG: %[[#i32x3:]] = OpTypeArray %[[#i32]] %[[#three]] 9; CHECK-SPIRV-DAG: %[[#test_arr_init:]] = OpConstantComposite %[[#i32x3]] %[[#one]] %[[#two]] %[[#three]] 10; CHECK-SPIRV-DAG: %[[#twelve:]] = OpConstant %[[#i32]] 12 11; CHECK-SPIRV-DAG: %[[#const_i32x3_ptr:]] = OpTypePointer UniformConstant %[[#i32x3]] 12 13; CHECK-SPIRV: %[[#test_arr2:]] = OpVariable %[[#const_i32x3_ptr]] UniformConstant %[[#test_arr_init]] 14; CHECK-SPIRV: %[[#test_arr:]] = OpVariable %[[#const_i32x3_ptr]] UniformConstant %[[#test_arr_init]] 15 16; CHECK-SPIRV-DAG: %[[#i8_ptr:]] = OpTypePointer Function %[[#i8]] 17; CHECK-SPIRV-DAG: %[[#const_i8_ptr:]] = OpTypePointer UniformConstant %[[#i8]] 18; CHECK-SPIRV-DAG: %[[#i32x3_ptr:]] = OpTypePointer Function %[[#i32x3]] 19 20; CHECK-SPIRV: %[[#arr:]] = OpVariable %[[#i32x3_ptr]] Function 21; CHECK-SPIRV: %[[#arr2:]] = OpVariable %[[#i32x3_ptr]] Function 22; CHECK-SPIRV: %[[#arr_i8_ptr:]] = OpBitcast %[[#i8_ptr]] %[[#arr]] 23; CHECK-SPIRV: OpCopyMemorySized %[[#arr_i8_ptr]] %[[#test_arr]] %[[#twelve]] Aligned 4 24; CHECK-SPIRV: %[[#arr2_i8_ptr:]] = OpBitcast %[[#i8_ptr]] %[[#arr2]] 25; CHECK-SPIRV: OpCopyMemorySized %[[#arr2_i8_ptr]] %[[#test_arr2]] %[[#twelve]] Aligned 4 26 27 28@__const.test.arr = private unnamed_addr addrspace(2) constant [3 x i32] [i32 1, i32 2, i32 3], align 4 29@__const.test.arr2 = private unnamed_addr addrspace(2) constant [3 x i32] [i32 1, i32 2, i32 3], align 4 30 31define spir_func void @test() { 32entry: 33 %arr = alloca [3 x i32], align 4 34 %arr2 = alloca [3 x i32], align 4 35 %0 = bitcast [3 x i32]* %arr to i8* 36 call void @llvm.memcpy.p0i8.p2i8.i32(i8* align 4 %0, i8 addrspace(2)* align 4 bitcast ([3 x i32] addrspace(2)* @__const.test.arr to i8 addrspace(2)*), i32 12, i1 false) 37 %1 = bitcast [3 x i32]* %arr2 to i8* 38 call void @llvm.memcpy.p0i8.p2i8.i32(i8* align 4 %1, i8 addrspace(2)* align 4 bitcast ([3 x i32] addrspace(2)* @__const.test.arr2 to i8 addrspace(2)*), i32 12, i1 false) 39 ret void 40} 41 42declare void @llvm.memcpy.p0i8.p2i8.i32(i8* nocapture writeonly, i8 addrspace(2)* nocapture readonly, i32, i1) 43