From b23eb1cd646ef10df5e241edae5b31c743f2d9d8 Mon Sep 17 00:00:00 2001 From: Alp Toker Date: Wed, 18 Dec 2013 22:34:19 +0000 Subject: [PATCH] Enhance OpenMP parser tests from r197553 / r197598 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 | 3 ++- test/OpenMP/threadprivate_messages.cpp | 9 ++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/test/OpenMP/parallel_messages.cpp b/test/OpenMP/parallel_messages.cpp index d20fefd7e3..8aee8414f0 100644 --- a/test/OpenMP/parallel_messages.cpp +++ b/test/OpenMP/parallel_messages.cpp @@ -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(); diff --git a/test/OpenMP/threadprivate_messages.cpp b/test/OpenMP/threadprivate_messages.cpp index 1665c48caf..943fca5105 100644 --- a/test/OpenMP/threadprivate_messages.cpp +++ b/test/OpenMP/threadprivate_messages.cpp @@ -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}} -- 2.40.0