[v2,16/37] GDB: testsuite: C++: Don't return value from top-level (sed)

Message ID 20260429230432.60487-17-thiago.bauermann@linaro.org
State New
Headers
Series GDB: testsuite: Fix top-level returns |

Commit Message

Thiago Jung Bauermann April 29, 2026, 11:04 p.m. UTC
  This patch is purely the result of running:

$ sed -i 's/^    return -1/    return/' *.exp*

and

$ sed -i 's/^    return 0/    return/' *.exp*

inside gdb/testsuite/gdb.cp.

I didn't include changes made to return statements inside procedures.
---
 gdb/testsuite/gdb.cp/abstract-origin.exp         |  4 ++--
 gdb/testsuite/gdb.cp/align.exp                   |  2 +-
 gdb/testsuite/gdb.cp/ambiguous.exp               |  2 +-
 gdb/testsuite/gdb.cp/annota2.exp                 |  2 +-
 gdb/testsuite/gdb.cp/annota3.exp                 |  2 +-
 gdb/testsuite/gdb.cp/anon-ns.exp                 |  2 +-
 gdb/testsuite/gdb.cp/anon-union.exp              |  2 +-
 gdb/testsuite/gdb.cp/arg-reference.exp           |  2 +-
 gdb/testsuite/gdb.cp/baseenum.exp                |  4 ++--
 gdb/testsuite/gdb.cp/bool.exp                    |  2 +-
 gdb/testsuite/gdb.cp/break-template-cast.exp     |  2 +-
 gdb/testsuite/gdb.cp/breakpoint-locs.exp         |  2 +-
 gdb/testsuite/gdb.cp/breakpoint-shlib-func.exp   |  6 +++---
 gdb/testsuite/gdb.cp/breakpoint.exp              |  2 +-
 gdb/testsuite/gdb.cp/bs15503.exp                 |  2 +-
 gdb/testsuite/gdb.cp/call-c.exp                  |  2 +-
 gdb/testsuite/gdb.cp/call-method-register.exp    |  6 +++---
 gdb/testsuite/gdb.cp/casts.exp                   |  4 ++--
 gdb/testsuite/gdb.cp/chained-calls.exp           |  4 ++--
 gdb/testsuite/gdb.cp/class2.exp                  |  2 +-
 gdb/testsuite/gdb.cp/classes.exp                 |  2 +-
 gdb/testsuite/gdb.cp/cmpd-minsyms.exp            |  2 +-
 gdb/testsuite/gdb.cp/cold-clone.exp              |  2 +-
 gdb/testsuite/gdb.cp/constexpr-field.exp         |  2 +-
 gdb/testsuite/gdb.cp/cp-relocate.exp             |  2 +-
 gdb/testsuite/gdb.cp/cpcompletion.exp            |  4 ++--
 gdb/testsuite/gdb.cp/cpexprs.exp.tcl             |  2 +-
 gdb/testsuite/gdb.cp/cplabel.exp                 |  4 ++--
 gdb/testsuite/gdb.cp/cplusfuncs.exp              |  2 +-
 gdb/testsuite/gdb.cp/ctti.exp                    |  2 +-
 gdb/testsuite/gdb.cp/derivation.exp              |  2 +-
 gdb/testsuite/gdb.cp/destrprint.exp              |  4 ++--
 gdb/testsuite/gdb.cp/disasm-func-name.exp        |  2 +-
 gdb/testsuite/gdb.cp/dispcxx.exp                 |  2 +-
 gdb/testsuite/gdb.cp/empty-enum.exp              |  4 ++--
 gdb/testsuite/gdb.cp/ena-dis-br-range.exp        |  4 ++--
 gdb/testsuite/gdb.cp/enum-class.exp              |  4 ++--
 gdb/testsuite/gdb.cp/exception.exp               |  2 +-
 gdb/testsuite/gdb.cp/exceptprint.exp             |  8 ++++----
 gdb/testsuite/gdb.cp/expand-sals.exp             |  4 ++--
 gdb/testsuite/gdb.cp/extern-c.exp                |  2 +-
 gdb/testsuite/gdb.cp/filename.exp                |  2 +-
 gdb/testsuite/gdb.cp/formatted-ref.exp           |  2 +-
 gdb/testsuite/gdb.cp/gdb1355.exp                 |  2 +-
 gdb/testsuite/gdb.cp/gdb2384.exp                 |  4 ++--
 gdb/testsuite/gdb.cp/gdb2495.exp                 |  2 +-
 gdb/testsuite/gdb.cp/hang.exp                    |  2 +-
 gdb/testsuite/gdb.cp/impl-this.exp               |  2 +-
 gdb/testsuite/gdb.cp/infcall-dlopen.exp          |  4 ++--
 gdb/testsuite/gdb.cp/inherit.exp                 |  2 +-
 gdb/testsuite/gdb.cp/iostream.exp                |  2 +-
 gdb/testsuite/gdb.cp/local.exp                   |  2 +-
 gdb/testsuite/gdb.cp/m-data.exp                  |  2 +-
 gdb/testsuite/gdb.cp/m-static.exp                |  2 +-
 gdb/testsuite/gdb.cp/main-cp.exp                 |  2 +-
 gdb/testsuite/gdb.cp/many-args.exp               |  2 +-
 gdb/testsuite/gdb.cp/mb-ctor.exp                 |  2 +-
 gdb/testsuite/gdb.cp/mb-inline.exp               |  4 ++--
 gdb/testsuite/gdb.cp/mb-templates.exp            |  4 ++--
 gdb/testsuite/gdb.cp/member-name.exp             |  2 +-
 gdb/testsuite/gdb.cp/member-ptr.exp              |  2 +-
 gdb/testsuite/gdb.cp/meth-typedefs.exp           |  2 +-
 gdb/testsuite/gdb.cp/method-call-in-c.exp        |  4 ++--
 gdb/testsuite/gdb.cp/method-ref-return.exp       |  4 ++--
 gdb/testsuite/gdb.cp/method.exp                  |  2 +-
 gdb/testsuite/gdb.cp/minsym-fallback.exp         |  2 +-
 gdb/testsuite/gdb.cp/misc.exp                    |  2 +-
 gdb/testsuite/gdb.cp/namelessclass.exp           |  4 ++--
 gdb/testsuite/gdb.cp/namespace-enum.exp          |  2 +-
 gdb/testsuite/gdb.cp/namespace-nested-import.exp |  2 +-
 gdb/testsuite/gdb.cp/namespace.exp               |  2 +-
 gdb/testsuite/gdb.cp/nested-class-func-class.exp |  4 ++--
 gdb/testsuite/gdb.cp/nested-types.exp            |  2 +-
 gdb/testsuite/gdb.cp/nextoverthrow.exp           |  4 ++--
 gdb/testsuite/gdb.cp/no-libstdcxx-probe.exp      |  4 ++--
 gdb/testsuite/gdb.cp/non-trivial-retval.exp      |  4 ++--
 gdb/testsuite/gdb.cp/noparam.exp                 |  2 +-
 gdb/testsuite/gdb.cp/nsalias.exp                 | 10 +++++-----
 gdb/testsuite/gdb.cp/nsdecl.exp                  |  2 +-
 gdb/testsuite/gdb.cp/nsimport.exp                |  2 +-
 gdb/testsuite/gdb.cp/nsrecurs.exp                |  2 +-
 gdb/testsuite/gdb.cp/nsstress.exp                |  2 +-
 gdb/testsuite/gdb.cp/nsusing.exp                 |  2 +-
 gdb/testsuite/gdb.cp/operator.exp                |  2 +-
 gdb/testsuite/gdb.cp/overload-const.exp          |  2 +-
 gdb/testsuite/gdb.cp/overload.exp                |  2 +-
 gdb/testsuite/gdb.cp/ovldbreak.exp               |  2 +-
 gdb/testsuite/gdb.cp/ovsrch.exp                  |  2 +-
 gdb/testsuite/gdb.cp/paramless.exp               |  2 +-
 gdb/testsuite/gdb.cp/paren-type.exp              |  2 +-
 gdb/testsuite/gdb.cp/parse-lang.exp              |  2 +-
 gdb/testsuite/gdb.cp/pass-by-ref-2.exp           |  4 ++--
 gdb/testsuite/gdb.cp/pass-by-ref.exp             |  4 ++--
 gdb/testsuite/gdb.cp/pointer-to-member.exp       |  2 +-
 gdb/testsuite/gdb.cp/pr-1023.exp                 |  2 +-
 gdb/testsuite/gdb.cp/pr-1210.exp                 |  2 +-
 gdb/testsuite/gdb.cp/pr-574.exp                  |  2 +-
 gdb/testsuite/gdb.cp/pr10687.exp                 |  2 +-
 gdb/testsuite/gdb.cp/pr12028.exp                 |  2 +-
 gdb/testsuite/gdb.cp/pr17132.exp                 |  4 ++--
 gdb/testsuite/gdb.cp/pr17494.exp                 |  4 ++--
 gdb/testsuite/gdb.cp/pr9067.exp                  |  2 +-
 gdb/testsuite/gdb.cp/pr9167.exp                  |  2 +-
 gdb/testsuite/gdb.cp/pr9631.exp                  |  2 +-
 gdb/testsuite/gdb.cp/print-demangle.exp          |  2 +-
 gdb/testsuite/gdb.cp/print-global-stub.exp       |  2 +-
 gdb/testsuite/gdb.cp/print-method-args.exp       |  2 +-
 gdb/testsuite/gdb.cp/printmethod.exp             |  2 +-
 gdb/testsuite/gdb.cp/psmang.exp                  |  2 +-
 gdb/testsuite/gdb.cp/psymtab-parameter.exp       |  2 +-
 gdb/testsuite/gdb.cp/ptype-cv-cp.exp             |  2 +-
 gdb/testsuite/gdb.cp/ptype-flags.exp             |  2 +-
 gdb/testsuite/gdb.cp/re-set-overloaded.exp       |  2 +-
 gdb/testsuite/gdb.cp/readnow-language.exp        |  2 +-
 gdb/testsuite/gdb.cp/ref-params.exp              |  2 +-
 gdb/testsuite/gdb.cp/ref-types.exp               |  2 +-
 gdb/testsuite/gdb.cp/rtti.exp                    |  2 +-
 gdb/testsuite/gdb.cp/rvalue-ref-casts.exp        |  4 ++--
 gdb/testsuite/gdb.cp/rvalue-ref-overload.exp     |  4 ++--
 gdb/testsuite/gdb.cp/rvalue-ref-params.exp       |  2 +-
 gdb/testsuite/gdb.cp/rvalue-ref-types.exp        |  6 +++---
 gdb/testsuite/gdb.cp/save-bp-qualified.exp       |  2 +-
 gdb/testsuite/gdb.cp/scope-err.exp               |  4 ++--
 gdb/testsuite/gdb.cp/shadow.exp                  |  2 +-
 gdb/testsuite/gdb.cp/static-method.exp           |  2 +-
 gdb/testsuite/gdb.cp/static-print-quit.exp       |  2 +-
 gdb/testsuite/gdb.cp/static-typedef-print.exp    |  4 ++--
 gdb/testsuite/gdb.cp/step-and-next-inline.exp    |  2 +-
 gdb/testsuite/gdb.cp/stub-array-size.exp         |  2 +-
 gdb/testsuite/gdb.cp/subtypes.exp                |  2 +-
 gdb/testsuite/gdb.cp/temargs.exp                 |  4 ++--
 gdb/testsuite/gdb.cp/templates.exp               |  2 +-
 gdb/testsuite/gdb.cp/try_catch.exp               |  2 +-
 gdb/testsuite/gdb.cp/typed-enum.exp              |  2 +-
 gdb/testsuite/gdb.cp/typedef-base.exp            |  4 ++--
 gdb/testsuite/gdb.cp/typedef-operator.exp        |  4 ++--
 gdb/testsuite/gdb.cp/typeid.exp                  |  4 ++--
 gdb/testsuite/gdb.cp/userdef.exp                 |  2 +-
 gdb/testsuite/gdb.cp/using-crash.exp             |  2 +-
 gdb/testsuite/gdb.cp/var-tag.exp                 |  2 +-
 gdb/testsuite/gdb.cp/virtbase.exp                |  2 +-
 gdb/testsuite/gdb.cp/virtbase2.exp               |  2 +-
 gdb/testsuite/gdb.cp/virtfunc.exp                |  2 +-
 gdb/testsuite/gdb.cp/virtfunc2.exp               |  2 +-
 gdb/testsuite/gdb.cp/vla-cxx.exp                 |  4 ++--
 gdb/testsuite/gdb.cp/watch-cp.exp                |  2 +-
 146 files changed, 194 insertions(+), 194 deletions(-)
  

Patch

diff --git a/gdb/testsuite/gdb.cp/abstract-origin.exp b/gdb/testsuite/gdb.cp/abstract-origin.exp
index f9df73d5fe85..5b7139527a08 100644
--- a/gdb/testsuite/gdb.cp/abstract-origin.exp
+++ b/gdb/testsuite/gdb.cp/abstract-origin.exp
@@ -14,15 +14,15 @@ 
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 standard_testfile .cc
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
-    return -1
+    return
 }
 
 if {![runto_main]} {
-    return -1
+    return
 }
 
 gdb_breakpoint [gdb_get_line_number "break-here"]
 gdb_continue_to_breakpoint "break-here"
 
diff --git a/gdb/testsuite/gdb.cp/align.exp b/gdb/testsuite/gdb.cp/align.exp
index 6cf046b0cb72..03b981175194 100644
--- a/gdb/testsuite/gdb.cp/align.exp
+++ b/gdb/testsuite/gdb.cp/align.exp
@@ -137,11 +137,11 @@  close $outfile
 
 standard_testfile $filename
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile \
 	 {debug nowarnings c++ additional_flags=-std=c++11}]} {
-    return -1
+    return
 }
 
 if {![runto_main]} {
     perror "test suppressed"
     return
diff --git a/gdb/testsuite/gdb.cp/ambiguous.exp b/gdb/testsuite/gdb.cp/ambiguous.exp
index 838fa95cbb1c..94ba6a6b7cac 100644
--- a/gdb/testsuite/gdb.cp/ambiguous.exp
+++ b/gdb/testsuite/gdb.cp/ambiguous.exp
@@ -31,11 +31,11 @@  if {[test_compiler_info {gcc-[0-9]-*}]} {
     set additional_flags "additional_flags=-Wno-inaccessible-base"
 }
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile \
      [list debug c++ $additional_flags]]} {
-    return -1
+    return
 }
 
 if {![runto_main]} {
     return
 }
