gdb/testsuite: remove use of then keyword from gdb.fortran/*.exp
authorAndrew Burgess <aburgess@redhat.com>
Mon, 14 Nov 2022 14:24:37 +0000 (14:24 +0000)
committerAndrew Burgess <aburgess@redhat.com>
Mon, 28 Nov 2022 21:04:09 +0000 (21:04 +0000)
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.

23 files changed:
gdb/testsuite/gdb.fortran/array-element.exp
gdb/testsuite/gdb.fortran/block-data.exp
gdb/testsuite/gdb.fortran/common-block.exp
gdb/testsuite/gdb.fortran/complex.exp
gdb/testsuite/gdb.fortran/derived-type-function.exp
gdb/testsuite/gdb.fortran/derived-type-striding.exp
gdb/testsuite/gdb.fortran/derived-type.exp
gdb/testsuite/gdb.fortran/dot-ops.exp
gdb/testsuite/gdb.fortran/exprs.exp
gdb/testsuite/gdb.fortran/function-calls.exp
gdb/testsuite/gdb.fortran/library-module.exp
gdb/testsuite/gdb.fortran/module.exp
gdb/testsuite/gdb.fortran/namelist.exp
gdb/testsuite/gdb.fortran/nested-funcs-2.exp
gdb/testsuite/gdb.fortran/nested-funcs.exp
gdb/testsuite/gdb.fortran/printing-types.exp
gdb/testsuite/gdb.fortran/ptr-indentation.exp
gdb/testsuite/gdb.fortran/ptype-on-functions.exp
gdb/testsuite/gdb.fortran/short-circuit-argument-list.exp
gdb/testsuite/gdb.fortran/subarray.exp
gdb/testsuite/gdb.fortran/type-kinds.exp
gdb/testsuite/gdb.fortran/types.exp
gdb/testsuite/gdb.fortran/vla-value.exp

index 22b72e2974b130cb8343366ef3554a784610cc78..f5d313cdf1ac3f077220d779771b46d27b9dfa3e 100644 (file)
@@ -26,7 +26,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug f90}]} {
     return -1
 }
 
-if ![runto sub_] then {
+if {![runto sub_]} {
     perror "couldn't run to breakpoint sub_"
     return
 }
index 482dcc296b2748bf62300476d8135a49c3104798..ab0649101080776ae3a194acede779a83f1def50 100644 (file)
@@ -30,7 +30,7 @@ if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug f90}]} {
     return -1
 }
 
-if ![fortran_runto_main] then {
+if {![fortran_runto_main]} {
     return -1
 }
 
index e8d7c22213456ab42d55fb7b7c04e0a7e93cef21..b8cbfb895c5bfc87a54a87bfd8b10720e6871f6a 100644 (file)
@@ -27,7 +27,7 @@ if {[prepare_for_testing "failed to prepare" ${testfile} \
     return -1
 }
 
-if ![fortran_runto_main] then {
+if {![fortran_runto_main]} {
     perror "couldn't run to main"
     return
 }
index 9298b3be56cb5c36f70382f3bc3b3111e382ab41..896e01cb932d4df3fcc0efff3105eebc51b88470 100644 (file)
@@ -22,7 +22,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug f90 quiet
     return -1
 }
 
-if ![fortran_runto_main] then {
+if {![fortran_runto_main]} {
     perror "Couldn't run to main"
     return
 }
index 573444a58083f90b7d681700806d6a9d80715973..3adabd63d36d8aa8a09c6a55781377ea77ba7076 100644 (file)
@@ -27,7 +27,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug f90}]} {
     return -1
 }
 
-if ![fortran_runto_main] then {
+if {![fortran_runto_main]} {
     perror "couldn't run to main"
     return
 }
index 1edc489bcfbc35b2fe8534970865657bffc37a64..bf868f572841290459101a2f558e2161c5cc67a9 100644 (file)
@@ -29,7 +29,7 @@ if {[prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} \
     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"
     return
 }
index b3be8e57056af3b7dfe7573797f0bc3524aac591..63ec0c8d0baf69a94426be5359f1c18d016d9145 100644 (file)
@@ -27,7 +27,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug f90}]} {
     return -1
 }
 
-if ![fortran_runto_main] then {
+if {![fortran_runto_main]} {
     perror "couldn't run to main"
     return
 }
index fefa27b87dbb4e554c6d9e10b5c39fe6a3e2dfa8..2bad2bc7c8f4b0916973235711afdcda865cb84a 100644 (file)
@@ -153,7 +153,7 @@ proc test_dot_operations {} {
 
 clean_restart
 
-if [set_lang_fortran] then {
+if {[set_lang_fortran]} {
     test_dot_operations
 } else {
     warning "$test_name tests suppressed." 0
index 28c0a86f2394e9d8f84a0e41a886cc6aa37d4687..c14cdad4ff54e7a5c2375e8f51391e1cd485274f 100644 (file)
@@ -249,7 +249,7 @@ gdb_reinitialize_dir $srcdir/$subdir
 
 gdb_test "set print sevenbit-strings" ""
 
-if [set_lang_fortran] then {
+if {[set_lang_fortran]} {
     test_value_history
     test_convenience_variables
     test_integer_literals_accepted
index bc0192be0646b3abcdb09c8f586ad8bb5e1660b9..ea58e6249c9cbe9e8595ac2865de77d929877f9b 100644 (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"
     return
 }
index 1745360d80cf1f5357e14ec8eb4a00c50972ef6d..a6ed67d404f139b3fa7798181e3a20580c2cd8bf 100644 (file)
@@ -39,7 +39,7 @@ clean_restart $testfile
 
 gdb_load_shlib $libfile
 
-if ![fortran_runto_main] then {
+if {![fortran_runto_main]} {
     perror "couldn't run to main"
     return
 }
index fe539fbc6d347863ee34a7afc0c780a87f5c5503..b9c9d6b44f3027603f6817b82c54985641f34d32 100644 (file)
@@ -34,7 +34,7 @@ gdb_test "print mod1::var_const" " = 20" "fully qualified name of DW_TAG_constan
 # Avoid shared lib symbols.
 gdb_test_no_output "set auto-solib-add off"
 
-if ![fortran_runto_main] then {
+if {![fortran_runto_main]} {
     perror "couldn't run to main"
     return
 }
index 39cf0e176549c94eda280029a4fe36257c813166..46f24f4797008c53507f3f56ac998abc0142679a 100644 (file)
@@ -25,7 +25,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug f90}]} {
     return -1
 }
 
-if ![fortran_runto_main] then {
+if {![fortran_runto_main]} {
     perror "couldn't run to main"
     return
 }
index bf679447c0336cca2e6ffeed88574013e3678d20..2a83144b64804fc7a5f58002ae7797c96be5d05a 100644 (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.
-    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"
        return
     }
index ea3d66685be531ec198b6d5e892ee22448257a9e..237e09ed00978818a70a044e67e8e25f78796f95 100755 (executable)
@@ -25,7 +25,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug f90}]} {
     return -1
 }
 
-if ![fortran_runto_main] then {
+if {![fortran_runto_main]} {
     perror "couldn't run to main"
     continue
 }
index 3a8e02fea129c631c608ef265cd5f62e5339839e..0ba07f6c1ff2d18ca451afd5b0fdf4a3ff794628 100644 (file)
@@ -22,7 +22,7 @@ if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug f90}]} {
     return -1
 }
 
-if {![fortran_runto_main]} then {
+if {![fortran_runto_main]} {
     return -1
 }
 
index 983783429576954ac4561d8d84635af03bd31564..daf5bd535507030a658640d0f5e670dbd7aa5503 100644 (file)
@@ -22,7 +22,7 @@ if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug f90}]} {
     return -1
 }
 
-if {![fortran_runto_main]} then {
+if {![fortran_runto_main]} {
     return -1
 }
 
index cc2454858a0938076e4e7bc620dcbd604ff272d3..6751b50a43d1e8b73a8c32772adc825794ca18f9 100644 (file)
@@ -24,7 +24,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug f90}]} {
     return -1
 }
 
-if ![fortran_runto_main] then {
+if {![fortran_runto_main]} {
     perror "couldn't run to main"
     return
 }
index aa7f5d1ebdef1814e2828716f04030e3b3b7d5f2..d458e1adfc4c081ef38df227b7d3504e43163081 100644 (file)
@@ -25,7 +25,7 @@ if {[prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} {debug f90}]} {
     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"
     return
 }
index b282c5dd7c979b9d5e0dbb707f7ccdecdd627669..88d47f91e77270ea5245eb6e41e57cd011b14e43 100644 (file)
@@ -30,7 +30,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug f90}]} {
 # Avoid shared lib symbols.
 gdb_test_no_output "set auto-solib-add off"
 
-if ![fortran_runto_main] then {
+if {![fortran_runto_main]} {
     perror "couldn't run to main"
     return
 }
index 47b788bf134b1e7e03aecb4fc56e348b83d640b2..e481ad3b38d5cb7c23ad8bf5da7250a28c3ea52a 100644 (file)
@@ -101,7 +101,7 @@ proc test_old_star_type_sizes {} {
 
 clean_restart
 
-if [set_lang_fortran] then {
+if {[set_lang_fortran]} {
     test_basic_parsing_of_type_kinds
     test_parsing_invalid_type_kinds
     test_old_star_type_sizes
index 594276f3a7b7febe6c7e0e9c9cac2aa5d02c0089..eac667646acd0b52356e6dbb86d3801b5ff7cd1a 100644 (file)
@@ -106,7 +106,7 @@ gdb_reinitialize_dir $srcdir/$subdir
 
 gdb_test "set print sevenbit-strings" ""
 
-if [set_lang_fortran] then {
+if {[set_lang_fortran]} {
     test_primitive_types_known
     test_default_types
     test_integer_literal_types_accepted
index 5b3a680c9f75789c0825e03c345dc4e7cdb83ce6..36ba0b405e3eadcdc2530a1e1d13997b8ddd1ea8 100644 (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
 clean_restart ${testfile}
 
-if ![fortran_runto_main] then {
+if {![fortran_runto_main]} {
     perror "couldn't run to main"
     return
 }