aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGenOpenCL
diff options
context:
space:
mode:
authorGuy Benyei <guy.benyei@intel.com>2013-02-07 10:55:47 +0000
committerGuy Benyei <guy.benyei@intel.com>2013-02-07 10:55:47 +0000
commit21f18c4fda167dc5f72feddbd6a7ac1b63200a0d (patch)
tree80c1b120c64d3066fd4f5799174a16d8ed49eca0 /test/CodeGenOpenCL
parentf5a6aefa37d73fff3c47953e2c447f074e726a0e (diff)
Add OpenCL samplers as Clang builtin types and check sampler related restrictions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174601 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenOpenCL')
-rw-r--r--test/CodeGenOpenCL/opencl_types.cl13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/CodeGenOpenCL/opencl_types.cl b/test/CodeGenOpenCL/opencl_types.cl
index ab2ebe1ce7..b1e558db9b 100644
--- a/test/CodeGenOpenCL/opencl_types.cl
+++ b/test/CodeGenOpenCL/opencl_types.cl
@@ -1,5 +1,8 @@
// RUN: %clang_cc1 %s -emit-llvm -o - -O0 | FileCheck %s
+constant sampler_t glb_smp = 7;
+// CHECK: global i32 7
+
void fnc1(image1d_t img) {}
// CHECK: @fnc1(%opencl.image1d_t*
@@ -18,7 +21,17 @@ void fnc2arr(image2d_array_t img) {}
void fnc3(image3d_t img) {}
// CHECK: @fnc3(%opencl.image3d_t*
+void fnc4smp(sampler_t s) {}
+// CHECK: define void @fnc4smp(i32
+
kernel void foo(image1d_t img) {
+ sampler_t smp = 5;
+// CHECK: alloca i32
event_t evt;
// CHECK: alloca %opencl.event_t*
+// CHECK: store i32 5,
+ fnc4smp(smp);
+// CHECK: call void @fnc4smp(i32
+ fnc4smp(glb_smp);
+// CHECK: call void @fnc4smp(i32
}