diff --git a/gdb/testsuite/gdb.cp/annota2.exp b/gdb/testsuite/gdb.cp/annota2.exp
index b3190fb3e252..466cab05b8ab 100644
--- a/gdb/testsuite/gdb.cp/annota2.exp
+++ b/gdb/testsuite/gdb.cp/annota2.exp
@@ -24,11 +24,11 @@  require allow_cplus_tests
 
 standard_testfile .cc
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile \
 	 {debug c++ nowarnings}]} {
-    return -1
+    return
 }
 
 # This testcase cannot use runto_main because of the different prompt
 # we get when using annotation level 2.
 #
diff --git a/gdb/testsuite/gdb.cp/annota3.exp b/gdb/testsuite/gdb.cp/annota3.exp
index a7016ee76bda..39a1399f95da 100644
--- a/gdb/testsuite/gdb.cp/annota3.exp
+++ b/gdb/testsuite/gdb.cp/annota3.exp
@@ -24,11 +24,11 @@  require allow_cplus_tests
 
 standard_testfile .cc
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile \
 	 {debug c++ nowarnings}]} {
-    return -1
+    return
 }
 
 # This testcase cannot use runto_main because of the different prompt
 # we get when using annotation level 2.
 #
diff --git a/gdb/testsuite/gdb.cp/anon-ns.exp b/gdb/testsuite/gdb.cp/anon-ns.exp
index 99f949cfc96c..50f77952bb3b 100644
--- a/gdb/testsuite/gdb.cp/anon-ns.exp
+++ b/gdb/testsuite/gdb.cp/anon-ns.exp
@@ -20,11 +20,11 @@ 
 require allow_cplus_tests
 
 standard_testfile .cc anon-ns2.cc
 
 if {[prepare_for_testing "failed to prepare" $testfile "$srcfile $srcfile2" {c++ debug}]} {
-    return -1
+    return
 }
 
 if {![runto_main]} {
     return
 }
diff --git a/gdb/testsuite/gdb.cp/anon-union.exp b/gdb/testsuite/gdb.cp/anon-union.exp
index 5b26f7a848da..def3c3df1095 100644
--- a/gdb/testsuite/gdb.cp/anon-union.exp
+++ b/gdb/testsuite/gdb.cp/anon-union.exp
@@ -26,11 +26,11 @@ 
 require allow_cplus_tests
 
 standard_testfile .cc
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
-    return -1
+    return
 }
 
 if {![runto_main]} {
     continue
 }
diff --git a/gdb/testsuite/gdb.cp/arg-reference.exp b/gdb/testsuite/gdb.cp/arg-reference.exp
index b690c1376e60..1433ec3b3e49 100644
--- a/gdb/testsuite/gdb.cp/arg-reference.exp
+++ b/gdb/testsuite/gdb.cp/arg-reference.exp
@@ -25,9 +25,9 @@  require allow_cplus_tests
 
 
 standard_testfile .cc
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
-    return -1
+    return
 }
 
 gdb_test "ptype foo" "type = int \\\(Obj\\\)" "no false reference"
diff --git a/gdb/testsuite/gdb.cp/baseenum.exp b/gdb/testsuite/gdb.cp/baseenum.exp
index da7a436026d2..5bf9963645d4 100644
--- a/gdb/testsuite/gdb.cp/baseenum.exp
+++ b/gdb/testsuite/gdb.cp/baseenum.exp
@@ -16,15 +16,15 @@ 
 # Test searching enum constant symbols derived from base classes.
 
 standard_testfile .cc
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
-    return -1
+    return
 }
 
 if {![runto_main]} {
-    return -1
+    return
 }
 
 gdb_breakpoint [gdb_get_line_number "breakpoint 1" $srcfile]
 gdb_continue_to_breakpoint "breakpoint 1"
 gdb_test "print X" "= A::X" "print enum constant X of class A"
diff --git a/gdb/testsuite/gdb.cp/bool.exp b/gdb/testsuite/gdb.cp/bool.exp
index 1cab03b73d0d..eb2946d8c725 100644
--- a/gdb/testsuite/gdb.cp/bool.exp
+++ b/gdb/testsuite/gdb.cp/bool.exp
@@ -24,11 +24,11 @@  require allow_cplus_tests
 
 
 standard_testfile .cc
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
-    return -1
+    return
 }
 
 runto_main
 
 # Testcases for tdep/2075.
diff --git a/gdb/testsuite/gdb.cp/break-template-cast.exp b/gdb/testsuite/gdb.cp/break-template-cast.exp
index 04ebff92489d..26cf9d387f3d 100644
--- a/gdb/testsuite/gdb.cp/break-template-cast.exp
+++ b/gdb/testsuite/gdb.cp/break-template-cast.exp
@@ -20,10 +20,10 @@  require allow_cplus_tests
 
 standard_testfile .cc
 
 if { [prepare_for_testing "failed to prepare" $testfile "$srcfile"\
 	  {debug c++}] } {
-    return -1
+    return
 }
 
 gdb_test "break foo" \
 	   "Breakpoint $decimal at $hex: foo\\. \\(2 locations\\)"
diff --git a/gdb/testsuite/gdb.cp/breakpoint-locs.exp b/gdb/testsuite/gdb.cp/breakpoint-locs.exp
index 2ab046d3be89..6a77ef26bdee 100644
--- a/gdb/testsuite/gdb.cp/breakpoint-locs.exp
+++ b/gdb/testsuite/gdb.cp/breakpoint-locs.exp
@@ -21,11 +21,11 @@  standard_testfile .cc breakpoint-locs-2.cc
 
 include_file breakpoint-locs.h
 
 if { [prepare_for_testing "failed to prepare" $testfile "$srcfile $srcfile2"\
 	  {debug c++}] } {
-    return -1
+    return
 }
 
 gdb_test "break N1::C1::baz" "\\(2 locations\\)"
 
 if {[have_index $binfile] == ""} {
diff --git a/gdb/testsuite/gdb.cp/breakpoint-shlib-func.exp b/gdb/testsuite/gdb.cp/breakpoint-shlib-func.exp
index aaa2a531c819..5f99ab9a437d 100644
--- a/gdb/testsuite/gdb.cp/breakpoint-shlib-func.exp
+++ b/gdb/testsuite/gdb.cp/breakpoint-shlib-func.exp
@@ -30,16 +30,16 @@  require allow_shlib_tests
 standard_testfile .cc -lib.cc
 
 set libobj [standard_output_file libfoo.so]
 if {[build_executable "build shared library" $libobj $srcfile2 \
 	 {debug c++ shlib}] != 0} {
-    return -1
+    return
 }
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile \
 	 [list debug c++ shlib=$libobj]]} {
-    return -1
+    return
 }
 
 gdb_load_shlib $libobj
 
 # Place the breakpoint before the shared library has been loaded, the
@@ -47,11 +47,11 @@  gdb_load_shlib $libobj
 gdb_test "break foo" "Breakpoint $decimal at $hex"
 gdb_test "info breakpoints" "<foo\\(\\)@plt>"
 
 # Runto main, but don't delete all the breakpoints.
 if {![runto_main no-delete-breakpoints]} {
-    return -1
+    return
 }
 
 # The breakpoint should now be showing in `foo` for real.
 gdb_test "info breakpoints" \
     "\r\n$decimal\\s+\[^\r\n\]+ in foo\\(\\) at \[^\r\n\]+\r\n.*" \
diff --git a/gdb/testsuite/gdb.cp/breakpoint.exp b/gdb/testsuite/gdb.cp/breakpoint.exp
index bb7b8bf5a510..936015e67095 100644
--- a/gdb/testsuite/gdb.cp/breakpoint.exp
+++ b/gdb/testsuite/gdb.cp/breakpoint.exp
@@ -24,11 +24,11 @@  require allow_cplus_tests
 #
 
 standard_testfile .cc
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
-    return -1
+    return
 }
 
 proc test_breakpoint {name} {
     # Restart the program every time, so that a single failure doesn't
     # lead to a cascade.
diff --git a/gdb/testsuite/gdb.cp/bs15503.exp b/gdb/testsuite/gdb.cp/bs15503.exp
index 3a1ec22b5a43..603cc0f1debb 100644
--- a/gdb/testsuite/gdb.cp/bs15503.exp
+++ b/gdb/testsuite/gdb.cp/bs15503.exp
@@ -20,11 +20,11 @@ 
 require allow_stl_tests
 
 standard_testfile .cc
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
-    return -1
+    return
 }
 
 if {![runto_main]} {
     return
 }
diff --git a/gdb/testsuite/gdb.cp/call-c.exp b/gdb/testsuite/gdb.cp/call-c.exp
index bdbe42772397..b5f7fdb24bb1 100644
--- a/gdb/testsuite/gdb.cp/call-c.exp
+++ b/gdb/testsuite/gdb.cp/call-c.exp
@@ -22,11 +22,11 @@  set objfilecpp [standard_output_file ${testfile}.o]
 
 if {[gdb_compile "$srcdir/$subdir/${srcfile2}" "${objfilec}" object {debug}] != ""
     || [gdb_compile "$srcdir/$subdir/${srcfile}" "${objfilecpp}" object {c++ debug}] != ""
     || [gdb_compile "${objfilecpp} ${objfilec}" "${binfile}" executable {c++ debug}] != ""} {
     untested "failed to compile"
-    return -1
+    return
 }
 
 clean_restart ${::testfile}
 
 runto_main
diff --git a/gdb/testsuite/gdb.cp/call-method-register.exp b/gdb/testsuite/gdb.cp/call-method-register.exp
index d711cc9bd532..815c0e6a485f 100644
--- a/gdb/testsuite/gdb.cp/call-method-register.exp
+++ b/gdb/testsuite/gdb.cp/call-method-register.exp
@@ -30,11 +30,11 @@  lappend flags_debug c++
 set flags_nodebug {}
 lappend flags_nodebug nodebug
 lappend flags_nodebug c++
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile $flags_debug]} {
-    return -1
+    return
 }
 
 set asm_file [standard_output_file $srcfile2]
 Dwarf::assemble $asm_file {
 
@@ -103,15 +103,15 @@  Dwarf::assemble $asm_file {
     }
 }
 
 if { [prepare_for_testing "failed to prepare" ${testfile} \
 	  [list $srcfile $asm_file] $::flags_nodebug] } {
-    return -1
+    return
 }
 
 if {![runto_main]} {
-    return -1
+    return
 }
 
 gdb_test "print global_var.yyy ()" \
     "Address requested for identifier \"global_var\" which is in register .*" \
     "call method on register local"
diff --git a/gdb/testsuite/gdb.cp/casts.exp b/gdb/testsuite/gdb.cp/casts.exp
index fd37368e1a88..67246ac7b5ca 100644
--- a/gdb/testsuite/gdb.cp/casts.exp
+++ b/gdb/testsuite/gdb.cp/casts.exp
@@ -33,11 +33,11 @@  set opts {}
 lappend opts debug
 lappend opts c++
 lappend opts additional_flags=-std=c++11
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile $opts]} {
-    return -1
+    return
 }
 
 if {![runto_main]} {
     return
 }
@@ -213,11 +213,11 @@  gdb_test "print &dynamic_cast<VirtualRight &> (*vlr) == vr" " = true"
 gdb_test "print &dynamic_cast<VirtualRight &> (*vl) == vr" " = true"
 gdb_test "print &dynamic_cast<VirtualRight &> (*vr) == vr" " = true"
 
 if {[prepare_for_testing "failed to prepare" ${testfile}03 $srcfile2 \
 			 {debug c++ additional_flags=-std=c++03}]} {
-    return -1
+    return
 }
 
 if {![runto_main]} {
    return
 }
diff --git a/gdb/testsuite/gdb.cp/chained-calls.exp b/gdb/testsuite/gdb.cp/chained-calls.exp
index 4d7522a0bd1a..5c7b84d50b6e 100644
--- a/gdb/testsuite/gdb.cp/chained-calls.exp
+++ b/gdb/testsuite/gdb.cp/chained-calls.exp
@@ -18,15 +18,15 @@ 
 require allow_cplus_tests
 
 standard_testfile .cc
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
-    return -1
+    return
 }
 
 if {![runto_main]} {
-    return -1
+    return
 }
 
 gdb_breakpoint [gdb_get_line_number "Break here"]
 gdb_continue_to_breakpoint "Break here"
 
diff --git a/gdb/testsuite/gdb.cp/class2.exp b/gdb/testsuite/gdb.cp/class2.exp
index d8f1e7972250..705f51ac3e07 100644
--- a/gdb/testsuite/gdb.cp/class2.exp
+++ b/gdb/testsuite/gdb.cp/class2.exp
@@ -24,11 +24,11 @@  set flags [list debug c++]
 if { [gcc_major_version "clang-*" "c++"] > 10 } {
     lappend flags additional_flags=-Wno-non-c-typedef-for-linkage
 }
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile $flags]} {
-    return -1
+    return
 }
 
 # Start with "set print object off" and "set print symbol off".
 
 gdb_test_no_output "set print object off"
