aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGenOpenCL
diff options
context:
space:
mode:
authorGuy Benyei <guy.benyei@intel.com>2013-01-20 12:31:11 +0000
committerGuy Benyei <guy.benyei@intel.com>2013-01-20 12:31:11 +0000
commite6b9d802fb7b16d93474c4f1c179ab36202e8a8b (patch)
tree9a396d8d98d2ac759c7050a9838cd3439f6ba02a /test/CodeGenOpenCL
parentb3ce35764adcc5749e8729709b1f3737227d90ec (diff)
Implement OpenCL event_t as Clang builtin type, including event_t related OpenCL restrictions (OpenCL 1.2 spec 6.9)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172973 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenOpenCL')
-rw-r--r--test/CodeGenOpenCL/event_t.cl12
-rw-r--r--test/CodeGenOpenCL/opencl_types.cl2
2 files changed, 14 insertions, 0 deletions
diff --git a/test/CodeGenOpenCL/event_t.cl b/test/CodeGenOpenCL/event_t.cl
new file mode 100644
index 0000000000..ddf12a9d8b
--- /dev/null
+++ b/test/CodeGenOpenCL/event_t.cl
@@ -0,0 +1,12 @@
+// RUN: %clang_cc1 %s -emit-llvm -o - -O0 | FileCheck %s
+
+void foo(event_t evt);
+
+void kernel ker() {
+ event_t e;
+// CHECK: alloca %opencl.event_t*,
+ foo(e);
+// CHECK: call void @foo(%opencl.event_t* %
+ foo(0);
+// CHECK: call void @foo(%opencl.event_t* null)
+}
diff --git a/test/CodeGenOpenCL/opencl_types.cl b/test/CodeGenOpenCL/opencl_types.cl
index 35444ed9cb..ab2ebe1ce7 100644
--- a/test/CodeGenOpenCL/opencl_types.cl
+++ b/test/CodeGenOpenCL/opencl_types.cl
@@ -19,4 +19,6 @@ void fnc3(image3d_t img) {}
// CHECK: @fnc3(%opencl.image3d_t*
kernel void foo(image1d_t img) {
+ event_t evt;
+// CHECK: alloca %opencl.event_t*
}