6 changes: 3 additions & 3 deletions clang/test/CodeGenOpenCL/spir64_target.cl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %clang_cc1 -no-opaque-pointers %s -triple "spir64-unknown-unknown" -emit-llvm -o - | FileCheck %s
// RUN: %clang_cc1 %s -triple "spir64-unknown-unknown" -emit-llvm -o - | FileCheck %s

// CHECK: target triple = "spir64-unknown-unknown"

Expand All @@ -15,7 +15,7 @@ kernel void foo(global long *arg) {

my_st *tmp = 0;
arg[3] = (long)(&tmp->v);
//CHECK: store i64 8, i64 addrspace(1)*
//CHECK: store i64 8, ptr addrspace(1)
arg[4] = (long)(&tmp->v2);
//CHECK: store i64 16, i64 addrspace(1)*
//CHECK: store i64 16, ptr addrspace(1)
}
12 changes: 6 additions & 6 deletions clang/test/CodeGenOpenCL/spirv_target.cl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// RUN: %clang_cc1 -no-opaque-pointers %s -triple "spirv32-unknown-unknown" -verify -emit-llvm -o - | FileCheck %s -check-prefix=SPIRV32
// RUN: %clang_cc1 -no-opaque-pointers %s -triple "spirv64-unknown-unknown" -verify -emit-llvm -o - | FileCheck %s -check-prefix=SPIRV64
// RUN: %clang_cc1 %s -triple "spirv32-unknown-unknown" -verify -emit-llvm -o - | FileCheck %s -check-prefix=SPIRV32
// RUN: %clang_cc1 %s -triple "spirv64-unknown-unknown" -verify -emit-llvm -o - | FileCheck %s -check-prefix=SPIRV64

// SPIRV32: target triple = "spirv32-unknown-unknown"
// SPIRV64: target triple = "spirv64-unknown-unknown"
Expand All @@ -22,10 +22,10 @@ kernel void foo(global long *arg) {
#endif
my_st *tmp = 0;

// SPIRV32: store i64 4, i64 addrspace(1)*
// SPIRV64: store i64 8, i64 addrspace(1)*
// SPIRV32: store i64 4, ptr addrspace(1)
// SPIRV64: store i64 8, ptr addrspace(1)
arg[0] = (long)(&tmp->v);
// SPIRV32: store i64 8, i64 addrspace(1)*
// SPIRV64: store i64 16, i64 addrspace(1)*
// SPIRV32: store i64 8, ptr addrspace(1)
// SPIRV64: store i64 16, ptr addrspace(1)
arg[1] = (long)(&tmp->v2);
}
8 changes: 4 additions & 4 deletions clang/test/CodeGenOpenCL/str_literals.cl
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
// RUN: %clang_cc1 -no-opaque-pointers %s -cl-opt-disable -emit-llvm -o - -ffake-address-space-map | FileCheck %s
// RUN: %clang_cc1 %s -cl-opt-disable -emit-llvm -o - -ffake-address-space-map | FileCheck %s

__constant char *__constant x = "hello world";
__constant char *__constant y = "hello world";

// CHECK: unnamed_addr addrspace(2) constant{{.*}}"hello world\00"
// CHECK-NOT: addrspace(2) unnamed_addr constant
// CHECK: @x = {{(dso_local )?}}addrspace(2) constant i8 addrspace(2)*
// CHECK: @y = {{(dso_local )?}}addrspace(2) constant i8 addrspace(2)*
// CHECK: @x = {{(dso_local )?}}addrspace(2) constant ptr addrspace(2)
// CHECK: @y = {{(dso_local )?}}addrspace(2) constant ptr addrspace(2)
// CHECK: unnamed_addr addrspace(2) constant{{.*}}"f\00"

