]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
testsuite: Unset torture_current_flags after use
authorRichard Sandiford <richard.sandiford@arm.com>
Mon, 7 Oct 2024 12:03:02 +0000 (13:03 +0100)
committerRichard Sandiford <richard.sandiford@arm.com>
Mon, 7 Oct 2024 12:03:02 +0000 (13:03 +0100)
Before running a test with specific torture options, gcc-dg-runtest
sets the global variable torture_current_flags to the set of torture
options that will be used.  However, it never unset the variable
afterwards, which meant that the last options would hang around
and potentially confuse later non-torture tests.

I saw this with a follow-on patch to check-function-bodies, but it's
probably possible to construct aritificial test combinations that
expose it with check-function-bodies's existing flag filtering.

gcc/testsuite/
* lib/gcc-dg.exp (gcc-dg-runtest): Unset torture_current_flags
after each test.

gcc/testsuite/lib/gcc-dg.exp

index cb401a704359ac0268882992144e4e26b3f68c20..7adca02f9377db27cf4ff7de4a3d4eac0d06d029 100644 (file)
@@ -628,6 +628,7 @@ proc gcc-dg-runtest { testcases flags default-extra-flags } {
            set torture_current_flags "$flags_t"
            verbose "Testing $nshort, $flags $flags_t" 1
            dg-test $test "$flags $flags_t" ${default-extra-flags}
+           unset torture_current_flags
        }
     }