aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.base/callfuncs.exp
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/testsuite/gdb.base/callfuncs.exp')
-rw-r--r--gdb/testsuite/gdb.base/callfuncs.exp14
1 files changed, 13 insertions, 1 deletions
diff --git a/gdb/testsuite/gdb.base/callfuncs.exp b/gdb/testsuite/gdb.base/callfuncs.exp
index 46ba509..9aeb09b 100644
--- a/gdb/testsuite/gdb.base/callfuncs.exp
+++ b/gdb/testsuite/gdb.base/callfuncs.exp
@@ -469,5 +469,17 @@ if {$old_reg_content == $new_reg_content} then {
fail "nested call dummies preserve register contents"
}
-return 0
+# GDB should not crash by internal error on $sp underflow during the inferior
+# call. It is OK it will stop on some: Cannot access memory at address 0x$hex.
+if {![target_info exists gdb,nosignals] && ![istarget "*-*-uclinux*"]} {
+ gdb_test {set $old_sp = $sp}
+
+ gdb_test {set $sp = 0}
+ gdb_test "call doubleit (1)" "" "sp == 0: call doubleit (1)"
+
+ gdb_test {set $sp = -1}
+ gdb_test "call doubleit (1)" "" "sp == -1: call doubleit (1)"
+
+ gdb_test {set $sp = $old_sp}
+}