void f() {
//CHECK: store i8 addrspace(2)* {{.*}}, i8 addrspace(2)**
//CHECK: store ptr addrspace(2) {{.*}}, ptr
constant const char *f3 = __func__;
}
6 changes: 3 additions & 3 deletions clang/test/CodeGenOpenCL/vectorLoadStore.cl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %clang_cc1 -no-opaque-pointers -cl-std=CL2.0 -triple "spir-unknown-unknown" %s -emit-llvm -O0 -o - | FileCheck %s
// RUN: %clang_cc1 -cl-std=CL2.0 -triple "spir-unknown-unknown" %s -emit-llvm -O0 -o - | FileCheck %s

typedef char char2 __attribute((ext_vector_type(2)));
typedef char char3 __attribute((ext_vector_type(3)));
Expand All @@ -16,7 +16,7 @@ void alignment() {
__private char2 data_generic[100];
__private char8 data_private[100];

// CHECK: %{{.*}} = load <4 x float>, <4 x float> addrspace(4)* %{{.*}}, align 2
// CHECK: store <4 x float> %{{.*}}, <4 x float>* %{{.*}}, align 8
// CHECK: %{{.*}} = load <4 x float>, ptr addrspace(4) %{{.*}}, align 2
// CHECK: store <4 x float> %{{.*}}, ptr %{{.*}}, align 8
((private float4 *)data_private)[1] = ((float4 *)data_generic)[2];
}
24 changes: 12 additions & 12 deletions clang/test/CodeGenOpenCL/vector_literals.cl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// RUN: %clang_cc1 -no-opaque-pointers -emit-llvm %s -o - -O0 | FileCheck %s
// RUN: %clang_cc1 -no-opaque-pointers -emit-llvm %s -o - -cl-std=clc++ -O0 | FileCheck %s
// RUN: %clang_cc1 -emit-llvm %s -o - -O0 | FileCheck %s
// RUN: %clang_cc1 -emit-llvm %s -o - -cl-std=clc++ -O0 | FileCheck %s