diff --git a/gdb/testsuite/gdb.cp/classes.exp b/gdb/testsuite/gdb.cp/classes.exp
index ea4b2033b830..71ce810adadf 100644
--- a/gdb/testsuite/gdb.cp/classes.exp
+++ b/gdb/testsuite/gdb.cp/classes.exp
@@ -32,11 +32,11 @@  if { [test_compiler_info "clang-*" "c++"] } {
 	lappend flags additional_flags=-Wno-non-c-typedef-for-linkage
     }
 }
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile $flags]} {
-    return -1
+    return
 }
 
 # Test ptype of class objects.
 
 proc test_ptype_class_objects {} {
diff --git a/gdb/testsuite/gdb.cp/cmpd-minsyms.exp b/gdb/testsuite/gdb.cp/cmpd-minsyms.exp
index 7afda5fbe827..19653a4ccc9e 100644
--- a/gdb/testsuite/gdb.cp/cmpd-minsyms.exp
+++ b/gdb/testsuite/gdb.cp/cmpd-minsyms.exp
@@ -22,11 +22,11 @@  require allow_cplus_tests
 # Tests for c++/12273, breakpoint/12803
 standard_testfile .cc
 
 # Do NOT compile with debug flag.
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {c++}]} {
-    return -1
+    return
 }
 
 # Before setting the language, try to set a few simple breakpoints
 set min_syms [list \
 		  "GDB<int>::a() const" \
diff --git a/gdb/testsuite/gdb.cp/cold-clone.exp b/gdb/testsuite/gdb.cp/cold-clone.exp
index 1fb7c2449af4..d2c69c504faa 100644
--- a/gdb/testsuite/gdb.cp/cold-clone.exp
+++ b/gdb/testsuite/gdb.cp/cold-clone.exp
@@ -20,11 +20,11 @@  lappend flags debug
 lappend flags c++
 lappend flags optimize=-O2
 lappend_include_file flags $srcdir/lib/attributes.h
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile $flags]} {
-    return -1
+    return
 }
 
 gdb_test_multiple "break foo" "" {
     -re -wrap "\\($decimal locations\\)" {
 	fail $gdb_test_name
diff --git a/gdb/testsuite/gdb.cp/constexpr-field.exp b/gdb/testsuite/gdb.cp/constexpr-field.exp
index 3e8a7b985137..c50ea3ef5d94 100644
--- a/gdb/testsuite/gdb.cp/constexpr-field.exp
+++ b/gdb/testsuite/gdb.cp/constexpr-field.exp
@@ -20,11 +20,11 @@  require {have_compile_flag -std=c++17}
 
 standard_testfile .cc
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile \
 	 {c++ debug additional_flags=-std=c++17}]} {
-    return -1
+    return
 }
 
 if {![runto_main]} {
     return
 }
diff --git a/gdb/testsuite/gdb.cp/cp-relocate.exp b/gdb/testsuite/gdb.cp/cp-relocate.exp
index fb45313466b1..c42c67a95e75 100644
--- a/gdb/testsuite/gdb.cp/cp-relocate.exp
+++ b/gdb/testsuite/gdb.cp/cp-relocate.exp
@@ -110,11 +110,11 @@  gdb_test_multiple "info file" "info file" {
     }
 }
 
 if { $func1_sec == $func2_sec } {
     untested "cp-relocate.exp - template functions in same sections"
-    return -1
+    return
 }
 
 # Now start a clean GDB, for add-symbol-file tests.
 clean_restart
 
diff --git a/gdb/testsuite/gdb.cp/cpcompletion.exp b/gdb/testsuite/gdb.cp/cpcompletion.exp
index 555392b470ab..f767a8b7bc64 100644
--- a/gdb/testsuite/gdb.cp/cpcompletion.exp
+++ b/gdb/testsuite/gdb.cp/cpcompletion.exp
@@ -54,19 +54,19 @@  proc test_class_complete {class expr name matches} {
 require allow_cplus_tests
 
 standard_testfile .cc
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
-    return -1
+    return
 }
 
 # Tests below are about tab-completion, which doesn't work if readline
 # library isn't used.  Check it first.
 
 if { ![readline_is_used] } {
     untested "no tab completion support without readline"
-    return -1
+    return
 }
 
 # Test that completion is restricted by class name (all methods)
 test_class_complete Foo "" "complete class methods" \
     [list Foo Foofoo get_foo set_foo ~Foo]
diff --git a/gdb/testsuite/gdb.cp/cpexprs.exp.tcl b/gdb/testsuite/gdb.cp/cpexprs.exp.tcl
index 085dfdd0678a..c9646755f0ac 100644
--- a/gdb/testsuite/gdb.cp/cpexprs.exp.tcl
+++ b/gdb/testsuite/gdb.cp/cpexprs.exp.tcl
@@ -704,11 +704,11 @@  standard_testfile cpexprs.cc
 
 # Include required flags.
 set flags "$flags debug c++"
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile "$flags"]} {
-    return -1
+    return
 }
 
 if {![runto_main]} {
     perror "couldn't run to breakpoint"
     continue
diff --git a/gdb/testsuite/gdb.cp/cplabel.exp b/gdb/testsuite/gdb.cp/cplabel.exp
index 0bb22cd96ad0..e0301eb3628c 100644
--- a/gdb/testsuite/gdb.cp/cplabel.exp
+++ b/gdb/testsuite/gdb.cp/cplabel.exp
@@ -18,15 +18,15 @@ 
 require allow_cplus_tests
 
 standard_testfile .cc
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {c++ debug}]} {
-    return -1
+    return
 }
 
 if {![runto_main]} {
-    return -1
+    return
 }
 
 set methods {"bar" "baz"}
 set labels {"to_the_top" "get_out_of_here"}
 
diff --git a/gdb/testsuite/gdb.cp/cplusfuncs.exp b/gdb/testsuite/gdb.cp/cplusfuncs.exp
index b8ce5d7bdd02..62b149c9f357 100644
--- a/gdb/testsuite/gdb.cp/cplusfuncs.exp
+++ b/gdb/testsuite/gdb.cp/cplusfuncs.exp
@@ -19,11 +19,11 @@ 
 require allow_cplus_tests
 
 standard_testfile .cc
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
-    return -1
+    return
 }
 
 #
 # g++ changed its ABI between 2.95 and 3.0.  gdb has two demanglers
 # for the two different styles.  The two demanglers have some subtle
diff --git a/gdb/testsuite/gdb.cp/ctti.exp b/gdb/testsuite/gdb.cp/ctti.exp
index e328b7c59c41..5c2be5de57b8 100644
--- a/gdb/testsuite/gdb.cp/ctti.exp
+++ b/gdb/testsuite/gdb.cp/ctti.exp
@@ -25,11 +25,11 @@  require allow_cplus_tests
 
 standard_testfile cttiadd.cc cttiadd1.cc cttiadd2.cc cttiadd3.cc
 
 if {[prepare_for_testing "failed to prepare" $testfile \
 	 [list $srcfile $srcfile2 $srcfile3 $srcfile4] {debug c++}]} {
-    return -1
+    return
 }
 
 if {![runto_main]} {
     return
 }
diff --git a/gdb/testsuite/gdb.cp/derivation.exp b/gdb/testsuite/gdb.cp/derivation.exp
index 34fbf3c250e1..3b42c85a6272 100644
--- a/gdb/testsuite/gdb.cp/derivation.exp
+++ b/gdb/testsuite/gdb.cp/derivation.exp
@@ -34,11 +34,11 @@  load_lib "cp-support.exp"
 
 standard_testfile derivation.cc derivation2.cc
 
 if {[prepare_for_testing "failed to prepare" $testfile \
 	[list $srcfile $srcfile2] {debug c++}]} {
-    return -1
+    return
 }
 
 # Check inheritance of typedefs.
 with_test_prefix "before run" {
     foreach klass {"A" "D" "E" "F" "A2" "D2"} {
diff --git a/gdb/testsuite/gdb.cp/destrprint.exp b/gdb/testsuite/gdb.cp/destrprint.exp
index b0f1087a38df..f20255a4c4f7 100644
--- a/gdb/testsuite/gdb.cp/destrprint.exp
+++ b/gdb/testsuite/gdb.cp/destrprint.exp
@@ -14,15 +14,15 @@ 
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 standard_testfile .cc
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
-    return -1
+    return
 }
 
 if {![runto_main]} {
-    return -1
+    return
 }
 
 gdb_breakpoint [gdb_get_line_number "Break here"]
 gdb_continue_to_breakpoint "Break here"
 
diff --git a/gdb/testsuite/gdb.cp/disasm-func-name.exp b/gdb/testsuite/gdb.cp/disasm-func-name.exp
index 77b872fe1ade..d4b6586dbded 100644
--- a/gdb/testsuite/gdb.cp/disasm-func-name.exp
+++ b/gdb/testsuite/gdb.cp/disasm-func-name.exp
@@ -22,11 +22,11 @@  require allow_cplus_tests
 
 standard_testfile .cc
 
 if {[prepare_for_testing "failed to prepare" $testfile \
 	 $srcfile {debug c++}]} {
-    return -1
+    return
 }
 
 if {![runto_main]} {
     return
 }
diff --git a/gdb/testsuite/gdb.cp/dispcxx.exp b/gdb/testsuite/gdb.cp/dispcxx.exp
index 0af655ad0a50..c20dbadd65ce 100644
--- a/gdb/testsuite/gdb.cp/dispcxx.exp
+++ b/gdb/testsuite/gdb.cp/dispcxx.exp
@@ -16,11 +16,11 @@ 
 require allow_cplus_tests
 
 standard_testfile .cc
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
-    return -1
+    return
 }
 
 if {![runto_main]} {
     return
 }
diff --git a/gdb/testsuite/gdb.cp/empty-enum.exp b/gdb/testsuite/gdb.cp/empty-enum.exp
index 437dd0ad0868..e2b82d386f34 100644
--- a/gdb/testsuite/gdb.cp/empty-enum.exp
+++ b/gdb/testsuite/gdb.cp/empty-enum.exp
@@ -33,15 +33,15 @@  set opts {}
 lappend opts debug
 lappend opts c++
 lappend opts additional_flags=-std=c++11
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile $opts]} {
-    return -1
+    return
 }
 
 if {![runto_main]} {
-    return -1
+    return
 }
 
 gdb_breakpoint "breakpt"
 gdb_continue_to_breakpoint "stop in breakpt"
 
diff --git a/gdb/testsuite/gdb.cp/ena-dis-br-range.exp b/gdb/testsuite/gdb.cp/ena-dis-br-range.exp
index f6d3f0cb9717..36ab2f659697 100644
--- a/gdb/testsuite/gdb.cp/ena-dis-br-range.exp
+++ b/gdb/testsuite/gdb.cp/ena-dis-br-range.exp
@@ -24,15 +24,15 @@ 
 require allow_cplus_tests
 
 standard_testfile .cc
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
-    return -1
+    return
 }
 
 if {![runto 'marker']} {
-    return -1
+    return
 }
 
 # Returns a buffer corresponding to what GDB replies when asking for
 # 'info breakpoint'.  The parameters are all the existing breakpoints
 # enabled/disable value: 'n' or 'y'.
diff --git a/gdb/testsuite/gdb.cp/enum-class.exp b/gdb/testsuite/gdb.cp/enum-class.exp
index b7858719f1e5..26a496972fa6 100644
--- a/gdb/testsuite/gdb.cp/enum-class.exp
+++ b/gdb/testsuite/gdb.cp/enum-class.exp
@@ -19,15 +19,15 @@  require allow_cplus_tests
 
 standard_testfile .cc
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile \
 	 {debug c++ additional_flags=-std=c++11}]} {
-    return -1
+    return
 }
 
 if {![runto_main]} {
-    return -1
+    return
 }
 
 gdb_test "ptype E1" \
     [multi_line \
 	"type = enum class E1 (: int )?{" \
diff --git a/gdb/testsuite/gdb.cp/exception.exp b/gdb/testsuite/gdb.cp/exception.exp
index 987fa799c56f..b7bba4c71d42 100644
--- a/gdb/testsuite/gdb.cp/exception.exp
+++ b/gdb/testsuite/gdb.cp/exception.exp
@@ -33,11 +33,11 @@  set nl	"\[\r\n\]+"
 require allow_stl_tests
 
 standard_testfile .cc
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
-    return -1
+    return
 }
 
 # Set a catch catchpoint
 
 gdb_test "catch catch" "Catchpoint ${::decimal} \\(catch\\)" \
diff --git a/gdb/testsuite/gdb.cp/exceptprint.exp b/gdb/testsuite/gdb.cp/exceptprint.exp
index b940f66f9a89..d0e0a07bfb90 100644
--- a/gdb/testsuite/gdb.cp/exceptprint.exp
+++ b/gdb/testsuite/gdb.cp/exceptprint.exp
@@ -16,20 +16,20 @@ 
 standard_testfile .cc
 
 require allow_cplus_tests
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
-    return -1
+    return
 }
 
 if {![runto_main]} {
-    return -1
+    return
 }
 
 if {[skip_libstdcxx_probe_tests]} {
     untested "could not find libstdc++ stap probe"
-    return -1
+    return
 }
 
 proc do_continue_to_catchpoint {name} {
     global gdb_prompt
 
@@ -69,11 +69,11 @@  do_exceptprint_tests "reference to struct" "{mv = 77}"
 
 
 delete_breakpoints
 
 if {![runto_main]} {
-    return -1
+    return
 }
 
 with_test_prefix "2nd run" {
     gdb_test "catch catch int if \$_exception == 23" \
 	"Catchpoint ${::decimal} \\(catch\\)" \
diff --git a/gdb/testsuite/gdb.cp/expand-sals.exp b/gdb/testsuite/gdb.cp/expand-sals.exp
index dad11bbd9b0e..187073ec86eb 100644
--- a/gdb/testsuite/gdb.cp/expand-sals.exp
+++ b/gdb/testsuite/gdb.cp/expand-sals.exp
@@ -15,14 +15,14 @@ 
 
 require allow_cplus_tests
 
 set srcfile expand-sals.cc
 if { [prepare_for_testing "failed to prepare" expand-sals $srcfile {debug c++}] } {
-    return -1
+    return
 }
 if {![runto_main]} {
-    return -1
+    return
 }
 
 gdb_breakpoint [gdb_get_line_number "func-line"]
 gdb_continue_to_breakpoint "func" ".*func-line.*"
 
diff --git a/gdb/testsuite/gdb.cp/extern-c.exp b/gdb/testsuite/gdb.cp/extern-c.exp
index 67a2ced08072..ce77afae1e47 100644
--- a/gdb/testsuite/gdb.cp/extern-c.exp
+++ b/gdb/testsuite/gdb.cp/extern-c.exp
@@ -18,11 +18,11 @@ 
 require allow_cplus_tests
 
 standard_testfile .cc
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
-    return -1
+    return
 }
 
 runto_main
 
 if { [gdb_breakpoint "c_func"] == 1 } {
diff --git a/gdb/testsuite/gdb.cp/filename.exp b/gdb/testsuite/gdb.cp/filename.exp
index f9f6007ccc79..72fbbcfcebee 100644
--- a/gdb/testsuite/gdb.cp/filename.exp
+++ b/gdb/testsuite/gdb.cp/filename.exp
@@ -18,11 +18,11 @@  require allow_cplus_tests
 standard_testfile .cc
 
 include_file includefile
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
-    return -1
+    return
 }
 
 if {![runto_main]} {
     return
 }
diff --git a/gdb/testsuite/gdb.cp/formatted-ref.exp b/gdb/testsuite/gdb.cp/formatted-ref.exp
index 354c716a6c07..bc2ac9d36b24 100644
--- a/gdb/testsuite/gdb.cp/formatted-ref.exp
+++ b/gdb/testsuite/gdb.cp/formatted-ref.exp
@@ -31,11 +31,11 @@ 
 require allow_cplus_tests
 
 standard_testfile .cc
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
-    return -1
+    return
 }
 
 proc get_address { var } {
     global expect_out
     global gdb_prompt
diff --git a/gdb/testsuite/gdb.cp/gdb1355.exp b/gdb/testsuite/gdb.cp/gdb1355.exp
index 900f9029c259..77e845b468d6 100644
--- a/gdb/testsuite/gdb.cp/gdb1355.exp
+++ b/gdb/testsuite/gdb.cp/gdb1355.exp
@@ -28,11 +28,11 @@  require allow_cplus_tests
 #
 
 standard_testfile .cc
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
-    return -1
+    return
 }
 
 if {![runto_main]} {
     return
 }
