llvm-project/clang/test/SemaOpenCL/storageclass.cl
Tanya Lattner 4fdce3faa8 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.

llvm-svn: 158759
2012-06-19 23:09:52 +00:00

13 lines
435 B
Common Lisp

// 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}}
}