typedef __attribute__((ext_vector_type(2))) int int2;
typedef __attribute__((ext_vector_type(3))) int int3;
Expand All @@ -18,55 +18,55 @@ void vector_literals_valid() {
//CHECK: insertelement <4 x i32> %{{.+}}, i32 %{{.+}}, i32 3
int4 a_1_1_1_1 = (int4)(1, 2, c1.s2, c2.s3);

//CHECK: store <2 x i32> <i32 1, i32 2>, <2 x i32>*
//CHECK: store <2 x i32> <i32 1, i32 2>, ptr
//CHECK: shufflevector <2 x i32> %{{[0-9]+}}, <2 x i32> poison, <4 x i32> <i32 0, i32 1, i32 undef, i32 undef>
//CHECK: shufflevector <4 x i32> %{{.+}}, <4 x i32> undef, <4 x i32> <i32 0, i32 1, i32 undef, i32 undef>
//CHECK: insertelement <4 x i32> %{{.+}}, i32 3, i32 2
//CHECK: insertelement <4 x i32> %{{.+}}, i32 4, i32 3
int4 a_2_1_1 = (int4)((int2)(1, 2), 3, 4);

//CHECK: store <2 x i32> <i32 2, i32 3>, <2 x i32>*
//CHECK: store <2 x i32> <i32 2, i32 3>, ptr
//CHECK: shufflevector <2 x i32> %{{[0-9]+}}, <2 x i32> poison, <4 x i32> <i32 0, i32 1, i32 undef, i32 undef>
//CHECK: shufflevector <4 x i32> <i32 1, i32 undef, i32 undef, i32 undef>, <4 x i32> %{{.+}}, <4 x i32> <i32 0, i32 4, i32 5, i32 undef>
//CHECK: insertelement <4 x i32> %{{.+}}, i32 4, i32 3
int4 a_1_2_1 = (int4)(1, (int2)(2, 3), 4);

//CHECK: store <2 x i32> <i32 3, i32 4>, <2 x i32>*
//CHECK: store <2 x i32> <i32 3, i32 4>, ptr
//CHECK: shufflevector <2 x i32> %{{[0-9]+}}, <2 x i32> poison, <4 x i32> <i32 0, i32 1, i32 undef, i32 undef>
//CHECK: shufflevector <4 x i32> <i32 1, i32 2, i32 undef, i32 undef>, <4 x i32> %{{.+}}, <4 x i32> <i32 0, i32 1, i32 4, i32 5>
int4 a_1_1_2 = (int4)(1, 2, (int2)(3, 4));

//CHECK: store <2 x i32> <i32 1, i32 2>, <2 x i32>*
//CHECK: store <2 x i32> <i32 1, i32 2>, ptr
//CHECK: shufflevector <2 x i32> %{{[0-9]+}}, <2 x i32> poison, <4 x i32> <i32 0, i32 1, i32 undef, i32 undef>
//CHECK: shufflevector <4 x i32> %{{.+}}, <4 x i32> undef, <4 x i32> <i32 0, i32 1, i32 undef, i32 undef>
//CHECK: shufflevector <4 x i32> %{{.+}}, <4 x i32> <i32 3, i32 3, i32 undef, i32 undef>, <4 x i32> <i32 0, i32 1, i32 4, i32 5>
int4 a_2_2 = (int4)((int2)(1, 2), (int2)(3));

//CHECK: store <4 x i32> <i32 2, i32 3, i32 4, i32 undef>, <4 x i32>*
//CHECK: store <4 x i32> <i32 2, i32 3, i32 4, i32 undef>, ptr
//CHECK: shufflevector <4 x i32> %{{.+}}, <4 x i32> poison, <3 x i32> <i32 0, i32 1, i32 2>
//CHECK: shufflevector <3 x i32> %{{.+}}, <3 x i32> poison, <4 x i32> <i32 0, i32 1, i32 2, i32 undef>
//CHECK: shufflevector <4 x i32> <i32 1, i32 undef, i32 undef, i32 undef>, <4 x i32> %{{.+}}, <4 x i32> <i32 0, i32 4, i32 5, i32 6>
int4 a_1_3 = (int4)(1, (int3)(2, 3, 4));

//CHECK: store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, <4 x i32>* %a
//CHECK: store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %a
int4 a = (int4)(1);

//CHECK: load <4 x i32>, <4 x i32>* %a
//CHECK: load <4 x i32>, ptr %a
//CHECK: shufflevector <4 x i32> %{{[0-9]+}}, <4 x i32> poison, <2 x i32> <i32 0, i32 1>
//CHECK: shufflevector <2 x i32> %{{[0-9]+}}, <2 x i32> poison, <8 x i32> <i32 0, i32 1, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef>
//CHECK: shufflevector <8 x i32> <i32 1, i32 2, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef>, <8 x i32> %{{.+}}, <8 x i32> <i32 0, i32 1, i32 8, i32 9, i32 undef, i32 undef, i32 undef, i32 undef>
//CHECK: load <4 x i32>, <4 x i32>* %a
//CHECK: load <4 x i32>, ptr %a
//CHECK: shufflevector <4 x i32> %{{[0-9]+}}, <4 x i32> poison, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 undef, i32 undef, i32 undef, i32 undef>
//CHECK: shufflevector <8 x i32> %{{.+}}, <8 x i32> %{{.+}}, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 8, i32 9, i32 10, i32 11>
int8 b = (int8)(1, 2, a.xy, a);

//CHECK: store <4 x float> <float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00>, <4 x float>* %V2
//CHECK: store <4 x float> <float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00>, ptr %V2
float4 V2 = (float4)(1);
}

void vector_literals_with_cast() {
// CHECK-LABEL: vector_literals_with_cast
// CHECK: store <2 x i32> <i32 12, i32 34>, <2 x i32>*
// CHECK: store <2 x i32> <i32 12, i32 34>, ptr
// CHECK: extractelement <2 x i32> %{{[0-9]+}}, i{{[0-9]+}} 0
unsigned int withCast = ((int2)((int2)(12, 34))).s0;
}