diff --git a/gdb/testsuite/gdb.cp/gdb2384.exp b/gdb/testsuite/gdb.cp/gdb2384.exp
index 0a5b3088fa0f..d0c96aeaab32 100644
--- a/gdb/testsuite/gdb.cp/gdb2384.exp
+++ b/gdb/testsuite/gdb.cp/gdb2384.exp
@@ -30,19 +30,19 @@  include_file gdb2384-base.h
 set sofile [standard_output_file gdb2384-base.so]
 
 if { [gdb_compile_shlib $srcdir/$subdir/$srcfile2 $sofile {debug c++}] != ""
      || [gdb_compile $srcdir/$subdir/$srcfile $binfile executable [list debug "c++" shlib=${sofile}]] != ""} {
     untested "failed to compile"
-    return -1
+    return
 }
 
 clean_restart ${::testfile}
 gdb_load_shlib ${sofile}
 
 
 if {![runto_main]} {
-    return -1
+    return
 }
 
 gdb_breakpoint [gdb_get_line_number "First breakpoint"]
 gdb_continue_to_breakpoint "run to 'First breakpoint', first time"
 
diff --git a/gdb/testsuite/gdb.cp/gdb2495.exp b/gdb/testsuite/gdb.cp/gdb2495.exp
index c3bac7a9ce46..aa5a2a16e437 100644
--- a/gdb/testsuite/gdb.cp/gdb2495.exp
+++ b/gdb/testsuite/gdb.cp/gdb2495.exp
@@ -40,11 +40,11 @@  standard_testfile .cc
 # Some targets can't do function calls, so don't even bother with this
 # test.
 require {!target_info exists gdb,cannot_call_functions}
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
-    return -1
+    return
 }
 
 if {![runto_main]} {
     return
 }
diff --git a/gdb/testsuite/gdb.cp/hang.exp b/gdb/testsuite/gdb.cp/hang.exp
index f547f1bb1590..bd6fbd24ae7c 100644
--- a/gdb/testsuite/gdb.cp/hang.exp
+++ b/gdb/testsuite/gdb.cp/hang.exp
@@ -20,11 +20,11 @@  standard_testfile hang1.cc hang2.cc hang3.cc
 
 include_file hang.H
 
 if {[prepare_for_testing "failed to prepare" $testfile \
 	 [list $srcfile $srcfile2 $srcfile3] {debug c++}]} {
-    return -1
+    return
 }
 
 # As of May 1, 2002, GDB hangs trying to read the debug info for the
 # `hang2.o' compilation unit from the executable `hang', when compiled
 # by g++ 2.96 with STABS debugging info.  Here's what's going on, as
diff --git a/gdb/testsuite/gdb.cp/impl-this.exp b/gdb/testsuite/gdb.cp/impl-this.exp
index 213d41e664f7..a8979f383c79 100644
--- a/gdb/testsuite/gdb.cp/impl-this.exp
+++ b/gdb/testsuite/gdb.cp/impl-this.exp
@@ -21,11 +21,11 @@ 
 require allow_cplus_tests
 
 standard_testfile .cc
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
-    return -1
+    return
 }
 
 set gcc_used [test_compiler_info gcc-*-*]
 
 # First test expressions when there is no context.
diff --git a/gdb/testsuite/gdb.cp/infcall-dlopen.exp b/gdb/testsuite/gdb.cp/infcall-dlopen.exp
index 50ccf608ef66..b69c9f58cce0 100644
--- a/gdb/testsuite/gdb.cp/infcall-dlopen.exp
+++ b/gdb/testsuite/gdb.cp/infcall-dlopen.exp
@@ -20,17 +20,17 @@  set libfile [standard_output_file ${testfile}.so]
 set lib_dlopen [shlib_target_file ${testfile}.so]
 
 # Use completely arbitrary file for $libfile source.
 if { [gdb_compile_shlib ${srcdir}/${subdir}/${srcfile2} ${libfile} {debug c++}] != ""
      || [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {debug c++ shlib_load}] } {
-    return -1
+    return
 }
 
 gdb_load_shlib $libfile
 
 if { ![runto_main] } {
-    return -1
+    return
 }
 
 for {set i 0} {$i < 10} {incr i} {
     gdb_test "p openlib (\"${lib_dlopen}\")" " = 1" "test $i"
     # Try to exploit the GDB trashed memory.
diff --git a/gdb/testsuite/gdb.cp/inherit.exp b/gdb/testsuite/gdb.cp/inherit.exp
index 5d7d12c40e9c..dd2ea1a7afcf 100644
--- a/gdb/testsuite/gdb.cp/inherit.exp
+++ b/gdb/testsuite/gdb.cp/inherit.exp
@@ -25,11 +25,11 @@  require allow_cplus_tests
 load_lib "cp-support.exp"
 
 standard_testfile misc.cc
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile  {debug c++}]} {
-    return -1
+    return
 }
 
 # Single inheritance, print type definitions.
 
 proc test_ptype_si { } {
diff --git a/gdb/testsuite/gdb.cp/iostream.exp b/gdb/testsuite/gdb.cp/iostream.exp
index 39ccdb4087dc..b23e81115322 100644
--- a/gdb/testsuite/gdb.cp/iostream.exp
+++ b/gdb/testsuite/gdb.cp/iostream.exp
@@ -19,11 +19,11 @@ 
 require allow_cplus_tests
 
 standard_testfile .cc
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
-    return -1
+    return
 }
 
 if {![runto_main]} {
     return
 }
diff --git a/gdb/testsuite/gdb.cp/local.exp b/gdb/testsuite/gdb.cp/local.exp
index 73527687ff85..cf072ba6c722 100644
--- a/gdb/testsuite/gdb.cp/local.exp
+++ b/gdb/testsuite/gdb.cp/local.exp
@@ -30,11 +30,11 @@  set nl "\[\r\n\]+"
 require allow_cplus_tests
 
 standard_testfile .cc
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
-    return -1
+    return
 }
 
 #
 # set it up at a breakpoint so we can play with the variable values
 #
diff --git a/gdb/testsuite/gdb.cp/m-data.exp b/gdb/testsuite/gdb.cp/m-data.exp
index 1d1c94e107da..125c7e0483ad 100644
--- a/gdb/testsuite/gdb.cp/m-data.exp
+++ b/gdb/testsuite/gdb.cp/m-data.exp
@@ -25,11 +25,11 @@  require allow_cplus_tests
 #
 
 standard_testfile .cc
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
-    return -1
+    return
 }
 
 if {![runto_main]} {
     return
 }
diff --git a/gdb/testsuite/gdb.cp/m-static.exp b/gdb/testsuite/gdb.cp/m-static.exp
index 939e1880d64f..a898bc934e54 100644
--- a/gdb/testsuite/gdb.cp/m-static.exp
+++ b/gdb/testsuite/gdb.cp/m-static.exp
@@ -35,11 +35,11 @@  if { [test_compiler_info gcc-*] && [gcc_major_version] >= 10 } {
     lappend flags additional_flags=-fno-eliminate-unused-debug-types
 }
 
 if {[prepare_for_testing "failed to prepare" $testfile \
 	 [list $srcfile $srcfile2] $flags]} {
-    return -1
+    return
 }
 
 if {![runto_main]} {
     return
 }
diff --git a/gdb/testsuite/gdb.cp/main-cp.exp b/gdb/testsuite/gdb.cp/main-cp.exp
index bdca417e0b50..42175cd5ec31 100644
--- a/gdb/testsuite/gdb.cp/main-cp.exp
+++ b/gdb/testsuite/gdb.cp/main-cp.exp
@@ -23,11 +23,11 @@  require !readnow
 set opts {}
 lappend opts debug
 lappend opts c++
 
 if { [prepare_for_testing "failed to prepare" $testfile $srcfile $opts] } {
-    return -1
+    return
 }
 
 require {string eq [have_index $binfile] ""}
 
 gdb_test_no_output "maint info symtabs"
diff --git a/gdb/testsuite/gdb.cp/many-args.exp b/gdb/testsuite/gdb.cp/many-args.exp
index 49b5e28e976f..a2b19b0edf58 100644
--- a/gdb/testsuite/gdb.cp/many-args.exp
+++ b/gdb/testsuite/gdb.cp/many-args.exp
@@ -22,11 +22,11 @@ 
 require allow_cplus_tests
 
 standard_testfile .cc
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
-    return -1
+    return
 }
 
 if {![runto_main]} {
     return
 }
diff --git a/gdb/testsuite/gdb.cp/mb-ctor.exp b/gdb/testsuite/gdb.cp/mb-ctor.exp
index 925c215f9d82..67fb8f1afe40 100644
--- a/gdb/testsuite/gdb.cp/mb-ctor.exp
+++ b/gdb/testsuite/gdb.cp/mb-ctor.exp
@@ -20,11 +20,11 @@  require allow_cplus_tests
 
 
 standard_testfile .cc
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
-    return -1
+    return
 }
 
 if {[test_compiler_info {clang-*-*} c++]} {
     set using_clang true
 } else {
diff --git a/gdb/testsuite/gdb.cp/mb-inline.exp b/gdb/testsuite/gdb.cp/mb-inline.exp
index 4bb95547ccf2..3a7d15ad2185 100644
--- a/gdb/testsuite/gdb.cp/mb-inline.exp
+++ b/gdb/testsuite/gdb.cp/mb-inline.exp
@@ -24,11 +24,11 @@  standard_testfile mb-inline1.cc mb-inline2.cc
 set hdrfile "${testfile}.h"
 include_file $hdrfile
 
 if {[prepare_for_testing "failed to prepare" $testfile \
 	 [list $srcfile $srcfile2] {debug c++}]} {
-    return -1
+    return
 }
 
 set bp_location [gdb_get_line_number "set breakpoint here" $hdrfile]
 
 # Set a breakpoint with multiple locations.
@@ -78,11 +78,11 @@  gdb_test_multiple "info break" "disabled breakpoint 1.2" {
 delete_breakpoints
 
 set bp_location [gdb_get_line_number "set multi-line breakpoint here" $hdrfile]
 
 if { ![runto_main] } {
-    return 0
+    return
 }
 
 gdb_test "break $hdrfile:$bp_location" \
     "Breakpoint.*at.*: $hdrfile:$bp_location. \\(2 locations\\).*" \
     "set multi_line_foo breakpoint"
diff --git a/gdb/testsuite/gdb.cp/mb-templates.exp b/gdb/testsuite/gdb.cp/mb-templates.exp
index c9b78e8a16c4..a1d55d3246f2 100644
--- a/gdb/testsuite/gdb.cp/mb-templates.exp
+++ b/gdb/testsuite/gdb.cp/mb-templates.exp
@@ -20,11 +20,11 @@  require allow_stl_tests
 
 
 standard_testfile .cc
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
-    return -1
+    return
 }
 
 set bp_location [gdb_get_line_number "set breakpoint here"]
 
 # Set a breakpoint with multiple locations
@@ -106,11 +106,11 @@  gdb_test "continue" \
 delete_breakpoints
 
 set bp_location [gdb_get_line_number "set multi-line breakpoint here"]
 
 if { ![runto_main] } {
-    return 0
+    return
 }
 
 gdb_test "break $srcfile:$bp_location" \
     "Breakpoint.*at.*: $srcfile:$bp_location. \\(2 locations\\).*" \
     "set multi_line_foo breakpoint"
diff --git a/gdb/testsuite/gdb.cp/member-name.exp b/gdb/testsuite/gdb.cp/member-name.exp
index ca414c9915f2..95f628076b7b 100644
--- a/gdb/testsuite/gdb.cp/member-name.exp
+++ b/gdb/testsuite/gdb.cp/member-name.exp
@@ -16,11 +16,11 @@ 
 require allow_cplus_tests
 
 standard_testfile .cc
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
-    return -1
+    return
 }
 
 if {![runto_main]} {
     return
 }
diff --git a/gdb/testsuite/gdb.cp/member-ptr.exp b/gdb/testsuite/gdb.cp/member-ptr.exp
index f7aa475d4f81..055b1d4e7095 100644
--- a/gdb/testsuite/gdb.cp/member-ptr.exp
+++ b/gdb/testsuite/gdb.cp/member-ptr.exp
@@ -25,11 +25,11 @@  require allow_cplus_tests
 
 
 standard_testfile .cc
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
-    return -1
+    return
 }
 
 if {![runto_main]} {
     return
 }
diff --git a/gdb/testsuite/gdb.cp/meth-typedefs.exp b/gdb/testsuite/gdb.cp/meth-typedefs.exp
index 898bdd499e76..ba0fc6d9cbb7 100644
--- a/gdb/testsuite/gdb.cp/meth-typedefs.exp
+++ b/gdb/testsuite/gdb.cp/meth-typedefs.exp
@@ -35,11 +35,11 @@  require allow_cplus_tests
 # Tests for c++/12266 et al
 standard_testfile .cc
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile \
 	 {c++ debug additional_flags=-std=c++11}]} {
-    return -1
+    return
 }
 
 if {![runto_main]} {
     return
 }
