https://gcc.gnu.org/g:6e79fa4a25769b2facf519aaf04b2a757dd3c887

commit r15-9200-g6e79fa4a25769b2facf519aaf04b2a757dd3c887
Author: Richard Earnshaw <rearn...@arm.com>
Date:   Fri Apr 4 13:38:35 2025 +0100

    arm: testsuite: restore dg-do-what-default in mve.exp
    
    On Arm, running
    
            make check-gcc RUNTESTFLAGS="dwarf2.exp=pr43190.c"
    
    with a target list of "arm-qemu{,-mthumb}"
    
    results in no errors.  But running it with
    
            make check-gcc RUNTESTFLAGS="{mve,dwarf2}.exp=pr43190.c"
    
    results in unresolved tests while running the thumb variant.  The problem
    is that mve.exp is changing dg-do-what-default to "assemble", but failing
    to restore the original value once its tests are complete.  The result is
    that all subsequent tests run with an incorrect underlying default value.
    
    The fix is easy - save dg-do-what-default and restore it after the tests
    are complete.
    
    gcc/testsuite/ChangeLog:
    
            * gcc.target/arm/mve/mve.exp: Save dg-do-what-default before
            changing it.  Restore it once done.

Diff:
---
 gcc/testsuite/gcc.target/arm/mve/mve.exp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/gcc/testsuite/gcc.target/arm/mve/mve.exp 
b/gcc/testsuite/gcc.target/arm/mve/mve.exp
index a5d8511afdac..9dc56c9b2d9f 100644
--- a/gcc/testsuite/gcc.target/arm/mve/mve.exp
+++ b/gcc/testsuite/gcc.target/arm/mve/mve.exp
@@ -35,6 +35,7 @@ global dg_runtest_extra_prunes
 set dg_runtest_extra_prunes ""
 lappend dg_runtest_extra_prunes "warning: switch '-m(cpu|arch)=.*' conflicts 
with switch '-m(cpu|arch)=.*'"
 
+set saved-dg-do-what-default ${dg-do-what-default}
 set dg-do-what-default "assemble"
 
 # Initialize `dg'.
@@ -53,6 +54,8 @@ dg-runtest [lsort [glob -nocomplain 
$srcdir/$subdir/general-c/*.\[cCS\]]] \
 dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cCS\]]] \
        "" $DEFAULT_CFLAGS
 
+set dg-do-what-default ${saved-dg-do-what-default}
+
 # All done.
 set dg_runtest_extra_prunes ""
 dg-finish

Reply via email to