summaryrefslogtreecommitdiff
path: root/test/SemaOpenCL/invalid-image.cl
diff options
context:
space:
mode:
authorXiuli Pan <xiulipan@outlook.com>2016-02-25 03:34:20 +0000
committerXiuli Pan <xiulipan@outlook.com>2016-02-25 03:34:20 +0000
commit800a12167c4afa985f1ee38935660e6194dc022c (patch)
treecd8c50c30ec53ceab20e3a3c18fb1b1f6ee36e18 /test/SemaOpenCL/invalid-image.cl
parent1f5a30d156f6323ba6f4ee3e0542f42e75687ddf (diff)
downloadclang-800a12167c4afa985f1ee38935660e6194dc022c.tar.gz
[OpenCL] Add Sema checks for types
Summary: Add Sema checks for opencl type: image, pipe.... This patch is partitioned from http://reviews.llvm.org/D16047 Reviewers: Anastasia, yaxunl Subscribers: pekka.jaaskelainen, cfe-commits Differential Revision: http://reviews.llvm.org/D17437 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261818 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaOpenCL/invalid-image.cl')
-rw-r--r--test/SemaOpenCL/invalid-image.cl8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/SemaOpenCL/invalid-image.cl b/test/SemaOpenCL/invalid-image.cl
new file mode 100644
index 0000000000..2ef7abf4cd
--- /dev/null
+++ b/test/SemaOpenCL/invalid-image.cl
@@ -0,0 +1,8 @@
+// RUN: %clang_cc1 -verify %s
+
+void test1(image1d_t *i){} // expected-error {{pointer to type 'image1d_t' is invalid in OpenCL}}
+
+void test2(image1d_t i) {
+ image1d_t ti; // expected-error {{type 'image1d_t' can only be used as a function parameter}}
+ image1d_t ai[] = {i,i};// expected-error {{array of 'image1d_t' type is invalid in OpenCL}}
+}