aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@arm.com>2024-10-07 13:03:02 +0100
committerRichard Sandiford <richard.sandiford@arm.com>2024-10-07 13:03:02 +0100
commitfce02baff53bbcb673f41ea18668103edb2f7c00 (patch)
tree96f4a7d4ca8225d1651be55a2c6e8a38cfdb097b
parentb0b71618157ddac52266909978f331406f98f3a2 (diff)
downloadgcc-fce02baff53bbcb673f41ea18668103edb2f7c00.zip
gcc-fce02baff53bbcb673f41ea18668103edb2f7c00.tar.gz
gcc-fce02baff53bbcb673f41ea18668103edb2f7c00.tar.bz2
testsuite: Unset torture_current_flags after use
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.
-rw-r--r--gcc/testsuite/lib/gcc-dg.exp1
1 files changed, 1 insertions, 0 deletions
diff --git a/gcc/testsuite/lib/gcc-dg.exp b/gcc/testsuite/lib/gcc-dg.exp
index cb401a7..7adca02 100644
--- a/gcc/testsuite/lib/gcc-dg.exp
+++ b/gcc/testsuite/lib/gcc-dg.exp
@@ -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
}
}