diff --git a/gdb/testsuite/gdb.cp/method-call-in-c.exp b/gdb/testsuite/gdb.cp/method-call-in-c.exp
index a8e62f816a3b..5d4600b2ec23 100644
--- a/gdb/testsuite/gdb.cp/method-call-in-c.exp
+++ b/gdb/testsuite/gdb.cp/method-call-in-c.exp
@@ -24,15 +24,15 @@  set opts {}
 lappend opts debug
 lappend opts c++
 lappend opts additional_flags=-std=c++11
 
 if { [prepare_for_testing "failed to prepare" $testfile $srcfile $opts] } {
-    return -1
+    return
 }
 
 if {![runto_main]} {
-    return 0
+    return
 }
 
 gdb_breakpoint [gdb_get_line_number "Break here"]
 gdb_continue_to_breakpoint "Break here"
 
diff --git a/gdb/testsuite/gdb.cp/method-ref-return.exp b/gdb/testsuite/gdb.cp/method-ref-return.exp
index 8e082f36aa2c..1e5e0619b015 100644
--- a/gdb/testsuite/gdb.cp/method-ref-return.exp
+++ b/gdb/testsuite/gdb.cp/method-ref-return.exp
@@ -18,15 +18,15 @@ 
 require allow_cplus_tests
 
 standard_testfile .cc
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
-    return -1
+    return
 }
 
 if {![runto_main]} {
-    return -1
+    return
 }
 
 # Set a breakpoint after the bar object is created and the reference is obtained.
 gdb_breakpoint [gdb_get_line_number "breakpoint here"]
 gdb_continue_to_breakpoint "after reference assignment"
diff --git a/gdb/testsuite/gdb.cp/method.exp b/gdb/testsuite/gdb.cp/method.exp
index d890be1df9e6..e0946651a6e4 100644
--- a/gdb/testsuite/gdb.cp/method.exp
+++ b/gdb/testsuite/gdb.cp/method.exp
@@ -35,11 +35,11 @@ 
 require allow_cplus_tests
 
 standard_testfile .cc
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
-    return -1
+    return
 }
 
 #
 # set it up at a breakpoint so we can play with the variable values
 #
diff --git a/gdb/testsuite/gdb.cp/minsym-fallback.exp b/gdb/testsuite/gdb.cp/minsym-fallback.exp
index 46427d6905c8..b42710278144 100644
--- a/gdb/testsuite/gdb.cp/minsym-fallback.exp
+++ b/gdb/testsuite/gdb.cp/minsym-fallback.exp
@@ -35,11 +35,11 @@  set objmainfile [standard_output_file ${testfile}-main.o]
 
 if {[gdb_compile $srcdir/$subdir/$srcfile $objfile object $nodebug_flags] != ""
     || [gdb_compile $srcdir/$subdir/$srcfile2 $objmainfile object $debug_flags] != ""
     || [gdb_compile "$objfile $objmainfile" $binfile executable $debug_flags] != ""} {
     untested "failed to compile"
-    return -1
+    return
 }
 
 clean_restart ${executable}
 
 gdb_test_no_output "set breakpoint pending off"
diff --git a/gdb/testsuite/gdb.cp/misc.exp b/gdb/testsuite/gdb.cp/misc.exp
index 974ad1a550c1..e844ab9244e3 100644
--- a/gdb/testsuite/gdb.cp/misc.exp
+++ b/gdb/testsuite/gdb.cp/misc.exp
@@ -18,11 +18,11 @@ 
 require allow_cplus_tests
 
 standard_testfile .cc
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
-    return -1
+    return
 }
 
 #
 # Deduce language of main()
 #
diff --git a/gdb/testsuite/gdb.cp/namelessclass.exp b/gdb/testsuite/gdb.cp/namelessclass.exp
index a247fcebb7bc..e3be4cf666c8 100644
--- a/gdb/testsuite/gdb.cp/namelessclass.exp
+++ b/gdb/testsuite/gdb.cp/namelessclass.exp
@@ -26,15 +26,15 @@  require is_x86_64_m64_target
 
 standard_testfile .S
 set csrcfile "${testfile}.cc"
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {nodebug}]} {
-    return -1
+    return
 }
 
 if {![runto_main]} {
-    return -1
+    return
 }
 
 # Set a breakpoint in the lambda in A::doit ().  */
 set line [gdb_get_line_number "set breakpoint here" $csrcfile]
 gdb_breakpoint $line
diff --git a/gdb/testsuite/gdb.cp/namespace-enum.exp b/gdb/testsuite/gdb.cp/namespace-enum.exp
index cc9c274ad497..8ccdd320c738 100644
--- a/gdb/testsuite/gdb.cp/namespace-enum.exp
+++ b/gdb/testsuite/gdb.cp/namespace-enum.exp
@@ -15,11 +15,11 @@ 
 
 standard_testfile .cc namespace-enum-main.cc
 
 if {[prepare_for_testing "failed to prepare" $testfile \
 	 [list $srcfile $srcfile2] {debug c++}]} {
-    return -1
+    return
 }
 
 gdb_test "print foo::B::B_B" "`foo::B' is not defined as an aggregate type."
 gdb_test "print foo::B_B" "foo::B_B"
 gdb_test "print A_A" "A_A"
diff --git a/gdb/testsuite/gdb.cp/namespace-nested-import.exp b/gdb/testsuite/gdb.cp/namespace-nested-import.exp
index 1ec31c1903e3..b2fb2d914cbb 100644
--- a/gdb/testsuite/gdb.cp/namespace-nested-import.exp
+++ b/gdb/testsuite/gdb.cp/namespace-nested-import.exp
@@ -15,11 +15,11 @@ 
 
 
 standard_testfile .cc
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
-    return -1
+    return
 }
 
 ############################################
 # Test printing of a variable from a nested
 # in a namespace inner to the one which has
diff --git a/gdb/testsuite/gdb.cp/namespace.exp b/gdb/testsuite/gdb.cp/namespace.exp
index 6c5dd667060c..b39b2a164fc3 100644
--- a/gdb/testsuite/gdb.cp/namespace.exp
+++ b/gdb/testsuite/gdb.cp/namespace.exp
@@ -36,11 +36,11 @@  if {[test_compiler_info {gcc-[0-3]-*}]
     set xfail_class_types 1
 }
 
 if {[prepare_for_testing "failed to prepare" $testfile \
 	 [list $srcfile $srcfile2] {debug c++}]} {
-    return -1
+    return
 }
 
 gdb_test "show lang" "auto; currently c\\+\\+.*"
 
 #
diff --git a/gdb/testsuite/gdb.cp/nested-class-func-class.exp b/gdb/testsuite/gdb.cp/nested-class-func-class.exp
index f2d6f317b144..64b2ae8343c0 100644
--- a/gdb/testsuite/gdb.cp/nested-class-func-class.exp
+++ b/gdb/testsuite/gdb.cp/nested-class-func-class.exp
@@ -20,15 +20,15 @@  require allow_cplus_tests
 load_lib "cp-support.exp"
 
 standard_testfile .cc
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
-    return -1
+    return
 }
 
 if {![runto_main]} {
-    return -1
+    return
 }
 
 gdb_breakpoint [gdb_get_line_number "BP 1"]
 gdb_breakpoint [gdb_get_line_number "BP 2"]
 gdb_continue_to_breakpoint "BP 1"
diff --git a/gdb/testsuite/gdb.cp/nested-types.exp b/gdb/testsuite/gdb.cp/nested-types.exp
index e0a9d1635824..9806bb6d5c89 100644
--- a/gdb/testsuite/gdb.cp/nested-types.exp
+++ b/gdb/testsuite/gdb.cp/nested-types.exp
@@ -25,11 +25,11 @@  load_lib "cp-support.exp"
 
 standard_testfile .cc
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile \
 	 {debug c++}]} {
-    return -1
+    return
 }
 
 # Build the node given by ID (a number representing the struct S[ID] in
 # the source file).
 #
diff --git a/gdb/testsuite/gdb.cp/nextoverthrow.exp b/gdb/testsuite/gdb.cp/nextoverthrow.exp
index 2f34795d201b..2dbaae128694 100644
--- a/gdb/testsuite/gdb.cp/nextoverthrow.exp
+++ b/gdb/testsuite/gdb.cp/nextoverthrow.exp
@@ -17,20 +17,20 @@ 
 require allow_cplus_tests
 
 standard_testfile .cc
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
-    return -1
+    return
 }
 
 if {![runto_main]} {
     return
 }
 
 if {![skip_unwinder_tests]} {
     unsupported "nextoverthrow.exp could not find _Unwind_DebugHook"
-    return -1
+    return
 }
 
 # Set a temporary breakpoint and then continue to it.
 # The breakpoint is set according to a marker in the file.
 proc tbreak_and_cont {text} {
diff --git a/gdb/testsuite/gdb.cp/no-libstdcxx-probe.exp b/gdb/testsuite/gdb.cp/no-libstdcxx-probe.exp
index 202e1f0d0f1b..14e42a2e361a 100644
--- a/gdb/testsuite/gdb.cp/no-libstdcxx-probe.exp
+++ b/gdb/testsuite/gdb.cp/no-libstdcxx-probe.exp
@@ -16,19 +16,19 @@ 
 standard_testfile exceptprint.cc
 
 require allow_cplus_tests
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
-    return -1
+    return
 }
 
 # This tests that $_exception gives an error when the systemtap probes
 # are not available, so simulate this by disabling them.
 gdb_test "maint ignore-probes libstdcxx .*" ".*OBJNAME: ''"
 
 if {![runto_main]} {
-    return -1
+    return
 }
 
 gdb_test "catch throw" "Catchpoint $decimal \\(throw\\)" \
     "catch throw"
 
diff --git a/gdb/testsuite/gdb.cp/non-trivial-retval.exp b/gdb/testsuite/gdb.cp/non-trivial-retval.exp
index 0b70d3546e97..f5c32dca079d 100644
--- a/gdb/testsuite/gdb.cp/non-trivial-retval.exp
+++ b/gdb/testsuite/gdb.cp/non-trivial-retval.exp
@@ -35,15 +35,15 @@  if {[have_fvar_tracking]} {
     }
 }
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile [list debug c++ $additional_flags]]} {
 
-    return -1
+    return
 }
 
 if {![runto_main]} {
-    return -1
+    return
 }
 
 gdb_breakpoint [gdb_get_line_number "Break here"]
 gdb_continue_to_breakpoint "Break here"
 
diff --git a/gdb/testsuite/gdb.cp/noparam.exp b/gdb/testsuite/gdb.cp/noparam.exp
index 1607d64f8eee..8ce8becd91b9 100644
--- a/gdb/testsuite/gdb.cp/noparam.exp
+++ b/gdb/testsuite/gdb.cp/noparam.exp
@@ -12,10 +12,10 @@ 
 #
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 if { [prepare_for_testing "failed to prepare" "noparam" "noparam.cc" {debug c++}] } {
-    return -1
+    return
 }
 
 # Check if GDB does not crash.
 gdb_test "p C::m (int)" "no member function matches that type instantiation"
diff --git a/gdb/testsuite/gdb.cp/nsalias.exp b/gdb/testsuite/gdb.cp/nsalias.exp
index e384d8d77eb2..459efbf12d08 100644
--- a/gdb/testsuite/gdb.cp/nsalias.exp
+++ b/gdb/testsuite/gdb.cp/nsalias.exp
@@ -168,20 +168,20 @@  Dwarf::assemble $asm_file {
     }
 }
 
 if {[gdb_compile $srcdir/$subdir/$srcfile ${binfile}1.o \
 	 object {c++ debug}] != ""} {
-    return -1
+    return
 }
 
 if {[gdb_compile $asm_file ${binfile}2.o object {nodebug}] != ""} {
-    return -1
+    return
 }
 
 if {[gdb_compile [list ${binfile}1.o ${binfile}2.o] \
 	 $binfile executable {c++}] != ""} {
-    return -1
+    return
 }
 
 clean_restart $testfile
 
 # A procedure to run various tests on aliased namespaces.
@@ -302,16 +302,16 @@  set the_dwarf [format {
 } $imports]
 
 Dwarf::assemble $asm_file $the_dwarf
 
 if {[gdb_compile $asm_file ${binfile}3.o object {nodebug}] != ""} {
-    return -1
+    return
 }
 
 if {[gdb_compile [list ${binfile}1.o ${binfile}3.o] \
 	 ${binfile}-r executable {c++}] != ""} {
-    return -1
+    return
 }
 
 clean_restart
 
 # Set complaints before loading the file.  Otherwise the complaint won't
diff --git a/gdb/testsuite/gdb.cp/nsdecl.exp b/gdb/testsuite/gdb.cp/nsdecl.exp
index 72d20b618dc6..e068f419db89 100644
--- a/gdb/testsuite/gdb.cp/nsdecl.exp
+++ b/gdb/testsuite/gdb.cp/nsdecl.exp
@@ -17,11 +17,11 @@ 
 
 
 standard_testfile .cc
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
-    return -1
+    return
 }
 
 if {![runto_main]} {
     return
 }
diff --git a/gdb/testsuite/gdb.cp/nsimport.exp b/gdb/testsuite/gdb.cp/nsimport.exp
index bab4701f16fa..2ac4c0b4d5bd 100644
--- a/gdb/testsuite/gdb.cp/nsimport.exp
+++ b/gdb/testsuite/gdb.cp/nsimport.exp
@@ -18,11 +18,11 @@ 
 
 
 standard_testfile .cc
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
-    return -1
+    return
 }
 
 ############################################
 # test printing of namespace imported within
 # the function.
diff --git a/gdb/testsuite/gdb.cp/nsrecurs.exp b/gdb/testsuite/gdb.cp/nsrecurs.exp
index 220fe897387f..58d90420c820 100644
--- a/gdb/testsuite/gdb.cp/nsrecurs.exp
+++ b/gdb/testsuite/gdb.cp/nsrecurs.exp
@@ -15,11 +15,11 @@ 
 
 
 standard_testfile .cc
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
-    return -1
+    return
 }
 
 if {![runto_main]} {
     return
 }
