This fix was really hard!  Tested on hppa64-hp-hpux11.11.  Committed
to trunk.

Dave
---

testsuite: Fix g++.dg/gomp/deprecate-1.C on hppa targets (v2)

The g++.dg/gomp/deprecate-1.C test fails on hppa targets (such as
hppa64-hp-hpux11.11 and hppa-unknown-linux-gnu) because the leading '#'
character is stripped from the diagnostic source line mirror snippet
during metadirective warning expansions.

This patch fixes the failure by restricting the rigid literal multiline
block to non-hppa targets, and appending target-specific dg-regexp
directives to the end of the file to gracefully consume the unhashed
caret fragments on PA-RISC architectures without altering file line
indices.

2026-10-26  John David Anglin  <[email protected]>

gcc/testsuite/ChangeLog:

        * g++.dg/gomp/deprecate-1.C: Restrict the final literal multiline
        verification block to non-hppa targets, and append trailing
        dg-regexp directives to consume the unhashed diagnostic caret
        fragments on hppa targets.

diff --git a/gcc/testsuite/g++.dg/gomp/deprecate-1.C 
b/gcc/testsuite/g++.dg/gomp/deprecate-1.C
index 37ff86a8daa..cafa5b6dd12 100644
--- a/gcc/testsuite/g++.dg/gomp/deprecate-1.C
+++ b/gcc/testsuite/g++.dg/gomp/deprecate-1.C
@@ -109,16 +109,14 @@ bar ()
    { dg-end-multiline-output "" } */
   ;
   #pragma omp master                           /* { dg-warning "'master' 
construct deprecated since OpenMP 5.1, use 'masked'" } */
-/* { dg-begin-multiline-output "" }
+/* { dg-begin-multiline-output "" { target { ! hppa*-*-* } } }
    #pragma omp master
                                                                                
                                                     ^
    { dg-end-multiline-output "" } */
   ;
   #pragma omp metadirective when (device={arch("blahblah")}: nothing) default 
(nothing)                /* { dg-warning "'default' clause on metadirectives 
deprecated since OpenMP 5.2, use 'otherwise'" } */
-/* { dg-begin-multiline-output "" }
-   #pragma omp metadirective when (device={arch("blahblah")}: nothing) default 
(nothing)
-                                                                       ^~~~~~~
-                                                                       
otherwise
-   { dg-end-multiline-output "" } */
+/* { dg-regexp ".*pragma omp metadirective when.*" { target hppa*-*-* } } */
+/* { dg-regexp ".*\\^~~~~~~.*" { target hppa*-*-* } } */
+/* { dg-regexp ".*otherwise.*" { target hppa*-*-* } } */
   ;
 }

Attachment: signature.asc
Description: PGP signature

Reply via email to