[binutils-gdb] GDB: testsuite: base: Don't return value from top-level (manual)

Thiago Bauermann via Gdb-cvs <[email protected]>
Newsgroups gmane.comp.gdb.cvs
Message-ID <[email protected]>
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=f5f7f366fe76b58ac7ab125ea9007f91cd1a33a3

commit f5f7f366fe76b58ac7ab125ea9007f91cd1a33a3
Author: Thiago Jung Bauermann <[email protected]>
Date:   Wed Apr 29 20:04:06 2026 -0300

    GDB: testsuite: base: Don't return value from top-level (manual)
    
    This patch manually changes "return -1" and "return 0" statements that
    weren't caught by the sed command.
    
    These return statements fall into one of these criteria:
    
    - misaligned line, which is then fixed by this patch;
    - return at top level but inside a block such as save_vars,
      with_test_prefix, foreach, gdb_test_multiple.
    
    Some weren't changed because they didn't meet the criteria above, or
    weren't trivial to check.
    
    There was also one return statement with an unnecessary semi-colon at
    the end, which was removed.
    
    Approved-By: Tom Tromey <[email protected]>

Diff:
---
 gdb/testsuite/gdb.base/argv0-symlink.exp                |  8 ++++----
 gdb/testsuite/gdb.base/async-shell.exp                  |  2 +-
 gdb/testsuite/gdb.base/attach-pie-misread.exp           |  2 +-
 gdb/testsuite/gdb.base/bigcore.exp                      |  4 ++--
 gdb/testsuite/gdb.base/bp-cmds-continue-ctrl-c.exp      |  2 +-
 gdb/testsuite/gdb.base/bp-cmds-run-with-ex.exp          |  2 +-
 gdb/testsuite/gdb.base/branch-to-self.exp               |  4 ++--
 gdb/testsuite/gdb.base/break-always.exp                 |  2 +-
 gdb/testsuite/gdb.base/bt-on-error-and-warning.exp      |  2 +-
 gdb/testsuite/gdb.base/bt-on-fatal-signal.exp           |  2 +-
 gdb/testsuite/gdb.base/catch-fork-kill.exp              |  2 +-
 gdb/testsuite/gdb.base/catch-syscall.exp                |  2 +-
 gdb/testsuite/gdb.base/checkpoint.exp                   |  2 +-
 gdb/testsuite/gdb.base/code_elim.exp                    |  4 ++--
 gdb/testsuite/gdb.base/compare-sections.exp             |  6 +++---
 gdb/testsuite/gdb.base/cond-eval-mode.exp               |  2 +-
 gdb/testsuite/gdb.base/condbreak-bad.exp                |  6 +++---
 gdb/testsuite/gdb.base/continue-all-already-running.exp |  2 +-
 gdb/testsuite/gdb.base/coredump-filter.exp              |  2 +-
 gdb/testsuite/gdb.base/corefile-exec-context.exp        |  2 +-
 gdb/testsuite/gdb.base/corefile-find-exec.exp           | 12 ++++++------
 gdb/testsuite/gdb.base/cvexpr.exp                       |  2 +-
 gdb/testsuite/gdb.base/detach.exp                       |  2 +-
 gdb/testsuite/gdb.base/disabled-location.exp            |  2 +-
 gdb/testsuite/gdb.base/dmsym.exp                        |  4 ++--
 gdb/testsuite/gdb.base/dso2dso.exp                      |  4 ++--
 gdb/testsuite/gdb.base/endianity.exp                    |  4 ++--
 gdb/testsuite/gdb.base/foll-exec-mode.exp               |  8 ++++----
 gdb/testsuite/gdb.base/fullname.exp                     |  2 +-
 gdb/testsuite/gdb.base/fullpath-expand.exp              |  2 +-
 gdb/testsuite/gdb.base/gcore-relro.exp                  | 12 ++++++------
 gdb/testsuite/gdb.base/gcore.exp                        |  2 +-
 gdb/testsuite/gdb.base/gcorebg.exp                      |  2 +-
 gdb/testsuite/gdb.base/global-var-nested-by-dso.exp     |  2 +-
 gdb/testsuite/gdb.base/gnu-ifunc.exp                    |  2 +-
 gdb/testsuite/gdb.base/gnu_vector.exp                   |  4 ++--
 gdb/testsuite/gdb.base/huge.exp                         |  2 +-
 gdb/testsuite/gdb.base/info-fun.exp                     |  4 ++--
 gdb/testsuite/gdb.base/info-proc.exp                    |  4 ++--
 gdb/testsuite/gdb.base/info-shared.exp                  |  2 +-
 gdb/testsuite/gdb.base/interp.exp                       |  2 +-
 gdb/testsuite/gdb.base/jit-reader-simple.exp            |  2 +-
 gdb/testsuite/gdb.base/jump.exp                         |  2 +-
 gdb/testsuite/gdb.base/label.exp                        |  2 +-
 gdb/testsuite/gdb.base/longjmp.exp                      |  4 ++--
 gdb/testsuite/gdb.base/moribund-step.exp                |  2 +-
 gdb/testsuite/gdb.base/nostdlib.exp                     |  2 +-
 gdb/testsuite/gdb.base/overlays.exp                     |  4 ++--
 gdb/testsuite/gdb.base/printcmds.exp                    |  4 ++--
 gdb/testsuite/gdb.base/random-signal.exp                |  2 +-
 gdb/testsuite/gdb.base/randomize.exp                    |  4 ++--
 gdb/testsuite/gdb.base/readline-ask.exp                 |  2 +-
 gdb/testsuite/gdb.base/readline.exp                     |  2 +-
 gdb/testsuite/gdb.base/readnever.exp                    |  2 +-
 gdb/testsuite/gdb.base/relocate.exp                     |  4 ++--
 gdb/testsuite/gdb.base/reread.exp                       |  4 ++--
 gdb/testsuite/gdb.base/return2.exp                      |  4 ++--
 gdb/testsuite/gdb.base/setshow.exp                      |  4 ++--
 gdb/testsuite/gdb.base/solib-abort.exp                  |  2 +-
 gdb/testsuite/gdb.base/solib-bad-entry-addr.exp         |  2 +-
 gdb/testsuite/gdb.base/solib-display.exp                |  4 ++--
 gdb/testsuite/gdb.base/solib-overlap.exp                |  6 +++---
 gdb/testsuite/gdb.base/solib-search.exp                 |  2 +-
 gdb/testsuite/gdb.base/solib-symbol.exp                 |  2 +-
 gdb/testsuite/gdb.base/stale-infcall.exp                |  2 +-
 gdb/testsuite/gdb.base/step-break.exp                   |  4 ++--
 gdb/testsuite/gdb.base/step-line.exp                    |  2 +-
 gdb/testsuite/gdb.base/step-test.exp                    |  6 +++---
 gdb/testsuite/gdb.base/style-logging.exp                |  2 +-
 gdb/testsuite/gdb.base/testenv.exp                      |  2 +-
 gdb/testsuite/gdb.base/traced-thread.exp                |  2 +-
 gdb/testsuite/gdb.base/valgrind-bt.exp                  |  4 ++--
 gdb/testsuite/gdb.base/valgrind-infcall.exp             |  4 ++--
 gdb/testsuite/gdb.base/vdso-warning.exp                 |  2 +-
 gdb/testsuite/gdb.base/watchpoint.exp                   |  4 ++--
 gdb/testsuite/gdb.base/wchar.exp                        |  2 +-
 gdb/testsuite/gdb.base/wrong_frame_bt_full.exp          |  4 ++--
 77 files changed, 124 insertions(+), 124 deletions(-)

diff --git a/gdb/testsuite/gdb.base/argv0-symlink.exp b/gdb/testsuite/gdb.base/argv0-symlink.exp
index 6b05bba205d..58d5ef98fc4 100644
--- a/gdb/testsuite/gdb.base/argv0-symlink.exp
+++ b/gdb/testsuite/gdb.base/argv0-symlink.exp
@@ -42,13 +42,13 @@ with_test_prefix "file symlink" {
 		    "ln -sf ${testfile} [standard_output_file $filelink]"]
     if {[lindex $status 0] != 0} {
 	unsupported "$test (host does not support symbolic links)"
-	return 0
+	return
     }
 
     clean_restart "$filelink"
 
     if {![runto_main]} {
-	return -1
+	return
     }
 
     gdb_test_no_output "set print repeats 10000"
