diff options
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/lib/gcc-dg.exp | 6 | ||||
-rw-r--r-- | gcc/testsuite/lib/target-supports.exp | 6 |
2 files changed, 11 insertions, 1 deletions
diff --git a/gcc/testsuite/lib/gcc-dg.exp b/gcc/testsuite/lib/gcc-dg.exp index 6e9a7b2..c0adef6 100644 --- a/gcc/testsuite/lib/gcc-dg.exp +++ b/gcc/testsuite/lib/gcc-dg.exp @@ -1375,8 +1375,9 @@ set dg_runtest_extra_prunes "" # 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 true { + 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 @@ -1384,4 +1385,7 @@ proc find-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.exp b/gcc/testsuite/lib/target-supports.exp index 7b3172d..4970536 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -653,6 +653,9 @@ proc check_effective_target_stack_size { } { # For nvptx target, stack size limits are relevant for execution only. if { [istarget nvptx-*-*] } { set dg-do-what [find-dg-do-what] + if { ![llength ${dg-do-what}] } { + error "unexpected call stack" + } if { ![string equal [lindex ${dg-do-what} 0] run] } { return 0 } @@ -1014,6 +1017,9 @@ proc check_effective_target_alloca {} { } set dg-do-what [find-dg-do-what] + if { ![llength ${dg-do-what}] } { + error "unexpected call stack" + } if { [string equal [lindex ${dg-do-what} 0] run] } { # For 'dg-do run', it additionally depends on runtime support. # (If not supported, we don't try to demote 'run' to 'link', |