aboutsummaryrefslogtreecommitdiff
path: root/test/SemaOpenCL/event_t.cl
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2013-04-08 18:45:10 +0000
committerDimitry Andric <dim@FreeBSD.org>2013-04-08 18:45:10 +0000
commit809500fc2c13c8173a16b052304d983864e4a1e1 (patch)
tree4fc2f184c499d106f29a386c452b49e5197bf63d /test/SemaOpenCL/event_t.cl
parentbe7c9ec198dcdb5bf73a35bfbb00b3333cb87909 (diff)
downloadsrc-809500fc2c13c8173a16b052304d983864e4a1e1.tar.gz
src-809500fc2c13c8173a16b052304d983864e4a1e1.zip
Vendor import of clang trunk r178860:vendor/clang/clang-trunk-r178860
Notes
Notes: svn path=/vendor/clang/dist/; revision=249261 svn path=/vendor/clang/clang-trunk-r178860/; revision=249262; tag=vendor/clang/clang-trunk-r178860
Diffstat (limited to 'test/SemaOpenCL/event_t.cl')
-rw-r--r--test/SemaOpenCL/event_t.cl17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/SemaOpenCL/event_t.cl b/test/SemaOpenCL/event_t.cl
new file mode 100644
index 000000000000..57a0981cf130
--- /dev/null
+++ b/test/SemaOpenCL/event_t.cl
@@ -0,0 +1,17 @@
+// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only
+
+event_t glb_evt; // expected-error {{the event_t type cannot be used to declare a program scope variable}}
+
+struct evt_s {
+ event_t evt; // expected-error {{the event_t type cannot be used to declare a structure or union field}}
+} evt_str;
+
+void foo(event_t evt); // expected-note {{passing argument to parameter 'evt' here}}
+
+void kernel ker(event_t argevt) { // expected-error {{the event_t type cannot be used to declare a kernel function argument}}
+ event_t e;
+ constant event_t const_evt; // expected-error {{the event_t type can only be used with __private address space qualifier}}
+ foo(e);
+ foo(0);
+ foo(5); // expected-error {{passing 'int' to parameter of incompatible type 'event_t'}}
+}