[PATCH] D29725: Lit C++11 Compatibility - Parse OpenMP
Phabricator via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Feb 8 11:57:53 PST 2017
This revision was automatically updated to reflect the committed changes.
Closed by commit rL294504: [Lit Test] Make tests C++11 compatible - Parse OpenMP (authored by lcharles).
Changed prior to commit:
https://reviews.llvm.org/D29725?vs=87684&id=87687#toc
Repository:
rL LLVM
https://reviews.llvm.org/D29725
Files:
cfe/trunk/test/OpenMP/declare_reduction_messages.cpp
cfe/trunk/test/OpenMP/openmp_check.cpp
Index: cfe/trunk/test/OpenMP/declare_reduction_messages.cpp
===================================================================
--- cfe/trunk/test/OpenMP/declare_reduction_messages.cpp
+++ cfe/trunk/test/OpenMP/declare_reduction_messages.cpp
@@ -1,4 +1,6 @@
// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -std=c++98 %s
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -std=c++11 %s
int temp; // expected-note 7 {{'temp' declared here}}
@@ -51,7 +53,17 @@
#pragma omp declare reduction(fun222 : long : omp_out += omp_in) // expected-error {{redefinition of user-defined reduction for type 'long'}}
#pragma omp declare reduction(fun1 : long : omp_out += omp_in) initializer // expected-error {{expected '(' after 'initializer'}}
#pragma omp declare reduction(fun2 : long : omp_out += omp_in) initializer { // expected-error {{expected '(' after 'initializer'}} expected-error {{expected expression}} expected-warning {{extra tokens at the end of '#pragma omp declare reduction' are ignored}}
-#pragma omp declare reduction(fun3 : long : omp_out += omp_in) initializer[ // expected-error {{expected '(' after 'initializer'}} expected-error {{expected expression}} expected-warning {{extra tokens at the end of '#pragma omp declare reduction' are ignored}}
+#pragma omp declare reduction(fun3 : long : omp_out += omp_in) initializer[
+#if __cplusplus <= 199711L
+// expected-error at -2 {{expected '(' after 'initializer'}}
+// expected-error at -3 {{expected expression}}
+// expected-warning at -4 {{extra tokens at the end of '#pragma omp declare reduction' are ignored}}
+#else
+// expected-error at -6 {{expected '(' after 'initializer'}}
+// expected-error at -7 {{expected variable name or 'this' in lambda capture list}}
+// expected-error at -8 {{expected ')'}}
+// expected-note at -9 {{to match this '('}}
+#endif
#pragma omp declare reduction(fun4 : long : omp_out += omp_in) initializer() // expected-error {{expected expression}}
#pragma omp declare reduction(fun5 : long : omp_out += omp_in) initializer(temp) // expected-error {{only 'omp_priv' or 'omp_orig' variables are allowed in initializer expression}}
#pragma omp declare reduction(fun6 : long : omp_out += omp_in) initializer(omp_orig // expected-error {{expected ')'}} expected-note {{to match this '('}}
Index: cfe/trunk/test/OpenMP/openmp_check.cpp
===================================================================
--- cfe/trunk/test/OpenMP/openmp_check.cpp
+++ cfe/trunk/test/OpenMP/openmp_check.cpp
@@ -1,15 +1,35 @@
// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -std=c++98 %s
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -std=c++11 %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}}
+ auto F = [&]() {
+#if __cplusplus <= 199711L
+ // expected-warning at -2 {{'auto' type specifier is a C++11 extension}}
+ // expected-error at -3 {{expected expression}}
+ // expected-error at -4 {{expected ';' at end of declaration}}
+#else
+ // expected-no-diagnostics
+#endif
+
#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 ('}')}}
+ F();
+#if __cplusplus <= 199711L
+ // expected-error at -2 {{C++ requires a type specifier for all declarations}}
+#endif
+ return a;
+#if __cplusplus <= 199711L
+ // expected-error at -2 {{expected unqualified-id}}
+#endif
+}
+#if __cplusplus <= 199711L
+// expected-error at -2 {{extraneous closing brace ('}')}}
+#endif
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D29725.87687.patch
Type: text/x-patch
Size: 4048 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170208/27441dc6/attachment-0001.bin>
More information about the cfe-commits
mailing list