aboutsummaryrefslogtreecommitdiff
path: root/test/SemaOpenCL
diff options
context:
space:
mode:
authorTanya Lattner <tonic@nondot.org>2012-06-19 23:09:52 +0000
committerTanya Lattner <tonic@nondot.org>2012-06-19 23:09:52 +0000
commit5e94d6fa2e1d5ca606e060406adee13b96849f2a (patch)
tree161ade880d818e72ce228288eec6eaeadc5f1bcf /test/SemaOpenCL
parentdd3284b17829adfd542ecf4a7b4423dce1d7502b (diff)
Extend the support for cl-std to include 1.2.
Add error checking for the static qualifier which is now allowed in certain situations for OpenCL 1.2. Use the CL version to turn on this feature. Added test case for 1.2 static storage class feature. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158759 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaOpenCL')
-rw-r--r--test/SemaOpenCL/storageclass.cl12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/SemaOpenCL/storageclass.cl b/test/SemaOpenCL/storageclass.cl
new file mode 100644
index 0000000000..c78e7cd436
--- /dev/null
+++ b/test/SemaOpenCL/storageclass.cl
@@ -0,0 +1,12 @@
+// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL1.2
+
+static int A;
+
+// static is not allowed at local scope.
+void kernel foo() {
+ static int X = 5; // expected-error{{variables in function scope cannot be declared static}}
+ auto int Y = 7; // expected-error{{OpenCL does not support the 'auto' storage class specifier}}
+}
+
+static void kernel bar() { // expected-error{{kernel functions cannot be declared static}}
+}