aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorAlexandre Oliva <oliva@adacore.com>2023-04-05 11:27:28 -0300
committerAlexandre Oliva <oliva@gnu.org>2023-04-05 22:43:01 -0300
commit673a2a6445a79bcce5ba433d6bbec4b99a1bc7c6 (patch)
tree5d930fb73f18e38f6dce8d41c577a4c98a5c8c37 /gcc
parent5229788da723442d51155693ab98f831e94d1d58 (diff)
downloadgcc-673a2a6445a79bcce5ba433d6bbec4b99a1bc7c6.zip
gcc-673a2a6445a79bcce5ba433d6bbec4b99a1bc7c6.tar.gz
gcc-673a2a6445a79bcce5ba433d6bbec4b99a1bc7c6.tar.bz2
testsuite: fix proc unsupported overriding in modules.exp [PR108899]
The overrider of proc unsupported in modules.exp had two problems reported by Thomas Schwinge, even after Jakub JelĂ­nek's fix: - it remained in effect while running other dejagnu testsets - it didn't quote correctly the argument list passed to it, which caused test names to be surrounded by curly braces, as in: UNSUPPORTED: {...} This patch fixes both issues, obsoleting and reverting Jakub's change, by dropping the overrider and renaming the saved proc back, and by using uplevel's argument list splicing. Co-authored-by: Thomas Schwinge <thomas@codesourcery.com> for gcc/testsuite/ChangeLog PR testsuite/108899 * g++.dg/modules/modules.exp (unsupported): Drop renaming. Fix quoting.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/g++.dg/modules/modules.exp20
1 files changed, 11 insertions, 9 deletions
diff --git a/gcc/testsuite/g++.dg/modules/modules.exp b/gcc/testsuite/g++.dg/modules/modules.exp
index 80aa392..dc302d3 100644
--- a/gcc/testsuite/g++.dg/modules/modules.exp
+++ b/gcc/testsuite/g++.dg/modules/modules.exp
@@ -319,15 +319,11 @@ cleanup_module_files [find $DEFAULT_REPO *.gcm]
# so that, after an unsupported result in dg-test, we can skip rather
# than fail subsequent related tests.
set module_do {"compile" "P"}
-if { [info procs unsupported] != [list] \
- && [info procs saved-unsupported] == [list] } {
- rename unsupported saved-unsupported
-
- proc unsupported { args } {
- global module_do
- lset module_do 1 "N"
- return [saved-unsupported $args]
- }
+rename unsupported modules-saved-unsupported
+proc unsupported { args } {
+ global module_do
+ lset module_do 1 "N"
+ return [uplevel 1 modules-saved-unsupported $args]
}
# not grouped tests, sadly tcl doesn't have negated glob
@@ -412,4 +408,10 @@ foreach src [lsort [find $srcdir/$subdir {*_a.[CHX}]] {
}
}
+# Restore the original unsupported proc, lest it will affect
+# subsequent test runs, or even fail renaming if we run modules.exp
+# for multiple targets/multilibs/options.
+rename unsupported {}
+rename modules-saved-unsupported unsupported
+
dg-finish