summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/Driver/opencl.cl15
-rw-r--r--clang/test/Frontend/stdlang.c4
2 files changed, 19 insertions, 0 deletions
diff --git a/clang/test/Driver/opencl.cl b/clang/test/Driver/opencl.cl
new file mode 100644
index 00000000000..e8e3b8f7538
--- /dev/null
+++ b/clang/test/Driver/opencl.cl
@@ -0,0 +1,15 @@
+// RUN: %clang %s
+// RUN: %clang -std=cl %s
+// RUN: %clang -std=cl1.1 %s
+// RUN: %clang -std=cl1.2 %s
+// RUN: %clang -std=cl2.0 %s
+// RUN: %clang -std=CL %s
+// RUN: %clang -std=CL1.1 %s
+// RUN: %clang -std=CL1.2 %s
+// RUN: %clang -std=CL2.0 %s
+// RUN: not %clang_cc1 -std=c99 -DOPENCL %s 2>&1 | FileCheck --check-prefix=CHECK-C99 %s
+// RUN: not %clang_cc1 -std=invalid -DOPENCL %s 2>&1 | FileCheck --check-prefix=CHECK-INVALID %s
+// CHECK-C99: error: invalid argument '-std=c99' not allowed with 'OpenCL'
+// CHECK-INVALID: error: invalid value 'invalid' in '-std=invalid'
+
+kernel void func(void);
diff --git a/clang/test/Frontend/stdlang.c b/clang/test/Frontend/stdlang.c
index 765d7272294..9c3c3078aaf 100644
--- a/clang/test/Frontend/stdlang.c
+++ b/clang/test/Frontend/stdlang.c
@@ -1,5 +1,9 @@
// RUN: %clang_cc1 -x cuda -std=c++11 -DCUDA %s
// RUN: %clang_cc1 -x cl -DOPENCL %s
+// RUN: %clang_cc1 -x cl -cl-std=cl -DOPENCL %s
+// RUN: %clang_cc1 -x cl -cl-std=cl1.1 -DOPENCL %s
+// RUN: %clang_cc1 -x cl -cl-std=cl1.2 -DOPENCL %s
+// RUN: %clang_cc1 -x cl -cl-std=cl2.0 -DOPENCL %s
// RUN: %clang_cc1 -x cl -cl-std=CL -DOPENCL %s
// RUN: %clang_cc1 -x cl -cl-std=CL1.1 -DOPENCL %s
// RUN: %clang_cc1 -x cl -cl-std=CL1.2 -DOPENCL %s
OpenPOWER on IntegriCloud