diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2011-05-02 19:39:53 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2011-05-02 19:39:53 +0000 |
| commit | 01af97d3b23bded2b2b21af19bbc6e4cce49e5b3 (patch) | |
| tree | 64a10f4c4154739d4a8191d7e1b52ce497f4ebd6 /test/CodeGenOpenCL | |
| parent | c3b054d250cdca485c71845089c316e10610ebad (diff) | |
Notes
Diffstat (limited to 'test/CodeGenOpenCL')
| -rw-r--r-- | test/CodeGenOpenCL/2011-04-15-vec-init-from-vec.cl | 12 | ||||
| -rw-r--r-- | test/CodeGenOpenCL/address-spaces.cl | 27 |
2 files changed, 39 insertions, 0 deletions
diff --git a/test/CodeGenOpenCL/2011-04-15-vec-init-from-vec.cl b/test/CodeGenOpenCL/2011-04-15-vec-init-from-vec.cl new file mode 100644 index 000000000000..c61be69b5739 --- /dev/null +++ b/test/CodeGenOpenCL/2011-04-15-vec-init-from-vec.cl @@ -0,0 +1,12 @@ +// RUN: %clang_cc1 %s -emit-llvm -o %t + +typedef __attribute__((ext_vector_type(4))) unsigned char uchar4; +typedef __attribute__((ext_vector_type(4))) unsigned int int4; +typedef __attribute__((ext_vector_type(8))) unsigned char uchar8; + +// OpenCL allows vectors to be initialized by vectors Handle bug in +// VisitInitListExpr for this case below. +void foo( int4 v ) +{ + uchar4 val[4] = {{(uchar4){((uchar8)(v.lo)).lo}}}; +}
\ No newline at end of file diff --git a/test/CodeGenOpenCL/address-spaces.cl b/test/CodeGenOpenCL/address-spaces.cl new file mode 100644 index 000000000000..e030c77d3e01 --- /dev/null +++ b/test/CodeGenOpenCL/address-spaces.cl @@ -0,0 +1,27 @@ +// RUN: %clang_cc1 %s -ffake-address-space-map -emit-llvm -o - | FileCheck %s + +void f__p(__private int *arg) { } +// CHECK: i32* nocapture %arg + +void f__g(__global int *arg) { } +// CHECK: i32 addrspace(1)* nocapture %arg + +void f__l(__local int *arg) { } +// CHECK: i32 addrspace(2)* nocapture %arg + +void f__c(__constant int *arg) { } +// CHECK: i32 addrspace(3)* nocapture %arg + + +void fp(private int *arg) { } +// CHECK: i32* nocapture %arg + +void fg(global int *arg) { } +// CHECK: i32 addrspace(1)* nocapture %arg + +void fl(local int *arg) { } +// CHECK: i32 addrspace(2)* nocapture %arg + +void fc(constant int *arg) { } +// CHECK: i32 addrspace(3)* nocapture %arg + |
