summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clang/lib/Parse/Parser.cpp1
-rw-r--r--clang/test/OpenMP/openmp_check.cpp15
2 files changed, 16 insertions, 0 deletions
diff --git a/clang/lib/Parse/Parser.cpp b/clang/lib/Parse/Parser.cpp
index 5b0704658a2..26dc3998ad8 100644
--- a/clang/lib/Parse/Parser.cpp
+++ b/clang/lib/Parse/Parser.cpp
@@ -282,6 +282,7 @@ bool Parser::SkipUntil(ArrayRef<tok::TokenKind> Toks, SkipUntilFlags Flags) {
// Ran out of tokens.
return false;
+ case tok::annot_pragma_openmp:
case tok::annot_pragma_openmp_end:
// Stop before an OpenMP pragma boundary.
case tok::annot_module_begin:
diff --git a/clang/test/OpenMP/openmp_check.cpp b/clang/test/OpenMP/openmp_check.cpp
new file mode 100644
index 00000000000..c9b5eb0b9cb
--- /dev/null
+++ b/clang/test/OpenMP/openmp_check.cpp
@@ -0,0 +1,15 @@
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s
+int nested(int a) {
+#pragma omp parallel
+ ++a;
+
+ auto F = [&]() { // expected-error {{expected expression}} expected-error {{expected ';' at end of declaration}} expected-warning {{'auto' type specifier is a C++11 extension}}
+#pragma omp parallel
+ {
+#pragma omp target
+ ++a;
+ }
+ };
+ F(); // expected-error {{C++ requires a type specifier for all declarations}}
+ return a; // expected-error {{expected unqualified-id}}
+}// expected-error {{extraneous closing brace ('}')}}
OpenPOWER on IntegriCloud