summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaOpenCL/storageclass.cl
diff options
context:
space:
mode:
authorTanya Lattner <tonic@nondot.org>2013-04-05 20:14:50 +0000
committerTanya Lattner <tonic@nondot.org>2013-04-05 20:14:50 +0000
commit713eef4f7ca2bb26a1a1d39713ac167a397b65b3 (patch)
treef9ff613110e298d0e35f617b655d8babec6504c3 /clang/test/SemaOpenCL/storageclass.cl
parentb8055cbc9dde9d1386d85f1e6f0876cef1646c87 (diff)
downloadbcm5719-llvm-713eef4f7ca2bb26a1a1d39713ac167a397b65b3.tar.gz
bcm5719-llvm-713eef4f7ca2bb26a1a1d39713ac167a397b65b3.zip
Add an error to check that all program scope variables are in the constant address space in OpenCL.
llvm-svn: 178906
Diffstat (limited to 'clang/test/SemaOpenCL/storageclass.cl')
-rw-r--r--clang/test/SemaOpenCL/storageclass.cl2
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/test/SemaOpenCL/storageclass.cl b/clang/test/SemaOpenCL/storageclass.cl
index fdfe1346218..d2678f2010d 100644
--- a/clang/test/SemaOpenCL/storageclass.cl
+++ b/clang/test/SemaOpenCL/storageclass.cl
@@ -2,6 +2,8 @@
static constant int A = 0;
+int X = 0; // expected-error{{global variables must have a constant address space qualifier}}
+
// static is not allowed at local scope.
void kernel foo() {
static int X = 5; // expected-error{{variables in function scope cannot be declared static}}
OpenPOWER on IntegriCloud