]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
GDB: testsuite: C++: Don't return value from top-level (manual)
authorThiago Jung Bauermann <thiago.bauermann@linaro.org>
Wed, 29 Apr 2026 23:04:08 +0000 (20:04 -0300)
committerThiago Jung Bauermann <thiago.bauermann@linaro.org>
Fri, 8 May 2026 21:55:59 +0000 (18:55 -0300)
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 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.

Approved-By: Tom Tromey <tom@tromey.com>
16 files changed:
gdb/testsuite/gdb.cp/anon-struct.exp
gdb/testsuite/gdb.cp/converts.exp
gdb/testsuite/gdb.cp/cp-relocate.exp
gdb/testsuite/gdb.cp/cpsizeof.exp
gdb/testsuite/gdb.cp/expand-psymtabs-cxx.exp
gdb/testsuite/gdb.cp/fpointer.exp
gdb/testsuite/gdb.cp/koenig.exp
gdb/testsuite/gdb.cp/method2.exp
gdb/testsuite/gdb.cp/nsnested.exp
gdb/testsuite/gdb.cp/nsnoimports.exp
gdb/testsuite/gdb.cp/oranking.exp
gdb/testsuite/gdb.cp/pr10728.exp
gdb/testsuite/gdb.cp/rvalue-ref-sizeof.exp
gdb/testsuite/gdb.cp/save-bp-qualified.exp
gdb/testsuite/gdb.cp/smartp.exp
gdb/testsuite/gdb.cp/static-print-quit.exp

index e420d75207fda913085c82b367bb5dbf84948bb5..10b7ce6c776621451630e07a6dc39316b4940cbc 100644 (file)
@@ -20,7 +20,7 @@
 standard_testfile .cc
 
 if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {debug c++}] } {
-     return -1
+    return
 }
 
 # Clang doesn't add any names for functions within anonymous structures,
index 7d26db9f3022dad3826f2923b573724593423e10..60a732f87ee00765d2233ff46012a29d064479ad 100644 (file)
@@ -16,7 +16,7 @@
 standard_testfile .cc
 
 if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {debug c++}] } {
-     return -1
+    return
 }
 
 ############################################
index c42c67a95e75d1766f7ae189b297f93a34d4b741..67a9f21b9646b5f457c86d9426f6c0d651dfbadf 100644 (file)
@@ -21,8 +21,8 @@ append binfile .o
 require allow_cplus_tests
 
 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" object {c++ debug}] != "" } {
-     untested "failed to compile"
-     return -1
+    untested "failed to compile"
+    return
 }
 
 proc get_func_address { func } {
@@ -67,7 +67,7 @@ gdb_test_multiple "info functions func<.>" "info functions" {
            pass "info functions"
        } else {
            fail "info functions"
-           return -1
+           return
        }
     }
 }
@@ -105,7 +105,7 @@ gdb_test_multiple "info file" "info file" {
            pass "info file"
        } else {
            fail "info file"
-           return -1
+           return
        }
     }
 }
index a43ae6431acf8f1526a8de9fe646a374c3b40d2d..23981185579115a833674199dd08d833bda16654 100644 (file)
@@ -19,7 +19,7 @@ standard_testfile .cc
 require allow_cplus_tests
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}] } {
-     return -1
+    return
 }
 
 if {![runto_main]} {
index 110970c89b8b7f2513e3825ecb4325c9e020fc17..e0d34c86a11d86f2fb08ec4ba7491e0574565516 100644 (file)
@@ -19,8 +19,8 @@ standard_testfile .cc
 set executable ${testfile}
 
 if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" object {debug c++} ] != "" } {
-     untested "failed to compile"
-     return -1
+    untested "failed to compile"
+    return
 }
 
 clean_restart ${executable}
index a97eef7e55b6a757baae9d8b87b8591325305d56..f4f69a0532d6162a01b22022aec35915249bbe2e 100644 (file)
@@ -19,7 +19,7 @@
 standard_testfile .cc
 
 if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {debug c++}] } {
-     return -1
+    return
 }
 
 if {![runto_main]} {
index 474c4a95b41e644af23cea721050af4debf551dd..4fd755ad7b7c935a2250ae2aa384d2d493a0dc85 100644 (file)
@@ -22,7 +22,7 @@ lappend opts additional_flags=-Wno-unused-comparison
 lappend opts additional_flags=-std=c++11
 
 if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} $opts] } {
-     return -1
+    return
 }
 
 ############################################
