]> granicus.if.org Git - clang/commitdiff
Allow clang to compile the "extern" storage class in OpenCL 1.2.
authorPekka Jaaskelainen <pekka.jaaskelainen@tut.fi>
Thu, 23 Jan 2014 16:36:09 +0000 (16:36 +0000)
committerPekka Jaaskelainen <pekka.jaaskelainen@tut.fi>
Thu, 23 Jan 2014 16:36:09 +0000 (16:36 +0000)
The tests (forgot to svn add, sorry!).

Patch from Fraser Cormack!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@199907 91177308-0d34-0410-b5e6-96231b3b80d8

test/SemaOpenCL/extern.cl [new file with mode: 0644]

diff --git a/test/SemaOpenCL/extern.cl b/test/SemaOpenCL/extern.cl
new file mode 100644 (file)
index 0000000..ee5e072
--- /dev/null
@@ -0,0 +1,9 @@
+// RUN: %clang_cc1 -x cl -cl-std=CL1.2 -emit-llvm %s -o - -verify | FileCheck %s
+// expected-no-diagnostics
+
+// CHECK: @foo = external global float
+extern constant float foo;
+
+kernel void test(global float* buf) {
+  buf[0] += foo;
+}