From: Thiago Jung Bauermann <thiago.bauermann@linaro.org>
To: gdb-patches@sourceware.org
Subject: [PATCH 17/36] GDB: testsuite: C++: Don't return -1 from top-level (manual)
Date: Mon, 27 Apr 2026 03:34:41 -0300 [thread overview]
Message-ID: <20260427063500.3847618-18-thiago.bauermann@linaro.org> (raw)
In-Reply-To: <20260427063500.3847618-1-thiago.bauermann@linaro.org>
This patch manually changes most "return -1" 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.
- procedure whose callers don't use the return value;
Some weren't changed because they didn't meet the criteria above, or
weren't trivial to check.
---
gdb/testsuite/gdb.cp/anon-struct.exp | 2 +-
gdb/testsuite/gdb.cp/break-f-std-string.exp | 2 +-
gdb/testsuite/gdb.cp/converts.exp | 2 +-
gdb/testsuite/gdb.cp/cp-relocate.exp | 8 ++++----
gdb/testsuite/gdb.cp/cpsizeof.exp | 2 +-
gdb/testsuite/gdb.cp/except-multi-location.exp | 4 ++--
gdb/testsuite/gdb.cp/expand-psymtabs-cxx.exp | 4 ++--
gdb/testsuite/gdb.cp/fpointer.exp | 2 +-
gdb/testsuite/gdb.cp/koenig.exp | 2 +-
gdb/testsuite/gdb.cp/local-static.exp | 2 +-
gdb/testsuite/gdb.cp/method2.exp | 2 +-
gdb/testsuite/gdb.cp/nsnested.exp | 2 +-
gdb/testsuite/gdb.cp/nsnoimports.exp | 2 +-
gdb/testsuite/gdb.cp/oranking.exp | 2 +-
gdb/testsuite/gdb.cp/pr10728.exp | 12 ++++++------
gdb/testsuite/gdb.cp/rvalue-ref-sizeof.exp | 2 +-
gdb/testsuite/gdb.cp/save-bp-qualified.exp | 4 ++--
gdb/testsuite/gdb.cp/smartp.exp | 2 +-
gdb/testsuite/gdb.cp/step-and-next-inline.exp | 2 +-
19 files changed, 30 insertions(+), 30 deletions(-)
diff --git a/gdb/testsuite/gdb.cp/anon-struct.exp b/gdb/testsuite/gdb.cp/anon-struct.exp
index e420d75207fd..10b7ce6c7766 100644
--- a/gdb/testsuite/gdb.cp/anon-struct.exp
+++ b/gdb/testsuite/gdb.cp/anon-struct.exp
@@ -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,
diff --git a/gdb/testsuite/gdb.cp/break-f-std-string.exp b/gdb/testsuite/gdb.cp/break-f-std-string.exp
index 330dfb24468f..4daca7ea0db0 100644
--- a/gdb/testsuite/gdb.cp/break-f-std-string.exp
+++ b/gdb/testsuite/gdb.cp/break-f-std-string.exp
@@ -71,7 +71,7 @@ proc test {cxx11_abi} {
"${srcdir}/${subdir}/${srcfile}" "${binfile}-${cxx11_abi}.o" \
object $options] != "" } {
untested "failed to compile"
- return -1
+ return
}
clean_restart ${testfile}-${cxx11_abi}.o
diff --git a/gdb/testsuite/gdb.cp/converts.exp b/gdb/testsuite/gdb.cp/converts.exp
index 7d26db9f3022..60a732f87ee0 100644
--- a/gdb/testsuite/gdb.cp/converts.exp
+++ b/gdb/testsuite/gdb.cp/converts.exp
@@ -16,7 +16,7 @@
standard_testfile .cc
if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {debug c++}] } {
- return -1
+ return
}
############################################
diff --git a/gdb/testsuite/gdb.cp/cp-relocate.exp b/gdb/testsuite/gdb.cp/cp-relocate.exp
index c42c67a95e75..67a9f21b9646 100644
--- a/gdb/testsuite/gdb.cp/cp-relocate.exp
+++ b/gdb/testsuite/gdb.cp/cp-relocate.exp
@@ -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
}
}
}
diff --git a/gdb/testsuite/gdb.cp/cpsizeof.exp b/gdb/testsuite/gdb.cp/cpsizeof.exp
index a43ae6431acf..239811855791 100644
--- a/gdb/testsuite/gdb.cp/cpsizeof.exp
+++ b/gdb/testsuite/gdb.cp/cpsizeof.exp
@@ -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]} {
diff --git a/gdb/testsuite/gdb.cp/except-multi-location.exp b/gdb/testsuite/gdb.cp/except-multi-location.exp
index 88a847b3ab72..52bc7c7dc964 100644
--- a/gdb/testsuite/gdb.cp/except-multi-location.exp
+++ b/gdb/testsuite/gdb.cp/except-multi-location.exp
@@ -49,7 +49,7 @@ proc test_multi_libstdcpp {static_bin static_lib} {
if { [gdb_compile_shlib ${srcfile_lib} ${binfile_lib} $lib_flags] != ""
|| [gdb_compile ${srcfile} ${binfile} executable $bin_flags] != "" } {
untested "failed to compile"
- return -1
+ return
}
clean_restart
@@ -58,7 +58,7 @@ proc test_multi_libstdcpp {static_bin static_lib} {
gdb_load_shlib $binfile_lib
if {![runto_main]} {
- return 0
+ return
}
gdb_test "catch catch" "Catchpoint ${::decimal} \\(catch\\)"
diff --git a/gdb/testsuite/gdb.cp/expand-psymtabs-cxx.exp b/gdb/testsuite/gdb.cp/expand-psymtabs-cxx.exp
index 110970c89b8b..e0d34c86a11d 100644
--- a/gdb/testsuite/gdb.cp/expand-psymtabs-cxx.exp
+++ b/gdb/testsuite/gdb.cp/expand-psymtabs-cxx.exp
@@ -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}
diff --git a/gdb/testsuite/gdb.cp/fpointer.exp b/gdb/testsuite/gdb.cp/fpointer.exp
index a97eef7e55b6..f4f69a0532d6 100644
--- a/gdb/testsuite/gdb.cp/fpointer.exp
+++ b/gdb/testsuite/gdb.cp/fpointer.exp
@@ -19,7 +19,7 @@
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/koenig.exp b/gdb/testsuite/gdb.cp/koenig.exp
index 474c4a95b41e..4fd755ad7b7c 100644
--- a/gdb/testsuite/gdb.cp/koenig.exp
+++ b/gdb/testsuite/gdb.cp/koenig.exp
@@ -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
}
############################################
diff --git a/gdb/testsuite/gdb.cp/local-static.exp b/gdb/testsuite/gdb.cp/local-static.exp
index a60412856b1f..9b33dc53ba0b 100644
--- a/gdb/testsuite/gdb.cp/local-static.exp
+++ b/gdb/testsuite/gdb.cp/local-static.exp
@@ -148,7 +148,7 @@ proc do_test {lang} {
if {[prepare_for_testing "failed to prepare" $testfile-$lang \
[list $src] $options]} {
- return -1
+ return
}
if {![runto_main]} {
diff --git a/gdb/testsuite/gdb.cp/method2.exp b/gdb/testsuite/gdb.cp/method2.exp
index 4eed2197c36c..e64853ab7ae8 100644
--- a/gdb/testsuite/gdb.cp/method2.exp
+++ b/gdb/testsuite/gdb.cp/method2.exp
@@ -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]} {
diff --git a/gdb/testsuite/gdb.cp/nsnested.exp b/gdb/testsuite/gdb.cp/nsnested.exp
index 8c1cef585a8d..11b326fa9b9c 100644
--- a/gdb/testsuite/gdb.cp/nsnested.exp
+++ b/gdb/testsuite/gdb.cp/nsnested.exp
@@ -16,7 +16,7 @@
standard_testfile .cc
if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {debug c++}] } {
- return -1
+ return
}
############################################
diff --git a/gdb/testsuite/gdb.cp/nsnoimports.exp b/gdb/testsuite/gdb.cp/nsnoimports.exp
index 3077e447c285..7c9e70ac3bf1 100644
--- a/gdb/testsuite/gdb.cp/nsnoimports.exp
+++ b/gdb/testsuite/gdb.cp/nsnoimports.exp
@@ -16,7 +16,7 @@
standard_testfile .cc
if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {debug c++}] } {
- return -1
+ return
}
############################################
diff --git a/gdb/testsuite/gdb.cp/oranking.exp b/gdb/testsuite/gdb.cp/oranking.exp
index f7a2f4636227..1f418a96a7db 100644
--- a/gdb/testsuite/gdb.cp/oranking.exp
+++ b/gdb/testsuite/gdb.cp/oranking.exp
@@ -16,7 +16,7 @@
standard_testfile .cc
if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {debug c++}] } {
- return -1
+ return
}
############################################
diff --git a/gdb/testsuite/gdb.cp/pr10728.exp b/gdb/testsuite/gdb.cp/pr10728.exp
index 0625d243bd8f..2560325ae727 100644
--- a/gdb/testsuite/gdb.cp/pr10728.exp
+++ b/gdb/testsuite/gdb.cp/pr10728.exp
@@ -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
diff --git a/gdb/testsuite/gdb.cp/rvalue-ref-sizeof.exp b/gdb/testsuite/gdb.cp/rvalue-ref-sizeof.exp
index a21485e215cb..ed15018b37ff 100644
--- a/gdb/testsuite/gdb.cp/rvalue-ref-sizeof.exp
+++ b/gdb/testsuite/gdb.cp/rvalue-ref-sizeof.exp
@@ -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]} {
diff --git a/gdb/testsuite/gdb.cp/save-bp-qualified.exp b/gdb/testsuite/gdb.cp/save-bp-qualified.exp
index a6851ba96623..345290276628 100644
--- a/gdb/testsuite/gdb.cp/save-bp-qualified.exp
+++ b/gdb/testsuite/gdb.cp/save-bp-qualified.exp
@@ -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.
diff --git a/gdb/testsuite/gdb.cp/smartp.exp b/gdb/testsuite/gdb.cp/smartp.exp
index 8a79f4385a9c..4c04a465e475 100644
--- a/gdb/testsuite/gdb.cp/smartp.exp
+++ b/gdb/testsuite/gdb.cp/smartp.exp
@@ -16,7 +16,7 @@
standard_testfile .cc
if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {debug c++}] } {
- return -1
+ return
}
############################################
diff --git a/gdb/testsuite/gdb.cp/step-and-next-inline.exp b/gdb/testsuite/gdb.cp/step-and-next-inline.exp
index e8bb998231b4..d57cbc5a5b47 100644
--- a/gdb/testsuite/gdb.cp/step-and-next-inline.exp
+++ b/gdb/testsuite/gdb.cp/step-and-next-inline.exp
@@ -41,7 +41,7 @@ proc do_test { use_header } {
if { [prepare_for_testing "failed to prepare" $executable \
$srcfile $options] } {
- return -1
+ return
}
with_test_prefix $prefix {
next prev parent reply other threads:[~2026-04-27 6:38 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-27 6:34 [PATCH 00/36] GDB: testsuite: Fix top-level returns Thiago Jung Bauermann
2026-04-27 6:34 ` [PATCH 01/36] GDB: testsuite: aarch64, arm: Don't return -1 from top-level (sed) Thiago Jung Bauermann
2026-04-27 6:34 ` [PATCH 02/36] GDB: testsuite: aarch64, arm: Don't return -1 from top-level (manual) Thiago Jung Bauermann
2026-04-27 6:34 ` [PATCH 03/36] GDB: testsuite: intel: Don't return -1 from top-level (sed) Thiago Jung Bauermann
2026-04-28 15:54 ` Schimpe, Christina
2026-04-28 16:42 ` Schimpe, Christina
2026-04-27 6:34 ` [PATCH 04/36] GDB: testsuite: intel: Don't return -1 from top-level (manual) Thiago Jung Bauermann
2026-04-28 16:39 ` Schimpe, Christina
2026-04-28 21:48 ` Thiago Jung Bauermann
2026-04-27 6:34 ` [PATCH 05/36] GDB: testsuite: powerpc: Don't return -1 from top-level (sed) Thiago Jung Bauermann
2026-04-27 6:34 ` [PATCH 06/36] GDB: testsuite: powerpc: Don't return -1 from top-level (manual) Thiago Jung Bauermann
2026-04-27 6:34 ` [PATCH 07/36] GDB: testsuite: riscv: Don't return -1 from top-level (sed) Thiago Jung Bauermann
2026-04-27 6:34 ` [PATCH 08/36] GDB: testsuite: riscv: Don't return -1 from top-level (manual) Thiago Jung Bauermann
2026-04-27 6:34 ` [PATCH 09/36] GDB: testsuite: s390: Don't return -1 from top-level (sed) Thiago Jung Bauermann
2026-04-27 6:34 ` [PATCH 10/36] GDB: testsuite: sparc: " Thiago Jung Bauermann
2026-04-27 6:34 ` [PATCH 11/36] GDB: testsuite: Don't return -1 from top-level in tests of various arches Thiago Jung Bauermann
2026-04-27 6:34 ` [PATCH 12/36] GDB: testsuite: Don't return -1 from top-level in multi-arch tests Thiago Jung Bauermann
2026-04-27 6:34 ` [PATCH 13/36] GDB: testsuite: base: Don't return -1 from top-level (sed) Thiago Jung Bauermann
2026-04-27 6:34 ` [PATCH 14/36] GDB: testsuite: base: Don't return 0 " Thiago Jung Bauermann
2026-04-27 6:34 ` [PATCH 15/36] GDB: testsuite: base: Don't return -1 from top-level (manual) Thiago Jung Bauermann
2026-04-27 6:34 ` [PATCH 16/36] GDB: testsuite: C++: Don't return -1 from top-level (sed) Thiago Jung Bauermann
2026-04-27 6:34 ` Thiago Jung Bauermann [this message]
2026-04-27 6:34 ` [PATCH 18/36] GDB: testsuite: DWARF: " Thiago Jung Bauermann
2026-04-27 6:34 ` [PATCH 19/36] GDB: testsuite: DWARF: Don't return -1 from top-level (manual) Thiago Jung Bauermann
2026-04-27 6:34 ` [PATCH 20/36] GDB: testsuite: GDB: Don't return -1 from top-level Thiago Jung Bauermann
2026-04-27 6:34 ` [PATCH 21/36] GDB: testsuite: Guile: " Thiago Jung Bauermann
2026-04-27 6:34 ` [PATCH 22/36] GDB: testsuite: Python: Don't return -1 from top-level (sed) Thiago Jung Bauermann
2026-04-27 6:34 ` [PATCH 23/36] GDB: testsuite: Python: Don't return -1 from top-level (manual) Thiago Jung Bauermann
2026-04-27 6:34 ` [PATCH 24/36] GDB: testsuite: linespec: Don't return -1 from top-level Thiago Jung Bauermann
2026-04-27 6:34 ` [PATCH 25/36] GDB: testsuite: MI: Don't return -1 from top-level (sed) Thiago Jung Bauermann
2026-04-27 6:34 ` [PATCH 26/36] GDB: testsuite: MI: Don't return -1 from top-level (manual) Thiago Jung Bauermann
2026-04-27 6:34 ` [PATCH 27/36] GDB: testsuite: reverse: Don't return -1 from top-level (sed) Thiago Jung Bauermann
2026-04-27 6:34 ` [PATCH 28/36] GDB: testsuite: reverse: Don't return -1 from top-level (manual) Thiago Jung Bauermann
2026-04-27 6:34 ` [PATCH 29/36] GDB: testsuite: server: Don't return -1 from top-level (sed) Thiago Jung Bauermann
2026-04-27 6:34 ` [PATCH 30/36] GDB: testsuite: server: Don't return -1 from top-level (manual) Thiago Jung Bauermann
2026-04-27 6:34 ` [PATCH 31/36] GDB: testsuite: threads: Don't return -1 from top-level (sed) Thiago Jung Bauermann
2026-04-27 6:34 ` [PATCH 32/36] GDB: testsuite: threads: Don't return 0 " Thiago Jung Bauermann
2026-04-27 6:34 ` [PATCH 33/36] GDB: testsuite: threads: Don't return -1 from top-level (manual) Thiago Jung Bauermann
2026-04-27 6:34 ` [PATCH 34/36] GDB: testsuite: TUI: Don't return -1 from top-level (sed) Thiago Jung Bauermann
2026-04-27 6:34 ` [PATCH 35/36] GDB: testsuite: TUI: Don't return 0 from top-level (manual) Thiago Jung Bauermann
2026-04-27 6:35 ` [PATCH 36/36] GDB: testsuite: XML: Don't return -1 nor 0 from top-level Thiago Jung Bauermann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260427063500.3847618-18-thiago.bauermann@linaro.org \
--to=thiago.bauermann@linaro.org \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox