diff options
author | dim <dim@FreeBSD.org> | 2012-08-15 20:02:54 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2012-08-15 20:02:54 +0000 |
commit | 554bcb69c2d785a011a30e7db87a36a87fe7db10 (patch) | |
tree | 9abb1a658a297776086f4e0dfa6ca533de02104e /test/SemaOpenCL | |
parent | bb67ca86b31f67faee50bd10c3b036d65751745a (diff) | |
download | FreeBSD-src-554bcb69c2d785a011a30e7db87a36a87fe7db10.zip FreeBSD-src-554bcb69c2d785a011a30e7db87a36a87fe7db10.tar.gz |
Vendor import of clang trunk r161861:
http://llvm.org/svn/llvm-project/cfe/trunk@161861
Diffstat (limited to 'test/SemaOpenCL')
-rw-r--r-- | test/SemaOpenCL/storageclass.cl | 12 | ||||
-rw-r--r-- | test/SemaOpenCL/warn-missing-prototypes.cl | 6 |
2 files changed, 18 insertions, 0 deletions
diff --git a/test/SemaOpenCL/storageclass.cl b/test/SemaOpenCL/storageclass.cl new file mode 100644 index 0000000..c78e7cd --- /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}} +} diff --git a/test/SemaOpenCL/warn-missing-prototypes.cl b/test/SemaOpenCL/warn-missing-prototypes.cl new file mode 100644 index 0000000..487cb28 --- /dev/null +++ b/test/SemaOpenCL/warn-missing-prototypes.cl @@ -0,0 +1,6 @@ +// RUN: %clang_cc1 -fsyntax-only -verify -Wmissing-prototypes %s + +void f() { } // expected-warning {{no previous prototype for function 'f'}} + +// Don't warn about kernel functions. +kernel void g() { } |