Skip to content

Commit f50c72d

Browse files
committed
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.
1 parent 0216141 commit f50c72d

29 files changed

+44
-44
lines changed

gdb/testsuite/gdb.asm/asm-source.exp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -166,14 +166,14 @@ if { "${asm-arch}" == "" } {
166166
}
167167

168168
# On NetBSD/ELF we need a special NetBSD-identifying note section.
169-
if { [istarget "*-*-netbsd*"] && ![istarget "*-*-netbsdaout*"] } then {
169+
if {[istarget "*-*-netbsd*"] && ![istarget "*-*-netbsdaout*"]} {
170170
set asm-note "netbsd"
171171
}
172172

173173
# On OpenBSD/ELF we need a similar note section. We make no attempt
174174
# of handing a.out here since most OpenBSD/a.out systems use a rather
175175
# outdated assembler that doesn't assemble this test's code anyway.
176-
if { [istarget "*-*-openbsd*"] } then {
176+
if {[istarget "*-*-openbsd*"]} {
177177
set asm-note "openbsd"
178178
}
179179

@@ -212,7 +212,7 @@ if { [string equal ${debug-flags} ""] } {
212212
}
213213

214214
# Allow the target board to override the debug flags.
215-
if { [board_info $dest exists debug_flags] } then {
215+
if {[board_info $dest exists debug_flags]} {
216216
set debug-flags "[board_info $dest debug_flags]"
217217
}
218218

@@ -239,11 +239,11 @@ regsub "--" "-g\[0-9\]" "${debug-flags}" "" debug-flags
239239
set asm1obj [standard_output_file asmrc1.o]
240240
set asm2obj [standard_output_file asmrc2.o]
241241

242-
if {[target_assemble ${srcdir}/${subdir}/${srcfile} $asm1obj "${asm-flags} ${debug-flags}"] != ""} then {
242+
if {[target_assemble ${srcdir}/${subdir}/${srcfile} $asm1obj "${asm-flags} ${debug-flags}"] != ""} {
243243
untested "failed to assemble"
244244
return -1
245245
}
246-
if {[target_assemble ${srcdir}/${subdir}/${srcfile2} $asm2obj "${asm-flags} ${debug-flags}"] != ""} then {
246+
if {[target_assemble ${srcdir}/${subdir}/${srcfile2} $asm2obj "${asm-flags} ${debug-flags}"] != ""} {
247247
untested "failed to assemble"
248248
return -1
249249
}
@@ -254,7 +254,7 @@ if {[target_assemble ${srcdir}/${subdir}/${srcfile2} $asm2obj "${asm-flags} ${de
254254
# code here that provides its own startup code. Using target_link
255255
# also avoids a lot of problems on many systems, most notably on
256256
# *-*-*bsd* and *-*-solaris2*.
257-
if {[target_link [list $asm1obj $asm2obj] "${binfile}" ${link-flags}] != "" } then {
257+
if {[target_link [list $asm1obj $asm2obj] "${binfile}" ${link-flags}] != ""} {
258258
untested "failed to link"
259259
return -1
260260
}
@@ -284,7 +284,7 @@ gdb_load ${binfile}
284284
# Run to `main' where we begin our tests.
285285
#
286286

287-
if ![runto_main] then {
287+
if {![runto_main]} {
288288
return 0
289289
}
290290

gdb/testsuite/gdb.compile/compile-tls.exp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" \
2121
}
2222

2323
clean_restart ${binfile}
24-
if ![runto_main] then {
24+
if {![runto_main]} {
2525
return 0
2626
}
2727

gdb/testsuite/gdb.ctf/funcreturn.exp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ if ![target_info exists no_long_long] {
106106
}
107107

108108
# Sun /bin/cc calls this a function returning double.
109-
if {!$gcc_compiled} then {setup_xfail "*-sun-sunos4*"}
109+
if {!$gcc_compiled} {setup_xfail "*-sun-sunos4*"}
110110
gdb_test "print v_float_func" \
111111
"$decimal = \{float \\(\\)\} 0x\[0-9a-z\]+.*" \
112112
"print float function"
@@ -179,7 +179,7 @@ if ![target_info exists no_long_long] {
179179
}
180180

181181
# Sun /bin/cc calls this a function returning double.
182-
if {!$gcc_compiled} then {setup_xfail "*-sun-sunos4*"}
182+
if {!$gcc_compiled} {setup_xfail "*-sun-sunos4*"}
183183
gdb_test "whatis v_float_func" \
184184
"type = float \\($void\\)" \
185185
"whatis float function"

gdb/testsuite/gdb.dwarf2/dw2-common-block.exp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ if { [prepare_for_testing "failed to prepare" "${testfile}" $srcfile \
3737
return -1
3838
}
3939

40-
if ![runto MAIN__] then {
40+
if {![runto MAIN__]} {
4141
perror "couldn't run to breakpoint MAIN__"
4242
return
4343
}

gdb/testsuite/gdb.dwarf2/dw2-cp-infcall-ref-static.exp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} \
3232
return -1
3333
}
3434

35-
if ![runto_main] then {
35+
if {![runto_main]} {
3636
return -1
3737
}
3838

gdb/testsuite/gdb.dwarf2/dw2-linkage-name-trust.exp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ if {[prepare_for_testing_full "failed to prepare" \
3434
return -1
3535
}
3636

37-
if ![runto_main] then {
37+
if {![runto_main]} {
3838
return -1
3939
}
4040

gdb/testsuite/gdb.dwarf2/dw2-single-line-discriminators.exp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ if { [prepare_for_testing "failed to prepare" "${testfile}" $srcfile {nodebug no
3535
return -1
3636
}
3737

38-
if ![runto_main] then {
38+
if {![runto_main]} {
3939
return
4040
}
4141

gdb/testsuite/gdb.dwarf2/locexpr-data-member-location.exp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ with_test_prefix "first session" {
105105
gdb_load_shlib ${lib_so}
106106

107107
# Run to foo to make sure foo refers to the function, and not foo@PLT.
108-
if ![runto foo qualified] then {
108+
if {![runto foo qualified]} {
109109
return
110110
}
111111

@@ -334,7 +334,7 @@ with_test_prefix "second session" {
334334
# loaded for remote targets.
335335
gdb_load_shlib ${lib_so}
336336

337-
if ![runto_main] then {
337+
if {![runto_main]} {
338338
return
339339
}
340340

gdb/testsuite/gdb.guile/scm-breakpoint.exp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,7 @@ proc_with_prefix test_bkpt_probe {} {
536536
return -1
537537
}
538538

539-
if ![gdb_guile_runto_main] then {
539+
if {![gdb_guile_runto_main]} {
540540
return
541541
}
542542

gdb/testsuite/gdb.mi/list-thread-groups-available.exp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ set MIFLAGS "-i=mi"
2121
standard_testfile
2222

2323
# Support for XML is needed to run this test.
24-
if [gdb_skip_xml_test] then {
24+
if {[gdb_skip_xml_test]} {
2525
unsupported "list-thread-groups-available.exp"
2626
return -1
2727
}

0 commit comments

Comments
 (0)