From f50c72da4dc7ab67ea244e9c6e97404a04700c2d Mon Sep 17 00:00:00 2001 From: Andrew Burgess Date: Mon, 14 Nov 2022 14:31:52 +0000 Subject: gdb/testsuite: remove use of then keyword from gdb.*/*.exp scripts 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 remaining gdb.*/*.exp scripts. Previous commits have done the bulk of this removal, this commit just handles the remaining directories that each contain a low number of instances. There should be no changes in what is tested after this commit. --- gdb/testsuite/gdb.opt/break-on-_exit.exp | 2 +- gdb/testsuite/gdb.opt/clobbered-registers-O2.exp | 2 +- gdb/testsuite/gdb.opt/fortran-string.exp | 2 +- gdb/testsuite/gdb.opt/solib-intra-step.exp | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) (limited to 'gdb/testsuite/gdb.opt') diff --git a/gdb/testsuite/gdb.opt/break-on-_exit.exp b/gdb/testsuite/gdb.opt/break-on-_exit.exp index d94cc7e..7c2fda6 100644 --- a/gdb/testsuite/gdb.opt/break-on-_exit.exp +++ b/gdb/testsuite/gdb.opt/break-on-_exit.exp @@ -50,7 +50,7 @@ save_vars { GDBFLAGS } { } } -if ![runto_main] then { +if {![runto_main]} { return 0 } diff --git a/gdb/testsuite/gdb.opt/clobbered-registers-O2.exp b/gdb/testsuite/gdb.opt/clobbered-registers-O2.exp index 66ec5c8..617ebff 100644 --- a/gdb/testsuite/gdb.opt/clobbered-registers-O2.exp +++ b/gdb/testsuite/gdb.opt/clobbered-registers-O2.exp @@ -26,7 +26,7 @@ if {[prepare_for_testing "failed to prepare" $testfile \ return -1 } -if { ![runto start_sequence] } then { +if {![runto start_sequence]} { return } diff --git a/gdb/testsuite/gdb.opt/fortran-string.exp b/gdb/testsuite/gdb.opt/fortran-string.exp index 8d4018e..5798ad0 100644 --- a/gdb/testsuite/gdb.opt/fortran-string.exp +++ b/gdb/testsuite/gdb.opt/fortran-string.exp @@ -27,7 +27,7 @@ if { [prepare_for_testing "prepare for testing" ${testfile} ${srcfile} \ return -1 } -if ![runto f] then { +if {![runto f]} { perror "couldn't run to f" return } diff --git a/gdb/testsuite/gdb.opt/solib-intra-step.exp b/gdb/testsuite/gdb.opt/solib-intra-step.exp index e803a7d..9306ced 100644 --- a/gdb/testsuite/gdb.opt/solib-intra-step.exp +++ b/gdb/testsuite/gdb.opt/solib-intra-step.exp @@ -39,7 +39,7 @@ if { [gdb_compile_shlib ${srcfile_lib} ${binfile_lib} $lib_flags] != "" clean_restart ${binfile} gdb_load_shlib $binfile_lib -if ![runto_main] then { +if {![runto_main]} { return 0 } @@ -92,7 +92,7 @@ gdb_test_multiple "step" $test { } } -if ![runto_main] then { +if {![runto_main]} { return 0 } -- cgit v1.1