gdb/testsuite: remove use of then keyword from gdb.fortran/*.exp

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.fortran/
test script directory.

There should be no changes in what is tested after this commit.
This commit is contained in:
Andrew Burgess
2022-11-14 14:24:37 +00:00
parent 6ca2ea063a
commit 49bb47443c
23 changed files with 23 additions and 23 deletions

View File

@ -26,7 +26,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug f90}]} {
return -1 return -1
} }
if ![runto sub_] then { if {![runto sub_]} {
perror "couldn't run to breakpoint sub_" perror "couldn't run to breakpoint sub_"
return return
} }

View File

@ -30,7 +30,7 @@ if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug f90}]} {
return -1 return -1
} }
if ![fortran_runto_main] then { if {![fortran_runto_main]} {
return -1 return -1
} }

View File

@ -27,7 +27,7 @@ if {[prepare_for_testing "failed to prepare" ${testfile} \
return -1 return -1
} }
if ![fortran_runto_main] then { if {![fortran_runto_main]} {
perror "couldn't run to main" perror "couldn't run to main"
return return
} }

View File

@ -22,7 +22,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug f90 quiet
return -1 return -1
} }
if ![fortran_runto_main] then { if {![fortran_runto_main]} {
perror "Couldn't run to main" perror "Couldn't run to main"
return return
} }

View File

@ -27,7 +27,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug f90}]} {
return -1 return -1
} }
if ![fortran_runto_main] then { if {![fortran_runto_main]} {
perror "couldn't run to main" perror "couldn't run to main"
return return
} }

View File

@ -29,7 +29,7 @@ if {[prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} \
return -1 return -1
} }
if {![runto [gdb_get_line_number "post_init"]]} then { if {![runto [gdb_get_line_number "post_init"]]} {
perror "couldn't run to breakpoint post_init" perror "couldn't run to breakpoint post_init"
return return
} }

View File

@ -27,7 +27,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug f90}]} {
return -1 return -1
} }
if ![fortran_runto_main] then { if {![fortran_runto_main]} {
perror "couldn't run to main" perror "couldn't run to main"
return return
} }

View File

@ -153,7 +153,7 @@ proc test_dot_operations {} {
clean_restart clean_restart
if [set_lang_fortran] then { if {[set_lang_fortran]} {
test_dot_operations test_dot_operations
} else { } else {
warning "$test_name tests suppressed." 0 warning "$test_name tests suppressed." 0

View File

@ -249,7 +249,7 @@ gdb_reinitialize_dir $srcdir/$subdir
gdb_test "set print sevenbit-strings" "" gdb_test "set print sevenbit-strings" ""
if [set_lang_fortran] then { if {[set_lang_fortran]} {
test_value_history test_value_history
test_convenience_variables test_convenience_variables
test_integer_literals_accepted test_integer_literals_accepted

View File

@ -39,7 +39,7 @@ with_complaints 5 {
} }
} }
if {![runto [gdb_get_line_number "post_init"]]} then { if {![runto [gdb_get_line_number "post_init"]]} {
perror "couldn't run to breakpoint post_init" perror "couldn't run to breakpoint post_init"
return return
} }

View File

@ -39,7 +39,7 @@ clean_restart $testfile
gdb_load_shlib $libfile gdb_load_shlib $libfile
if ![fortran_runto_main] then { if {![fortran_runto_main]} {
perror "couldn't run to main" perror "couldn't run to main"
return return
} }

View File

@ -34,7 +34,7 @@ gdb_test "print mod1::var_const" " = 20" "fully qualified name of DW_TAG_constan
# Avoid shared lib symbols. # Avoid shared lib symbols.
gdb_test_no_output "set auto-solib-add off" gdb_test_no_output "set auto-solib-add off"
if ![fortran_runto_main] then { if {![fortran_runto_main]} {
perror "couldn't run to main" perror "couldn't run to main"
return return
} }

View File

@ -25,7 +25,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug f90}]} {
return -1 return -1
} }
if ![fortran_runto_main] then { if {![fortran_runto_main]} {
perror "couldn't run to main" perror "couldn't run to main"
return return
} }

View File

@ -108,7 +108,7 @@ proc do_bp_tests {with_src_prefix_p with_nest_prefix_p} {
} }
# Break on a contained function and run to it. # Break on a contained function and run to it.
if {![runto ${src_prefix}[gdb_get_line_number "pre_init"]]} then { if {![runto ${src_prefix}[gdb_get_line_number "pre_init"]]} {
perror "couldn't run to breakpoint pre_init" perror "couldn't run to breakpoint pre_init"
return return
} }

View File

@ -25,7 +25,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug f90}]} {
return -1 return -1
} }
if ![fortran_runto_main] then { if {![fortran_runto_main]} {
perror "couldn't run to main" perror "couldn't run to main"
continue continue
} }

View File

@ -22,7 +22,7 @@ if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug f90}]} {
return -1 return -1
} }
if {![fortran_runto_main]} then { if {![fortran_runto_main]} {
return -1 return -1
} }

View File

@ -22,7 +22,7 @@ if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug f90}]} {
return -1 return -1
} }
if {![fortran_runto_main]} then { if {![fortran_runto_main]} {
return -1 return -1
} }

View File

@ -24,7 +24,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug f90}]} {
return -1 return -1
} }
if ![fortran_runto_main] then { if {![fortran_runto_main]} {
perror "couldn't run to main" perror "couldn't run to main"
return return
} }

View File

@ -25,7 +25,7 @@ if {[prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} {debug f90}]} {
return -1 return -1
} }
if {![runto [gdb_get_line_number "post_truth_table_init"]]} then { if {![runto [gdb_get_line_number "post_truth_table_init"]]} {
perror "couldn't run to breakpoint post_truth_table_init" perror "couldn't run to breakpoint post_truth_table_init"
return return
} }

View File

@ -30,7 +30,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug f90}]} {
# Avoid shared lib symbols. # Avoid shared lib symbols.
gdb_test_no_output "set auto-solib-add off" gdb_test_no_output "set auto-solib-add off"
if ![fortran_runto_main] then { if {![fortran_runto_main]} {
perror "couldn't run to main" perror "couldn't run to main"
return return
} }

View File

@ -101,7 +101,7 @@ proc test_old_star_type_sizes {} {
clean_restart clean_restart
if [set_lang_fortran] then { if {[set_lang_fortran]} {
test_basic_parsing_of_type_kinds test_basic_parsing_of_type_kinds
test_parsing_invalid_type_kinds test_parsing_invalid_type_kinds
test_old_star_type_sizes test_old_star_type_sizes

View File

@ -106,7 +106,7 @@ gdb_reinitialize_dir $srcdir/$subdir
gdb_test "set print sevenbit-strings" "" gdb_test "set print sevenbit-strings" ""
if [set_lang_fortran] then { if {[set_lang_fortran]} {
test_primitive_types_known test_primitive_types_known
test_default_types test_default_types
test_integer_literal_types_accepted test_integer_literal_types_accepted

View File

@ -130,7 +130,7 @@ gdb_test "print vla1(9, 9, 9)" "no such vector element \\\(vector not allocated\
# Try to assign VLA to user variable # Try to assign VLA to user variable
clean_restart ${testfile} clean_restart ${testfile}
if ![fortran_runto_main] then { if {![fortran_runto_main]} {
perror "couldn't run to main" perror "couldn't run to main"
return return
} }