diff options
Diffstat (limited to 'clang/test')
-rw-r--r-- | clang/test/CodeGenOpenCL/address-spaces.cl | 27 | ||||
-rw-r--r-- | clang/test/Parser/opencl-image-access.cl | 16 |
2 files changed, 43 insertions, 0 deletions
diff --git a/clang/test/CodeGenOpenCL/address-spaces.cl b/clang/test/CodeGenOpenCL/address-spaces.cl new file mode 100644 index 00000000000..e030c77d3e0 --- /dev/null +++ b/clang/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 + diff --git a/clang/test/Parser/opencl-image-access.cl b/clang/test/Parser/opencl-image-access.cl new file mode 100644 index 00000000000..313587c1d22 --- /dev/null +++ b/clang/test/Parser/opencl-image-access.cl @@ -0,0 +1,16 @@ +// RUN: %clang_cc1 %s -fsyntax-only + +typedef void* image2d_t; + +__kernel void f__ro(__read_only image2d_t a) { } + +__kernel void f__wo(__write_only image2d_t a) { } + +__kernel void f__rw(__read_write image2d_t a) { } + + +__kernel void fro(read_only image2d_t a) { } + +__kernel void fwo(write_only image2d_t a) { } + +__kernel void frw(read_write image2d_t a) { } |