diff options
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/restore.exp | 13 |
2 files changed, 16 insertions, 2 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 64c7d38..37e323f 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2019-09-22 Tom de Vries <tdevries@suse.de> + + * gdb.base/restore.exp: Allow register variables to be optimized out at + -O0. + 2019-09-20 Ulrich Weigand <uweigand@de.ibm.com> * gdb.arch/spu-info.exp: Remove file. diff --git a/gdb/testsuite/gdb.base/restore.exp b/gdb/testsuite/gdb.base/restore.exp index 947fe58..56c2f5e 100644 --- a/gdb/testsuite/gdb.base/restore.exp +++ b/gdb/testsuite/gdb.base/restore.exp @@ -73,8 +73,17 @@ proc restore_tests { } { # they should be. for {set var 1} {$var <= $c} {incr var} { set expected [expr 0x7eeb + $var] - gdb_test "print l$var" " = $expected" \ - "caller$c calls callee$e; return restored l$var to $expected" + set test "caller$c calls callee$e; return restored l$var to $expected" + set pass_pattern " = $expected" + set unsupported_pattern " = <optimized out>" + gdb_test_multiple "print l$var" $test { + -re "\[\r\n\]*(?:$pass_pattern)\[\r\n\]+$gdb_prompt $" { + pass $test + } + -re "\[\r\n\]*(?:$unsupported_pattern)\[\r\n\]+$gdb_prompt $" { + unsupported $test + } + } } } } |