diff options
Diffstat (limited to 'gdb/testsuite/gdb.base/varargs.exp')
-rw-r--r-- | gdb/testsuite/gdb.base/varargs.exp | 69 |
1 files changed, 19 insertions, 50 deletions
diff --git a/gdb/testsuite/gdb.base/varargs.exp b/gdb/testsuite/gdb.base/varargs.exp index ef8b6cb..3cde8ea 100644 --- a/gdb/testsuite/gdb.base/varargs.exp +++ b/gdb/testsuite/gdb.base/varargs.exp @@ -62,9 +62,10 @@ gdb_exit gdb_start gdb_reinitialize_dir $srcdir/$subdir gdb_load ${binfile} -send_gdb "set print sevenbit-strings\n" ; gdb_expect -re "$gdb_prompt $" -send_gdb "set print address off\n" ; gdb_expect -re "$gdb_prompt $" -send_gdb "set width 0\n" ; gdb_expect -re "$gdb_prompt $" +gdb_test_no_output "set print sevenbit-strings" +gdb_test_no_output "set print address off" +gdb_test_no_output "set width 0" + if [gdb_skip_stdio_test "varargs.exp"] { # Nothing in this module is testable without printf. @@ -89,57 +90,25 @@ if { $hp_aCC_compiler } { gdb_test "set overload-resolution 0" "" } -send_gdb "print find_max1(5,1,2,3,4,5)\n" -gdb_expect { - -re ".*find_max\\(5, 1, 2, 3, 4, 5\\) returns 5\[ \r\n\]+.\[0-9\]+ = 5.*$gdb_prompt $" { - pass "print find_max1(5,1,2,3,4,5)" - } - -re ".*$gdb_prompt $" { fail "print find_max1(5,1,2,3,4,5)" } - timeout { fail "(timeout) print find_max1(5,1,2,3,4,5)" } - } - - - - -send_gdb "print find_max1(1,3)\n" -gdb_expect { - -re ".*find_max\\(1, 3\\) returns 3\[ \r\n\]+.\[0-9\]+ = 3.*$gdb_prompt $" { - pass "print find_max1(1,3)" - } - -re ".*$gdb_prompt $" { fail "print find_max1(1,3)" } - timeout { fail "(timeout) print find_max1(1,3)" } - } - - -send_gdb "print find_max1(10,1,2,3,4,5,6,7,8,29,0)\n" -gdb_expect { - -re ".*find_max\\(10, 1, 2, 3, 4, 5, 6, 7, 8, 29, 0\\) returns 29\[ \r\n\]+.\[0-9\]+ = 29.*$gdb_prompt $" { - pass "print find_max1(10,1,2,3,4,5,6,7,8,29,0)" - } - -re ".*$gdb_prompt $" { fail "print find_max1(10,1,2,3,4,5,6,7,8,29,0)" } - timeout { fail "(timeout) print find_max1(10,1,2,3,4,5,6,7,8,29,0)" } - } - +gdb_test "print find_max1(5,1,2,3,4,5)" \ + "find_max\\(5, 1, 2, 3, 4, 5\\) returns 5\[ \r\n\]+.\[0-9\]+ = 5" \ + "print find_max1(5,1,2,3,4,5)" +gdb_test "print find_max1(1,3)" \ + ".*find_max\\(1, 3\\) returns 3\[ \r\n\]+.\[0-9\]+ = 3" \ + "print find_max1(1,3)" -send_gdb "print find_max2(3,1,2,3)\n" -gdb_expect { - -re ".*find_max\\(3, 1, 2, 3\\) returns 3\[ \r\n\]+.\[0-9\]+ = 3.*$gdb_prompt $" { - pass "print find_max2(3,1,2,3)" - } - -re ".*$gdb_prompt $" { fail "print find_max2(3,1,2,3)" } - timeout { fail "(timeout) print find_max2(3,1,2,3)" } - } +gdb_test "print find_max1(10,1,2,3,4,5,6,7,8,29,0)" \ + ".*find_max\\(10, 1, 2, 3, 4, 5, 6, 7, 8, 29, 0\\) returns 29\[ \r\n\]+.\[0-9\]+ = 29" \ + "print find_max1(10,1,2,3,4,5,6,7,8,29,0)" +gdb_test "print find_max2(3,1,2,3)" \ + ".*find_max\\(3, 1, 2, 3\\) returns 3\[ \r\n\]+.\[0-9\]+ = 3" \ + "print find_max2(3,1,2,3)" if {![target_info exists gdb,skip_float_tests]} { - send_gdb "print find_max_double(5,1.0,17.0,2.0,3.0,4.0)\n" - gdb_expect { - -re ".*find_max\\(.*\\) returns 17\\.000000\[ \r\n\]+.\[0-9\]+ = 17.*$gdb_prompt $" { - pass "print find_max_double(5,1.0,17.0,2.0,3.0,4.0)" - } - -re ".*$gdb_prompt $" { fail "print find_max_double(5,1.0,17.0,2.0,3.0,4.0)" } - timeout { fail "(timeout) print find_max_double(5,1.0,17.0,2.0,3.0,4.0)" } - } + gdb_test "print find_max_double(5,1.0,17.0,2.0,3.0,4.0)" \ + ".*find_max\\(.*\\) returns 17\\.000000\[ \r\n\]+.\[0-9\]+ = 17" \ + "print find_max_double(5,1.0,17.0,2.0,3.0,4.0)" } |