summaryrefslogtreecommitdiffstats
path: root/clang/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
commit379554ac5b15a4c76719d1241dd149b294f93331 (patch)
treea5431c462e35764f6c3b73ff2cdabbe44e8e76f0 /clang/test/SemaOpenCL/invalid-image.cl
parent73ef3c7fbcb1a2d7c8fd66c4b0af070f0f725b06 (diff)
downloadbcm5719-llvm-379554ac5b15a4c76719d1241dd149b294f93331.tar.gz
bcm5719-llvm-379554ac5b15a4c76719d1241dd149b294f93331.zip
[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 llvm-svn: 261818
Diffstat (limited to 'clang/test/SemaOpenCL/invalid-image.cl')
-rw-r--r--clang/test/SemaOpenCL/invalid-image.cl8
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/test/SemaOpenCL/invalid-image.cl b/clang/test/SemaOpenCL/invalid-image.cl
new file mode 100644
index 00000000000..2ef7abf4cdb
--- /dev/null
+++ b/clang/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}}
+}
OpenPOWER on IntegriCloud