aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorThomas Schwinge <thomas@codesourcery.com>2022-07-11 09:33:19 +0200
committerThomas Schwinge <thomas@codesourcery.com>2022-07-11 11:23:33 +0200
commit06b2a2abe26554c6f9365676683d67368cbba206 (patch)
treea01d98b250ff10e44f48dafe771d882dcdb75240 /gcc
parent4c94382a132a4b2b9d020806549a006fa6764d1b (diff)
downloadgcc-06b2a2abe26554c6f9365676683d67368cbba206.zip
gcc-06b2a2abe26554c6f9365676683d67368cbba206.tar.gz
gcc-06b2a2abe26554c6f9365676683d67368cbba206.tar.bz2
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.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/c-c++-common/gomp/pragma-3.c8
-rw-r--r--gcc/testsuite/c-c++-common/gomp/pragma-5.c8
2 files changed, 10 insertions, 6 deletions
diff --git a/gcc/testsuite/c-c++-common/gomp/pragma-3.c b/gcc/testsuite/c-c++-common/gomp/pragma-3.c
index ae18e9b..3e1b211 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 8124f70..173c25e 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