From: Thiago Jung Bauermann <thiago.bauermann@linaro.org>
To: gdb-patches@sourceware.org
Subject: [PATCH 02/36] GDB: testsuite: aarch64, arm: Don't return -1 from top-level (manual)
Date: Mon, 27 Apr 2026 03:34:26 -0300 [thread overview]
Message-ID: <20260427063500.3847618-3-thiago.bauermann@linaro.org> (raw)
In-Reply-To: <20260427063500.3847618-1-thiago.bauermann@linaro.org>
This patch manually changes the "return -1" statements that weren't
caught by the sed command.
In aarch64-prologue.exp and arm-cmse-sgstubs.exp, this was caused by a
misaligned line, which is now fixed.
In aarch64-mte.exp, arm-pthread_cond_timedwait-bt.exp and thumb2-it.exp
this is because the return statements have extra indentation due to
being inside with_test_prefix or save_vars blocks.
In the case of pr25124.exp it's because the file didn't match the glob
pattern of the sed command.
In the other testcases, the return statements are in procedures whose
callers don't use the return value. In some of those, that return value
would have "bubbled up" as the top level return value.
There's also a top-level "return 0" fixed in iwmmxt-regs.exp.
---
gdb/testsuite/gdb.arch/aarch64-fpmr-core.exp | 2 +-
gdb/testsuite/gdb.arch/aarch64-gcs-core.exp | 2 +-
gdb/testsuite/gdb.arch/aarch64-mte-core.exp | 6 +++---
gdb/testsuite/gdb.arch/aarch64-mte.exp | 6 +++---
gdb/testsuite/gdb.arch/aarch64-prologue.exp | 2 +-
gdb/testsuite/gdb.arch/aarch64-sme-core.exp.tcl | 8 ++++----
.../gdb.arch/aarch64-sme-regs-available.exp.tcl | 10 +++++-----
.../gdb.arch/aarch64-sme-regs-sigframe.exp.tcl | 8 ++++----
.../gdb.arch/aarch64-sme-regs-unavailable.exp.tcl | 8 ++++----
gdb/testsuite/gdb.arch/arm-cmse-sgstubs.exp | 2 +-
.../gdb.arch/arm-pthread_cond_timedwait-bt.exp | 2 +-
gdb/testsuite/gdb.arch/iwmmxt-regs.exp | 2 +-
gdb/testsuite/gdb.arch/pr25124.exp | 2 +-
gdb/testsuite/gdb.arch/thumb2-it.exp | 2 +-
14 files changed, 31 insertions(+), 31 deletions(-)
diff --git a/gdb/testsuite/gdb.arch/aarch64-fpmr-core.exp b/gdb/testsuite/gdb.arch/aarch64-fpmr-core.exp
index 81ebd4892aa9..030f9f9b55e8 100644
--- a/gdb/testsuite/gdb.arch/aarch64-fpmr-core.exp
+++ b/gdb/testsuite/gdb.arch/aarch64-fpmr-core.exp
@@ -29,7 +29,7 @@ proc check_fpmr_core_file {core_filename} {
"load core file"]
} {
untested "failed to generate core file"
- return -1
+ return
}
# Check the value of FPMR in the core file.
diff --git a/gdb/testsuite/gdb.arch/aarch64-gcs-core.exp b/gdb/testsuite/gdb.arch/aarch64-gcs-core.exp
index 30a620ed06b3..808fb943fdfb 100644
--- a/gdb/testsuite/gdb.arch/aarch64-gcs-core.exp
+++ b/gdb/testsuite/gdb.arch/aarch64-gcs-core.exp
@@ -48,7 +48,7 @@ proc check_core_file {core_filename saved_gcspr} {
"#0 function \\(gcspr=$hex\\) at .*aarch64-gcs-core.c:$decimal" \
"$decimal.*__asm__ volatile \\(\"ret\\\\n\"\\);"] \
"load core file"]} {
- return -1
+ return
}
# Check the value of GCSPR in the core file.
diff --git a/gdb/testsuite/gdb.arch/aarch64-mte-core.exp b/gdb/testsuite/gdb.arch/aarch64-mte-core.exp
index 1d570a9497a2..92ffb6f1be64 100644
--- a/gdb/testsuite/gdb.arch/aarch64-mte-core.exp
+++ b/gdb/testsuite/gdb.arch/aarch64-mte-core.exp
@@ -94,20 +94,20 @@ proc test_mode { mode } {
standard_testfile
set executable "${::testfile}-${mode}"
if {[prepare_for_testing "failed to prepare" ${executable} ${::srcfile} ${compile_flags}]} {
- return -1
+ return
}
set binfile [standard_output_file ${executable}]
if {![runto_main]} {
untested "could not run to main"
- return -1
+ return
}
# Targets that don't support memory tagging should not execute the
# runtime memory tagging tests.
if {![supports_memtag]} {
unsupported "memory tagging unsupported"
- return -1
+ return
}
# Run until a crash and confirm GDB displays memory tag violation
diff --git a/gdb/testsuite/gdb.arch/aarch64-mte.exp b/gdb/testsuite/gdb.arch/aarch64-mte.exp
index 4826041e330a..72d4bba72531 100644
--- a/gdb/testsuite/gdb.arch/aarch64-mte.exp
+++ b/gdb/testsuite/gdb.arch/aarch64-mte.exp
@@ -278,7 +278,7 @@ with_test_prefix "print command" {
if {$ltag == -1} {
unresolved "unexpected tag value"
- return -1
+ return
}
set atag [expr {($ltag + 1) % 16}]
@@ -335,14 +335,14 @@ gdb_test "continue" \
# Restart to execute the async tag fault test.
with_test_prefix "async" {
if {![runto_main]} {
- return -1
+ return
}
gdb_breakpoint "access_memory"
if {[gdb_continue "access_memory"]} {
fail "could not run to tagged memory test function"
- return -1
+ return
}
# Force a tag fault.
diff --git a/gdb/testsuite/gdb.arch/aarch64-prologue.exp b/gdb/testsuite/gdb.arch/aarch64-prologue.exp
index c6fe2e262a5e..509fd31e8b4f 100644
--- a/gdb/testsuite/gdb.arch/aarch64-prologue.exp
+++ b/gdb/testsuite/gdb.arch/aarch64-prologue.exp
@@ -23,7 +23,7 @@ if { [prepare_for_testing "failed to prepare" $testfile $srcfile {nodebug}]} {
}
if {![runto_main]} {
- return -1
+ return
}
# Ensure gdb can break at excessiveprologue then continue.
diff --git a/gdb/testsuite/gdb.arch/aarch64-sme-core.exp.tcl b/gdb/testsuite/gdb.arch/aarch64-sme-core.exp.tcl
index 0727d7055502..ea53716e144f 100644
--- a/gdb/testsuite/gdb.arch/aarch64-sme-core.exp.tcl
+++ b/gdb/testsuite/gdb.arch/aarch64-sme-core.exp.tcl
@@ -33,7 +33,7 @@ proc check_sme_core_file { core_filename state vl svl } {
".*p = 0xff;.* crash point .*"] \
"load core file"]} {
untested "failed to generate core file"
- return -1
+ return
}
check_state $state $vl $svl
@@ -127,7 +127,7 @@ proc test_sme_core_file { id_start id_end } {
standard_testfile ${::srcdir}/${::subdir}/aarch64-sme-core.c
set executable "${::testfile}"
if {[prepare_for_testing "failed to prepare" ${executable} ${::srcfile} ${compile_flags}]} {
- return -1
+ return
}
set binfile [standard_output_file ${executable}]
@@ -166,12 +166,12 @@ proc test_sme_core_file { id_start id_end } {
# lifted, we can remove this guard.
if {[gdb_protocol_is_remote]} {
unsupported "aarch64 sve/sme tests not supported for remote targets"
- return -1
+ return
}
if {![runto_main]} {
untested "could not run to main"
- return -1
+ return
}
generate_sme_core_files ${executable} ${binfile} $id $state $vl $svl
diff --git a/gdb/testsuite/gdb.arch/aarch64-sme-regs-available.exp.tcl b/gdb/testsuite/gdb.arch/aarch64-sme-regs-available.exp.tcl
index 32805466e8a7..926583e0b5e4 100644
--- a/gdb/testsuite/gdb.arch/aarch64-sme-regs-available.exp.tcl
+++ b/gdb/testsuite/gdb.arch/aarch64-sme-regs-available.exp.tcl
@@ -52,7 +52,7 @@ proc check_regs { mode vl svl } {
# Check SVCR.
if {[gdb_test "print \$svcr" $za_state "svcr before assignments" ]} {
fail "incorrect za state"
- return -1
+ return
}
# Check the size of ZA.
@@ -85,7 +85,7 @@ proc check_regs { mode vl svl } {
# Make sure we have ZA state.
if {[gdb_test "print \$svcr" $za_state "svcr after assignment to ${register_name}" ]} {
fail "incorrect za state"
- return -1
+ return
}
set pattern [string_to_regexp [2d_array_value_pattern 255 $tile_svl $tile_svl]]
@@ -116,7 +116,7 @@ proc check_regs { mode vl svl } {
# Make sure we have ZA state.
if {[gdb_test "print \$svcr" $za_state "svcr after assignment of ${register_name}" ]} {
fail "incorrect za state"
- return -1
+ return
}
set pattern [string_to_regexp [1d_array_value_pattern 255 $num_elements]]
@@ -159,13 +159,13 @@ proc test_sme_registers_available { id_start id_end } {
standard_testfile ${::srcdir}/${::subdir}/aarch64-sme-regs-available.c
set executable "${::testfile}-${id_start}-${id_end}"
if {[prepare_for_testing "failed to prepare" ${executable} ${::srcfile} ${compile_flags}]} {
- return -1
+ return
}
set binfile [standard_output_file ${executable}]
if {![runto_main]} {
untested "could not run to main"
- return -1
+ return
}
gdb_test_no_output "set print repeats 1"
diff --git a/gdb/testsuite/gdb.arch/aarch64-sme-regs-sigframe.exp.tcl b/gdb/testsuite/gdb.arch/aarch64-sme-regs-sigframe.exp.tcl
index d83a1cbcf315..e550a17a133d 100644
--- a/gdb/testsuite/gdb.arch/aarch64-sme-regs-sigframe.exp.tcl
+++ b/gdb/testsuite/gdb.arch/aarch64-sme-regs-sigframe.exp.tcl
@@ -38,13 +38,13 @@ proc test_sme_registers_sigframe { id_start id_end } {
standard_testfile ${::srcdir}/${::subdir}/aarch64-sme-regs-sigframe.c
set executable "${::testfile}-${id_start}-${id_end}"
if {[prepare_for_testing "failed to prepare" ${executable} ${::srcfile} ${compile_flags}]} {
- return -1
+ return
}
set binfile [standard_output_file ${executable}]
if {![runto_main]} {
untested "could not run to main"
- return -1
+ return
}
set sigill_breakpoint "stop before SIGILL"
@@ -84,7 +84,7 @@ proc test_sme_registers_sigframe { id_start id_end } {
# Run the program until it has adjusted the svl.
if {[gdb_continue_to_breakpoint $sigill_breakpoint]} {
- return -1
+ return
}
# Check SVG to make sure it is correct
@@ -142,7 +142,7 @@ proc test_sme_registers_sigframe { id_start id_end } {
gdb_test_no_output "set \$pc=\$pc+4"
# Continue to the signal handler.
if {[gdb_continue_to_breakpoint $handler_breakpoint]} {
- return -1
+ return
}
# Modify TPIDR2 so it is different from its value past the signal
diff --git a/gdb/testsuite/gdb.arch/aarch64-sme-regs-unavailable.exp.tcl b/gdb/testsuite/gdb.arch/aarch64-sme-regs-unavailable.exp.tcl
index 5f2647f276d7..716c6a5c5718 100644
--- a/gdb/testsuite/gdb.arch/aarch64-sme-regs-unavailable.exp.tcl
+++ b/gdb/testsuite/gdb.arch/aarch64-sme-regs-unavailable.exp.tcl
@@ -36,7 +36,7 @@ proc_with_prefix check_regs { vl svl } {
# Make sure there is no SM or ZA state.
if {[gdb_test "print \$svcr" "= \\\[ \\\]"]} {
fail "incorrect ZA state"
- return -1
+ return
}
# Check the size of ZA.
@@ -116,7 +116,7 @@ proc test_sme_registers_unavailable { id_start id_end } {
standard_testfile ${::srcdir}/${::subdir}/aarch64-sme-regs-unavailable.c
set executable "${::testfile}-${id_start}-${id_end}"
if {[prepare_for_testing "failed to prepare" ${executable} ${::srcfile} ${compile_flags}]} {
- return -1
+ return
}
set binfile [standard_output_file ${executable}]
@@ -125,12 +125,12 @@ proc test_sme_registers_unavailable { id_start id_end } {
# via the RSP. When this restriction is lifted, we can remove this guard.
if {[gdb_protocol_is_remote]} {
unsupported "aarch64 sve/sme tests not supported for remote targets"
- return -1
+ return
}
if {![runto_main]} {
untested "could not run to main"
- return -1
+ return
}
gdb_test_no_output "set print repeats 1"
diff --git a/gdb/testsuite/gdb.arch/arm-cmse-sgstubs.exp b/gdb/testsuite/gdb.arch/arm-cmse-sgstubs.exp
index c2ecaffd1d2c..188ee1a913c4 100644
--- a/gdb/testsuite/gdb.arch/arm-cmse-sgstubs.exp
+++ b/gdb/testsuite/gdb.arch/arm-cmse-sgstubs.exp
@@ -23,7 +23,7 @@ if { [prepare_for_testing "failed to prepare" $testfile $srcfile ]} {
}
if {![runto_main]} {
- return -1
+ return
}
gdb_test "si" "0x.*" "branch to func from main"
diff --git a/gdb/testsuite/gdb.arch/arm-pthread_cond_timedwait-bt.exp b/gdb/testsuite/gdb.arch/arm-pthread_cond_timedwait-bt.exp
index 85ca6e78210f..02ae70095170 100644
--- a/gdb/testsuite/gdb.arch/arm-pthread_cond_timedwait-bt.exp
+++ b/gdb/testsuite/gdb.arch/arm-pthread_cond_timedwait-bt.exp
@@ -34,7 +34,7 @@ if { [build_executable "failed to prepare" ${testfile} ${srcfile} \
save_vars { GDBFLAGS } {
append GDBFLAGS " --readnever"
if { [clean_restart $testfile] == -1 } {
- return -1
+ return
}
}
diff --git a/gdb/testsuite/gdb.arch/iwmmxt-regs.exp b/gdb/testsuite/gdb.arch/iwmmxt-regs.exp
index 6c1848593b21..5317c9bfae35 100644
--- a/gdb/testsuite/gdb.arch/iwmmxt-regs.exp
+++ b/gdb/testsuite/gdb.arch/iwmmxt-regs.exp
@@ -38,7 +38,7 @@ gdb_load ${binfile}
#
if {![runto_main]} {
- return 0
+ return
}
# Set all the registers to arbitrary values.
diff --git a/gdb/testsuite/gdb.arch/pr25124.exp b/gdb/testsuite/gdb.arch/pr25124.exp
index 6086790bc568..b543812a50a4 100644
--- a/gdb/testsuite/gdb.arch/pr25124.exp
+++ b/gdb/testsuite/gdb.arch/pr25124.exp
@@ -22,7 +22,7 @@ standard_testfile .S
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable debug] != "" } {
untested "failed to compile"
- return -1
+ return
}
clean_restart $testfile
diff --git a/gdb/testsuite/gdb.arch/thumb2-it.exp b/gdb/testsuite/gdb.arch/thumb2-it.exp
index 0c9246b2131e..9ffcc6e1e3b9 100644
--- a/gdb/testsuite/gdb.arch/thumb2-it.exp
+++ b/gdb/testsuite/gdb.arch/thumb2-it.exp
@@ -35,7 +35,7 @@ gdb_test_multiple "list" "list main" {
-re ".*@ No Thumb-2.*$gdb_prompt $" {
pass "list main"
untested "skipping tests due to lack of Thumb-2"
- return -1
+ return
}
-re ".*@ Thumb-2 OK.*$gdb_prompt $" {
pass "list main"
next prev parent reply other threads:[~2026-04-27 6:35 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 ` Thiago Jung Bauermann [this message]
2026-04-27 6:34 ` [PATCH 03/36] GDB: testsuite: intel: " 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 ` [PATCH 17/36] GDB: testsuite: C++: Don't return -1 from top-level (manual) Thiago Jung Bauermann
2026-04-27 6:34 ` [PATCH 18/36] GDB: testsuite: DWARF: Don't return -1 from top-level (sed) 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-3-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