From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1643) id 7D08F3858412; Mon, 11 Jul 2022 09:24:24 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7D08F3858412 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Thomas Schwinge To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-1601] Enhance '_Pragma' diagnostics verification in OMP C/C++ test cases X-Act-Checkin: gcc X-Git-Author: Thomas Schwinge X-Git-Refname: refs/heads/master X-Git-Oldrev: 4c94382a132a4b2b9d020806549a006fa6764d1b X-Git-Newrev: 06b2a2abe26554c6f9365676683d67368cbba206 Message-Id: <20220711092424.7D08F3858412@sourceware.org> Date: Mon, 11 Jul 2022 09:24:24 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jul 2022 09:24:24 -0000 https://gcc.gnu.org/g:06b2a2abe26554c6f9365676683d67368cbba206 commit r13-1601-g06b2a2abe26554c6f9365676683d67368cbba206 Author: Thomas Schwinge Date: Mon Jul 11 09:33:19 2022 +0200 Enhance '_Pragma' diagnostics verification in OMP C/C++ test cases Follow-up to recent commit 0587cef3d7962a8b0f44779589ba2920dd3d71e5 "c: Fix location for _Pragma tokens [PR97498]". gcc/testsuite/ * c-c++-common/gomp/pragma-3.c: Enhance '_Pragma' diagnostics verification. * c-c++-common/gomp/pragma-5.c: Likewise. libgomp/ * testsuite/libgomp.oacc-c-c++-common/reduction-5.c: Enhance '_Pragma' diagnostics verification. Diff: --- gcc/testsuite/c-c++-common/gomp/pragma-3.c | 8 +++++--- gcc/testsuite/c-c++-common/gomp/pragma-5.c | 8 +++++--- libgomp/testsuite/libgomp.oacc-c-c++-common/reduction-5.c | 8 +++++--- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/gcc/testsuite/c-c++-common/gomp/pragma-3.c b/gcc/testsuite/c-c++-common/gomp/pragma-3.c index ae18e9b8886..3e1b2111c3d 100644 --- a/gcc/testsuite/c-c++-common/gomp/pragma-3.c +++ b/gcc/testsuite/c-c++-common/gomp/pragma-3.c @@ -2,13 +2,15 @@ /* PR preprocessor/103165 */ #define inner(...) #__VA_ARGS__ ; _Pragma("omp error severity(warning) message (\"Test\") at(compilation)") /* { dg-line inner_location } */ -#define outer(...) inner(__VA_ARGS__) +#define outer(...) inner(__VA_ARGS__) /* { dg-line outer_location } */ void f (void) { - const char *str = outer(inner(1,2)); - /* { dg-warning "'pragma omp error' encountered: Test" "inner expansion" { target *-*-* } inner_location } */ + const char *str = outer(inner(1,2)); /* { dg-line str_location } */ + /* { dg-warning "35:'pragma omp error' encountered: Test" "" { target *-*-* } inner_location } + { dg-note "20:in expansion of macro 'inner'" "" { target *-*-* } outer_location } + { dg-note "21:in expansion of macro 'outer'" "" { target *-*-* } str_location } */ } #if 0 diff --git a/gcc/testsuite/c-c++-common/gomp/pragma-5.c b/gcc/testsuite/c-c++-common/gomp/pragma-5.c index 8124f701502..173c25e803a 100644 --- a/gcc/testsuite/c-c++-common/gomp/pragma-5.c +++ b/gcc/testsuite/c-c++-common/gomp/pragma-5.c @@ -2,13 +2,15 @@ /* PR preprocessor/103165 */ #define inner(...) #__VA_ARGS__ ; _Pragma ( " omp error severity (warning) message (\"Test\") at(compilation)" ) /* { dg-line inner_location } */ -#define outer(...) inner(__VA_ARGS__) +#define outer(...) inner(__VA_ARGS__) /* { dg-line outer_location } */ void f (void) { - const char *str = outer(inner(1,2)); - /* { dg-warning "'pragma omp error' encountered: Test" "inner expansion" { target *-*-* } inner_location } */ + const char *str = outer(inner(1,2)); /* { dg-line str_location } */ + /* { dg-warning "35:'pragma omp error' encountered: Test" "" { target *-*-* } inner_location } + { dg-note "20:in expansion of macro 'inner'" "" { target *-*-* } outer_location } + { dg-note "21:in expansion of macro 'outer'" "" { target *-*-* } str_location } */ } #if 0 diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/reduction-5.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/reduction-5.c index 16aa0dd4ac1..72094609f0f 100644 --- a/libgomp/testsuite/libgomp.oacc-c-c++-common/reduction-5.c +++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/reduction-5.c @@ -17,7 +17,7 @@ const int n = 100; #define check_reduction(gwv_par, gwv_loop) \ { \ s1 = 2; s2 = 5; \ -DO_PRAGMA (acc parallel gwv_par copy (s1, s2)) \ +DO_PRAGMA (acc parallel gwv_par copy (s1, s2)) /* { dg-line DO_PRAGMA_loc } */ \ DO_PRAGMA (acc loop gwv_loop reduction (+:s1, s2)) \ for (i = 0; i < n; i++) \ { \ @@ -45,8 +45,10 @@ main (void) /* Nvptx targets require a vector_length or 32 in to allow spinlocks with gangs. */ - check_reduction (num_workers (nw) vector_length (vl), worker); - /* { dg-warning "region is vector partitioned but does not contain vector partitioned code" "test1" { target *-*-* } pragma_loc } */ + check_reduction (num_workers (nw) vector_length (vl), worker); /* { dg-line check_reduction_loc } + /* { dg-warning "22:region is vector partitioned but does not contain vector partitioned code" "" { target *-*-* } pragma_loc } + { dg-note "1:in expansion of macro 'DO_PRAGMA'" "" { target *-*-* } DO_PRAGMA_loc } + { dg-note "3:in expansion of macro 'check_reduction'" "" { target *-*-* } check_reduction_loc } */ check_reduction (vector_length (vl), vector); check_reduction (num_gangs (ng) num_workers (nw) vector_length (vl), gang worker vector);