From: Tom Tromey Date: Thu, 12 Dec 2024 14:54:51 +0000 (-0700) Subject: Remove "then" from test suite X-Git-Tag: binutils-2_44~256 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=03736207c6c81713c9ed749877de1c0e0ff3ffee;p=thirdparty%2Fbinutils-gdb.git Remove "then" from test suite This removes the "then" keyword from the test suite. Andrew did this once before, but some new ones crept in. This also adds braces to the "if" conditions and normalizes the failures to just use "return". --- diff --git a/gdb/testsuite/gdb.ada/str_chars.exp b/gdb/testsuite/gdb.ada/str_chars.exp index 6d494d3ee2c..f459e3cb6d3 100644 --- a/gdb/testsuite/gdb.ada/str_chars.exp +++ b/gdb/testsuite/gdb.ada/str_chars.exp @@ -28,8 +28,8 @@ if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug ]] != "" } clean_restart ${testfile} set bp_location [gdb_get_line_number "STOP" ${testdir}/foo.adb] -if ![runto "foo.adb:$bp_location" ] then { - return -1 +if {![runto "foo.adb:$bp_location"]} { + return } gdb_test "print Arg" \ diff --git a/gdb/testsuite/gdb.arch/aarch64-pseudo-unwind.exp b/gdb/testsuite/gdb.arch/aarch64-pseudo-unwind.exp index 4319623ebc4..8b7c14812a1 100644 --- a/gdb/testsuite/gdb.arch/aarch64-pseudo-unwind.exp +++ b/gdb/testsuite/gdb.arch/aarch64-pseudo-unwind.exp @@ -31,8 +31,8 @@ if { [prepare_for_testing "failed to prepare" ${testfile} \ clean_restart ${binfile} -if ![runto_main] then { - fail "could not run to main" +if {![runto_main]} { + return } gdb_breakpoint break_here_asm temporary diff --git a/gdb/testsuite/gdb.arch/amd64-pseudo-unwind.exp b/gdb/testsuite/gdb.arch/amd64-pseudo-unwind.exp index f035f8706e7..fa82bef6448 100644 --- a/gdb/testsuite/gdb.arch/amd64-pseudo-unwind.exp +++ b/gdb/testsuite/gdb.arch/amd64-pseudo-unwind.exp @@ -34,8 +34,8 @@ if { [prepare_for_testing "failed to prepare" ${testfile} \ clean_restart ${binfile} -if ![runto_main] then { - fail "could not run to main" +if {![runto_main]} { + return } gdb_breakpoint break_here_asm temporary diff --git a/gdb/testsuite/gdb.arch/arm-pseudo-unwind-legacy.exp b/gdb/testsuite/gdb.arch/arm-pseudo-unwind-legacy.exp index a8ffab06edf..bfedff245c7 100644 --- a/gdb/testsuite/gdb.arch/arm-pseudo-unwind-legacy.exp +++ b/gdb/testsuite/gdb.arch/arm-pseudo-unwind-legacy.exp @@ -36,8 +36,8 @@ if { [prepare_for_testing "failed to prepare" ${testfile} \ clean_restart ${binfile} -if ![runto_main] then { - fail "could not run to main" +if {![runto_main]} { + return } gdb_breakpoint break_here_asm temporary diff --git a/gdb/testsuite/gdb.arch/arm-pseudo-unwind.exp b/gdb/testsuite/gdb.arch/arm-pseudo-unwind.exp index 0a915c54191..004c606759f 100644 --- a/gdb/testsuite/gdb.arch/arm-pseudo-unwind.exp +++ b/gdb/testsuite/gdb.arch/arm-pseudo-unwind.exp @@ -31,8 +31,8 @@ if { [prepare_for_testing "failed to prepare" ${testfile} \ clean_restart ${binfile} -if ![runto_main] then { - fail "could not run to main" +if {![runto_main]} { + return } gdb_breakpoint break_here_asm temporary diff --git a/gdb/testsuite/gdb.base/value-history-unavailable.exp b/gdb/testsuite/gdb.base/value-history-unavailable.exp index 0086706bc90..8dc25dbc521 100644 --- a/gdb/testsuite/gdb.base/value-history-unavailable.exp +++ b/gdb/testsuite/gdb.base/value-history-unavailable.exp @@ -21,9 +21,8 @@ if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } { return -1 } -if ![runto_main] then { - perror "couldn't run to breakpoint" - continue +if {![runto_main]} { + return } set target_char_mask [get_valueof "/u" "a.x\[0]" "255" "get target char mask"] diff --git a/gdb/testsuite/gdb.python/py-connection-removed.exp b/gdb/testsuite/gdb.python/py-connection-removed.exp index 117075a6b6a..28c71da865f 100644 --- a/gdb/testsuite/gdb.python/py-connection-removed.exp +++ b/gdb/testsuite/gdb.python/py-connection-removed.exp @@ -33,8 +33,8 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } { return -1 } -if ![runto_main] then { - return 0 +if {![runto_main]} { + return } # Register a callback that will trigger when a connection is removed diff --git a/gdb/testsuite/gdb.python/py-finish-breakpoint-deletion.exp b/gdb/testsuite/gdb.python/py-finish-breakpoint-deletion.exp index 84e839b2117..4aed5c5ea93 100644 --- a/gdb/testsuite/gdb.python/py-finish-breakpoint-deletion.exp +++ b/gdb/testsuite/gdb.python/py-finish-breakpoint-deletion.exp @@ -25,8 +25,8 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile]} { return -1 } -if ![runto_main] then { - return 0 +if {![runto_main]} { + return } # For remote host testing diff --git a/gdb/testsuite/gdb.python/py-watchpoint.exp b/gdb/testsuite/gdb.python/py-watchpoint.exp index a3c0d7d03ea..93619562d3a 100644 --- a/gdb/testsuite/gdb.python/py-watchpoint.exp +++ b/gdb/testsuite/gdb.python/py-watchpoint.exp @@ -25,7 +25,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile]} { require allow_python_tests -if ![runto_main] then { +if {![runto_main]} { return }