[clang] Handle __declspec() attributes in using
[llvm-project.git] / clang / test / CodeGenOpenCL / vectorLoadStore.cl
blob7f8992929b48900f763eea72b08e581bf22da477
1 // RUN: %clang_cc1 -cl-std=CL2.0 -triple "spir-unknown-unknown" %s -emit-llvm -O0 -o - | FileCheck %s
3 typedef char char2 __attribute((ext_vector_type(2)));
4 typedef char char3 __attribute((ext_vector_type(3)));
5 typedef char char8 __attribute((ext_vector_type(8)));
6 typedef float float4 __attribute((ext_vector_type(4)));
8 // Check for optimized vec3 load/store which treats vec3 as vec4.
9 void foo(char3 *P, char3 *Q) {
10 *P = *Q;
11 // CHECK: %{{.*}} = shufflevector <4 x i8> %{{.*}}, <4 x i8> poison, <3 x i32> <i32 0, i32 1, i32 2>
14 // CHECK: define{{.*}} spir_func void @alignment()
15 void alignment() {
16 __private char2 data_generic[100];
17 __private char8 data_private[100];
19 // CHECK: %{{.*}} = load <4 x float>, ptr addrspace(4) %{{.*}}, align 2
20 // CHECK: store <4 x float> %{{.*}}, ptr %{{.*}}, align 8
21 ((private float4 *)data_private)[1] = ((float4 *)data_generic)[2];