|
1 | 1 | // RUN: %clang_cc1 %s -triple spir-unknown-unknown -O0 -emit-llvm -o - | FileCheck %s --check-prefix=CHECK-LLVM
|
2 |
| -// RUN: %clang_cc1 %s -triple spir-unknown-unknown -O0 -emit-llvm-bc -o %t.bc |
3 |
| -// RUN: llvm-spirv %t.bc -o %t.spv |
4 |
| -// RUN: llvm-spirv %t.spv -to-text -o - | FileCheck %s --check-prefix=CHECK-SPIRV |
5 | 2 |
|
6 | 3 | // CHECK-LLVM: @__const.test.arr = private unnamed_addr addrspace(2) constant [3 x i32] [i32 1, i32 2, i32 3], align 4
|
7 | 4 |
|
8 |
| -// CHECK-SPIRV-DAG: TypeInt [[i32:[0-9]+]] 32 0 |
9 |
| -// CHECK-SPIRV-DAG: TypeInt [[i8:[0-9]+]] 8 0 |
10 |
| -// CHECK-SPIRV-DAG: Constant [[i32]] [[one:[0-9]+]] 1 |
11 |
| -// CHECK-SPIRV-DAG: Constant [[i32]] [[two:[0-9]+]] 2 |
12 |
| -// CHECK-SPIRV-DAG: Constant [[i32]] [[three:[0-9]+]] 3 |
13 |
| -// CHECK-SPIRV-DAG: Constant [[i32]] [[twelve:[0-9]+]] 12 |
14 |
| -// CHECK-SPIRV-DAG: TypeArray [[i32x3:[0-9]+]] [[i32]] [[three]] |
15 |
| -// CHECK-SPIRV-DAG: TypePointer [[i32x3_ptr:[0-9]+]] 7 [[i32x3]] |
16 |
| -// CHECK-SPIRV-DAG: TypePointer [[const_i32x3_ptr:[0-9]+]] 0 [[i32x3]] |
17 |
| -// CHECK-SPIRV-DAG: TypePointer [[i8_ptr:[0-9]+]] 7 [[i8]] |
18 |
| -// CHECK-SPIRV-DAG: TypePointer [[const_i8_ptr:[0-9]+]] 0 [[i8]] |
19 |
| -// CHECK-SPIRV: ConstantComposite [[i32x3]] [[test_arr_init:[0-9]+]] [[one]] [[two]] [[three]] |
20 |
| -// CHECK-SPIRV: Variable [[const_i32x3_ptr]] [[test_arr:[0-9]+]] 0 [[test_arr_init]] |
21 |
| -// CHECK-SPIRV: Variable [[const_i32x3_ptr]] [[test_arr2:[0-9]+]] 0 [[test_arr_init]] |
22 |
| - |
23 | 5 | void test() {
|
24 | 6 | __private int arr[] = {1,2,3};
|
25 | 7 | __private const int arr2[] = {1,2,3};
|
26 | 8 | // CHECK-LLVM: %arr = alloca [3 x i32], align 4
|
27 | 9 | // CHECK-LLVM: %[[arr_i8_ptr:[0-9]+]] = bitcast [3 x i32]* %arr to i8*
|
28 |
| -// CHECK-LLVM: 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) |
29 |
| - |
30 |
| -// CHECK-SPIRV: Variable [[i32x3_ptr]] [[arr:[0-9]+]] 7 |
31 |
| -// CHECK-SPIRV: Variable [[i32x3_ptr]] [[arr2:[0-9]+]] 7 |
32 |
| - |
33 |
| -// CHECK-SPIRV: Bitcast [[i8_ptr]] [[arr_i8_ptr:[0-9]+]] [[arr]] |
34 |
| -// CHECK-SPIRV: Bitcast [[const_i8_ptr]] [[test_arr_const_i8_ptr:[0-9]+]] [[test_arr]] |
35 |
| -// CHECK-SPIRV: CopyMemorySized [[arr_i8_ptr]] [[test_arr_const_i8_ptr]] [[twelve]] 2 4 |
| 10 | +// CHECK-LLVM: call void @llvm.memcpy.p0i8.p2i8.i32(i8* align 4 %[[arr_i8_ptr]], i8 addrspace(2)* align 4 bitcast ([3 x i32] addrspace(2)* @__const.test.arr to i8 addrspace(2)*), i32 12, i1 false) |
36 | 11 |
|
37 |
| -// CHECK-SPIRV: Bitcast [[i8_ptr]] [[arr2_i8_ptr:[0-9]+]] [[arr2]] |
38 |
| -// CHECK-SPIRV: Bitcast [[const_i8_ptr]] [[test_arr2_const_i8_ptr:[0-9]+]] [[test_arr2]] |
39 |
| -// CHECK-SPIRV: CopyMemorySized [[arr2_i8_ptr]] [[test_arr2_const_i8_ptr]] [[twelve]] 2 4 |
40 | 12 | }
|
0 commit comments