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

Message ID 20260429230432.60487-3-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" 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, aarch64-non-address-bits.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, save_vars or gdb_test_multiple blocks.
---
 gdb/testsuite/gdb.arch/aarch64-mte.exp                   | 6 +++---
 gdb/testsuite/gdb.arch/aarch64-non-address-bits.exp      | 2 +-
 gdb/testsuite/gdb.arch/aarch64-prologue.exp              | 2 +-
 gdb/testsuite/gdb.arch/arm-cmse-sgstubs.exp              | 2 +-
 gdb/testsuite/gdb.arch/arm-pthread_cond_timedwait-bt.exp | 2 +-
 gdb/testsuite/gdb.arch/thumb2-it.exp                     | 2 +-
 6 files changed, 8 insertions(+), 8 deletions(-)
  

Patch

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
@@ -276,11 +276,11 @@  with_test_prefix "print command" {
 	set ltag [get_ltag_from_ptr ${tagged_ptr_addr}]
     }
 
     if {$ltag == -1} {
 	unresolved "unexpected tag value"
-	return -1
+	return
     }
 
     set atag [expr {($ltag + 1) % 16}]
     set atag_hexnn [get_tag_nn $atag]
 
@@ -333,18 +333,18 @@  gdb_test "continue" \
 	 "display tag violation information"
 
 # 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.
     gdb_test "memory-tag set-allocation-tag tagged_ptr 1 05" \
 	     $atag_msg \
diff --git a/gdb/testsuite/gdb.arch/aarch64-non-address-bits.exp b/gdb/testsuite/gdb.arch/aarch64-non-address-bits.exp
index 8066b2035e1b..595dcb4f2ce1 100644
--- a/gdb/testsuite/gdb.arch/aarch64-non-address-bits.exp
+++ b/gdb/testsuite/gdb.arch/aarch64-non-address-bits.exp
@@ -54,11 +54,11 @@  gdb_test_multiple "ptype \$pauth_cmask" "fetch PAC cmask" {
     }
     -re -wrap "type = void" {
     }
     -re ".*$gdb_prompt $" {
 	fail $gdb_test_name
-	return 1
+	return
     }
 }
 
 # Value of the cmask register.
 set cmask 0
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
@@ -21,11 +21,11 @@  standard_testfile
 if { [prepare_for_testing "failed to prepare" $testfile $srcfile {nodebug}]} {
     return
 }
 
 if {![runto_main]} {
-   return -1
+    return
 }
 
 # Ensure gdb can break at excessiveprologue then continue.
 gdb_breakpoint "excessiveprologue"
 gdb_continue_to_breakpoint "excessiveprologue"
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
@@ -21,11 +21,11 @@  standard_testfile
 if { [prepare_for_testing "failed to prepare" $testfile $srcfile ]} {
     return
 }
 
 if {![runto_main]} {
-   return -1
+    return
 }
 
 gdb_test "si" "0x.*" "branch to func from main"
 
 gdb_test "ni" "0x.*" "next instruction in func"
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
@@ -32,11 +32,11 @@  if { [build_executable "failed to prepare" ${testfile} ${srcfile} \
 }
 
 save_vars { GDBFLAGS } {
     append GDBFLAGS " --readnever"
     if { [clean_restart $testfile] == -1 } {
-	return -1
+	return
     }
 }
 
 if { ![runto_main] } {
     return
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
@@ -33,11 +33,11 @@  if {![runto_main]} {
 # Make sure that the compiler options allow Thumb-2.
 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"
     }
 }