diff --git a/gdb/testsuite/gdb.cp/nsstress.exp b/gdb/testsuite/gdb.cp/nsstress.exp
index 872bf62fd6e3..eebfaf30fef6 100644
--- a/gdb/testsuite/gdb.cp/nsstress.exp
+++ b/gdb/testsuite/gdb.cp/nsstress.exp
@@ -17,11 +17,11 @@ 
 
 
 standard_testfile .cc
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
-    return -1
+    return
 }
 
 if {![runto_main]} {
     continue
 }
diff --git a/gdb/testsuite/gdb.cp/nsusing.exp b/gdb/testsuite/gdb.cp/nsusing.exp
index d76676fda9e1..7b1d3e5283a9 100644
--- a/gdb/testsuite/gdb.cp/nsusing.exp
+++ b/gdb/testsuite/gdb.cp/nsusing.exp
@@ -14,11 +14,11 @@ 
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 standard_testfile .cc
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
-    return -1
+    return
 }
 
 ############################################
 # Test printing of namespace imported within the function.
 
diff --git a/gdb/testsuite/gdb.cp/operator.exp b/gdb/testsuite/gdb.cp/operator.exp
index 15dfee5a9fe1..1e22f8f74bff 100644
--- a/gdb/testsuite/gdb.cp/operator.exp
+++ b/gdb/testsuite/gdb.cp/operator.exp
@@ -15,11 +15,11 @@ 
 
 standard_testfile .cc
 
 if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} \
 	  {debug c++ additional_flags=-Wno-unused-comparison}] } {
-    return -1
+    return
 }
 
 ############################################
 
 if {![runto_main]} {
diff --git a/gdb/testsuite/gdb.cp/overload-const.exp b/gdb/testsuite/gdb.cp/overload-const.exp
index a036aee6a6c8..442617848587 100644
--- a/gdb/testsuite/gdb.cp/overload-const.exp
+++ b/gdb/testsuite/gdb.cp/overload-const.exp
@@ -18,11 +18,11 @@ 
 require allow_cplus_tests
 
 standard_testfile .cc
 
 if {[prepare_for_testing "failed to prepare" $testfile $testfile.cc {c++ debug}]} {
-    return -1
+    return
 }
 
 gdb_test_no_output "set language c++"
 
 if {[gdb_breakpoint "myclass::func"]} {
diff --git a/gdb/testsuite/gdb.cp/overload.exp b/gdb/testsuite/gdb.cp/overload.exp
index 5d586b19e244..9c0149bdfe05 100644
--- a/gdb/testsuite/gdb.cp/overload.exp
+++ b/gdb/testsuite/gdb.cp/overload.exp
@@ -27,11 +27,11 @@  set nl "\[\r\n\]+"
 require allow_cplus_tests
 
 standard_testfile .cc
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
-    return -1
+    return
 }
 
 # Set it up at a breakpoint so we can play with the variable values.
 
 if {![runto 'marker1']} {
diff --git a/gdb/testsuite/gdb.cp/ovldbreak.exp b/gdb/testsuite/gdb.cp/ovldbreak.exp
index a4e853e2986e..dce7d3b414b3 100644
--- a/gdb/testsuite/gdb.cp/ovldbreak.exp
+++ b/gdb/testsuite/gdb.cp/ovldbreak.exp
@@ -31,11 +31,11 @@  set timeout 15
 require allow_cplus_tests
 
 standard_testfile .cc
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
-    return -1
+    return
 }
 
 # set it up at a breakpoint so we can play with the variable values
 #
 if {![runto_main]} {
diff --git a/gdb/testsuite/gdb.cp/ovsrch.exp b/gdb/testsuite/gdb.cp/ovsrch.exp
index 4b8392395513..5fccdb43d4db 100644
--- a/gdb/testsuite/gdb.cp/ovsrch.exp
+++ b/gdb/testsuite/gdb.cp/ovsrch.exp
@@ -59,11 +59,11 @@  standard_testfile ovsrch1.cc ovsrch2.cc ovsrch3.cc ovsrch4.cc
 
 include_file ovsrch.h
 
 if {[prepare_for_testing "failed to prepare" $testfile \
 	 [list $srcfile $srcfile2 $srcfile3 $srcfile4] {c++ debug}]} {
-    return -1
+    return
 }
 
 if {![runto_main]} {
     return
 }
diff --git a/gdb/testsuite/gdb.cp/paramless.exp b/gdb/testsuite/gdb.cp/paramless.exp
index 65f4a461f6b7..4c9b6a8b8bdc 100644
--- a/gdb/testsuite/gdb.cp/paramless.exp
+++ b/gdb/testsuite/gdb.cp/paramless.exp
@@ -25,11 +25,11 @@  set opts {}
 lappend opts debug
 lappend opts c++
 lappend opts additional_flags=-std=c++11
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile $opts]} {
-    return -1
+    return
 }
 
 foreach ordinary {"outer<int>::fn" "outer<char>::fn<short>" "toplev<char>"} {
     gdb_breakpoint $ordinary message
     clean_restart $testfile
diff --git a/gdb/testsuite/gdb.cp/paren-type.exp b/gdb/testsuite/gdb.cp/paren-type.exp
index fef63979cff7..16df250c61bb 100644
--- a/gdb/testsuite/gdb.cp/paren-type.exp
+++ b/gdb/testsuite/gdb.cp/paren-type.exp
@@ -14,11 +14,11 @@ 
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 standard_testfile .cc
 
 if { [prepare_for_testing "failed to prepare" ${testfile} ${testfile}.cc {c++ debug}] } {
-    return -1
+    return
 }
 
 gdb_test_no_output "set breakpoint pending off"
 
 gdb_test "break C::f(long)" {Function "C::f\(long\)" not defined\.}
diff --git a/gdb/testsuite/gdb.cp/parse-lang.exp b/gdb/testsuite/gdb.cp/parse-lang.exp
index 04504a091b0b..0b1d2b6bcf1a 100644
--- a/gdb/testsuite/gdb.cp/parse-lang.exp
+++ b/gdb/testsuite/gdb.cp/parse-lang.exp
@@ -14,11 +14,11 @@ 
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 standard_testfile .cc
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
-    return -1
+    return
 }
 
 # Place the breakpoint before inferior gets started.  Then the breakpoint
 # condition will be re-evaluated in non-C++ startup code.
 gdb_breakpoint "C::m if v == 42"
diff --git a/gdb/testsuite/gdb.cp/pass-by-ref-2.exp b/gdb/testsuite/gdb.cp/pass-by-ref-2.exp
index e4c56ee2b7ec..3d7046359010 100644
--- a/gdb/testsuite/gdb.cp/pass-by-ref-2.exp
+++ b/gdb/testsuite/gdb.cp/pass-by-ref-2.exp
@@ -29,15 +29,15 @@  require allow_cplus_tests
 
 standard_testfile .cc
 
 set options {debug c++ additional_flags=-std=c++11}
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile $options]} {
-    return -1
+    return
 }
 
 if {![runto_main]} {
-    return -1
+    return
 }
 
 # GCC version <= 6 and Clang do not emit DW_AT_defaulted and DW_AT_deleted.
 set is_gcc_6_or_older [test_compiler_info {gcc-[0-6]-*}]
 set is_clang [test_compiler_info {clang-*}]
diff --git a/gdb/testsuite/gdb.cp/pass-by-ref.exp b/gdb/testsuite/gdb.cp/pass-by-ref.exp
index fde95d4d0a4e..66bc4b356582 100644
--- a/gdb/testsuite/gdb.cp/pass-by-ref.exp
+++ b/gdb/testsuite/gdb.cp/pass-by-ref.exp
@@ -334,15 +334,15 @@  set program [generate_program $classes $stmts]
 set srcfile [standard_output_file ${srcfile}]
 gdb_produce_source $srcfile $program
 
 set options {debug c++ additional_flags=-std=c++11}
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile $options]} {
-    return -1
+    return
 }
 
 if {![runto_main]} {
-    return -1
+    return
 }
 
 set bp_location [gdb_get_line_number "stop here"]
 gdb_breakpoint $bp_location
 gdb_continue_to_breakpoint "end of main" ".*return .*;"
diff --git a/gdb/testsuite/gdb.cp/pointer-to-member.exp b/gdb/testsuite/gdb.cp/pointer-to-member.exp
index 5370cdbed18c..d2d04b27ae27 100644
--- a/gdb/testsuite/gdb.cp/pointer-to-member.exp
+++ b/gdb/testsuite/gdb.cp/pointer-to-member.exp
@@ -20,9 +20,9 @@ 
 require allow_cplus_tests
 
 standard_testfile .cc
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
-    return -1
+    return
 }
 
 gdb_test "print ptm" " = &A::i"
diff --git a/gdb/testsuite/gdb.cp/pr-1023.exp b/gdb/testsuite/gdb.cp/pr-1023.exp
index 5e15b649c777..e524e88bb39c 100644
--- a/gdb/testsuite/gdb.cp/pr-1023.exp
+++ b/gdb/testsuite/gdb.cp/pr-1023.exp
@@ -25,11 +25,11 @@  require allow_cplus_tests
 #
 
 standard_testfile .cc
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
-    return -1
+    return
 }
 
 if {![runto_main]} {
     return
 }
diff --git a/gdb/testsuite/gdb.cp/pr-1210.exp b/gdb/testsuite/gdb.cp/pr-1210.exp
index cf42f58b228e..c215d0f1a918 100644
--- a/gdb/testsuite/gdb.cp/pr-1210.exp
+++ b/gdb/testsuite/gdb.cp/pr-1210.exp
@@ -24,11 +24,11 @@  require allow_cplus_tests
 #
 
 standard_testfile .cc
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
-    return -1
+    return
 }
 
 if {![runto_main]} {
     return
 }
diff --git a/gdb/testsuite/gdb.cp/pr-574.exp b/gdb/testsuite/gdb.cp/pr-574.exp
index 1952463063fe..4312eebb0677 100644
--- a/gdb/testsuite/gdb.cp/pr-574.exp
+++ b/gdb/testsuite/gdb.cp/pr-574.exp
@@ -33,11 +33,11 @@  if { [test_compiler_info gcc-*] && [gcc_major_version] >= 10 } {
     # Work around PR gcc/101452.
     lappend flags additional_flags=-fno-eliminate-unused-debug-types
 }
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile $flags]} {
-    return -1
+    return
 }
 
 if {![runto_main]} {
     return
 }
diff --git a/gdb/testsuite/gdb.cp/pr10687.exp b/gdb/testsuite/gdb.cp/pr10687.exp
index b27de9720887..c2063f975ae3 100644
--- a/gdb/testsuite/gdb.cp/pr10687.exp
+++ b/gdb/testsuite/gdb.cp/pr10687.exp
@@ -14,11 +14,11 @@ 
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 standard_testfile .cc
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
-    return -1
+    return
 }
 
 if {![runto_main]} {
     return
 }
diff --git a/gdb/testsuite/gdb.cp/pr12028.exp b/gdb/testsuite/gdb.cp/pr12028.exp
index b656a88975d5..f4e0aefb0d46 100644
--- a/gdb/testsuite/gdb.cp/pr12028.exp
+++ b/gdb/testsuite/gdb.cp/pr12028.exp
@@ -14,11 +14,11 @@ 
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 standard_testfile .cc
 
 if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {debug c++}] } {
-    return -1
+    return
 }
 
 ############################################
 
 if {![runto_main]} {
diff --git a/gdb/testsuite/gdb.cp/pr17132.exp b/gdb/testsuite/gdb.cp/pr17132.exp
index 3492425534a4..06d329c81fd7 100644
--- a/gdb/testsuite/gdb.cp/pr17132.exp
+++ b/gdb/testsuite/gdb.cp/pr17132.exp
@@ -18,15 +18,15 @@ 
 require allow_cplus_tests
 
 standard_testfile .cc
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
-    return -1
+    return
 }
 
 if {![runto_main]} {
-    return -1
+    return
 }
 
 gdb_breakpoint [gdb_get_line_number "Break here"]
 gdb_continue_to_breakpoint "Break here"
 
diff --git a/gdb/testsuite/gdb.cp/pr17494.exp b/gdb/testsuite/gdb.cp/pr17494.exp
index 33bc4831239f..ab23e1133823 100644
--- a/gdb/testsuite/gdb.cp/pr17494.exp
+++ b/gdb/testsuite/gdb.cp/pr17494.exp
@@ -18,15 +18,15 @@ 
 require allow_cplus_tests
 
 standard_testfile .cc
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
-    return -1
+    return
 }
 
 if {![runto_main]} {
-    return -1
+    return
 }
 
 gdb_breakpoint [gdb_get_line_number "Break here"]
 gdb_continue_to_breakpoint "Break here"
 
diff --git a/gdb/testsuite/gdb.cp/pr9067.exp b/gdb/testsuite/gdb.cp/pr9067.exp
index 43f4aa75796f..043690123f88 100644
--- a/gdb/testsuite/gdb.cp/pr9067.exp
+++ b/gdb/testsuite/gdb.cp/pr9067.exp
@@ -20,11 +20,11 @@  require allow_cplus_tests
 load_lib "cp-support.exp"
 
 standard_testfile .cc
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
-    return -1
+    return
 }
 
 if {![runto_main]} {
     return
 }
diff --git a/gdb/testsuite/gdb.cp/pr9167.exp b/gdb/testsuite/gdb.cp/pr9167.exp
index d1ceb6a4b9a1..8ae4356a6dad 100644
--- a/gdb/testsuite/gdb.cp/pr9167.exp
+++ b/gdb/testsuite/gdb.cp/pr9167.exp
@@ -20,11 +20,11 @@  if { [test_compiler_info gcc-*] && [gcc_major_version] >= 10 } {
     # Work around PR gcc/101452.
     lappend flags additional_flags=-fno-eliminate-unused-debug-types
 }
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile $flags]} {
-    return -1
+    return
 }
 
 if {![runto_main]} {
     return
 }
diff --git a/gdb/testsuite/gdb.cp/pr9631.exp b/gdb/testsuite/gdb.cp/pr9631.exp
index f0b4fb5dc220..71cdda50d985 100644
--- a/gdb/testsuite/gdb.cp/pr9631.exp
+++ b/gdb/testsuite/gdb.cp/pr9631.exp
@@ -18,11 +18,11 @@ 
 require allow_cplus_tests
 
 standard_testfile .cc
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
-    return -1
+    return
 }
 
 if {![runto_main]} {
     return
 }
