From 554bcb69c2d785a011a30e7db87a36a87fe7db10 Mon Sep 17 00:00:00 2001 From: dim <dim@FreeBSD.org> Date: Wed, 15 Aug 2012 20:02:54 +0000 Subject: Vendor import of clang trunk r161861: http://llvm.org/svn/llvm-project/cfe/trunk@161861 --- test/SemaOpenCL/storageclass.cl | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 test/SemaOpenCL/storageclass.cl (limited to 'test/SemaOpenCL/storageclass.cl') 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}} +} -- cgit v1.1