The canonical form of 'if' in modern TCL is 'if {} {}'. But there's
still a bunch of places in the testsuite where we make use of the
'then' keyword, and sometimes these get copies into new tests, which
just spreads poor practice.
This commit removes all use of the 'then' keyword from the gdb.multi/
test script directory.
There should be no changes in what is tested after this commit.
---
gdb/testsuite/gdb.multi/base.exp | 8 ++++----
gdb/testsuite/gdb.multi/bkpt-multi-exec.exp | 4 ++--
gdb/testsuite/gdb.multi/dummy-frame-restore.exp | 4 ++--
gdb/testsuite/gdb.multi/info-threads.exp | 2 +-
gdb/testsuite/gdb.multi/multi-arch-exec.exp | 2 +-
gdb/testsuite/gdb.multi/multi-arch.exp | 4 ++--
gdb/testsuite/gdb.multi/multi-re-run.exp | 2 +-
gdb/testsuite/gdb.multi/tids-gid-reset.exp | 8 ++++----
gdb/testsuite/gdb.multi/tids.exp | 2 +-
9 files changed, 18 insertions(+), 18 deletions(-)
@@ -85,7 +85,7 @@ gdb_test_multiple "info inferior 2 3" "info inferior 2 3" {
exp_continue
}
-re "$gdb_prompt $" {
- if { !$see1 && $see2 && $see3 } then {
+ if {!$see1 && $see2 && $see3} {
pass "info inferior 2 3"
} else {
fail "info inferior 2 3"
@@ -111,7 +111,7 @@ gdb_test_multiple "info inferior 1-2" "info inferior 1-2" {
exp_continue
}
-re "$gdb_prompt $" {
- if { $see1 && $see2 && !$see3 } then {
+ if {$see1 && $see2 && !$see3} {
pass "info inferior 1-2"
} else {
fail "info inferior 1-2"
@@ -154,7 +154,7 @@ gdb_test "list commonfun" "from goodbye.*" "list commonfun in goodbye"
# Let's run the hello program.
gdb_test "inferior 1" ".*" "switch to inferior 1 to run it"
-if { ![runto_main] } then {
+if {![runto_main]} {
return -1
}
@@ -183,7 +183,7 @@ gdb_test_multiple "info inferiors" "check remove-inferiors" {
exp_continue
}
-re "$gdb_prompt $" {
- if { $see1 && !$see2 && !$see3 } then {
+ if {$see1 && !$see2 && !$see3} {
pass "check remove-inferiors"
} else {
fail "check remove-inferiors"
@@ -19,7 +19,7 @@ if ![target_can_use_run_cmd] {
# Until "catch exec" is implemented on other targets...
#
-if {![istarget "*-linux*"]} then {
+if {![istarget "*-linux*"]} {
return
}
@@ -49,7 +49,7 @@ clean_restart ${exec1}
# Start the program running, and stop at main.
#
-if ![runto_main] then {
+if {![runto_main]} {
return
}
@@ -27,7 +27,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug}]} {
# Inferior 1 stops at f1.
-if ![runto f1] then {
+if {![runto f1]} {
return 0
}
@@ -40,7 +40,7 @@ delete_breakpoints
# Inferior 2 stops at f2.
-if ![runto f2] then {
+if {![runto f2]} {
return 0
}
@@ -24,7 +24,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {pthreads d
return -1
}
-if { ![runto_main] } then {
+if {![runto_main]} {
return -1
}
@@ -151,7 +151,7 @@ proc do_test { first_arch mode selected_thread } {
set from_exec "$first_arch-multi-arch-exec"
clean_restart ${from_exec}
- if ![runto all_started] then {
+ if {![runto all_started]} {
return -1
}
@@ -78,7 +78,7 @@ if { [build_executable "failed to prepare" ${exec2} "${srcfile2}" \
# Start inferior 1
clean_restart ${exec1}
-if ![runto_main] then {
+if {![runto_main]} {
return
}
@@ -88,7 +88,7 @@ gdb_test "add-inferior" "Added inferior 2.*" "add empty inferior 2"
gdb_test "inferior 2" "Switching to inferior 2.*" "switch to inferior 2"
gdb_load ${binfile2}
-if ![runto_main] then {
+if {![runto_main]} {
return
}
@@ -80,7 +80,7 @@ proc test_re_run {re_run_inf} {
# Run the steady inferior to a breakpoint, and let it stay stopped
# there.
- if ![runto all_started] then {
+ if {![runto all_started]} {
return 0
}
@@ -31,7 +31,7 @@ with_test_prefix "single-inferior" {
with_test_prefix "before restart" {
clean_restart ${testfile}
- if { ![runto_main] } then {
+ if {![runto_main]} {
return -1
}
@@ -40,7 +40,7 @@ with_test_prefix "single-inferior" {
with_test_prefix "restart" {
gdb_continue_to_end
- if { ![runto_main] } then {
+ if {![runto_main]} {
return -1
}
}
@@ -66,7 +66,7 @@ with_test_prefix "multi-inferior" {
gdb_test "inferior 2" "Switching to inferior 2 .*" "switch to inferior 2"
gdb_load ${binfile}
- if ![runto_main] then {
+ if {![runto_main]} {
return
}
@@ -82,7 +82,7 @@ with_test_prefix "multi-inferior" {
with_test_prefix "restart" {
gdb_continue_to_end
- if { ![runto_main] } then {
+ if {![runto_main]} {
return -1
}
}
@@ -31,7 +31,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {pthreads d
return -1
}
-if { ![runto_main] } then {
+if {![runto_main]} {
return -1
}