summaryrefslogtreecommitdiff
path: root/test/SemaOpenCL/storageclass.cl
diff options
context:
space:
mode:
authorTanya Lattner <tonic@nondot.org>2013-04-04 23:36:11 +0000
committerTanya Lattner <tonic@nondot.org>2013-04-04 23:36:11 +0000
commit98bb78885c36800d23fe247f10131bc6dcb30581 (patch)
tree824e7ca28f591606dd144f4674fbd2e544da61ba /test/SemaOpenCL/storageclass.cl
parentb11a9086ebaf8e081daa8a6cd94ea99c97c027d2 (diff)
downloadclang-98bb78885c36800d23fe247f10131bc6dcb30581.tar.gz
Add an error to check that all program scope variables are in the constant address space in OpenCL.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178811 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaOpenCL/storageclass.cl')
-rw-r--r--test/SemaOpenCL/storageclass.cl2
1 files changed, 2 insertions, 0 deletions
diff --git a/test/SemaOpenCL/storageclass.cl b/test/SemaOpenCL/storageclass.cl
index fdfe134621..d2678f2010 100644
--- a/test/SemaOpenCL/storageclass.cl
+++ b/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}}