[v2,12/37] GDB: testsuite: Don't return value from top-level in multi-arch tests

Message ID 20260429230432.60487-13-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
  Oddly enough, there are multi-arch arch tests.  This patch contains
fixes for them.

Some changes are the result of running:

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

inside gdb/testsuite/gdb.arch and the others are manual changes.
---
 gdb/testsuite/gdb.arch/disp-step-insn-reloc.exp |  6 +++---
 gdb/testsuite/gdb.arch/ftrace-insn-reloc.exp    | 14 +++++++-------
 gdb/testsuite/gdb.arch/skip-prologue.exp        |  2 +-
 3 files changed, 11 insertions(+), 11 deletions(-)
  

Patch

diff --git a/gdb/testsuite/gdb.arch/disp-step-insn-reloc.exp b/gdb/testsuite/gdb.arch/disp-step-insn-reloc.exp
index 7d26244129ce..87440a1b28e8 100644
--- a/gdb/testsuite/gdb.arch/disp-step-insn-reloc.exp
+++ b/gdb/testsuite/gdb.arch/disp-step-insn-reloc.exp
@@ -21,15 +21,15 @@  require support_displaced_stepping
 # Some targets have leading underscores on assembly symbols.
 set additional_flags [gdb_target_symbol_prefix_flags]
 
 if {[prepare_for_testing "failed to prepare" $executable $srcfile \
 	 [list debug $additional_flags]]} {
-    return -1
+    return
 }
 
 if {![runto_main]} {
-    return -1
+    return
 }
 
 # Read function name from testcases[N].
 
 proc read_testcase { n } {
@@ -47,11 +47,11 @@  proc read_testcase { n } {
 }
 
 set n_testcases [get_integer_valueof "n_testcases" 0]
 if { ${n_testcases} == 0 } {
     untested "no instruction relocation to test"
-    return 1
+    return
 }
 
 # Set a fast tracepoint on each set_point${i} symbol.  There is one for
 # each testcase.
 for { set i 0 } { ${i} < ${n_testcases} } { incr i } {
diff --git a/gdb/testsuite/gdb.arch/ftrace-insn-reloc.exp b/gdb/testsuite/gdb.arch/ftrace-insn-reloc.exp
index 0846e0365d42..06eb5a691bdf 100644
--- a/gdb/testsuite/gdb.arch/ftrace-insn-reloc.exp
+++ b/gdb/testsuite/gdb.arch/ftrace-insn-reloc.exp
@@ -19,20 +19,20 @@  standard_testfile insn-reloc.c
 # Some targets have leading underscores on assembly symbols.
 set additional_flags [gdb_target_symbol_prefix_flags]
 
 if {[prepare_for_testing "failed to prepare" $testfile-no-ipa $srcfile \
 	 [list debug $additional_flags]]} {
-    return -1
+    return
 }
 
 if {![runto_main]} {
-    return -1
+    return
 }
 
 if {![gdb_target_supports_trace]} {
     unsupported "target does not support trace"
-    return -1
+    return
 }
 
 require allow_in_proc_agent
 set libipa [get_in_proc_agent]
 
@@ -41,24 +41,24 @@  set libipa [get_in_proc_agent]
 # file unused because linking not done" when building the object.
 
 if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
 	  executable [list debug $additional_flags shlib=$libipa] ] != "" } {
     untested "failed to compile"
-    return -1
+    return
 }
 clean_restart $testfile
 set remote_libipa [gdb_load_shlib $libipa]
 
 if {![runto_main]} {
-    return 0
+    return
 }
 
 gdb_reinitialize_dir $srcdir/$subdir
 
 if { [gdb_test "info sharedlibrary" ".*[file tail $libipa].*" "IPA loaded"] != 0 } {
     untested "could not find IPA lib loaded"
-    return 1
+    return
 }
 
 # Read function name from testcases[N].
 
 proc read_testcase { n } {
@@ -77,11 +77,11 @@  proc read_testcase { n } {
 
 set n_testcases [gdb_readexpr "n_testcases"]
 
 if { ${n_testcases} == 0 } {
     untested "no instruction relocation to test"
-    return 1
+    return
 }
 
 # Set a fast tracepoint on each set_point${i} symbol.  There is one for
 # each testcase.
 for { set i 0 } { ${i} < ${n_testcases} } { incr i } {
diff --git a/gdb/testsuite/gdb.arch/skip-prologue.exp b/gdb/testsuite/gdb.arch/skip-prologue.exp
index c805356d8746..c53f86250c84 100644
--- a/gdb/testsuite/gdb.arch/skip-prologue.exp
+++ b/gdb/testsuite/gdb.arch/skip-prologue.exp
@@ -17,11 +17,11 @@ 
 
 standard_testfile
 
 if { [prepare_for_testing "failed to prepare"  $testfile $srcfile \
 	  {nodebug}] } {
-    return -1
+    return
 }
 
 proc do_test { f } {
     set bp_addr ""
     gdb_test_multiple "break $f" "" {