diff options
author | Thomas Schwinge <tschwinge@baylibre.com> | 2025-03-05 18:28:53 +0100 |
---|---|---|
committer | Thomas Schwinge <tschwinge@baylibre.com> | 2025-03-13 13:07:27 +0100 |
commit | 6888a4bb584ad3977cb1e8cdefedea70b1f135ea (patch) | |
tree | d2f23725672ac8300e2c10afd5c9c3f7b17ef937 /gcc/testsuite/lib | |
parent | 5967fe0dd1f3a49176740553cd147e99d6950895 (diff) | |
download | gcc-6888a4bb584ad3977cb1e8cdefedea70b1f135ea.zip gcc-6888a4bb584ad3977cb1e8cdefedea70b1f135ea.tar.gz gcc-6888a4bb584ad3977cb1e8cdefedea70b1f135ea.tar.bz2 |
Move 'find-dg-do-what' from 'gcc/testsuite/lib/gcc-dg.exp' into 'gcc/testsuite/lib/target-supports-dg.exp'
This was added in commit f553b1aaa2b1b925c918e5dcf966290b045321c2
"Refactor duplicated code into 'gcc/testsuite/lib/gcc-dg.exp:find-dg-do-what'",
for use by 'gcc/testsuite/lib/target-supports.exp'. The latter is used by
several test suites, 'gcc/testsuite/lib/gcc-dg.exp' however doesn't get loaded
for 'make check-target-libstdc++-v3', for example, and testing ERRORs out:
ERROR: (DejaGnu) proc "find-dg-do-what" does not exist.
The error code is TCL LOOKUP COMMAND find-dg-do-what
The info on the error is:
invalid command name "find-dg-do-what"
while executing
"::tcl_unknown find-dg-do-what"
("uplevel" body line 1)
invoked from within
"uplevel 1 ::tcl_unknown $args"
Fix this by moving 'find-dg-do-what' into the DejaGnu interfacing file
corresponding to 'gcc/testsuite/lib/target-supports.exp':
'gcc/testsuite/lib/target-supports-dg.exp' (next to other related procedures).
gcc/testsuite/
* lib/gcc-dg.exp (find-dg-do-what): Move...
* lib/target-supports-dg.exp: ... here.
Diffstat (limited to 'gcc/testsuite/lib')
-rw-r--r-- | gcc/testsuite/lib/gcc-dg.exp | 20 | ||||
-rw-r--r-- | gcc/testsuite/lib/target-supports-dg.exp | 21 |
2 files changed, 21 insertions, 20 deletions
diff --git a/gcc/testsuite/lib/gcc-dg.exp b/gcc/testsuite/lib/gcc-dg.exp index 008b853..f5ad424 100644 --- a/gcc/testsuite/lib/gcc-dg.exp +++ b/gcc/testsuite/lib/gcc-dg.exp @@ -1376,23 +1376,3 @@ proc gcc-transform-out-of-tree { args } { set additional_prunes "" set dg_runtest_extra_prunes "" - -# Find the 'dg-do-what' variable living inside DejaGnu's 'dg-test' procedure, -# as a local variable. We start looking at the second-outer frame: this way, -# the caller of 'find-dg-do-what' may maintain a local 'dg-do-what' variable -# without interfering with this search. -proc find-dg-do-what { } { - set level [info level] - set lookup_level 2 - while { $lookup_level <= $level } { - upvar $lookup_level dg-do-what dg-do-what - if { [info exists dg-do-what] } { - verbose "find-dg-do-what: found 'dg-do-what' at level $lookup_level: ${dg-do-what}" 2 - return ${dg-do-what} - } - incr lookup_level - } - # We've not be called (indirectly) from 'dg-test'. - verbose "find-dg-do-what: have not found 'dg-do-what'" 2 - return [list] -} diff --git a/gcc/testsuite/lib/target-supports-dg.exp b/gcc/testsuite/lib/target-supports-dg.exp index c307258..422ea83 100644 --- a/gcc/testsuite/lib/target-supports-dg.exp +++ b/gcc/testsuite/lib/target-supports-dg.exp @@ -58,6 +58,27 @@ proc testname-for-summary { } { return "$testname_with_flags" } +# Find the 'dg-do-what' variable living inside DejaGnu's 'dg-test' procedure, +# as a local variable. We start looking at the second-outer frame: this way, +# the caller of 'find-dg-do-what' may maintain a local 'dg-do-what' variable +# without interfering with this search. + +proc find-dg-do-what { } { + set level [info level] + set lookup_level 2 + while { $lookup_level <= $level } { + upvar $lookup_level dg-do-what dg-do-what + if { [info exists dg-do-what] } { + verbose "find-dg-do-what: found 'dg-do-what' at level $lookup_level: ${dg-do-what}" 2 + return ${dg-do-what} + } + incr lookup_level + } + # We've not be called (indirectly) from 'dg-test'. + verbose "find-dg-do-what: have not found 'dg-do-what'" 2 + return [list] +} + # If this target does not support weak symbols, skip this test. proc dg-require-weak { args } { |