https://gcc.gnu.org/g:33f3774e0ec02cff229f71d95abc09a2ca297279

commit 33f3774e0ec02cff229f71d95abc09a2ca297279
Author: Mikael Morin <mik...@gcc.gnu.org>
Date:   Fri Aug 22 22:22:56 2025 +0200

    Correction régression libgomp depend-4

Diff:
---
 gcc/testsuite/lib/scandump.exp                 | 12 +++++++-----
 gcc/testsuite/lib/scantree.exp                 | 18 +++++++++---------
 libgomp/testsuite/libgomp.fortran/depend-4.f90 |  6 +++++-
 3 files changed, 21 insertions(+), 15 deletions(-)

diff --git a/gcc/testsuite/lib/scandump.exp b/gcc/testsuite/lib/scandump.exp
index 74a77f0a57e1..ab46c560b0f4 100644
--- a/gcc/testsuite/lib/scandump.exp
+++ b/gcc/testsuite/lib/scandump.exp
@@ -221,9 +221,9 @@ proc scan-dump-not { args } {
 # Argument 1 is the regexp to match.
 # Argument 2 is the suffix for the dump file
 # Argument 3 is the suffix of the dump base
-# Argument 4 is the variable name to store the matched content
+# Argument 4 is the list of variable names to store the matched content
 # Argument 5 handles expected failures and the like
-proc scan-dump-var { args } {
+proc scan-dump-vars { args } {
 
     if { [llength $args] >= 6 } {
         switch [dg-process-target [lindex $args 5]] {
@@ -255,9 +255,11 @@ proc scan-dump-var { args } {
     set text [read $fd]
     close $fd
 
-    global [lindex $args 4]
-    set [lindex $args 4] {}
-    if [regexp -- [lindex $args 1] $text scratch [lindex $args 4]] {
+    foreach var [lindex $args 4] {
+       global $var
+       set $var {}
+    }
+    if [regexp -- [lindex $args 1] $text scratch {*}[lindex $args 4]] {
        pass "$testname"
     } else {
        fail "$testname"
diff --git a/gcc/testsuite/lib/scantree.exp b/gcc/testsuite/lib/scantree.exp
index b67713e11cbf..e5641689e565 100644
--- a/gcc/testsuite/lib/scantree.exp
+++ b/gcc/testsuite/lib/scantree.exp
@@ -98,25 +98,25 @@ proc scan-tree-dump-not { args } {
 # Call pass if pattern is present, otherwise fail.
 #
 # Argument 0 is the regexp to match
-# Argument 1 is the name of the dumped tree pass
-# Argument 2 is the variable name to store the matched content
+# Argument 1 is the list of variable names to store the matched content
+# Argument 2 is the name of the dumped tree pass
 # Argument 3 handles expected failures and the like
-proc scan-tree-dump-var { args } {
+proc scan-tree-dump-vars { args } {
 
     if { [llength $args] < 3 } {
        error "scan-tree-dump-var: too few arguments"
        return
     }
     if { [llength $args] > 4 } {
-       error "scan-tree-dump-var: too many arguments"
-       return
+       error "scan-tree-dump-var: too many arguments"
+       return
     }
     if { [llength $args] >= 4 } {
-       scan-dump-var "tree" [lindex $args 0] \
-                 "\[0-9\]\[0-9\]\[0-9\]t.[lindex $args 1]" "" [lindex $args 2] 
[lindex $args 3]
+       scan-dump-vars "tree" [lindex $args 0] \
+                 "\[0-9\]\[0-9\]\[0-9\]t.[lindex $args 2]" "" [lindex $args 1] 
[lindex $args 3]
     } else {
-       scan-dump-var "tree" [lindex $args 0] \
-                 "\[0-9\]\[0-9\]\[0-9\]t.[lindex $args 1]" "" [lindex $args 2]
+       scan-dump-vars "tree" [lindex $args 0] \
+                 "\[0-9\]\[0-9\]\[0-9\]t.[lindex $args 2]" "" [lindex $args 1]
     }
 }
 
diff --git a/libgomp/testsuite/libgomp.fortran/depend-4.f90 
b/libgomp/testsuite/libgomp.fortran/depend-4.f90
index 35b47e93ac2d..75a646c86225 100644
--- a/libgomp/testsuite/libgomp.fortran/depend-4.f90
+++ b/libgomp/testsuite/libgomp.fortran/depend-4.f90
@@ -102,7 +102,11 @@ end program main
 ! { dg-final { scan-tree-dump-times "#pragma omp task depend\\(out:ppp\\)" 1 
"gimple" } }
 ! { dg-final { scan-tree-dump-times "#pragma omp task depend\\(inout:ppp\\)" 1 
"gimple" } }
 ! { dg-final { scan-tree-dump-times "#pragma omp task depend\\(out:&bbb\\)" 1 
"gimple" } }
-! { dg-final { scan-tree-dump-times "#pragma omp task 
depend\\(depobj:&obj\\\[0\\\]\\) depend\\(depobj:&obj\\\[1\\\]\\)" 1 "gimple" } 
}
+! { dg-final { global addr1 addr2; scan-tree-dump-vars {#pragma omp task 
depend\(depobj:([^)]+)\) depend\(depobj:([^)]+)\)} [list addr1 addr2] "gimple" 
} }
+! { dg-final { global addr1 lbound1; scan-tree-dump-vars "$addr1 = 
&obj\\\[0\\\]{lb: (\[^ \]+) sz: 16};" [list lbound1] "gimple" } }
+! { dg-final { global lbound1; scan-tree-dump "$lbound1 = 0;" "gimple" } }
+! { dg-final { global addr2 lbound2; scan-tree-dump-vars "$addr2 = 
&obj\\\[1\\\]{lb: (\[^ \]+) sz: 16};" [list lbound2] "gimple" } }
+! { dg-final { global lbound2; scan-tree-dump "$lbound2 = 0;" "gimple" } }
 ! { dg-final { scan-tree-dump-times "#pragma omp task depend\\(in:ppp\\)" 1 
"gimple" } }
 
 ! { dg-final { scan-tree-dump-times "MEM\\\[\[^\r\n]+\\\] = ppp;" 1 "gimple" } 
}

Reply via email to