diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2017-12-18 20:11:37 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2017-12-18 20:11:37 +0000 |
| commit | 461a67fa15370a9ec88f8f8a240bf7c123bb2029 (patch) | |
| tree | 6942083d7d56bba40ec790a453ca58ad3baf6832 /test/CodeGenOpenCL/vectorLoadStore.cl | |
| parent | 75c3240472ba6ac2669ee72ca67eb72d4e2851fc (diff) | |
Notes
Diffstat (limited to 'test/CodeGenOpenCL/vectorLoadStore.cl')
| -rw-r--r-- | test/CodeGenOpenCL/vectorLoadStore.cl | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/test/CodeGenOpenCL/vectorLoadStore.cl b/test/CodeGenOpenCL/vectorLoadStore.cl index 44bc7bd25d45..cb35e6f4689b 100644 --- a/test/CodeGenOpenCL/vectorLoadStore.cl +++ b/test/CodeGenOpenCL/vectorLoadStore.cl @@ -1,9 +1,22 @@ -// RUN: %clang_cc1 %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 char3 __attribute((ext_vector_type(3)));; +typedef char char2 __attribute((ext_vector_type(2))); +typedef char char3 __attribute((ext_vector_type(3))); +typedef char char8 __attribute((ext_vector_type(8))); +typedef float float4 __attribute((ext_vector_type(4))); // Check for optimized vec3 load/store which treats vec3 as vec4. void foo(char3 *P, char3 *Q) { *P = *Q; // CHECK: %{{.*}} = shufflevector <4 x i8> %{{.*}}, <4 x i8> undef, <3 x i32> <i32 0, i32 1, i32 2> } + +// CHECK: define spir_func void @alignment() +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 + ((private float4 *)data_private)[1] = ((float4 *)data_generic)[2]; +} |
