https://gcc.gnu.org/g:8ed21dfa6f62b80147fd5f444e9fd0da1ffc5a36

commit r17-5602-g8ed21dfa6f62b80147fd5f444e9fd0da1ffc5a36
Author: John David Anglin <[email protected]>
Date:   Mon Oct 26 20:21:46 2026 -0400

    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:
---
 gcc/testsuite/g++.dg/gomp/deprecate-1.C | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/gcc/testsuite/g++.dg/gomp/deprecate-1.C 
b/gcc/testsuite/g++.dg/gomp/deprecate-1.C
index 37ff86a8daaf..cafa5b6dd123 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*-*-* } } */
   ;
 }

Reply via email to