index 4eed2197c36ccb027e66d008b6a2393cb366187c..e64853ab7ae835c390a7cc9b5168bf905d466992 100644 (file)
@@ -23,7 +23,7 @@ require allow_cplus_tests
 standard_testfile .cc
 
 if  {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
-     return -1
+    return
 }
 
 if {![runto_main]} {
index 8c1cef585a8d73e111532d0d36eaa90bbc7d3fc6..11b326fa9b9cab929aa5b44904ed16e71e20d6ba 100644 (file)
@@ -16,7 +16,7 @@
 standard_testfile .cc
 
 if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {debug c++}] } {
-     return -1
+    return
 }
 
 ############################################
index 3077e447c2856dd35ab758b6e93492f8e3f4f099..7c9e70ac3bf14193953383024f8cc0481f5de501 100644 (file)
@@ -16,7 +16,7 @@
 standard_testfile .cc
 
 if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {debug c++}] } {
-     return -1
+    return
 }
 
 ############################################
index f7a2f463622768991a6be8a3a558501ff1f2fda0..1f418a96a7db79c2601ab0a99c903d5b23281758 100644 (file)
@@ -16,7 +16,7 @@
 standard_testfile .cc
 
 if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {debug c++}] } {
-     return -1
+    return
 }
 
 ############################################
index 0625d243bd8f1443e04e46f41427a94532d45e82..2560325ae7277722e3860cef74cdbdb177751778 100644 (file)
@@ -28,18 +28,18 @@ set tfx [standard_output_file pr10728-x.o]
 set tfy [standard_output_file pr10728-y.o]
 
 if  { [gdb_compile "${srcdir}/${subdir}/$srcfile2" "${tfy}.o" object {c++}] != "" } {
-     untested "failed to compile second object file"
-     return -1
+    untested "failed to compile second object file"
+    return
 }
 
 if  { [gdb_compile "${srcdir}/${subdir}/$srcfile" "${tfx}.o" object {debug c++}] != "" } {
-     untested "failed to compile first object file"
-     return -1
+    untested "failed to compile first object file"
+    return
 }
 
 if  { [gdb_compile "${tfx}.o ${tfy}.o" ${binfile} executable {debug c++}] != "" } {
-     untested "failed to compile"
-     return -1
+    untested "failed to compile"
+    return
 }
 
 clean_restart $::testfile
index a21485e215cb4e63d91d7ee6fad80bdb45f8a733..ed15018b37ffe8a203cacca8383701f65ba659b8 100644 (file)
@@ -22,7 +22,7 @@ require allow_cplus_tests
 
 if {[prepare_for_testing ${testfile}.exp $testfile $srcfile \
     {debug c++ additional_flags="-std=gnu++11"}] } {
-     return -1
+    return
 }
 
 if {![runto_main]} {
index a6851ba9662362199951516ea9d8ab487d8c60df..345290276628daf59ae6c4457e6ab25ffba8d2da 100644 (file)
@@ -38,7 +38,7 @@ proc restart {} {
 
 with_test_prefix "save" {
     if {![restart]} {
-       return -1
+       return
     }
 
     gdb_breakpoint "function" qualified
@@ -56,7 +56,7 @@ with_test_prefix "save" {
 
 with_test_prefix "restore" {
     if {![restart]} {
-       return -1
+       return
     }
 
     # Restore the breakpoints.
index 8a79f4385a9c603b4c0c68a1b7d5b0dd00e45615..4c04a465e475ddbfd4f8efa845f4771bec4f07b1 100644 (file)
@@ -16,7 +16,7 @@
 standard_testfile .cc
 
 if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {debug c++}] } {
-     return -1
+    return
 }
 
 ############################################
index 19756f64732e613030c15d742ca777f237204571..58f4f5283b305efeb334a2affa3c6c862c0b93d5 100644 (file)
@@ -34,7 +34,7 @@ gdb_test_multiple "print c" "" {
     -re "\r\n$pagination_prompt$" {
        # gdb-7.1 did not crash with this testcase but it had the same bug.
        untested "bug does not reproduce"
-       return 0
+       return
     }
 }