@@ -82,13 +82,13 @@ with_test_prefix "dir symlink" {
     set status [remote_exec host "ln -sf . [standard_output_file $dirlink]"]
     if {[lindex $status 0] != 0} {
 	unsupported "$test (host does not support symbolic links)"
-	return 0
+	return
     }
 
     clean_restart "$dirlink/$filelink"
 
     if {![runto_main]} {
-	return -1
+	return
     }
 
     gdb_test_no_output "set print repeats 10000"
diff --git a/gdb/testsuite/gdb.base/async-shell.exp b/gdb/testsuite/gdb.base/async-shell.exp
index 72f3645a757..28003fa92d3 100644
--- a/gdb/testsuite/gdb.base/async-shell.exp
+++ b/gdb/testsuite/gdb.base/async-shell.exp
@@ -23,7 +23,7 @@ require !use_gdb_stub
 save_vars { GDBFLAGS } {
     set GDBFLAGS "$GDBFLAGS -ex \"set non-stop on\""
     if { [prepare_for_testing "failed to prepare" ${testfile} $srcfile] } {
-	return -1
+	return
     }
 }
 
diff --git a/gdb/testsuite/gdb.base/attach-pie-misread.exp b/gdb/testsuite/gdb.base/attach-pie-misread.exp
index a8002119d96..d2decd801fc 100644
--- a/gdb/testsuite/gdb.base/attach-pie-misread.exp
+++ b/gdb/testsuite/gdb.base/attach-pie-misread.exp
@@ -99,7 +99,7 @@ with_test_prefix "rebuild with DGEN defined" {
     set prelink_args [build_executable_own_libs ${testfile}.exp $executable $srcfile \
 			  [list pie "additional_flags=-DGEN=\"$genfile\""]]
     if {$prelink_args == ""} {
-	return -1
+	return
     }
 }
 
diff --git a/gdb/testsuite/gdb.base/bigcore.exp b/gdb/testsuite/gdb.base/bigcore.exp
index 7dd88108235..b1ced340fc1 100644
--- a/gdb/testsuite/gdb.base/bigcore.exp
+++ b/gdb/testsuite/gdb.base/bigcore.exp
@@ -39,8 +39,8 @@ standard_testfile .c
 set corefile [standard_output_file ${binfile}.corefile]
 
 if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
-     untested "failed to compile"
-     return -1
+    untested "failed to compile"
+    return
 }
 
 # Traverse part of bigcore's linked list of memory chunks (forward or