diff --git a/gdb/testsuite/gdb.cp/print-demangle.exp b/gdb/testsuite/gdb.cp/print-demangle.exp
index 98c0167d42dd..9065adc3eac4 100644
--- a/gdb/testsuite/gdb.cp/print-demangle.exp
+++ b/gdb/testsuite/gdb.cp/print-demangle.exp
@@ -16,11 +16,11 @@ 
 require allow_cplus_tests
 
 standard_testfile bool.cc
 
 if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug c++}]} {
-    return -1
+    return
 }
 
 runto_main
 
 gdb_breakpoint "return_true"
diff --git a/gdb/testsuite/gdb.cp/print-global-stub.exp b/gdb/testsuite/gdb.cp/print-global-stub.exp
index df29bb61ee93..f82df5931da3 100644
--- a/gdb/testsuite/gdb.cp/print-global-stub.exp
+++ b/gdb/testsuite/gdb.cp/print-global-stub.exp
@@ -23,11 +23,11 @@  set testfile $testfile.o
 set binfile [standard_output_file $testfile]
 
 if { [gdb_compile $srcdir/$subdir/$srcfile $binfile object \
 	  {c++ debug}] != "" } {
     untested "failed to compile"
-    return -1
+    return
 }
 
 clean_restart $testfile
 
 gdb_test "print s" " = <incomplete type>"
diff --git a/gdb/testsuite/gdb.cp/print-method-args.exp b/gdb/testsuite/gdb.cp/print-method-args.exp
index dd9cb8be748b..17f4204c44a8 100644
--- a/gdb/testsuite/gdb.cp/print-method-args.exp
+++ b/gdb/testsuite/gdb.cp/print-method-args.exp
@@ -20,11 +20,11 @@ 
 require allow_cplus_tests
 
 standard_testfile .cc
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
-    return -1
+    return
 }
 
 set re \
     [multi_line \
 	 "type = class A {" \
diff --git a/gdb/testsuite/gdb.cp/printmethod.exp b/gdb/testsuite/gdb.cp/printmethod.exp
index bad147b874d6..fdc1c91bf232 100644
--- a/gdb/testsuite/gdb.cp/printmethod.exp
+++ b/gdb/testsuite/gdb.cp/printmethod.exp
@@ -26,11 +26,11 @@  require allow_cplus_tests
 #
 
 standard_testfile .cc
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
-    return -1
+    return
 }
 
 if {![runto_main]} {
     return
 }
diff --git a/gdb/testsuite/gdb.cp/psmang.exp b/gdb/testsuite/gdb.cp/psmang.exp
index bd51b8b03a34..d29b51f867eb 100644
--- a/gdb/testsuite/gdb.cp/psmang.exp
+++ b/gdb/testsuite/gdb.cp/psmang.exp
@@ -180,11 +180,11 @@  require allow_cplus_tests
 
 standard_testfile psmang1.cc psmang2.cc
 
 if {[prepare_for_testing "failed to prepare" $testfile \
 	 [list $srcfile $srcfile2] {debug c++}]} {
-    return -1
+    return
 }
 
 gdb_test "break s::method1" "Breakpoint .* at .*: file .*psmang1.cc.*"
 
 # We have to exit and restart GDB here, to make sure that all the
diff --git a/gdb/testsuite/gdb.cp/psymtab-parameter.exp b/gdb/testsuite/gdb.cp/psymtab-parameter.exp
index 9412945fb099..aac95195922e 100644
--- a/gdb/testsuite/gdb.cp/psymtab-parameter.exp
+++ b/gdb/testsuite/gdb.cp/psymtab-parameter.exp
@@ -17,11 +17,11 @@  require allow_cplus_tests
 
 standard_testfile .cc
 
 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}.x" object {debug c++}] != "" } {
     untested "failed to compile"
-    return -1
+    return
 }
 
 clean_restart $testfile.x
 
 # As `main' is not present GDB fails to find the proper inferior language.
diff --git a/gdb/testsuite/gdb.cp/ptype-cv-cp.exp b/gdb/testsuite/gdb.cp/ptype-cv-cp.exp
index c0129a71f55b..bfc6e176cc17 100644
--- a/gdb/testsuite/gdb.cp/ptype-cv-cp.exp
+++ b/gdb/testsuite/gdb.cp/ptype-cv-cp.exp
@@ -18,11 +18,11 @@ 
 require allow_cplus_tests
 
 standard_testfile .cc
 
 if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {debug c++}] } {
-    return -1
+    return
 }
 
 gdb_test "whatis v_my_int" "type = my_int"
 gdb_test "ptype v_my_int" "type = int"
 
diff --git a/gdb/testsuite/gdb.cp/ptype-flags.exp b/gdb/testsuite/gdb.cp/ptype-flags.exp
index c97c8b436de1..4530f99a50cf 100644
--- a/gdb/testsuite/gdb.cp/ptype-flags.exp
+++ b/gdb/testsuite/gdb.cp/ptype-flags.exp
@@ -20,11 +20,11 @@  require allow_cplus_tests
 load_lib "cp-support.exp"
 
 standard_testfile .cc
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
-    return -1
+    return
 }
 
 if {![runto_main]} {
     return
 }
diff --git a/gdb/testsuite/gdb.cp/re-set-overloaded.exp b/gdb/testsuite/gdb.cp/re-set-overloaded.exp
index d63be344252d..e5492c67c6ed 100644
--- a/gdb/testsuite/gdb.cp/re-set-overloaded.exp
+++ b/gdb/testsuite/gdb.cp/re-set-overloaded.exp
@@ -20,11 +20,11 @@  standard_testfile bool.cc .cc
 set sofile [standard_output_file ${testfile}.so]
 
 if { [gdb_compile_shlib $srcdir/$subdir/$srcfile2 $sofile {debug c++}] != ""
      || [gdb_compile $srcdir/$subdir/$srcfile $binfile executable [list debug "c++" shlib=${sofile}]] != ""} {
     untested "failed to compile"
-    return -1
+    return
 }
 
 clean_restart $testfile
 gdb_load_shlib ${sofile}
 
diff --git a/gdb/testsuite/gdb.cp/readnow-language.exp b/gdb/testsuite/gdb.cp/readnow-language.exp
index 73199bf15a15..fb4e62805397 100644
--- a/gdb/testsuite/gdb.cp/readnow-language.exp
+++ b/gdb/testsuite/gdb.cp/readnow-language.exp
@@ -14,11 +14,11 @@ 
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 standard_testfile .cc
 
 if {[build_executable ${testfile}.exp $testfile ${testfile}.cc {c++ debug}] == -1} {
-    return -1
+    return
 }
 
 save_vars { GDBFLAGS } {
     set GDBFLAGS "$GDBFLAGS -readnow"
     clean_restart $testfile
diff --git a/gdb/testsuite/gdb.cp/ref-params.exp b/gdb/testsuite/gdb.cp/ref-params.exp
index 31144fcba213..0238d938dc14 100644
--- a/gdb/testsuite/gdb.cp/ref-params.exp
+++ b/gdb/testsuite/gdb.cp/ref-params.exp
@@ -23,11 +23,11 @@ 
 require allow_cplus_tests
 
 standard_testfile .cc
 
 if {[build_executable $testfile.exp $testfile $srcfile {debug c++}] == -1} {
-    return -1
+    return
 }
 
 proc gdb_start_again { text } {
     global binfile
     global srcfile
diff --git a/gdb/testsuite/gdb.cp/ref-types.exp b/gdb/testsuite/gdb.cp/ref-types.exp
index d56d10ea4bb4..b55b6ffe7f6f 100644
--- a/gdb/testsuite/gdb.cp/ref-types.exp
+++ b/gdb/testsuite/gdb.cp/ref-types.exp
@@ -23,11 +23,11 @@ 
 require allow_cplus_tests
 
 standard_testfile .cc
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
-    return -1
+    return
 }
 
 #
 # set it up at a breakpoint so we can play with the variable values
 #
diff --git a/gdb/testsuite/gdb.cp/rtti.exp b/gdb/testsuite/gdb.cp/rtti.exp
index b694ab935e34..7fe140c5c58e 100644
--- a/gdb/testsuite/gdb.cp/rtti.exp
+++ b/gdb/testsuite/gdb.cp/rtti.exp
@@ -36,11 +36,11 @@  standard_testfile rtti1.cc rtti2.cc
 
 include_file rtti.h
 
 if {[prepare_for_testing "failed to prepare" $testfile \
 	 [list $srcfile $srcfile2] {debug c++}]} {
-    return -1
+    return
 }
 
 if {![runto_main]} {
     return
 }
diff --git a/gdb/testsuite/gdb.cp/rvalue-ref-casts.exp b/gdb/testsuite/gdb.cp/rvalue-ref-casts.exp
index a73708d92112..360037912186 100644
--- a/gdb/testsuite/gdb.cp/rvalue-ref-casts.exp
+++ b/gdb/testsuite/gdb.cp/rvalue-ref-casts.exp
@@ -21,15 +21,15 @@  require allow_cplus_tests
 
 standard_testfile .cc
 
 if {[prepare_for_testing $testfile.exp $testfile $srcfile \
     {debug c++ additional_flags="-std=gnu++11"}]} {
-    return -1
+    return
 }
 
 if {![runto_main]} {
-    return -1
+    return
 }
 
 # Prevent symbol on address 0x0 being printed.
 gdb_test_no_output "set print symbol off"
 
diff --git a/gdb/testsuite/gdb.cp/rvalue-ref-overload.exp b/gdb/testsuite/gdb.cp/rvalue-ref-overload.exp
index b9da32c244e4..6083606567a0 100644
--- a/gdb/testsuite/gdb.cp/rvalue-ref-overload.exp
+++ b/gdb/testsuite/gdb.cp/rvalue-ref-overload.exp
@@ -24,18 +24,18 @@  load_lib "cp-support.exp"
 
 standard_testfile .cc
 
 if {[prepare_for_testing $testfile.exp $testfile $srcfile \
     {debug c++ additional_flags="-std=gnu++11"}]} {
-    return -1
+    return
 }
 
 # Set it up at a breakpoint so we can play with the variable values.
 
 if {![runto 'marker1']} {
     untested "couldn't run to marker1"
-    return -1
+    return
 }
 
 # Prevent symbol on address 0x0 being printed.
 gdb_test_no_output "set print symbol off"
 gdb_test "up" ".*main.*" "up from marker1"
diff --git a/gdb/testsuite/gdb.cp/rvalue-ref-params.exp b/gdb/testsuite/gdb.cp/rvalue-ref-params.exp
index 6b4c891cef3d..a4c7156bda7b 100644
--- a/gdb/testsuite/gdb.cp/rvalue-ref-params.exp
+++ b/gdb/testsuite/gdb.cp/rvalue-ref-params.exp
@@ -20,11 +20,11 @@  require allow_cplus_tests
 
 standard_testfile .cc
 
 if {[build_executable $testfile.exp $testfile $srcfile \
     {debug c++ additional_flags="-std=gnu++11"}] == -1} {
-    return -1
+    return
 }
 
 proc gdb_start_again {text prefix} {
     global binfile
     global srcfile
diff --git a/gdb/testsuite/gdb.cp/rvalue-ref-types.exp b/gdb/testsuite/gdb.cp/rvalue-ref-types.exp
index e251efebf35f..af10ce37b7f1 100644
--- a/gdb/testsuite/gdb.cp/rvalue-ref-types.exp
+++ b/gdb/testsuite/gdb.cp/rvalue-ref-types.exp
@@ -20,22 +20,22 @@  require allow_cplus_tests
 
 standard_testfile .cc
 
 if {[prepare_for_testing $testfile.exp $testfile $srcfile \
     {debug c++ additional_flags="-std=gnu++11"}]} {
-    return -1
+    return
 }
 
 #
 # Set it up at a breakpoint so we can play with the variable values.
 #
 if {![runto_main]} {
-    return -1
+    return
 }
 
 if {![runto 'marker1']} {
-    return -1
+    return
 }
 
 gdb_test "up" ".*main.*" "up from marker1 1"
 
 gdb_test "print rrt" " = \\(short( int)? &&\\) @$hex: -1" "print value of rrt"
diff --git a/gdb/testsuite/gdb.cp/save-bp-qualified.exp b/gdb/testsuite/gdb.cp/save-bp-qualified.exp
index a6ee09c6cdcb..a6851ba96623 100644
--- a/gdb/testsuite/gdb.cp/save-bp-qualified.exp
+++ b/gdb/testsuite/gdb.cp/save-bp-qualified.exp
@@ -16,11 +16,11 @@ 
 # Test "save breakpoints" + "break -qualified".
 
 standard_testfile .cc
 
 if { [build_executable "failed to prepare" ${testfile} $srcfile {debug c++}] } {
-    return -1
+    return
 }
 
 proc restart {} {
     global testfile
 
diff --git a/gdb/testsuite/gdb.cp/scope-err.exp b/gdb/testsuite/gdb.cp/scope-err.exp
index 3e2591402119..236928d84903 100644
--- a/gdb/testsuite/gdb.cp/scope-err.exp
+++ b/gdb/testsuite/gdb.cp/scope-err.exp
@@ -20,15 +20,15 @@  require allow_cplus_tests
 
 standard_testfile .cc
 set exefile $testfile
 
 if {[prepare_for_testing "failed to prepare" $exefile $srcfile {debug c++}]} {
-    return -1
+    return
 }
 
 if {![runto_main]} {
-    return 0
+    return
 }
 
 # Run to a location in the file.
 set bp_location [gdb_get_line_number "set breakpoint here"]
 
diff --git a/gdb/testsuite/gdb.cp/shadow.exp b/gdb/testsuite/gdb.cp/shadow.exp
index 1fed09a366c9..d095f85324ad 100644
--- a/gdb/testsuite/gdb.cp/shadow.exp
+++ b/gdb/testsuite/gdb.cp/shadow.exp
@@ -18,11 +18,11 @@ 
 
 
 standard_testfile .cc
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
-    return -1
+    return
 }
 
 if {![runto_main]} {
     return
 }
diff --git a/gdb/testsuite/gdb.cp/static-method.exp b/gdb/testsuite/gdb.cp/static-method.exp
index 527352f4ac4a..7ab795d0115d 100644
--- a/gdb/testsuite/gdb.cp/static-method.exp
+++ b/gdb/testsuite/gdb.cp/static-method.exp
@@ -41,11 +41,11 @@  require allow_cplus_tests
 
 # Tests for c++/12750
 standard_testfile .cc
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {c++ debug}]} {
-    return -1
+    return
 }
 
 # The GDB workaround for GCC PR debug/45682 does not apply as it requires
 # DW_AT_linkage_name of methods.  The whole class A is in anonymous namespace,
 # therefore not accessible outside of the CU (compilation unit) and therefore
