[v2,08/37] GDB: testsuite: riscv: Don't return value from top-level (manual)

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

Commit Message

Thiago Jung Bauermann April 29, 2026, 11:03 p.m. UTC
  This patch manually changes the "return -1" and "return 0" statements
that weren't caught by the sed command.

This happened only in one testcase due to the statements being inside a
foreach_with_prefix block, and in the others because the return
statement was in a misaligned line, which is now fixed.
---
 gdb/testsuite/gdb.arch/riscv-bp-infcall.exp       | 2 +-
 gdb/testsuite/gdb.arch/riscv-info-fcsr.exp        | 2 +-
 gdb/testsuite/gdb.arch/riscv-reg-aliases.exp      | 2 +-
 gdb/testsuite/gdb.arch/riscv-unwind-long-insn.exp | 4 ++--
 4 files changed, 5 insertions(+), 5 deletions(-)
  

Patch

diff --git a/gdb/testsuite/gdb.arch/riscv-bp-infcall.exp b/gdb/testsuite/gdb.arch/riscv-bp-infcall.exp
index 7d5e27debda6..9e67e303dacb 100644
--- a/gdb/testsuite/gdb.arch/riscv-bp-infcall.exp
+++ b/gdb/testsuite/gdb.arch/riscv-bp-infcall.exp
@@ -23,11 +23,11 @@  standard_testfile
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
     return
 }
 
 if {![runto_main]} {
-   return 0
+    return
 }
 
 # Figure out where the breakpoint will be placed taking account for
 # stack alignment, and allocation of the dummy code area.
 set bp_addr [get_valueof "/x" "\$sp" 0]
diff --git a/gdb/testsuite/gdb.arch/riscv-info-fcsr.exp b/gdb/testsuite/gdb.arch/riscv-info-fcsr.exp
index 930f1b24c4e7..df9aa97025b7 100644
--- a/gdb/testsuite/gdb.arch/riscv-info-fcsr.exp
+++ b/gdb/testsuite/gdb.arch/riscv-info-fcsr.exp
@@ -23,11 +23,11 @@  standard_testfile
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
     return
 }
 
 if {![runto_main]} {
-   return 0
+    return
 }
 
 # Merge FFLAGS_VALUE and FRM_VALUE into a single hexadecimal value
 # that can be written to the fcsr register.  The two arguments should
 # be the value of each of the two fields within the fcsr register.
diff --git a/gdb/testsuite/gdb.arch/riscv-reg-aliases.exp b/gdb/testsuite/gdb.arch/riscv-reg-aliases.exp
index 998f4f485d37..d1d98327403a 100644
--- a/gdb/testsuite/gdb.arch/riscv-reg-aliases.exp
+++ b/gdb/testsuite/gdb.arch/riscv-reg-aliases.exp
@@ -20,11 +20,11 @@  standard_testfile
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
     return
 }
 
 if {![runto_main]} {
-   return 0
+    return
 }
 
 
 # A list for all the integer register names and their aliases.  The format is
 # a list with each entry being itself a list, the first item being the primary
diff --git a/gdb/testsuite/gdb.arch/riscv-unwind-long-insn.exp b/gdb/testsuite/gdb.arch/riscv-unwind-long-insn.exp
index 7be5316bcfb0..b49d466b15f2 100644
--- a/gdb/testsuite/gdb.arch/riscv-unwind-long-insn.exp
+++ b/gdb/testsuite/gdb.arch/riscv-unwind-long-insn.exp
@@ -31,15 +31,15 @@  foreach_with_prefix {insn_size} {6 8} {
     set flags [list debug additional_flags=-DBAD_INSN_LEN=${insn_size}]
 
     set testfile "${testfile}-${insn_size}"
     if {[prepare_for_testing "failed to prepare" $testfile \
 	     "$srcfile $srcfile2" $flags]} {
-	return -1
+	return
     }
 
     if {![runto_main]} {
-	return 0
+	return
     }
 
     gdb_breakpoint "bar"
     gdb_continue_to_breakpoint "bar"