diff --git a/gdb/testsuite/gdb.base/bp-cmds-continue-ctrl-c.exp b/gdb/testsuite/gdb.base/bp-cmds-continue-ctrl-c.exp
index 368507b2409..9fac9b551b3 100644
--- a/gdb/testsuite/gdb.base/bp-cmds-continue-ctrl-c.exp
+++ b/gdb/testsuite/gdb.base/bp-cmds-continue-ctrl-c.exp
@@ -121,7 +121,7 @@ with_test_prefix "run" {
     clean_restart $testfile
 
     if {![runto_main]} {
-	return -1
+	return
     }
 
     do_test
diff --git a/gdb/testsuite/gdb.base/bp-cmds-run-with-ex.exp b/gdb/testsuite/gdb.base/bp-cmds-run-with-ex.exp
index 95c2811a3e0..1bdb75f44fd 100644
--- a/gdb/testsuite/gdb.base/bp-cmds-run-with-ex.exp
+++ b/gdb/testsuite/gdb.base/bp-cmds-run-with-ex.exp
@@ -35,7 +35,7 @@ save_vars { GDBFLAGS } {
     gdb_exit
     if {[gdb_spawn] != 0} {
 	fail "spawn gdb"
-	return -1
+	return
     }
 }
 
diff --git a/gdb/testsuite/gdb.base/branch-to-self.exp b/gdb/testsuite/gdb.base/branch-to-self.exp
index ffd15780d72..2cb388219e0 100644
--- a/gdb/testsuite/gdb.base/branch-to-self.exp
+++ b/gdb/testsuite/gdb.base/branch-to-self.exp
@@ -28,7 +28,7 @@ with_test_prefix "single-step" {
 
     clean_restart ${testfile}
     if {![runto_main]} {
-	return -1
+	return
     }
     set line_num [gdb_get_line_number "loop-line" ${testfile}.c]
 
@@ -61,7 +61,7 @@ with_test_prefix "break-cond" {
 	clean_restart ${testfile}
 
 	if {![runto_main]} {
-	    return -1
+	    return
 	}
 
 	set test "set breakpoint condition-evaluation $side"
diff --git a/gdb/testsuite/gdb.base/break-always.exp b/gdb/testsuite/gdb.base/break-always.exp
index f2eb1a3ba8b..8fe3fb3f863 100644
--- a/gdb/testsuite/gdb.base/break-always.exp
+++ b/gdb/testsuite/gdb.base/break-always.exp
@@ -78,7 +78,7 @@ foreach test_value {0 1} {
 	    # Some targets do not allow manually writing a breakpoint to a
 	    # certain memory address, like QEMU.  In that case, just bail out.
 	    unsupported "cannot write to address $bp_address"
-	    return -1
+	    return
 	}
 	-re " = .*$gdb_prompt $" {
 	    pass $write_test
diff --git a/gdb/testsuite/gdb.base/bt-on-error-and-warning.exp b/gdb/testsuite/gdb.base/bt-on-error-and-warning.exp
index a9a1db344d2..0873ce5728c 100644
--- a/gdb/testsuite/gdb.base/bt-on-error-and-warning.exp
+++ b/gdb/testsuite/gdb.base/bt-on-error-and-warning.exp
@@ -37,7 +37,7 @@ gdb_test_multiple "maint set internal-error backtrace on" \
     "check backtrace is supported" {
     -re "support for this feature is not compiled into GDB" {
 	untested "feature not supported"
-	return -1
+	return
     }
     -re "$gdb_prompt $" {
 	pass $gdb_test_name
diff --git a/gdb/testsuite/gdb.base/bt-on-fatal-signal.exp b/gdb/testsuite/gdb.base/bt-on-fatal-signal.exp
index 9bf5f09c566..67511741d39 100644
--- a/gdb/testsuite/gdb.base/bt-on-fatal-signal.exp
+++ b/gdb/testsuite/gdb.base/bt-on-fatal-signal.exp
@@ -42,7 +42,7 @@ if {![runto_main]} {
 gdb_test_multiple "maint set backtrace-on-fatal-signal on" "" {
     -re "support for this feature is not compiled into GDB" {
 	untested $testfile
-	return -1
+	return
     }
     -re "$gdb_prompt $" {
 	pass $gdb_test_name
diff --git a/gdb/testsuite/gdb.base/catch-fork-kill.exp b/gdb/testsuite/gdb.base/catch-fork-kill.exp
index 498e34a49be..cd541e66247 100644
--- a/gdb/testsuite/gdb.base/catch-fork-kill.exp
+++ b/gdb/testsuite/gdb.base/catch-fork-kill.exp
@@ -44,7 +44,7 @@ foreach kind {"fork" "vfork"} {
     if {[build_executable $testfile.exp $testfile ${srcfile} \
 	     ${compile_options}] == -1} {
 	untested "failed to compile"
-	return -1
+	return
     }
 }
 
diff --git a/gdb/testsuite/gdb.base/catch-syscall.exp b/gdb/testsuite/gdb.base/catch-syscall.exp
index 673fca4a998..63abc1aec80 100644
--- a/gdb/testsuite/gdb.base/catch-syscall.exp
+++ b/gdb/testsuite/gdb.base/catch-syscall.exp
@@ -24,7 +24,7 @@ require supports_catch_syscall
 standard_testfile
 
 if  { [prepare_for_testing "failed to prepare" $testfile ${testfile}.c] } {
-     return -1
+    return
 }
 
 if {![runto_main]} {
diff --git a/gdb/testsuite/gdb.base/checkpoint.exp b/gdb/testsuite/gdb.base/checkpoint.exp
index b6ea9f63f17..828a633d4a4 100644
--- a/gdb/testsuite/gdb.base/checkpoint.exp
+++ b/gdb/testsuite/gdb.base/checkpoint.exp
@@ -38,7 +38,7 @@ if {[is_remote host]} {
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile \
 	 [list debug "additional_flags=-DPI_TXT=\"$pi_txt\" -DCOPY1_TXT=\"$copy1_txt\""]]} {
-     return -1
+    return
 }
 
 global gdb_prompt
diff --git a/gdb/testsuite/gdb.base/code_elim.exp b/gdb/testsuite/gdb.base/code_elim.exp
index 15e59b9095b..7c79ff54f19 100644
--- a/gdb/testsuite/gdb.base/code_elim.exp
+++ b/gdb/testsuite/gdb.base/code_elim.exp
@@ -38,12 +38,12 @@ remote_exec build "rm -f ${binfile2}"
 
 if { [gdb_compile "${srcdir}/${subdir}/${srcfile1}" "${binfile1}" executable $opts] != "" } {
      untested "failed to compile"
-     return -1
+    return
 }
 
 if { [gdb_compile "${srcdir}/${subdir}/${srcfile2}" "${binfile2}" executable $opts] != "" } {
      untested "failed to compile"
-     return -1
+    return
 }
 
 proc not_null_var_address { var } {
diff --git a/gdb/testsuite/gdb.base/compare-sections.exp b/gdb/testsuite/gdb.base/compare-sections.exp
index bf620706177..ba2687dbcb8 100644
--- a/gdb/testsuite/gdb.base/compare-sections.exp
+++ b/gdb/testsuite/gdb.base/compare-sections.exp
@@ -117,7 +117,7 @@ with_test_prefix "read-only" {
 
     if {!$has_ro_sections} {
 	unsupported "no read-only sections"
-	return -1;
+	return
     }
 
     set orig -1
@@ -132,7 +132,7 @@ with_test_prefix "read-only" {
 
     if {$orig == -1} {
 	untested "couldn't read address of read-only section"
-	return -1
+	return
     }
 
     # Come up with different value.
@@ -153,7 +153,7 @@ with_test_prefix "read-only" {
 
     if { $written != $patch } {
 	unsupported "can't patch read-only section"
-	return -1
+	return
     }
 
     gdb_test "compare-sections -r" \
diff --git a/gdb/testsuite/gdb.base/cond-eval-mode.exp b/gdb/testsuite/gdb.base/cond-eval-mode.exp
index e9463950eb5..c2aefc4a93b 100644
--- a/gdb/testsuite/gdb.base/cond-eval-mode.exp
+++ b/gdb/testsuite/gdb.base/cond-eval-mode.exp
@@ -47,7 +47,7 @@ set warning "warning: Target does not support breakpoint condition evaluation.\r
 gdb_test_multiple $test_target $test_target {
     -re "$warning\r\n$gdb_prompt $" {
 	unsupported $test_target
-	return -1
+	return
     }
 
     -re "^$test_target\r\n$gdb_prompt $" {
diff --git a/gdb/testsuite/gdb.base/condbreak-bad.exp b/gdb/testsuite/gdb.base/condbreak-bad.exp
index 216b485b635..7ee32bdb40b 100644
--- a/gdb/testsuite/gdb.base/condbreak-bad.exp
+++ b/gdb/testsuite/gdb.base/condbreak-bad.exp
@@ -67,7 +67,7 @@ with_test_prefix "with run" {
 # deletes the breakpoints.
 with_test_prefix "with continue 1" {
     if {![runto_main]} {
-	return -1
+	return
     }
 
     gdb_breakpoint "$bp_location"
@@ -87,7 +87,7 @@ with_test_prefix "with continue 1" {
 # Repeat with a condition that evaluates to false.
 with_test_prefix "with continue 2" {
     if {![runto_main]} {
-	return -1
+	return
     }
 
     gdb_breakpoint "$bp_location"
@@ -107,7 +107,7 @@ with_test_prefix "with continue 2" {
 # Repeat with a condition that contains junk at the end.
 with_test_prefix "with junk" {
     if {![runto_main]} {
-	return -1
+	return
     }
 
     gdb_breakpoint "$bp_location"
diff --git a/gdb/testsuite/gdb.base/continue-all-already-running.exp b/gdb/testsuite/gdb.base/continue-all-already-running.exp
index 734b5e9681b..65d9073e74e 100644
--- a/gdb/testsuite/gdb.base/continue-all-already-running.exp
+++ b/gdb/testsuite/gdb.base/continue-all-already-running.exp
@@ -21,7 +21,7 @@ standard_testfile
 save_vars { GDBFLAGS } {
     set GDBFLAGS "$GDBFLAGS -ex \"set non-stop on\""
     if { [prepare_for_testing "failed to prepare" ${testfile} $srcfile] } {
-	return -1
+	return
     }
 }
 
diff --git a/gdb/testsuite/gdb.base/coredump-filter.exp b/gdb/testsuite/gdb.base/coredump-filter.exp
index 6bf26f1643a..26bf2ebed50 100644
--- a/gdb/testsuite/gdb.base/coredump-filter.exp
+++ b/gdb/testsuite/gdb.base/coredump-filter.exp
@@ -194,7 +194,7 @@ gdb_test_multiple "info inferiors" "getting inferior pid" {
 	# If the target does not provide PID information (like usermode QEMU),
 	# just bail out as the rest of the test may rely on it, giving spurious
 	# failures.
-	return -1
+	return
     }
 }
 
diff --git a/gdb/testsuite/gdb.base/corefile-exec-context.exp b/gdb/testsuite/gdb.base/corefile-exec-context.exp
index 8c342171cec..9b018533b68 100644
--- a/gdb/testsuite/gdb.base/corefile-exec-context.exp
+++ b/gdb/testsuite/gdb.base/corefile-exec-context.exp
@@ -147,7 +147,7 @@ save_vars { ::env($env_var_name) } {
     set corefile [core_find $binfile {} $args]
     if {$corefile == ""} {
 	untested "unable to create corefile"
-	return 0
+	return
     }
 }
 set corefile_3 "$binfile.2.core"
diff --git a/gdb/testsuite/gdb.base/corefile-find-exec.exp b/gdb/testsuite/gdb.base/corefile-find-exec.exp
index 7d79b70c41b..7219d32e4cb 100644
--- a/gdb/testsuite/gdb.base/corefile-find-exec.exp
+++ b/gdb/testsuite/gdb.base/corefile-find-exec.exp
@@ -65,7 +65,7 @@ with_test_prefix "absolute path" {
 	set corefile [core_find $binfile]
 	if {$corefile == ""} {
 	    untested "unable to create corefile"
-	    return 0
+	    return
 	}
 	set corefile_1 "$binfile.1.core"
 	remote_exec build "mv $corefile $corefile_1"
@@ -86,7 +86,7 @@ with_test_prefix "absolute path" {
 	set corefile [core_find $symlink]
 	if {$corefile == ""} {
 	    untested "unable to create corefile"
-	    return 0
+	    return
 	}
 	set corefile_2 "$binfile.2.core"
 	remote_exec build "mv $corefile $corefile_2"
@@ -108,7 +108,7 @@ with_test_prefix "absolute path" {
 	set corefile [core_find $symlink]
 	if {$corefile == ""} {
 	    untested "unable to create corefile"
-	    return 0
+	    return
 	}
 	set corefile_3 "$binfile.3.core"
 	remote_exec build "mv $corefile $corefile_3"
@@ -142,7 +142,7 @@ with_test_prefix "absolute path" {
 	set corefile [core_find $binfile_2]
 	if {$corefile == ""} {
 	    untested "unable to create corefile"
-	    return 0
+	    return
 	}
 	set corefile_4 "$binfile.4.core"
 	remote_exec build "mv $corefile $corefile_4"
@@ -216,7 +216,7 @@ with_test_prefix "relative path" {
 	    set corefile [core_find $rel_path_to_file]
 	    if {$corefile == ""} {
 		untested "unable to create corefile"
-		return 0
+		return
 	    }
 	    set corefile_5 "${work_dir}/${testfile}.5.core"
 	    remote_exec build "mv $corefile $corefile_5"
@@ -230,7 +230,7 @@ with_test_prefix "relative path" {
 	    set corefile [core_find $rel_path_to_symlink_2]
 	    if {$corefile == ""} {
 		untested "unable to create corefile"
-		return 0
+		return
 	    }
 	    set corefile_6 "${work_dir}/${testfile}.6.core"
 	    remote_exec build "mv $corefile $corefile_6"
diff --git a/gdb/testsuite/gdb.base/cvexpr.exp b/gdb/testsuite/gdb.base/cvexpr.exp
index a726b1a71bf..f556d38803b 100644
--- a/gdb/testsuite/gdb.base/cvexpr.exp
+++ b/gdb/testsuite/gdb.base/cvexpr.exp
@@ -518,7 +518,7 @@ foreach testspec $specs {
 # These tests don't rely on the debug format.
 with_test_prefix nodebug {
     if { [prepare_for_testing "failed to prepare" $testfile $srcfile {nodebug}] } {
-	return 0
+	return
     }
 
     gdb_test "ptype _Atomic int" "type = _Atomic int"
diff --git a/gdb/testsuite/gdb.base/detach.exp b/gdb/testsuite/gdb.base/detach.exp
index be5afddc1f8..b8b1ce91dde 100644
--- a/gdb/testsuite/gdb.base/detach.exp
+++ b/gdb/testsuite/gdb.base/detach.exp
@@ -19,7 +19,7 @@
 
 # Only GNU/Linux is known to support this.
 if { ! [istarget "*-*-linux*"] } {
-  return 0
+    return
 }
 
 standard_testfile attach.c
diff --git a/gdb/testsuite/gdb.base/disabled-location.exp b/gdb/testsuite/gdb.base/disabled-location.exp
index 17e8987ded1..3a5c2f34477 100644
--- a/gdb/testsuite/gdb.base/disabled-location.exp
+++ b/gdb/testsuite/gdb.base/disabled-location.exp
@@ -20,7 +20,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile}] } {
 }
 
 if {![runto_main]} {
-   return 0
+    return
 }
 
 gdb_test "break function" \
diff --git a/gdb/testsuite/gdb.base/dmsym.exp b/gdb/testsuite/gdb.base/dmsym.exp
index 3820b13bfdc..6b02b97014d 100644
--- a/gdb/testsuite/gdb.base/dmsym.exp
+++ b/gdb/testsuite/gdb.base/dmsym.exp
@@ -26,8 +26,8 @@ set dmsym_o [standard_output_file dmsym.o]
 if {[gdb_compile "${srcdir}/${subdir}/dmsym.c" \
 		 $dmsym_o \
 		 object {}] != ""} {
-  untested "failed to compile object file"
-  return -1
+    untested "failed to compile object file"
+    return
 }
 
 if {[gdb_compile \
diff --git a/gdb/testsuite/gdb.base/dso2dso.exp b/gdb/testsuite/gdb.base/dso2dso.exp
index 1e7e633d182..6f8962b0309 100644
--- a/gdb/testsuite/gdb.base/dso2dso.exp
+++ b/gdb/testsuite/gdb.base/dso2dso.exp
@@ -49,14 +49,14 @@ if { [build_executable "build shlib 2" $binfile_libdso2 \
 
 if { [prepare_for_testing "prepare" $testfile $srcfile \
 	  [list debug shlib=$binfile_libdso2 shlib=$binfile_libdso1]] != 0 } {
-  return
+    return
 }
 
 gdb_load_shlib $binfile_libdso2
 gdb_load_shlib $binfile_libdso1
 
 if { ![runto_main] } {
-  return -1
+    return
 }
 
 set bp_location [gdb_get_line_number "STOP HERE" [file tail $srcfile_libdso1]]
diff --git a/gdb/testsuite/gdb.base/endianity.exp b/gdb/testsuite/gdb.base/endianity.exp
index 0da319a824c..e82f31f2985 100644
--- a/gdb/testsuite/gdb.base/endianity.exp
+++ b/gdb/testsuite/gdb.base/endianity.exp
@@ -21,12 +21,12 @@ set test_sso [expr \
 
 if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} \
 	  [list debug additional_flags=-DTEST_SSO=$test_sso]] } {
-  return -1
+    return
 }
 
 set bp_location [gdb_get_line_number "START"]
 if {![runto "endianity.c:$bp_location"]} {
-  return -1
+    return
 }
 
 gdb_test "print o" "= {v = 3, w = 2, x = 7, f = 23.5, cplx = 1.25 \\+ 7.25i, d = 75}" \
diff --git a/gdb/testsuite/gdb.base/foll-exec-mode.exp b/gdb/testsuite/gdb.base/foll-exec-mode.exp
index c3f5390ca5c..6fa076ada2a 100644
--- a/gdb/testsuite/gdb.base/foll-exec-mode.exp
+++ b/gdb/testsuite/gdb.base/foll-exec-mode.exp
@@ -47,13 +47,13 @@ set compile_options debug
 
 # build the first test case
 if  { [gdb_compile "${srcdir}/${subdir}/${srcfile2}" "${binfile2}" executable $compile_options] != "" } {
-      untested "failed to compile"
-      return -1
+    untested "failed to compile"
+    return
 }
 
 if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable $compile_options] != "" } {
-      untested "failed to compile"
-      return -1
+    untested "failed to compile"
+    return
 }
 
 #  Test exec catchpoints to ensure exec events are supported.
diff --git a/gdb/testsuite/gdb.base/fullname.exp b/gdb/testsuite/gdb.base/fullname.exp
index 7f46cb56d85..30969248d56 100644
--- a/gdb/testsuite/gdb.base/fullname.exp
+++ b/gdb/testsuite/gdb.base/fullname.exp
@@ -95,7 +95,7 @@ if { [gdb_breakpoint [standard_output_file tmp-${srcfile}]:${line} {no-message}]
 with_cwd [standard_output_file {}] {
     if  { [gdb_compile [standard_output_file tmp-${srcfile}] "${testfile}" \
 	       executable {debug}] != "" } {
-	return -1
+	return
     }
 }
 
diff --git a/gdb/testsuite/gdb.base/fullpath-expand.exp b/gdb/testsuite/gdb.base/fullpath-expand.exp
index 053eb9b59f0..e7f96c1e7a5 100644
--- a/gdb/testsuite/gdb.base/fullpath-expand.exp
+++ b/gdb/testsuite/gdb.base/fullpath-expand.exp
@@ -29,7 +29,7 @@ with_cwd $srcdir {
 
     if { $err != "" } {
 	untested "${srcfile} or ${srcfile2} compilation failed"
-	return -1
+	return
     }
 }
 
diff --git a/gdb/testsuite/gdb.base/gcore-relro.exp b/gdb/testsuite/gdb.base/gcore-relro.exp
index 59bd37f93ac..70b6daff293 100644
--- a/gdb/testsuite/gdb.base/gcore-relro.exp
+++ b/gdb/testsuite/gdb.base/gcore-relro.exp
@@ -24,13 +24,13 @@ set objfile [standard_output_file ${testfile}.o]
 
  if { [gdb_compile_shlib ${srcdir}/${subdir}/${srcfile_lib} ${binfile_lib} {debug}] != ""
       || [gdb_compile ${srcdir}/${subdir}/${srcfile} ${objfile} object {debug}] != "" } {
-      untested "failed to compile"
-      return -1
+     untested "failed to compile"
+     return
  }
  set opts [list debug shlib=${binfile_lib} ldflags=-Wl,-z,relro]
  if { [gdb_compile ${objfile} ${binfile} executable $opts] != "" } {
-      unsupported "-Wl,-z,relro compilation failed"
-      return -1
+     unsupported "-Wl,-z,relro compilation failed"
+     return
  }
 
 with_test_prefix "first session" {
@@ -38,11 +38,11 @@ with_test_prefix "first session" {
     gdb_load_shlib ${binfile_lib}
 
     if {![runto lib]} {
-	return -1
+	return
     }
 
     if {![gdb_gcore_cmd $gcorefile "save a corefile"]} {
-	return -1
+	return
     }
 }
 
diff --git a/gdb/testsuite/gdb.base/gcore.exp b/gdb/testsuite/gdb.base/gcore.exp
index aa887b0da14..243e0b39082 100644
--- a/gdb/testsuite/gdb.base/gcore.exp
+++ b/gdb/testsuite/gdb.base/gcore.exp
@@ -54,7 +54,7 @@ set pre_corefile_extern_array \
 set corefile [standard_output_file gcore.test]
 set core_supported [gdb_gcore_cmd "$corefile" "save a corefile"]
 if {!$core_supported} {
-  return -1
+    return
 }
 
 # Now restart gdb and load the corefile.
diff --git a/gdb/testsuite/gdb.base/gcorebg.exp b/gdb/testsuite/gdb.base/gcorebg.exp
index 8724794b607..67436dedb43 100644
--- a/gdb/testsuite/gdb.base/gcorebg.exp
+++ b/gdb/testsuite/gdb.base/gcorebg.exp
@@ -26,7 +26,7 @@ require can_spawn_for_attach
 set corefile [standard_output_file ${testfile}.core]
 
 if {[build_executable "failed to build" $testfile ${srcfile}] == -1 } {
-     return -1
+    return
 }
 
 # Cleanup.
diff --git a/gdb/testsuite/gdb.base/global-var-nested-by-dso.exp b/gdb/testsuite/gdb.base/global-var-nested-by-dso.exp
index 5fca2345f6a..164f60b2579 100644
--- a/gdb/testsuite/gdb.base/global-var-nested-by-dso.exp
+++ b/gdb/testsuite/gdb.base/global-var-nested-by-dso.exp
@@ -45,7 +45,7 @@ gdb_load_shlib $binfile_lib1
 gdb_load_shlib $binfile_lib2
 
 if { ![runto_main] } {
-  return -1
+    return
 }
 
 gdb_test "next" "$decimal.*b_main \\(\\);" "step over c_main"
diff --git a/gdb/testsuite/gdb.base/gnu-ifunc.exp b/gdb/testsuite/gdb.base/gnu-ifunc.exp
index 2c1dffeeece..d6a50a9b686 100644
--- a/gdb/testsuite/gdb.base/gnu-ifunc.exp
+++ b/gdb/testsuite/gdb.base/gnu-ifunc.exp
@@ -393,7 +393,7 @@ with_test_prefix "static" {
 	 || [gdb_compile "${srcdir}/${subdir}/$srcfile $lib_o $final_o" \
 		 $staticbinfile executable {debug}] != "" } {
 	untested "failed to compile second testcase"
-	return -1
+	return
     }
 
     clean_restart $staticexecutable
diff --git a/gdb/testsuite/gdb.base/gnu_vector.exp b/gdb/testsuite/gdb.base/gnu_vector.exp
index b92d82c3428..36724d1e978 100644
--- a/gdb/testsuite/gdb.base/gnu_vector.exp
+++ b/gdb/testsuite/gdb.base/gnu_vector.exp
@@ -36,8 +36,8 @@ if { [do_compile {-mcpu=native}] != ""
      && [do_compile {-mcpu=native -Wno-psabi}] != ""
      && [do_compile {-march=native}] != ""
      && [do_compile] != ""} {
-	untested "compiler can't handle vector_size attribute?"
-	return -1
+    untested "compiler can't handle vector_size attribute?"
+    return
 }
 
 clean_restart $testfile
diff --git a/gdb/testsuite/gdb.base/huge.exp b/gdb/testsuite/gdb.base/huge.exp
index 4ddfceebd9e..98c081b557a 100644
--- a/gdb/testsuite/gdb.base/huge.exp
+++ b/gdb/testsuite/gdb.base/huge.exp
@@ -46,7 +46,7 @@ clean_restart $testfile
 
 with_timeout_factor 3 {
     if {![runto_main]} {
-	return -1
+	return
     }
 
     gdb_test_no_output "set max-value-size unlimited"
diff --git a/gdb/testsuite/gdb.base/info-fun.exp b/gdb/testsuite/gdb.base/info-fun.exp
index c2f9ae03152..1465220d3db 100644
--- a/gdb/testsuite/gdb.base/info-fun.exp
+++ b/gdb/testsuite/gdb.base/info-fun.exp
@@ -38,7 +38,7 @@ foreach_with_prefix n_flag { 0 1 } {
 	     || [gdb_compile $srcdir/$subdir/${srcfile} ${binfile} \
 		     executable $bin_flags] != "" } {
 	    untested "failed to compile"
-	    return -1
+	    return
 	}
 
 	if {$libsepdebug == "SEP"} {
@@ -53,7 +53,7 @@ foreach_with_prefix n_flag { 0 1 } {
 	clean_restart $executable
 
 	if {![runto_main]} {
-	    return 0
+	    return
 	}
 
 	set match_str {All functions matching regular expression "foo":[\r\n]*}
diff --git a/gdb/testsuite/gdb.base/info-proc.exp b/gdb/testsuite/gdb.base/info-proc.exp
index f1b435e249f..89eed2ac815 100644
--- a/gdb/testsuite/gdb.base/info-proc.exp
+++ b/gdb/testsuite/gdb.base/info-proc.exp
@@ -27,7 +27,7 @@ save_vars { env(GDB_INFO_PROC_ENVIRON_1) } {
 
     if {[prepare_for_testing "failed to prepare" $testfile \
 	     [list $srcfile $srcfile2] {debug nowarnings}]} {
-	return -1
+	return
     }
 }
 
@@ -40,7 +40,7 @@ gdb_test_multiple "info proc" "info proc without a process" {
     -re "Not supported on this target.*$gdb_prompt $" {
 	# info proc command not supported -- nothing to test here.
 	unsupported "gdb does not support info proc on this target"
-	return -1
+	return
     }
 }
 
diff --git a/gdb/testsuite/gdb.base/info-shared.exp b/gdb/testsuite/gdb.base/info-shared.exp
index 993e64f64a2..5e740f2a3ee 100644
--- a/gdb/testsuite/gdb.base/info-shared.exp
+++ b/gdb/testsuite/gdb.base/info-shared.exp
@@ -160,7 +160,7 @@ with_test_prefix styled {
 
 	gdb_test_no_output "set style enabled off"
 	if {![runto_main]} {
-	    return 0
+	    return
 	}
 	gdb_breakpoint "stop"
 	gdb_continue_to_breakpoint "library load #1" "\\.?stop .*"
diff --git a/gdb/testsuite/gdb.base/interp.exp b/gdb/testsuite/gdb.base/interp.exp
index d19d0e3ceca..516c1507657 100644
--- a/gdb/testsuite/gdb.base/interp.exp
+++ b/gdb/testsuite/gdb.base/interp.exp
@@ -82,7 +82,7 @@ gdb_test "$commands\nend" "" "finish defining hello command"
 gdb_test "hello" [string_to_regexp "^done,value=\"23\""]
 
 if {![runto_main]} {
-  return -1
+    return
 }
 
 gdb_test "list" ".*\[0-9\].*main \\(int argc.*" "can list sources"
diff --git a/gdb/testsuite/gdb.base/jit-reader-simple.exp b/gdb/testsuite/gdb.base/jit-reader-simple.exp
index 445e2b053fd..a50a92b6c50 100644
--- a/gdb/testsuite/gdb.base/jit-reader-simple.exp
+++ b/gdb/testsuite/gdb.base/jit-reader-simple.exp
@@ -181,7 +181,7 @@ with_test_prefix "two JITers" {
     gdb_load $binfile_dl2
 
     if {![runto_main]} {
-	return -1
+	return
     }
 
     set num_bps 0
diff --git a/gdb/testsuite/gdb.base/jump.exp b/gdb/testsuite/gdb.base/jump.exp
index 3139b081aa2..63b145dbf5e 100644
--- a/gdb/testsuite/gdb.base/jump.exp
+++ b/gdb/testsuite/gdb.base/jump.exp
@@ -110,7 +110,7 @@ for {set inf 2} {$inf <= $num_inferiors} {incr inf} {
 	"Switching to inferior ${inf} .*" \
 	"switch to inferior ${inf}"
     if {![runto_main]} {
-	return -1
+	return
     }
 }
 
diff --git a/gdb/testsuite/gdb.base/label.exp b/gdb/testsuite/gdb.base/label.exp
index 418841961c8..647f1551d51 100644
--- a/gdb/testsuite/gdb.base/label.exp
+++ b/gdb/testsuite/gdb.base/label.exp
@@ -25,7 +25,7 @@ if { [prepare_for_testing "failed to prepare" $testfile ${srcfile} debug] } {
 
 
 if {![runto_main]} {
-  return -1
+    return
 }
 
 gdb_test "break -q here" \
diff --git a/gdb/testsuite/gdb.base/longjmp.exp b/gdb/testsuite/gdb.base/longjmp.exp
index 92b9544021f..c895799938a 100644
--- a/gdb/testsuite/gdb.base/longjmp.exp
+++ b/gdb/testsuite/gdb.base/longjmp.exp
@@ -21,8 +21,8 @@
 standard_testfile .c
 
 if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug nowarnings}] != "" } {
-     untested "failed to compile"
-     return -1
+    untested "failed to compile"
+    return
 }
 
 proc do_test { with_probes } {
diff --git a/gdb/testsuite/gdb.base/moribund-step.exp b/gdb/testsuite/gdb.base/moribund-step.exp
index 79acb0a543c..134a9032192 100644
--- a/gdb/testsuite/gdb.base/moribund-step.exp
+++ b/gdb/testsuite/gdb.base/moribund-step.exp
@@ -20,7 +20,7 @@ require support_displaced_stepping
 save_vars { GDBFLAGS } {
     set GDBFLAGS "$GDBFLAGS -ex \"set non-stop on\""
     if { [prepare_for_testing "failed to prepare" ${testfile} $srcfile] } {
-	return -1
+	return
     }
 }
 
diff --git a/gdb/testsuite/gdb.base/nostdlib.exp b/gdb/testsuite/gdb.base/nostdlib.exp
index 91a3de3fa23..920f145d628 100644
--- a/gdb/testsuite/gdb.base/nostdlib.exp
+++ b/gdb/testsuite/gdb.base/nostdlib.exp
@@ -49,7 +49,7 @@ foreach_with_prefix pie { "nopie" "pie" } {
     }
     if {$err != ""} {
 	untested "failed to compile"
-	return -1
+	return
     }
 
     clean_restart $filename
diff --git a/gdb/testsuite/gdb.base/overlays.exp b/gdb/testsuite/gdb.base/overlays.exp
index 1cb452b7714..0d11726d4df 100644
--- a/gdb/testsuite/gdb.base/overlays.exp
+++ b/gdb/testsuite/gdb.base/overlays.exp
@@ -29,8 +29,8 @@ standard_testfile overlays.c ovlymgr.c foo.c bar.c baz.c grbx.c
 if {[build_executable $testfile.exp $testfile \
 	 [list $srcfile $srcfile2 $srcfile3 $srcfile4 $srcfile5 $srcfile6] \
 	 "debug ldscript=-Wl,-T$linker_script"] == -1} {
-     untested "failed to compile"
-     return -1
+    untested "failed to compile"
+    return
 }
 
 remote_exec build "mv ${testfile}.o foo.o bar.o baz.o grbx.o ovlymgr.o ${objdir}/${subdir}"
diff --git a/gdb/testsuite/gdb.base/printcmds.exp b/gdb/testsuite/gdb.base/printcmds.exp
index 0be8f170d19..12933d898ed 100644
--- a/gdb/testsuite/gdb.base/printcmds.exp
+++ b/gdb/testsuite/gdb.base/printcmds.exp
@@ -23,8 +23,8 @@
 standard_testfile .c
 
 if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
-     untested "failed to compile"
-     return -1
+    untested "failed to compile"
+    return
 }
 
 proc test_integer_literals_accepted {} {
diff --git a/gdb/testsuite/gdb.base/random-signal.exp b/gdb/testsuite/gdb.base/random-signal.exp
index e0c5e669c2f..9482b0aee8e 100644
--- a/gdb/testsuite/gdb.base/random-signal.exp
+++ b/gdb/testsuite/gdb.base/random-signal.exp
@@ -52,7 +52,7 @@ with_test_prefix "run" {
     clean_restart $testfile
 
     if {![runto_main]} {
-	return -1
+	return
     }
 
     do_test
diff --git a/gdb/testsuite/gdb.base/randomize.exp b/gdb/testsuite/gdb.base/randomize.exp
index 58c2c78ee26..ef358bef88e 100644
--- a/gdb/testsuite/gdb.base/randomize.exp
+++ b/gdb/testsuite/gdb.base/randomize.exp
@@ -43,11 +43,11 @@ set test "set disable-randomization off"
 gdb_test_multiple "${test}" "${test}" {
     -re "Disabling randomization .* unsupported .*$gdb_prompt $" {
 	untested "disabling randomization is not supported on this Linux GDB"
-	return -1
+	return
     }
     -re "No symbol .* in current context.*$gdb_prompt $" {
 	untested "disabling randomization is not supported on this GDB platform"
-	return -1
+	return
     }
     -re "$gdb_prompt $" {
 	pass $test
diff --git a/gdb/testsuite/gdb.base/readline-ask.exp b/gdb/testsuite/gdb.base/readline-ask.exp
index bee3fbba4e7..3857d90436f 100644
--- a/gdb/testsuite/gdb.base/readline-ask.exp
+++ b/gdb/testsuite/gdb.base/readline-ask.exp
@@ -98,7 +98,7 @@ gdb_test_multiple "" $test {
     }
     -re "$gdb_prompt " {
 	fail $test
-	return 0
+	return
     }
 }
 
diff --git a/gdb/testsuite/gdb.base/readline.exp b/gdb/testsuite/gdb.base/readline.exp
index f8f9adecf8f..c9e5830a322 100644
--- a/gdb/testsuite/gdb.base/readline.exp
+++ b/gdb/testsuite/gdb.base/readline.exp
@@ -154,7 +154,7 @@ save_vars { env(TERM) } {
 
     if { ![readline_is_used] } {
 	unsupported "readline isn't used."
-	return -1
+	return
     }
 
     save_vars { timeout env(GDBHISTSIZE) env(GDBHISTFILE) } {
diff --git a/gdb/testsuite/gdb.base/readnever.exp b/gdb/testsuite/gdb.base/readnever.exp
index 9f74b8b005d..bba1186a344 100644
--- a/gdb/testsuite/gdb.base/readnever.exp
+++ b/gdb/testsuite/gdb.base/readnever.exp
@@ -27,7 +27,7 @@ if { [build_executable "failed to build" $testfile $srcfile { debug }] == -1 } {
 save_vars { GDBFLAGS } {
     append GDBFLAGS " --readnever"
     if { [clean_restart $testfile] == -1 } {
-       return -1
+       return
     }
 }
 
diff --git a/gdb/testsuite/gdb.base/relocate.exp b/gdb/testsuite/gdb.base/relocate.exp
index 8c1ffc52e50..5b5d7cffd72 100644
--- a/gdb/testsuite/gdb.base/relocate.exp
+++ b/gdb/testsuite/gdb.base/relocate.exp
@@ -21,8 +21,8 @@ append binfile .o
 
 remote_exec build "rm -f ${binfile}"
 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" object {debug}] != "" } {
-     untested "failed to compile"
-     return -1
+    untested "failed to compile"
+    return
 }
 
 clean_restart
diff --git a/gdb/testsuite/gdb.base/reread.exp b/gdb/testsuite/gdb.base/reread.exp
index d5373ce3348..15d1186a40a 100644
--- a/gdb/testsuite/gdb.base/reread.exp
+++ b/gdb/testsuite/gdb.base/reread.exp
@@ -27,7 +27,7 @@ foreach_with_prefix opts { "" "pie" } {
 	if  { [gdb_compile "${srcdir}/${subdir}/${srcfile1}" "${binfile1}" \
 		   executable ${testfile1_opt}] != "" } {
 	    untested "failed to compile first testcase"
-	    return -1
+	    return
 	}
 
 	# build the second test case
@@ -44,7 +44,7 @@ foreach_with_prefix opts { "" "pie" } {
 	      && [gdb_compile "${srcdir}/${subdir}/${srcfile2}" "${binfile2}" \
 		      executable ${testfile2_opt2}] != ""} {
 	    untested "failed to compile second testcase"
-	    return -1
+	    return
 	}
 
 	# Start with a fresh gdb.
diff --git a/gdb/testsuite/gdb.base/return2.exp b/gdb/testsuite/gdb.base/return2.exp
index e0aa63b8d5b..7168aef49fc 100644
--- a/gdb/testsuite/gdb.base/return2.exp
+++ b/gdb/testsuite/gdb.base/return2.exp
@@ -19,8 +19,8 @@
 standard_testfile .c
 
 if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
-     untested "failed to compile"
-     return -1
+    untested "failed to compile"
+    return
 }
 
 set allow_float_test [allow_float_test]
diff --git a/gdb/testsuite/gdb.base/setshow.exp b/gdb/testsuite/gdb.base/setshow.exp
index feac4e993ac..b8923492e4b 100644
--- a/gdb/testsuite/gdb.base/setshow.exp
+++ b/gdb/testsuite/gdb.base/setshow.exp
@@ -23,8 +23,8 @@
 standard_testfile .c
 
 if { [gdb_compile ${srcdir}/${subdir}/${srcfile} ${binfile} executable {debug}] != "" } {
-     untested "failed to compile"
-     return -1
+    untested "failed to compile"
+    return
 }
 
 proc_with_prefix test_setshow_annotate {} {
diff --git a/gdb/testsuite/gdb.base/solib-abort.exp b/gdb/testsuite/gdb.base/solib-abort.exp
index cdf7af6b26f..f731eecbef7 100644
--- a/gdb/testsuite/gdb.base/solib-abort.exp
+++ b/gdb/testsuite/gdb.base/solib-abort.exp
@@ -42,7 +42,7 @@ if { [prepare_for_testing "prepare" $testfile $srcfile $bin_flags] != 0 } {
 }
 
 if {![runto_main]} {
-  return 0
+    return
 }
 
 # Run until the program dies.
diff --git a/gdb/testsuite/gdb.base/solib-bad-entry-addr.exp b/gdb/testsuite/gdb.base/solib-bad-entry-addr.exp
index 39694bffe63..eff7ffe16cb 100644
--- a/gdb/testsuite/gdb.base/solib-bad-entry-addr.exp
+++ b/gdb/testsuite/gdb.base/solib-bad-entry-addr.exp
@@ -95,5 +95,5 @@ if { $load_segment_count <= 2 } {
 clean_restart $testfile
 
 if {![runto_main message]} {
-  return 0
+    return
 }
diff --git a/gdb/testsuite/gdb.base/solib-display.exp b/gdb/testsuite/gdb.base/solib-display.exp
index cda9605b0db..83afcaba149 100644
--- a/gdb/testsuite/gdb.base/solib-display.exp
+++ b/gdb/testsuite/gdb.base/solib-display.exp
@@ -67,7 +67,7 @@ foreach libsepdebug {NO IN SEP} { with_test_prefix "$libsepdebug" {
     if { [gdb_compile_shlib ${srcfile_lib} ${binfile_lib} $sep_lib_flags] != ""
 	 || [gdb_compile ${srcfile} ${binfile} executable $bin_flags] != "" } {
       untested "failed to compile"
-      return -1
+      return
     }
 
     if {$libsepdebug == "SEP"} {
@@ -82,7 +82,7 @@ foreach libsepdebug {NO IN SEP} { with_test_prefix "$libsepdebug" {
     clean_restart $executable
 
     if {![runto_main]} {
-      return 0
+      return
     }
 
     gdb_test "display (int) a_global" "1: \\(int\\) a_global = 41"
diff --git a/gdb/testsuite/gdb.base/solib-overlap.exp b/gdb/testsuite/gdb.base/solib-overlap.exp
index feb080708b7..3fc92d37e90 100644
--- a/gdb/testsuite/gdb.base/solib-overlap.exp
+++ b/gdb/testsuite/gdb.base/solib-overlap.exp
@@ -61,7 +61,7 @@ foreach prelink_lib1 {0x40000000 0x50000000} { with_test_prefix "$prelink_lib1"
 	 || [gdb_compile_shlib ${srcfile_lib} ${binfile_lib2} $lib_flags] != ""
 	 || [gdb_compile ${srcfile} ${binfile} executable $bin_flags] != "" } {
 	untested "failed to compile"
-	return -1
+	return
     }
 
     if {[catch {exec prelink -N -r ${prelink_lib1} ${binfile_lib1}} output] != 0
@@ -69,7 +69,7 @@ foreach prelink_lib1 {0x40000000 0x50000000} { with_test_prefix "$prelink_lib1"
 	# Maybe we don't have prelink.
 	verbose -log "prelink failed: $output"
 	untested "could not prelink ${binfile_lib1_test_msg} or ${binfile_lib2_test_msg}."
-	return -1
+	return
     }
 
     set test_spawn_id [spawn_wait_for_attach $binfile]
@@ -85,7 +85,7 @@ foreach prelink_lib1 {0x40000000 0x50000000} { with_test_prefix "$prelink_lib1"
 	 || [gdb_compile_shlib ${srcfile_lib} ${binfile_lib2} $lib_flags] != ""} {
 	untested "failed to compile shared library"
 	kill_wait_spawned_process $test_spawn_id
-	return -1
+	return
     }
 
     clean_restart ${binfile_base}
diff --git a/gdb/testsuite/gdb.base/solib-search.exp b/gdb/testsuite/gdb.base/solib-search.exp
index 43f54b41df0..3ae9bc442b2 100644
--- a/gdb/testsuite/gdb.base/solib-search.exp
+++ b/gdb/testsuite/gdb.base/solib-search.exp
@@ -90,7 +90,7 @@ set corefile [standard_output_file solib-search.core]
 set core_supported [gdb_gcore_cmd "$corefile" "save a corefile"]
 
 if {!$core_supported} {
-  return -1
+    return
 }
 
 # Before we restart gdb, replace the libs with the "wrong" ones.
diff --git a/gdb/testsuite/gdb.base/solib-symbol.exp b/gdb/testsuite/gdb.base/solib-symbol.exp
index efddd52eef9..7a7941b9f4f 100644
--- a/gdb/testsuite/gdb.base/solib-symbol.exp
+++ b/gdb/testsuite/gdb.base/solib-symbol.exp
@@ -47,7 +47,7 @@ gdb_test "br foo2" \
 delete_breakpoints
 
 if {![runto_main]} {
-  return 0
+    return
 }
 
 # Break in the library.
diff --git a/gdb/testsuite/gdb.base/stale-infcall.exp b/gdb/testsuite/gdb.base/stale-infcall.exp
index cb7c0997203..ea3db89d2e9 100644
--- a/gdb/testsuite/gdb.base/stale-infcall.exp
+++ b/gdb/testsuite/gdb.base/stale-infcall.exp
@@ -36,7 +36,7 @@ gdb_test_multiple "next" $test {
     -re "( test-fail .*|\r\nCannot insert breakpoint 0\\.\r\n.*)\r\n$gdb_prompt $" {
 	xfail $test
 	untested "system lacks support for tracking longjmps"
-	return -1
+	return
     }
 }
 gdb_test_no_output {delete $test_fail_bpnum}
diff --git a/gdb/testsuite/gdb.base/step-break.exp b/gdb/testsuite/gdb.base/step-break.exp
index a580d7f201b..e5fe59933bd 100644
--- a/gdb/testsuite/gdb.base/step-break.exp
+++ b/gdb/testsuite/gdb.base/step-break.exp
@@ -18,11 +18,11 @@
 standard_testfile
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
-     return -1
+    return
 }
 
 if {![runto_main]} {
-   return 0
+    return
 }
 
 set bp_location [gdb_get_line_number "set breakpoint here"]
diff --git a/gdb/testsuite/gdb.base/step-line.exp b/gdb/testsuite/gdb.base/step-line.exp
index e0a75835738..b85ea7800c4 100644
--- a/gdb/testsuite/gdb.base/step-line.exp
+++ b/gdb/testsuite/gdb.base/step-line.exp
@@ -28,7 +28,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
 }
 
 if {![runto_main]} {
-   return 0
+    return
 }
 
 set remote_linefile [gdb_remote_download host ${srcdir}/${subdir}/${linefile}]
diff --git a/gdb/testsuite/gdb.base/step-test.exp b/gdb/testsuite/gdb.base/step-test.exp
index b10a732f93b..ccd636ab71d 100644
--- a/gdb/testsuite/gdb.base/step-test.exp
+++ b/gdb/testsuite/gdb.base/step-test.exp
@@ -25,7 +25,7 @@ if { [prepare_for_testing "prepare" $testfile $srcfile] != 0 } {
 }
 
 if {![runto_main]} {
-   return 0
+    return
 }
 
 # Set a breakpoint at line 45, if stepi then finish fails, we would
@@ -142,10 +142,10 @@ gdb_test_multiple "finish" "$test" {
     -re ".*(Program received|$inferior_exited_re).*$gdb_prompt $" {
 	# Oops... We ran to the end of the program...  Better reset
 	if {![runto_main]} {
-	    return 0
+	    return
 	}
 	if {![runto step-test.c:45]} {
-	    return 0
+	    return
 	}
 	fail "$test"
     }
diff --git a/gdb/testsuite/gdb.base/style-logging.exp b/gdb/testsuite/gdb.base/style-logging.exp
index 8895e88d4b5..7f56b2d49f2 100644
--- a/gdb/testsuite/gdb.base/style-logging.exp
+++ b/gdb/testsuite/gdb.base/style-logging.exp
@@ -24,7 +24,7 @@ standard_testfile style.c
 
 with_ansi_styling_terminal {
     if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
-	return -1
+	return
     }
 
     if {![runto_main]} {
diff --git a/gdb/testsuite/gdb.base/testenv.exp b/gdb/testsuite/gdb.base/testenv.exp
index 83de52c510b..62887ebe717 100644
--- a/gdb/testsuite/gdb.base/testenv.exp
+++ b/gdb/testsuite/gdb.base/testenv.exp
@@ -28,7 +28,7 @@ standard_testfile .c
 # and start with a fresh gdb
 
 if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } {
-     return -1
+    return
 }
 
 # Test that the inferior sees EXPECTED env vars starting with
diff --git a/gdb/testsuite/gdb.base/traced-thread.exp b/gdb/testsuite/gdb.base/traced-thread.exp
index b6d35490722..219e3f900ac 100644
--- a/gdb/testsuite/gdb.base/traced-thread.exp
+++ b/gdb/testsuite/gdb.base/traced-thread.exp
@@ -26,7 +26,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile \
 }
 
 if {![runto "parent_stop"]} {
-  return -1
+    return
 }
 
 # We don't want to be bothered.
diff --git a/gdb/testsuite/gdb.base/valgrind-bt.exp b/gdb/testsuite/gdb.base/valgrind-bt.exp
index 36614427cf9..2fd29e72508 100644
--- a/gdb/testsuite/gdb.base/valgrind-bt.exp
+++ b/gdb/testsuite/gdb.base/valgrind-bt.exp
@@ -42,13 +42,13 @@ gdb_test_multiple "continue" $test {
 	fail "$test (remote connection closed)"
 	# Only if valgrind got stuck.
 	kill_wait_spawned_process $valgrind_spawn_id
-	return -1
+	return
     }
     -re "The program is not being run\\.\r\n$gdb_prompt $" {
 	fail "$test (valgrind vgdb has terminated)"
 	# Only if valgrind got stuck.
 	kill_wait_spawned_process $valgrind_spawn_id
-	return -1
+	return
     }
     -re "\r\n$gdb_prompt $" {
 	pass "$test (false warning)"
diff --git a/gdb/testsuite/gdb.base/valgrind-infcall.exp b/gdb/testsuite/gdb.base/valgrind-infcall.exp
index c39d3181983..ca13f42f076 100644
--- a/gdb/testsuite/gdb.base/valgrind-infcall.exp
+++ b/gdb/testsuite/gdb.base/valgrind-infcall.exp
@@ -42,13 +42,13 @@ while {$loop && $continue_count < 100} {
 	    fail "$test (remote connection closed)"
 	    # Only if valgrind got stuck.
 	    kill_wait_spawned_process $valgrind_spawn_id
-	    return -1
+	    return
 	}
 	-re "The program is not being run\\.\r\n$gdb_prompt $" {
 	    fail "$test (valgrind vgdb has terminated)"
 	    # Only if valgrind got stuck.
 	    kill_wait_spawned_process $valgrind_spawn_id
-	    return -1
+	    return
 	}
 	-re "\r\n$gdb_prompt $" {
 	    pass "$test (false warning)"
diff --git a/gdb/testsuite/gdb.base/vdso-warning.exp b/gdb/testsuite/gdb.base/vdso-warning.exp
index 4f61554dc68..358a1dd42d8 100644
--- a/gdb/testsuite/gdb.base/vdso-warning.exp
+++ b/gdb/testsuite/gdb.base/vdso-warning.exp
@@ -73,7 +73,7 @@ with_test_prefix "core" {
     set corefile [standard_output_file $testfile.core]
     set core_supported [gdb_gcore_cmd "$corefile" "save a corefile"]
     if {!$core_supported} {
-	return -1
+	return
     }
 
     clean_restart ${testfile}
diff --git a/gdb/testsuite/gdb.base/watchpoint.exp b/gdb/testsuite/gdb.base/watchpoint.exp
index 29b9c3fd07d..46eec592402 100644
--- a/gdb/testsuite/gdb.base/watchpoint.exp
+++ b/gdb/testsuite/gdb.base/watchpoint.exp
@@ -26,8 +26,8 @@ set allow_hw_watchpoint_tests_p [allow_hw_watchpoint_tests]
 standard_testfile
 
 if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
-     untested "failed to compile"
-     return -1
+    untested "failed to compile"
+    return
 }
 
 # True if we're forcing no hardware watchpoints.
diff --git a/gdb/testsuite/gdb.base/wchar.exp b/gdb/testsuite/gdb.base/wchar.exp
index d3cfd09d5de..d4c1a5fd87c 100644
--- a/gdb/testsuite/gdb.base/wchar.exp
+++ b/gdb/testsuite/gdb.base/wchar.exp
@@ -21,7 +21,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
 
 set bp_location [gdb_get_line_number "START"]
 if {![runto "wchar.c:$bp_location"]} {
-  return -1
+    return
 }
 
 gdb_test "print narrow" "= 97 L'a'"
diff --git a/gdb/testsuite/gdb.base/wrong_frame_bt_full.exp b/gdb/testsuite/gdb.base/wrong_frame_bt_full.exp
index 98680e5c5a3..8a381843cff 100644
--- a/gdb/testsuite/gdb.base/wrong_frame_bt_full.exp
+++ b/gdb/testsuite/gdb.base/wrong_frame_bt_full.exp
@@ -28,8 +28,8 @@ set opaque_objfile [standard_output_file "$opaque_testfile.o"]
 if {[gdb_compile "${srcdir}/${subdir}/$opaque_testfile.c" \
 		 $opaque_objfile \
 		 object {}] != ""} {
-  untested "failed to compile"
-  return -1
+    untested "failed to compile"
+    return
 }
 
 if {[gdb_compile \
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.