summaryrefslogtreecommitdiff
path: root/test/Driver/unknown-std.cl
diff options
context:
space:
mode:
Diffstat (limited to 'test/Driver/unknown-std.cl')
-rw-r--r--test/Driver/unknown-std.cl16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/Driver/unknown-std.cl b/test/Driver/unknown-std.cl
new file mode 100644
index 000000000000..b87a8c881ce5
--- /dev/null
+++ b/test/Driver/unknown-std.cl
@@ -0,0 +1,16 @@
+// This file checks output given when processing OpenCL files.
+// When user selects invalid language standard
+// print out supported values with short description.
+
+// RUN: not %clang %s -std=foobar -c 2>&1 | \
+// RUN: FileCheck --match-full-lines %s
+
+// CHECK: error: invalid value 'foobar' in '-std=foobar'
+// CHECK-NEXT: note: use 'cl' for 'OpenCL 1.0' standard
+// CHECK-NEXT: note: use 'cl1.1' for 'OpenCL 1.1' standard
+// CHECK-NEXT: note: use 'cl1.2' for 'OpenCL 1.2' standard
+// CHECK-NEXT: note: use 'cl2.0' for 'OpenCL 2.0' standard
+
+// Make sure that no other output is present.
+// CHECK-NOT: {{^.+$}}
+