diff --git a/gdb/testsuite/gdb.cp/static-print-quit.exp b/gdb/testsuite/gdb.cp/static-print-quit.exp
index 088abb9b9f8e..19756f64732e 100644
--- a/gdb/testsuite/gdb.cp/static-print-quit.exp
+++ b/gdb/testsuite/gdb.cp/static-print-quit.exp
@@ -17,11 +17,11 @@  require allow_cplus_tests
 
 standard_testfile .cc
 
 if { [gdb_compile $srcdir/$subdir/$srcfile $binfile.o object {debug c++}] != ""} {
     untested "failed to compile"
-    return -1
+    return
 }
 
 clean_restart $testfile.o
 
 gdb_test_no_output "set width 80"
diff --git a/gdb/testsuite/gdb.cp/static-typedef-print.exp b/gdb/testsuite/gdb.cp/static-typedef-print.exp
index 2d0b9869725a..579ddf671688 100644
--- a/gdb/testsuite/gdb.cp/static-typedef-print.exp
+++ b/gdb/testsuite/gdb.cp/static-typedef-print.exp
@@ -16,15 +16,15 @@ 
 require allow_cplus_tests
 
 standard_testfile .cc
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
-    return -1
+    return
 }
 
 if {![runto_main]} {
-    return -1
+    return
 }
 
 gdb_test "print a" \
 	 "static INSTANCE = <same as static member of an already seen type>}}.*" \
 	 "print static member"
diff --git a/gdb/testsuite/gdb.cp/step-and-next-inline.exp b/gdb/testsuite/gdb.cp/step-and-next-inline.exp
index 08694a67afbf..e8bb998231b4 100644
--- a/gdb/testsuite/gdb.cp/step-and-next-inline.exp
+++ b/gdb/testsuite/gdb.cp/step-and-next-inline.exp
@@ -14,11 +14,11 @@ 
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 standard_testfile .cc
 
 if {[test_compiler_info gcc*] && ![supports_statement_frontiers] } {
-    return -1
+    return
 }
 
 # Compile the test source with USE_NEXT_INLINE_H defined (when
 # use_header is true), or not defined.
 proc do_test { use_header } {
diff --git a/gdb/testsuite/gdb.cp/stub-array-size.exp b/gdb/testsuite/gdb.cp/stub-array-size.exp
index 527f74fe8e26..fab9754dcc9c 100644
--- a/gdb/testsuite/gdb.cp/stub-array-size.exp
+++ b/gdb/testsuite/gdb.cp/stub-array-size.exp
@@ -24,9 +24,9 @@  standard_testfile .cc stub-array-size2.cc
 
 include_file stub-array-size.h
 
 if {[prepare_for_testing "failed to prepare" $testfile "$srcfile $srcfile2" \
 	{c++ debug}]} {
-    return -1
+    return
 }
 
 gdb_test "print sizeof(a)/sizeof(a\[0\])" "10"
diff --git a/gdb/testsuite/gdb.cp/subtypes.exp b/gdb/testsuite/gdb.cp/subtypes.exp
index 31c8c2264928..187bd494902a 100644
--- a/gdb/testsuite/gdb.cp/subtypes.exp
+++ b/gdb/testsuite/gdb.cp/subtypes.exp
@@ -25,11 +25,11 @@  standard_testfile .cc subtypes-2.cc
 include_file subtypes.h
 
 if {[prepare_for_testing "failed to prepare" $testfile \
 	 [list $srcfile $srcfile2] \
 	 {debug c++ additional_flags=-std=c++11}]} {
-    return -1
+    return
 }
 
 # Xfail for superfluous DW_TAG_lexical_block, gcc PR debug/55541.
 set have_xfail [expr {[test_compiler_info gcc-*] && [gcc_major_version] < 5}]
 
diff --git a/gdb/testsuite/gdb.cp/temargs.exp b/gdb/testsuite/gdb.cp/temargs.exp
index eb1d987c6747..ff4ae3bf5747 100644
--- a/gdb/testsuite/gdb.cp/temargs.exp
+++ b/gdb/testsuite/gdb.cp/temargs.exp
@@ -21,15 +21,15 @@  require allow_cplus_tests
 
 standard_testfile .cc
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile \
 	 {debug c++ additional_flags=-std=c++11}]} {
-    return -1
+    return
 }
 
 if {![runto_main]} {
-    return -1
+    return
 }
 
 # gcc 4.4 and earlier don't emit enough info for some of our template tests.
 set have_older_template_gcc 0
 set have_pr_41736_fixed 1
diff --git a/gdb/testsuite/gdb.cp/templates.exp b/gdb/testsuite/gdb.cp/templates.exp
index 3531b231e5df..044190f1fac0 100644
--- a/gdb/testsuite/gdb.cp/templates.exp
+++ b/gdb/testsuite/gdb.cp/templates.exp
@@ -28,11 +28,11 @@  if { [test_compiler_info gcc-*] && [gcc_major_version] >= 10 } {
     # Work around PR gcc/101452.
     lappend flags additional_flags=-DGCC_BUG
 }
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile $flags]} {
-    return -1
+    return
 }
 
 #
 #  Test printing of the types of templates.
 #
diff --git a/gdb/testsuite/gdb.cp/try_catch.exp b/gdb/testsuite/gdb.cp/try_catch.exp
index 6a8e68834773..663f42a9c0e3 100644
--- a/gdb/testsuite/gdb.cp/try_catch.exp
+++ b/gdb/testsuite/gdb.cp/try_catch.exp
@@ -25,11 +25,11 @@  require allow_stl_tests
 #
 
 standard_testfile .cc
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
-    return -1
+    return
 }
 
 if {![runto_main]} {
     return
 }
diff --git a/gdb/testsuite/gdb.cp/typed-enum.exp b/gdb/testsuite/gdb.cp/typed-enum.exp
index 7fc3759ef02e..a2021abd64cb 100644
--- a/gdb/testsuite/gdb.cp/typed-enum.exp
+++ b/gdb/testsuite/gdb.cp/typed-enum.exp
@@ -23,10 +23,10 @@  set opts {}
 lappend opts debug
 lappend opts c++
 lappend opts additional_flags=-std=c++11
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile $opts]} {
-    return -1
+    return
 }
 
 gdb_test "print (int)byte_val" "= 128"
 gdb_test "print (int)uchar_val" "= 128"
diff --git a/gdb/testsuite/gdb.cp/typedef-base.exp b/gdb/testsuite/gdb.cp/typedef-base.exp
index 97ce29f2a9c8..358b510e7f13 100644
--- a/gdb/testsuite/gdb.cp/typedef-base.exp
+++ b/gdb/testsuite/gdb.cp/typedef-base.exp
@@ -18,15 +18,15 @@ 
 require allow_cplus_tests
 
 standard_testfile .cc
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
-    return -1
+    return
 }
 
 if {![runto_main]} {
-    return -1
+    return
 }
 
 gdb_test "ptype C::x" \
 	 "type = int" \
 	 "ptype typedef base struct member"
diff --git a/gdb/testsuite/gdb.cp/typedef-operator.exp b/gdb/testsuite/gdb.cp/typedef-operator.exp
index 4e45dd8a4fb4..9513b3725dc7 100644
--- a/gdb/testsuite/gdb.cp/typedef-operator.exp
+++ b/gdb/testsuite/gdb.cp/typedef-operator.exp
@@ -18,17 +18,17 @@ 
 require allow_cplus_tests
 
 standard_testfile .cc
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {c++ debug}]} {
-    return -1
+    return
 }
 
 gdb_test_no_output "set language c++"
 
 gdb_test "p *u" {You can't do that without a process to debug.} "test crash"
 
 if {![runto_main]} {
-    return -1
+    return
 }
 
 gdb_test "p *v" " = 42" "test typedef"
diff --git a/gdb/testsuite/gdb.cp/typeid.exp b/gdb/testsuite/gdb.cp/typeid.exp
index 06ba7468c758..4587ec0199ec 100644
--- a/gdb/testsuite/gdb.cp/typeid.exp
+++ b/gdb/testsuite/gdb.cp/typeid.exp
@@ -16,11 +16,11 @@ 
 standard_testfile .cc
 
 require allow_cplus_tests
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
-    return -1
+    return
 }
 
 proc do_typeid_tests {started} {
     global hex
 
@@ -81,11 +81,11 @@  proc do_typeid_tests {started} {
 with_test_prefix "before starting" {
     do_typeid_tests 0
 }
 
 if {![runto_main]} {
-    return -1
+    return
 }
 
 with_test_prefix "after starting" {
     do_typeid_tests 1
 }
diff --git a/gdb/testsuite/gdb.cp/userdef.exp b/gdb/testsuite/gdb.cp/userdef.exp
index 68362fed2b0a..01182c4a9f15 100644
--- a/gdb/testsuite/gdb.cp/userdef.exp
+++ b/gdb/testsuite/gdb.cp/userdef.exp
@@ -22,11 +22,11 @@ 
 require allow_stl_tests
 
 standard_testfile .cc
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
-    return -1
+    return
 }
 
 if {![runto_main]} {
     return
 }
diff --git a/gdb/testsuite/gdb.cp/using-crash.exp b/gdb/testsuite/gdb.cp/using-crash.exp
index 8334006f7c31..1f5e4ce7eb43 100644
--- a/gdb/testsuite/gdb.cp/using-crash.exp
+++ b/gdb/testsuite/gdb.cp/using-crash.exp
@@ -13,11 +13,11 @@ 
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 standard_testfile .cc
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
-    return -1
+    return
 }
 
 runto "foo"
 
 # This would cause reading debug info with using_directives pointing to
diff --git a/gdb/testsuite/gdb.cp/var-tag.exp b/gdb/testsuite/gdb.cp/var-tag.exp
index 676b36943d2f..c1b1158a4b57 100644
--- a/gdb/testsuite/gdb.cp/var-tag.exp
+++ b/gdb/testsuite/gdb.cp/var-tag.exp
@@ -21,11 +21,11 @@  require allow_cplus_tests
 
 standard_testfile var-tag.cc var-tag-2.cc var-tag-3.cc var-tag-4.cc
 
 if {[prepare_for_testing "failed to prepare" $testfile \
     [list $srcfile $srcfile2 $srcfile3 $srcfile4] {debug c++}]} {
-    return -1
+    return
 }
 
 proc do_global_tests {lang} {
     set invalid_print "Attempt to use a type name as an expression"
 
diff --git a/gdb/testsuite/gdb.cp/virtbase.exp b/gdb/testsuite/gdb.cp/virtbase.exp
index b0c43fa87eaf..530587ac775d 100644
--- a/gdb/testsuite/gdb.cp/virtbase.exp
+++ b/gdb/testsuite/gdb.cp/virtbase.exp
@@ -18,11 +18,11 @@ 
 require allow_cplus_tests
 
 standard_testfile .cc
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
-    return -1
+    return
 }
 
 if {![runto_main]} {
     return
 }
diff --git a/gdb/testsuite/gdb.cp/virtbase2.exp b/gdb/testsuite/gdb.cp/virtbase2.exp
index ae0424142f78..635635a0d282 100644
--- a/gdb/testsuite/gdb.cp/virtbase2.exp
+++ b/gdb/testsuite/gdb.cp/virtbase2.exp
@@ -18,11 +18,11 @@ 
 require allow_cplus_tests
 
 standard_testfile .cc
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
-    return -1
+    return
 }
 
 if {![runto_main]} {
     return
 }
diff --git a/gdb/testsuite/gdb.cp/virtfunc.exp b/gdb/testsuite/gdb.cp/virtfunc.exp
index 21e300e4ffc9..eecf4611e233 100644
--- a/gdb/testsuite/gdb.cp/virtfunc.exp
+++ b/gdb/testsuite/gdb.cp/virtfunc.exp
@@ -23,11 +23,11 @@  require allow_cplus_tests
 load_lib "cp-support.exp"
 
 standard_testfile .cc
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
-    return -1
+    return
 }
 
 proc test_ptype_of_classes {} {
 
     # class VA
diff --git a/gdb/testsuite/gdb.cp/virtfunc2.exp b/gdb/testsuite/gdb.cp/virtfunc2.exp
index 761453f6227e..6d4b83e7ba42 100644
--- a/gdb/testsuite/gdb.cp/virtfunc2.exp
+++ b/gdb/testsuite/gdb.cp/virtfunc2.exp
@@ -23,11 +23,11 @@  require allow_cplus_tests
 load_lib "cp-support.exp"
 
 standard_testfile .cc
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
-    return -1
+    return
 }
 
 if {![runto_main]} {
     return
 }
diff --git a/gdb/testsuite/gdb.cp/vla-cxx.exp b/gdb/testsuite/gdb.cp/vla-cxx.exp
index 6fe42422c9fd..3e32cb96538e 100644
--- a/gdb/testsuite/gdb.cp/vla-cxx.exp
+++ b/gdb/testsuite/gdb.cp/vla-cxx.exp
@@ -18,15 +18,15 @@  standard_testfile .cc
 set flags {}
 lappend flags debug
 lappend flags c++
 
 if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} $flags] } {
-    return -1
+    return
 }
 
 if {![runto_main]} {
-    return -1
+    return
 }
 
 gdb_breakpoint [gdb_get_line_number "Before pointer assignment"]
 gdb_continue_to_breakpoint "Before pointer assignment"
 
diff --git a/gdb/testsuite/gdb.cp/watch-cp.exp b/gdb/testsuite/gdb.cp/watch-cp.exp
index 31a66864fe3a..906002b754f6 100644
--- a/gdb/testsuite/gdb.cp/watch-cp.exp
+++ b/gdb/testsuite/gdb.cp/watch-cp.exp
@@ -16,11 +16,11 @@ 
 require allow_cplus_tests allow_hw_watchpoint_tests
 
 standard_testfile .cc
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
-    return -1
+    return
 }
 
 if {![runto_main]} {
     return
 }