]> granicus.if.org Git - clang/commitdiff
Enhance OpenMP parser tests from r197553 / r197598
authorAlp Toker <alp@nuanti.com>
Wed, 18 Dec 2013 22:34:19 +0000 (22:34 +0000)
committerAlp Toker <alp@nuanti.com>
Wed, 18 Dec 2013 22:34:19 +0000 (22:34 +0000)
Move some of the verifier directives away from the end of the pragma line.

This ensures that the diagnostics relate to the trailing token being tested and
not the verifier comments which are themselves part of the token stream.

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

test/OpenMP/parallel_messages.cpp
test/OpenMP/threadprivate_messages.cpp

index d20fefd7e37fa413f559659854988827b15f53d2..8aee8414f0340728b0ac26fbfc300ae4d2c1cad9 100644 (file)
@@ -19,7 +19,8 @@ int main(int argc, char **argv) {
   #pragma omp parallel } // expected-warning {{extra tokens at the end of '#pragma omp parallel' are ignored}}
   foo();
   #pragma omp parallel
-  #pragma omp parallel unknown() // expected-warning {{extra tokens at the end of '#pragma omp parallel' are ignored}}
+  // expected-warning@+1 {{extra tokens at the end of '#pragma omp parallel' are ignored}}
+  #pragma omp parallel unknown()
   foo();
   L1:
     foo();
index 1665c48cafbca0779bf091efd7960898a821c2fd..943fca51058ceca5ad727e52c67ba01f8a181edf 100644 (file)
@@ -24,7 +24,8 @@ int foo() { // expected-note {{declared here}}
   return (a);
 }
 
-#pragma omp threadprivate (a) ( // expected-error {{'#pragma omp threadprivate' must precede all references to variable 'a'}} expected-warning {{extra tokens at the end of '#pragma omp threadprivate' are ignored}}
+#pragma omp threadprivate (a) (
+// expected-error@-1 {{'#pragma omp threadprivate' must precede all references to variable 'a'}} expected-warning@-1 {{extra tokens at the end of '#pragma omp threadprivate' are ignored}}
 #pragma omp threadprivate (a) [ // expected-error {{'#pragma omp threadprivate' must precede all references to variable 'a'}} expected-warning {{extra tokens at the end of '#pragma omp threadprivate' are ignored}}
 #pragma omp threadprivate (a) { // expected-error {{'#pragma omp threadprivate' must precede all references to variable 'a'}} expected-warning {{extra tokens at the end of '#pragma omp threadprivate' are ignored}}
 #pragma omp threadprivate (a) ) // expected-error {{'#pragma omp threadprivate' must precede all references to variable 'a'}} expected-warning {{extra tokens at the end of '#pragma omp threadprivate' are ignored}}
@@ -35,8 +36,10 @@ int foo() { // expected-note {{declared here}}
 #pragma omp threadprivate(d)) // expected-error {{'#pragma omp threadprivate' must precede all references to variable 'd'}} expected-warning {{extra tokens at the end of '#pragma omp threadprivate' are ignored}}
 int x, y;
 #pragma omp threadprivate(x)) // expected-warning {{extra tokens at the end of '#pragma omp threadprivate' are ignored}}
-#pragma omp threadprivate(y)), // expected-warning {{extra tokens at the end of '#pragma omp threadprivate' are ignored}}
-#pragma omp threadprivate(a,d)  // expected-error {{'#pragma omp threadprivate' must precede all references to variable 'a'}} expected-error {{'#pragma omp threadprivate' must precede all references to variable 'd'}}
+#pragma omp threadprivate(y)),
+// expected-warning@-1 {{extra tokens at the end of '#pragma omp threadprivate' are ignored}}
+#pragma omp threadprivate(a,d)
+// expected-error@-1 {{'#pragma omp threadprivate' must precede all references to variable 'a'}} expected-error@-1 {{'#pragma omp threadprivate' must precede all references to variable 'd'}}
 #pragma omp threadprivate(d.a) // expected-error {{expected identifier}}
 #pragma omp threadprivate((float)a) // expected-error {{expected unqualified-id}}
 int foa; // expected-note {{'foa' declared here}}