public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 00/14] Remove all uses of 'then' keyword from the testsuite
@ 2022-11-15 10:42 Andrew Burgess
  2022-11-15 10:42 ` [PATCH 01/14] gdb/testsuite: remove DOS line endings from a test script Andrew Burgess
                   ` (15 more replies)
  0 siblings, 16 replies; 17+ messages in thread
From: Andrew Burgess @ 2022-11-15 10:42 UTC (permalink / raw)
  To: gdb-patches; +Cc: Andrew Burgess

It was pointed out to me (off-list) that in this patch:

  https://sourceware.org/pipermail/gdb-patches/2022-November/193744.html

I had made use of TCL's 'then' keyword, which apparently is not the
preferred way to write if statements these days, at least, not for
single line conditions.  And it certainly seems that NOT using 'then'
is more common in the GDB testsuite.

As my use of 'then' was due to copy&paste from another test, this
series aims to prevent the same mistake happening again by removing
all uses of 'then' for if statements where the condition fits on a
single line.

The change was generated with sed, I sanity checked them all by eye,
and didn't see any obvious mistakes.  Tested on x86-64 GNU/Linux and
didn't see any test regressions.

Thoughts?

Thanks,
Andrew

---

Andrew Burgess (14):
  gdb/testsuite: remove DOS line endings from a test script
  gdb/testsuite: remove use of then keyword from gdb.ada/*.exp
  gdb/testsuite: remove use of then keyword from gdb.base/*.exp
  gdb/testsuite: remove use of then keyword from gdb.arch/*.exp
  gdb/testsuite: remove use of then keyword from gdb.cp/*.exp
  gdb/testsuite: remove use of then keyword from gdb.python/*.exp
  gdb/testsuite: remove use of then keyword from gdb.threads/*.exp
  gdb/testsuite: remove use of then keyword from gdb.trace/*.exp
  gdb/testsuite: remove use of then keyword from gdb.reverse/*.exp
  gdb/testsuite: remove use of then keyword from gdb.disasm/*.exp
  gdb/testsuite: remove use of then keyword from gdb.fortran/*.exp
  gdb/testsuite: remove use of then keyword from gdb.multi/*.exp
  gdb/testsuite: remove use of then keyword from gdb.*/*.exp scripts
  gdb/testsuite: remove use of then keyword from library files

 .../boards/native-extended-gdbserver.exp      |   4 +-
 gdb/testsuite/config/sid.exp                  |  16 +-
 gdb/testsuite/config/sim.exp                  |  10 +-
 gdb/testsuite/config/slite.exp                |   8 +-
 gdb/testsuite/gdb.ada/O2_float_param.exp      |   2 +-
 gdb/testsuite/gdb.ada/access_tagged_param.exp |   2 +-
 gdb/testsuite/gdb.ada/addr_arith.exp          |   2 +-
 gdb/testsuite/gdb.ada/arr_acc_idx_w_gap.exp   |   2 +-
 gdb/testsuite/gdb.ada/arr_arr.exp             |   2 +-
 gdb/testsuite/gdb.ada/arr_enum_idx_w_gap.exp  |   2 +-
 gdb/testsuite/gdb.ada/array_bounds.exp        |   2 +-
 gdb/testsuite/gdb.ada/array_return.exp        |   4 +-
 gdb/testsuite/gdb.ada/arrayptr.exp            |   2 +-
 gdb/testsuite/gdb.ada/bp_c_mixed_case.exp     |   2 +-
 gdb/testsuite/gdb.ada/bp_inlined_func.exp     |   2 +-
 gdb/testsuite/gdb.ada/call_pn.exp             |   2 +-
 gdb/testsuite/gdb.ada/catch_assert_if.exp     |   4 +-
 gdb/testsuite/gdb.ada/catch_ex.exp            |   6 +-
 gdb/testsuite/gdb.ada/catch_ex_std.exp        |   2 +-
 gdb/testsuite/gdb.ada/convvar_comp.exp        |   2 +-
 gdb/testsuite/gdb.ada/disc_arr_bound.exp      |   2 +-
 gdb/testsuite/gdb.ada/discrete-char.exp       |   2 +-
 gdb/testsuite/gdb.ada/dot_all.exp             |   2 +-
 gdb/testsuite/gdb.ada/dyn_loc.exp             |   2 +-
 gdb/testsuite/gdb.ada/dyn_stride.exp          |   2 +-
 gdb/testsuite/gdb.ada/excep_handle.exp        |   2 +-
 gdb/testsuite/gdb.ada/frame_args.exp          |   2 +-
 gdb/testsuite/gdb.ada/fun_in_declare.exp      |   2 +-
 gdb/testsuite/gdb.ada/ghost.exp               |   2 +-
 .../gdb.ada/info_addr_mixed_case.exp          |   2 +-
 gdb/testsuite/gdb.ada/info_auto_lang.exp      |   2 +-
 gdb/testsuite/gdb.ada/info_exc.exp            |   2 +-
 gdb/testsuite/gdb.ada/local-enum.exp          |   2 +-
 gdb/testsuite/gdb.ada/mi_catch_assert.exp     |   2 +-
 gdb/testsuite/gdb.ada/mi_catch_ex.exp         |   2 +-
 gdb/testsuite/gdb.ada/mi_catch_ex_hand.exp    |   2 +-
 gdb/testsuite/gdb.ada/mi_ex_cond.exp          |   2 +-
 gdb/testsuite/gdb.ada/mi_task_arg.exp         |   2 +-
 gdb/testsuite/gdb.ada/mi_task_info.exp        |   2 +-
 gdb/testsuite/gdb.ada/minsyms.exp             |   2 +-
 gdb/testsuite/gdb.ada/mod_from_name.exp       |   2 +-
 gdb/testsuite/gdb.ada/optim_drec.exp          |   2 +-
 gdb/testsuite/gdb.ada/ptype_tagged_param.exp  |   2 +-
 gdb/testsuite/gdb.ada/rec_comp.exp            |   2 +-
 gdb/testsuite/gdb.ada/rec_return.exp          |   2 +-
 gdb/testsuite/gdb.ada/ref_param.exp           |   2 +-
 gdb/testsuite/gdb.ada/scalar_storage.exp      |   2 +-
 gdb/testsuite/gdb.ada/set_wstr.exp            |   2 +-
 gdb/testsuite/gdb.ada/small_reg_param.exp     |   2 +-
 gdb/testsuite/gdb.ada/str_uninit.exp          |   2 +-
 gdb/testsuite/gdb.ada/taft_type.exp           |   2 +-
 gdb/testsuite/gdb.ada/task_switch_in_core.exp |   2 +-
 gdb/testsuite/gdb.ada/varsize_limit.exp       |   2 +-
 gdb/testsuite/gdb.ada/whatis_array_val.exp    |   2 +-
 gdb/testsuite/gdb.ada/widewide.exp            |   2 +-
 gdb/testsuite/gdb.arch/aarch64-unwind-pc.exp  |   2 +-
 gdb/testsuite/gdb.arch/alpha-step.exp         |   4 +-
 gdb/testsuite/gdb.arch/altivec-abi.exp        |   4 +-
 gdb/testsuite/gdb.arch/altivec-regs.exp       |   4 +-
 gdb/testsuite/gdb.arch/amd64-byte.exp         |   2 +-
 .../gdb.arch/amd64-disp-step-avx.exp          |   2 +-
 gdb/testsuite/gdb.arch/amd64-disp-step.exp    |   2 +-
 gdb/testsuite/gdb.arch/amd64-dword.exp        |   2 +-
 gdb/testsuite/gdb.arch/amd64-gs_base.exp      |   2 +-
 .../gdb.arch/amd64-init-x87-values.exp        |   8 +-
 gdb/testsuite/gdb.arch/amd64-word.exp         |   2 +-
 .../gdb.arch/arc-analyze-prologue.exp         |   2 +-
 gdb/testsuite/gdb.arch/arc-decode-insn.exp    |   2 +-
 .../gdb.arch/arc-disassembler-options.exp     |   2 +-
 .../gdb.arch/arm-disassembler-options.exp     |   2 +-
 gdb/testsuite/gdb.arch/arm-disp-step.exp      |   4 +-
 gdb/testsuite/gdb.arch/e500-abi.exp           |   4 +-
 gdb/testsuite/gdb.arch/e500-prologue.exp      |   4 +-
 gdb/testsuite/gdb.arch/e500-regs.exp          |   6 +-
 gdb/testsuite/gdb.arch/gdb1291.exp            |   4 +-
 gdb/testsuite/gdb.arch/gdb1431.exp            |   4 +-
 gdb/testsuite/gdb.arch/gdb1558.exp            |   2 +-
 gdb/testsuite/gdb.arch/i386-avx.exp           |   4 +-
 gdb/testsuite/gdb.arch/i386-biarch-core.exp   |   2 +-
 gdb/testsuite/gdb.arch/i386-bp_permanent.exp  |   4 +-
 gdb/testsuite/gdb.arch/i386-byte.exp          |   4 +-
 gdb/testsuite/gdb.arch/i386-disp-step.exp     |   4 +-
 gdb/testsuite/gdb.arch/i386-dr3-watch.exp     |   4 +-
 gdb/testsuite/gdb.arch/i386-float.exp         |   4 +-
 gdb/testsuite/gdb.arch/i386-gnu-cfi.exp       |   4 +-
 gdb/testsuite/gdb.arch/i386-permbkpt.exp      |   2 +-
 gdb/testsuite/gdb.arch/i386-prologue.exp      |   4 +-
 gdb/testsuite/gdb.arch/i386-signal.exp        |   2 +-
 gdb/testsuite/gdb.arch/i386-size-overlap.exp  |   2 +-
 gdb/testsuite/gdb.arch/i386-size.exp          |   2 +-
 .../gdb.arch/i386-sse-stack-align.exp         |   2 +-
 gdb/testsuite/gdb.arch/i386-sse.exp           |   2 +-
 gdb/testsuite/gdb.arch/i386-unwind.exp        |   2 +-
 gdb/testsuite/gdb.arch/i386-word.exp          |   4 +-
 gdb/testsuite/gdb.arch/iwmmxt-regs.exp        |   4 +-
 .../gdb.arch/mips-disassembler-options.exp    |   2 +-
 gdb/testsuite/gdb.arch/mips-fcr.exp           |   2 +-
 gdb/testsuite/gdb.arch/mips-fpregset-core.exp |   4 +-
 gdb/testsuite/gdb.arch/mips16-thunks.exp      |  14 +-
 gdb/testsuite/gdb.arch/pa-nullify.exp         |   6 +-
 gdb/testsuite/gdb.arch/powerpc-addpcis.exp    |   2 +-
 .../gdb.arch/powerpc-aix-prologue.exp         |   4 +-
 gdb/testsuite/gdb.arch/powerpc-altivec.exp    |   2 +-
 gdb/testsuite/gdb.arch/powerpc-altivec2.exp   |   2 +-
 gdb/testsuite/gdb.arch/powerpc-altivec3.exp   |   2 +-
 gdb/testsuite/gdb.arch/powerpc-d128-regs.exp  |   4 +-
 .../gdb.arch/powerpc-disassembler-options.exp |   2 +-
 .../gdb.arch/powerpc-fpscr-gcore.exp          |   4 +-
 gdb/testsuite/gdb.arch/powerpc-htm-regs.exp   |   2 +-
 gdb/testsuite/gdb.arch/powerpc-lnia.exp       |   2 +-
 .../gdb.arch/powerpc-plxv-nonrel.exp          |   2 +-
 gdb/testsuite/gdb.arch/powerpc-power10.exp    |   2 +-
 gdb/testsuite/gdb.arch/powerpc-power7.exp     |   2 +-
 gdb/testsuite/gdb.arch/powerpc-power8.exp     |   2 +-
 gdb/testsuite/gdb.arch/powerpc-power9.exp     |   2 +-
 gdb/testsuite/gdb.arch/powerpc-ppr-dscr.exp   |   2 +-
 gdb/testsuite/gdb.arch/powerpc-prologue.exp   |   4 +-
 gdb/testsuite/gdb.arch/powerpc-stackless.exp  |   2 +-
 gdb/testsuite/gdb.arch/powerpc-tar.exp        |   2 +-
 gdb/testsuite/gdb.arch/powerpc-vsx-gcore.exp  |   4 +-
 gdb/testsuite/gdb.arch/powerpc-vsx.exp        |   2 +-
 gdb/testsuite/gdb.arch/powerpc-vsx2.exp       |   2 +-
 gdb/testsuite/gdb.arch/powerpc-vsx3.exp       |   2 +-
 gdb/testsuite/gdb.arch/powerpc64-prologue.exp |   4 +-
 gdb/testsuite/gdb.arch/ppc-dfp.exp            |   2 +-
 gdb/testsuite/gdb.arch/ppc-fp.exp             |   2 +-
 gdb/testsuite/gdb.arch/ppc-longdouble.exp     |   6 +-
 gdb/testsuite/gdb.arch/ppc64-atomic-inst.exp  |   2 +-
 .../gdb.arch/ppc64-break-on-_exit.exp         |   2 +-
 .../gdb.arch/ppc64-isa207-atomic-inst.exp     |   2 +-
 gdb/testsuite/gdb.arch/pr25124.exp            |   2 +-
 gdb/testsuite/gdb.arch/riscv-bp-infcall.exp   |   2 +-
 gdb/testsuite/gdb.arch/riscv-info-fcsr.exp    |   2 +-
 gdb/testsuite/gdb.arch/riscv-reg-aliases.exp  |   2 +-
 .../gdb.arch/riscv-unwind-long-insn.exp       |   2 +-
 .../riscv64-unwind-prologue-with-ld-lw.exp    |   2 +-
 .../riscv64-unwind-prologue-with-mv.exp       |   2 +-
 .../gdb.arch/s390-disassembler-options.exp    |   2 +-
 gdb/testsuite/gdb.arch/s390-stackless.exp     |   2 +-
 gdb/testsuite/gdb.arch/s390-tdbregs.exp       |   2 +-
 gdb/testsuite/gdb.arch/sparc-sysstep.exp      |   2 +-
 gdb/testsuite/gdb.arch/sparc64-adi.exp        |   4 +-
 gdb/testsuite/gdb.arch/sparc64-regs.exp       |   4 +-
 gdb/testsuite/gdb.arch/thumb-bx-pc.exp        |   4 +-
 gdb/testsuite/gdb.arch/thumb-prologue.exp     |   4 +-
 gdb/testsuite/gdb.arch/thumb-singlestep.exp   |   4 +-
 gdb/testsuite/gdb.arch/thumb2-it.exp          |   4 +-
 gdb/testsuite/gdb.arch/vsx-regs.exp           |   4 +-
 gdb/testsuite/gdb.arch/vsx-vsr-float28.exp    |   4 +-
 gdb/testsuite/gdb.asm/asm-source.exp          |  14 +-
 gdb/testsuite/gdb.base/a2-run.exp             |   4 +-
 gdb/testsuite/gdb.base/advance.exp            |   2 +-
 gdb/testsuite/gdb.base/alias.exp              |   2 +-
 gdb/testsuite/gdb.base/all-bin.exp            |   2 +-
 .../gdb.base/annota-input-while-running.exp   |   2 +-
 gdb/testsuite/gdb.base/annota1.exp            |   2 +-
 gdb/testsuite/gdb.base/anon.exp               |   2 +-
 gdb/testsuite/gdb.base/arithmet.exp           |   2 +-
 gdb/testsuite/gdb.base/arrayidx.exp           |   2 +-
 gdb/testsuite/gdb.base/assign.exp             |   2 +-
 gdb/testsuite/gdb.base/async.exp              |   2 +-
 gdb/testsuite/gdb.base/attach-wait-input.exp  |   2 +-
 gdb/testsuite/gdb.base/attach.exp             |   2 +-
 .../gdb.base/auto-connect-native-target.exp   |   2 +-
 gdb/testsuite/gdb.base/auxv.exp               |   2 +-
 gdb/testsuite/gdb.base/backtrace.exp          |   2 +-
 gdb/testsuite/gdb.base/bfp-test.exp           |   2 +-
 gdb/testsuite/gdb.base/bigcore.exp            |   4 +-
 gdb/testsuite/gdb.base/bitfields2.exp         |   8 +-
 gdb/testsuite/gdb.base/bp-permanent.exp       |   2 +-
 gdb/testsuite/gdb.base/break-idempotent.exp   |   2 +-
 gdb/testsuite/gdb.base/break-unload-file.exp  |   2 +-
 gdb/testsuite/gdb.base/break.exp              |  14 +-
 .../gdb.base/bt-on-error-and-warning.exp      |   2 +-
 gdb/testsuite/gdb.base/bt-on-fatal-signal.exp |   2 +-
 gdb/testsuite/gdb.base/bt-selected-frame.exp  |   2 +-
 gdb/testsuite/gdb.base/call-ar-st.exp         |   4 +-
 gdb/testsuite/gdb.base/call-rt-st.exp         |   2 +-
 gdb/testsuite/gdb.base/call-sc.exp            |   2 +-
 gdb/testsuite/gdb.base/call-strs.exp          |   2 +-
 gdb/testsuite/gdb.base/callfuncs.exp          |  10 +-
 gdb/testsuite/gdb.base/catch-fork-static.exp  |   2 +-
 .../gdb.base/catch-signal-siginfo-cond.exp    |   2 +-
 gdb/testsuite/gdb.base/catch-syscall.exp      |  28 +--
 gdb/testsuite/gdb.base/checkpoint.exp         |   2 +-
 gdb/testsuite/gdb.base/clear_non_user_bp.exp  |   2 +-
 gdb/testsuite/gdb.base/compare-sections.exp   |   2 +-
 gdb/testsuite/gdb.base/completion.exp         |   2 +-
 gdb/testsuite/gdb.base/complex-parts.exp      |   2 +-
 gdb/testsuite/gdb.base/complex.exp            |   6 +-
 gdb/testsuite/gdb.base/cond-eval-mode.exp     |   2 +-
 gdb/testsuite/gdb.base/cond-expr.exp          |   2 +-
 .../gdb.base/condbreak-call-false.exp         |   2 +-
 .../gdb.base/consecutive-step-over.exp        |   2 +-
 gdb/testsuite/gdb.base/consecutive.exp        |   8 +-
 gdb/testsuite/gdb.base/constvars.exp          |   4 +-
 gdb/testsuite/gdb.base/coredump-filter.exp    |   2 +-
 gdb/testsuite/gdb.base/corefile.exp           |   6 +-
 gdb/testsuite/gdb.base/corefile2.exp          |   4 +-
 gdb/testsuite/gdb.base/ctf-constvars.exp      |   2 +-
 gdb/testsuite/gdb.base/ctf-ptype.exp          |  10 +-
 gdb/testsuite/gdb.base/decl-before-def.exp    |   2 +-
 gdb/testsuite/gdb.base/default.exp            |  10 +-
 gdb/testsuite/gdb.base/define.exp             |   2 +-
 gdb/testsuite/gdb.base/dfp-test.exp           |   2 +-
 gdb/testsuite/gdb.base/disabled-location.exp  |   2 +-
 gdb/testsuite/gdb.base/display.exp            |   2 +-
 gdb/testsuite/gdb.base/dprintf-detach.exp     |   2 +-
 gdb/testsuite/gdb.base/dump.exp               |  20 +-
 gdb/testsuite/gdb.base/duplicate-bp.exp       |   2 +-
 gdb/testsuite/gdb.base/eh_return.exp          |   2 +-
 gdb/testsuite/gdb.base/ena-dis-br.exp         |  16 +-
 gdb/testsuite/gdb.base/endianity.exp          |   2 +-
 gdb/testsuite/gdb.base/enum_cond.exp          |   2 +-
 gdb/testsuite/gdb.base/eval-skip.exp          |   2 +-
 gdb/testsuite/gdb.base/exe-lock.exp           |   2 +-
 .../gdb.base/exec-invalid-sysroot.exp         |   2 +-
 .../gdb.base/execl-update-breakpoints.exp     |   6 +-
 gdb/testsuite/gdb.base/exprs.exp              |   2 +-
 gdb/testsuite/gdb.base/fileio.exp             |   2 +-
 gdb/testsuite/gdb.base/finish.exp             |   4 +-
 gdb/testsuite/gdb.base/fixsection.exp         |   2 +-
 gdb/testsuite/gdb.base/float.exp              |  30 +--
 gdb/testsuite/gdb.base/float128.exp           |   2 +-
 gdb/testsuite/gdb.base/floatn.exp             |   2 +-
 gdb/testsuite/gdb.base/foll-exec-mode.exp     |   6 +-
 gdb/testsuite/gdb.base/foll-exec.exp          |  14 +-
 gdb/testsuite/gdb.base/foll-vfork.exp         |   2 +-
 gdb/testsuite/gdb.base/fork-running-state.exp |   2 +-
 gdb/testsuite/gdb.base/frame-args.exp         |   2 +-
 .../gdb.base/frame-info-consistent.exp        |   2 +-
 gdb/testsuite/gdb.base/frameapply.exp         |   2 +-
 gdb/testsuite/gdb.base/funcargs.exp           |  28 +--
 .../gdb.base/gcore-buffer-overflow.exp        |   2 +-
 gdb/testsuite/gdb.base/gcore.exp              |   8 +-
 gdb/testsuite/gdb.base/gdb1090.exp            |   2 +-
 gdb/testsuite/gdb.base/gdb11530.exp           |   2 +-
 gdb/testsuite/gdb.base/gdb11531.exp           |   2 +-
 gdb/testsuite/gdb.base/gdb1250.exp            |   2 +-
 gdb/testsuite/gdb.base/gdb1555.exp            |   2 +-
 gdb/testsuite/gdb.base/gdb1821.exp            |   2 +-
 gdb/testsuite/gdb.base/gnu-ifunc.exp          |   4 +-
 gdb/testsuite/gdb.base/gnu_vector.exp         |   2 +-
 gdb/testsuite/gdb.base/gold-gdb-index.exp     |   2 +-
 .../gdb.base/hbreak-in-shr-unsupported.exp    |   2 +-
 gdb/testsuite/gdb.base/hbreak2.exp            |   8 +-
 gdb/testsuite/gdb.base/hook-stop.exp          |   2 +-
 gdb/testsuite/gdb.base/huge.exp               |   2 +-
 gdb/testsuite/gdb.base/infcall-input.exp      |   2 +-
 gdb/testsuite/gdb.base/inferior-args.exp      |   2 +-
 gdb/testsuite/gdb.base/inferior-died.exp      |   2 +-
 gdb/testsuite/gdb.base/info-fun.exp           |   2 +-
 .../info-locals-unused-static-var.exp         |   2 +-
 gdb/testsuite/gdb.base/info-os.exp            |   6 +-
 gdb/testsuite/gdb.base/info-proc.exp          |   2 +-
 gdb/testsuite/gdb.base/info-program.exp       |   2 +-
 gdb/testsuite/gdb.base/info_qt.exp            |   2 +-
 .../gdb.base/inline-frame-cycle-unwind.exp    |   2 +-
 gdb/testsuite/gdb.base/interp.exp             |   2 +-
 gdb/testsuite/gdb.base/interrupt.exp          |   4 +-
 gdb/testsuite/gdb.base/jit-reader-exec.exp    |   2 +-
 gdb/testsuite/gdb.base/jump.exp               |   2 +-
 .../gdb.base/label-without-address.exp        |   2 +-
 gdb/testsuite/gdb.base/langs.exp              |  12 +-
 gdb/testsuite/gdb.base/large-frame.exp        |   2 +-
 .../gdb.base/list-missing-source.exp          |   2 +-
 gdb/testsuite/gdb.base/list.exp               |   8 +-
 gdb/testsuite/gdb.base/logical.exp            |   2 +-
 .../gdb.base/long-inferior-output.exp         |   2 +-
 gdb/testsuite/gdb.base/long_long.exp          |   2 +-
 gdb/testsuite/gdb.base/longjmp.exp            |   2 +-
 .../gdb.base/maint-info-sections.exp          |   2 +-
 .../gdb.base/maint-print-frame-id.exp         |   2 +-
 gdb/testsuite/gdb.base/maint.exp              |   2 +-
 gdb/testsuite/gdb.base/max-value-size.exp     |   6 +-
 gdb/testsuite/gdb.base/memattr.exp            |  16 +-
 gdb/testsuite/gdb.base/mips_pro.exp           |   6 +-
 gdb/testsuite/gdb.base/miscexprs.exp          |   2 +-
 gdb/testsuite/gdb.base/multi-forks.exp        |   2 +-
 gdb/testsuite/gdb.base/nodebug.exp            |   4 +-
 .../gdb.base/non-lazy-array-index.exp         |   2 +-
 gdb/testsuite/gdb.base/noreturn-finish.exp    |   2 +-
 gdb/testsuite/gdb.base/noreturn-return.exp    |   2 +-
 gdb/testsuite/gdb.base/opaque.exp             |  10 +-
 gdb/testsuite/gdb.base/overlays.exp           |  14 +-
 .../paginate-after-ctrl-c-running.exp         |   2 +-
 .../gdb.base/paginate-bg-execution.exp        |   2 +-
 .../gdb.base/paginate-inferior-exit.exp       |   2 +-
 gdb/testsuite/gdb.base/pc-fp.exp              |   2 +-
 gdb/testsuite/gdb.base/permissions.exp        |   2 +-
 gdb/testsuite/gdb.base/pie-execl.exp          |   4 +-
 gdb/testsuite/gdb.base/pointers.exp           |   2 +-
 gdb/testsuite/gdb.base/pr11022.exp            |   2 +-
 .../premature-dummy-frame-removal.exp         |   2 +-
 gdb/testsuite/gdb.base/printcmds.exp          |   2 +-
 gdb/testsuite/gdb.base/prologue.exp           |   2 +-
 gdb/testsuite/gdb.base/ptype.exp              |  12 +-
 gdb/testsuite/gdb.base/quit-live.exp          |   2 +-
 gdb/testsuite/gdb.base/radix.exp              |   4 +-
 gdb/testsuite/gdb.base/readnever.exp          |   2 +-
 gdb/testsuite/gdb.base/recurse.exp            |   2 +-
 gdb/testsuite/gdb.base/reggroups.exp          |   2 +-
 gdb/testsuite/gdb.base/relational.exp         |   2 +-
 gdb/testsuite/gdb.base/remote.exp             |  10 +-
 gdb/testsuite/gdb.base/return.exp             |   2 +-
 gdb/testsuite/gdb.base/return2.exp            |   6 +-
 gdb/testsuite/gdb.base/savedregs.exp          |   2 +-
 gdb/testsuite/gdb.base/scope.exp              |  60 +++---
 gdb/testsuite/gdb.base/sect-cmd.exp           |   2 +-
 gdb/testsuite/gdb.base/sepdebug.exp           |  16 +-
 gdb/testsuite/gdb.base/set-noassign.exp       |   2 +-
 gdb/testsuite/gdb.base/setshow.exp            |   4 +-
 gdb/testsuite/gdb.base/setvar.exp             |   4 +-
 gdb/testsuite/gdb.base/shlib-call.exp         |   2 +-
 gdb/testsuite/gdb.base/shreloc.exp            |   2 +-
 gdb/testsuite/gdb.base/sigall.exp             |   8 +-
 gdb/testsuite/gdb.base/sigaltstack.exp        |   2 +-
 gdb/testsuite/gdb.base/sigbpt.exp             |   2 +-
 gdb/testsuite/gdb.base/siginfo-addr.exp       |   2 +-
 gdb/testsuite/gdb.base/siginfo-obj.exp        |   4 +-
 gdb/testsuite/gdb.base/siginfo-thread.exp     |   2 +-
 gdb/testsuite/gdb.base/siginfo.exp            |   2 +-
 .../gdb.base/signals-state-child.exp          |   2 +-
 gdb/testsuite/gdb.base/signals.exp            |   2 +-
 gdb/testsuite/gdb.base/signest.exp            |   2 +-
 gdb/testsuite/gdb.base/signull.exp            |   2 +-
 gdb/testsuite/gdb.base/sigrepeat.exp          |   2 +-
 gdb/testsuite/gdb.base/sizeof.exp             |   2 +-
 gdb/testsuite/gdb.base/so-impl-ld.exp         |   2 +-
 gdb/testsuite/gdb.base/solib-disc.exp         |   2 +-
 gdb/testsuite/gdb.base/solib-display.exp      |   2 +-
 gdb/testsuite/gdb.base/solib-symbol.exp       |   2 +-
 gdb/testsuite/gdb.base/source-dir.exp         |   2 +-
 gdb/testsuite/gdb.base/source-execution.exp   |   2 +-
 gdb/testsuite/gdb.base/sss-bp-on-user-bp.exp  |   2 +-
 gdb/testsuite/gdb.base/stack-checking.exp     |   2 +-
 gdb/testsuite/gdb.base/stack-protector.exp    |   2 +-
 gdb/testsuite/gdb.base/step-break.exp         |   2 +-
 gdb/testsuite/gdb.base/step-line.exp          |   2 +-
 gdb/testsuite/gdb.base/step-over-syscall.exp  |   4 +-
 gdb/testsuite/gdb.base/step-test.exp          |   4 +-
 gdb/testsuite/gdb.base/store.exp              |   2 +-
 gdb/testsuite/gdb.base/structs.exp            |   2 +-
 gdb/testsuite/gdb.base/structs2.exp           |   2 +-
 gdb/testsuite/gdb.base/sym-file.exp           |  12 +-
 gdb/testsuite/gdb.base/symbol-alias.exp       |   2 +-
 gdb/testsuite/gdb.base/term.exp               |   2 +-
 gdb/testsuite/gdb.base/twice.exp              |   2 +-
 gdb/testsuite/gdb.base/type-opaque.exp        |   2 +-
 gdb/testsuite/gdb.base/until.exp              |   2 +-
 .../gdb.base/unwind-on-each-insn.exp          |   2 +-
 gdb/testsuite/gdb.base/varargs.exp            |   2 +-
 gdb/testsuite/gdb.base/volatile.exp           |   4 +-
 gdb/testsuite/gdb.base/watch-cond-infcall.exp |   2 +-
 gdb/testsuite/gdb.base/watch-cond.exp         |   6 +-
 gdb/testsuite/gdb.base/watch-non-mem.exp      |   2 +-
 gdb/testsuite/gdb.base/watch-read.exp         |   2 +-
 gdb/testsuite/gdb.base/watch-vfork.exp        |   2 +-
 gdb/testsuite/gdb.base/watch_thread_num.exp   |   2 +-
 .../gdb.base/watchpoint-reuse-slot.exp        |   2 +-
 .../watchpoint-stops-at-right-insn.exp        |   4 +-
 gdb/testsuite/gdb.base/watchpoint.exp         |  18 +-
 gdb/testsuite/gdb.base/wchar.exp              |   2 +-
 gdb/testsuite/gdb.base/whatis-exp.exp         |   2 +-
 .../gdb.base/whatis-ptype-typedefs.exp        |   4 +-
 gdb/testsuite/gdb.base/whatis.exp             |   6 +-
 gdb/testsuite/gdb.compile/compile-tls.exp     |   2 +-
 gdb/testsuite/gdb.cp/ambiguous.exp            |   2 +-
 gdb/testsuite/gdb.cp/anon-union.exp           |   2 +-
 gdb/testsuite/gdb.cp/breakpoint.exp           |   2 +-
 gdb/testsuite/gdb.cp/bs15503.exp              |   2 +-
 gdb/testsuite/gdb.cp/casts.exp                |   4 +-
 gdb/testsuite/gdb.cp/class2.exp               |   2 +-
 gdb/testsuite/gdb.cp/classes.exp              |   2 +-
 gdb/testsuite/gdb.cp/converts.exp             |   2 +-
 gdb/testsuite/gdb.cp/ctti.exp                 |   4 +-
 gdb/testsuite/gdb.cp/derivation.exp           |   2 +-
 gdb/testsuite/gdb.cp/disasm-func-name.exp     |   2 +-
 gdb/testsuite/gdb.cp/dispcxx.exp              |   2 +-
 gdb/testsuite/gdb.cp/ena-dis-br-range.exp     |   2 +-
 gdb/testsuite/gdb.cp/filename.exp             |   2 +-
 gdb/testsuite/gdb.cp/fpointer.exp             |   2 +-
 gdb/testsuite/gdb.cp/gdb1355.exp              |   2 +-
 gdb/testsuite/gdb.cp/gdb2384.exp              |   2 +-
 gdb/testsuite/gdb.cp/gdb2495.exp              |   4 +-
 gdb/testsuite/gdb.cp/inherit.exp              |   4 +-
 gdb/testsuite/gdb.cp/koenig.exp               |   2 +-
 gdb/testsuite/gdb.cp/local-static.exp         |   2 +-
 gdb/testsuite/gdb.cp/local.exp                |   4 +-
 gdb/testsuite/gdb.cp/m-data.exp               |   2 +-
 gdb/testsuite/gdb.cp/m-static.exp             |   2 +-
 gdb/testsuite/gdb.cp/mb-ctor.exp              |   2 +-
 gdb/testsuite/gdb.cp/member-name.exp          |   2 +-
 gdb/testsuite/gdb.cp/member-ptr.exp           |   2 +-
 gdb/testsuite/gdb.cp/method-call-in-c.exp     |   2 +-
 gdb/testsuite/gdb.cp/method.exp               |   2 +-
 .../gdb.cp/namespace-nested-import.exp        |   2 +-
 gdb/testsuite/gdb.cp/namespace.exp            |   6 +-
 gdb/testsuite/gdb.cp/nextoverthrow.exp        |   2 +-
 gdb/testsuite/gdb.cp/nsdecl.exp               |   2 +-
 gdb/testsuite/gdb.cp/nsimport.exp             |   2 +-
 gdb/testsuite/gdb.cp/nsnested.exp             |   2 +-
 gdb/testsuite/gdb.cp/nsnoimports.exp          |   2 +-
 gdb/testsuite/gdb.cp/nsrecurs.exp             |   2 +-
 gdb/testsuite/gdb.cp/nsstress.exp             |   2 +-
 gdb/testsuite/gdb.cp/nsusing.exp              |   4 +-
 gdb/testsuite/gdb.cp/operator.exp             |   2 +-
 gdb/testsuite/gdb.cp/oranking.exp             |   2 +-
 gdb/testsuite/gdb.cp/overload.exp             |   4 +-
 gdb/testsuite/gdb.cp/pr-1023.exp              |   2 +-
 gdb/testsuite/gdb.cp/pr-1210.exp              |   2 +-
 gdb/testsuite/gdb.cp/pr-574.exp               |   2 +-
 gdb/testsuite/gdb.cp/pr10687.exp              |   2 +-
 gdb/testsuite/gdb.cp/pr10728.exp              |   2 +-
 gdb/testsuite/gdb.cp/pr12028.exp              |   2 +-
 gdb/testsuite/gdb.cp/pr9067.exp               |   2 +-
 gdb/testsuite/gdb.cp/pr9167.exp               |   2 +-
 gdb/testsuite/gdb.cp/pr9631.exp               |   2 +-
 gdb/testsuite/gdb.cp/printmethod.exp          |   2 +-
 gdb/testsuite/gdb.cp/ptype-flags.exp          |   2 +-
 gdb/testsuite/gdb.cp/ref-types.exp            |  10 +-
 gdb/testsuite/gdb.cp/rtti.exp                 |   2 +-
 gdb/testsuite/gdb.cp/rvalue-ref-types.exp     |   2 +-
 gdb/testsuite/gdb.cp/shadow.exp               |   2 +-
 gdb/testsuite/gdb.cp/smartp.exp               |   2 +-
 gdb/testsuite/gdb.cp/try_catch.exp            |   2 +-
 gdb/testsuite/gdb.cp/userdef.exp              |   2 +-
 gdb/testsuite/gdb.cp/virtbase.exp             |   2 +-
 gdb/testsuite/gdb.cp/virtbase2.exp            |   2 +-
 gdb/testsuite/gdb.cp/virtfunc.exp             |   2 +-
 gdb/testsuite/gdb.cp/virtfunc2.exp            |   2 +-
 gdb/testsuite/gdb.cp/watch-cp.exp             |   2 +-
 gdb/testsuite/gdb.cp/wide_char_types.exp      |   2 +-
 gdb/testsuite/gdb.ctf/funcreturn.exp          |   4 +-
 gdb/testsuite/gdb.disasm/t01_mov.exp          |   4 +-
 gdb/testsuite/gdb.disasm/t02_mova.exp         |   4 +-
 gdb/testsuite/gdb.disasm/t03_add.exp          |   4 +-
 gdb/testsuite/gdb.disasm/t04_sub.exp          |   4 +-
 gdb/testsuite/gdb.disasm/t05_cmp.exp          |   4 +-
 gdb/testsuite/gdb.disasm/t06_ari2.exp         |   4 +-
 gdb/testsuite/gdb.disasm/t07_ari3.exp         |   4 +-
 gdb/testsuite/gdb.disasm/t08_or.exp           |   4 +-
 gdb/testsuite/gdb.disasm/t09_xor.exp          |   4 +-
 gdb/testsuite/gdb.disasm/t10_and.exp          |   4 +-
 gdb/testsuite/gdb.disasm/t11_logs.exp         |   4 +-
 gdb/testsuite/gdb.disasm/t12_bit.exp          |   4 +-
 gdb/testsuite/gdb.disasm/t13_otr.exp          |   4 +-
 gdb/testsuite/gdb.dwarf2/dw2-common-block.exp |   2 +-
 .../gdb.dwarf2/dw2-cp-infcall-ref-static.exp  |   2 +-
 .../gdb.dwarf2/dw2-linkage-name-trust.exp     |   2 +-
 .../dw2-single-line-discriminators.exp        |   2 +-
 .../locexpr-data-member-location.exp          |   4 +-
 gdb/testsuite/gdb.fortran/array-element.exp   |   2 +-
 gdb/testsuite/gdb.fortran/block-data.exp      |   2 +-
 gdb/testsuite/gdb.fortran/common-block.exp    |   2 +-
 gdb/testsuite/gdb.fortran/complex.exp         |   2 +-
 .../gdb.fortran/derived-type-function.exp     |   2 +-
 .../gdb.fortran/derived-type-striding.exp     |   2 +-
 gdb/testsuite/gdb.fortran/derived-type.exp    |   2 +-
 gdb/testsuite/gdb.fortran/dot-ops.exp         |   2 +-
 gdb/testsuite/gdb.fortran/exprs.exp           |   2 +-
 gdb/testsuite/gdb.fortran/function-calls.exp  |   2 +-
 gdb/testsuite/gdb.fortran/library-module.exp  |   2 +-
 gdb/testsuite/gdb.fortran/module.exp          |   2 +-
 gdb/testsuite/gdb.fortran/namelist.exp        |   2 +-
 gdb/testsuite/gdb.fortran/nested-funcs-2.exp  |   2 +-
 gdb/testsuite/gdb.fortran/nested-funcs.exp    | 184 +++++++++---------
 gdb/testsuite/gdb.fortran/printing-types.exp  |   2 +-
 gdb/testsuite/gdb.fortran/ptr-indentation.exp |   2 +-
 .../gdb.fortran/ptype-on-functions.exp        |   2 +-
 .../short-circuit-argument-list.exp           |   2 +-
 gdb/testsuite/gdb.fortran/subarray.exp        |   2 +-
 gdb/testsuite/gdb.fortran/type-kinds.exp      |   2 +-
 gdb/testsuite/gdb.fortran/types.exp           |   2 +-
 gdb/testsuite/gdb.fortran/vla-value.exp       |   2 +-
 gdb/testsuite/gdb.guile/scm-breakpoint.exp    |   2 +-
 .../gdb.mi/list-thread-groups-available.exp   |   2 +-
 gdb/testsuite/gdb.mi/mi-async.exp             |   2 +-
 gdb/testsuite/gdb.mi/mi-corefile.exp          |   2 +-
 gdb/testsuite/gdb.mi/mi-frame-regs.exp        |   4 +-
 gdb/testsuite/gdb.mi/mi-info-os.exp           |   4 +-
 gdb/testsuite/gdb.mi/mi-regs.exp              |   2 +-
 gdb/testsuite/gdb.modula2/max-depth.exp       |   2 +-
 gdb/testsuite/gdb.modula2/multidim.exp        |   2 +-
 gdb/testsuite/gdb.modula2/unbounded-array.exp |   2 +-
 gdb/testsuite/gdb.multi/base.exp              |   8 +-
 gdb/testsuite/gdb.multi/bkpt-multi-exec.exp   |   4 +-
 .../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 +-
 gdb/testsuite/gdb.opt/break-on-_exit.exp      |   2 +-
 .../gdb.opt/clobbered-registers-O2.exp        |   2 +-
 gdb/testsuite/gdb.opt/fortran-string.exp      |   2 +-
 gdb/testsuite/gdb.opt/solib-intra-step.exp    |   4 +-
 gdb/testsuite/gdb.pascal/types.exp            |   2 +-
 gdb/testsuite/gdb.python/lib-types.exp        |   2 +-
 .../gdb.python/pretty-print-call-by-hand.exp  |   4 +-
 gdb/testsuite/gdb.python/py-bad-printers.exp  |   2 +-
 gdb/testsuite/gdb.python/py-block.exp         |   2 +-
 gdb/testsuite/gdb.python/py-breakpoint.exp    |  28 +--
 gdb/testsuite/gdb.python/py-cmd.exp           |   2 +-
 gdb/testsuite/gdb.python/py-connection.exp    |   2 +-
 gdb/testsuite/gdb.python/py-disasm.exp        |   2 +-
 gdb/testsuite/gdb.python/py-events.exp        |   2 +-
 .../gdb.python/py-finish-breakpoint.exp       |  16 +-
 .../gdb.python/py-finish-breakpoint2.exp      |   2 +-
 gdb/testsuite/gdb.python/py-format-string.exp |   2 +-
 gdb/testsuite/gdb.python/py-frame-inline.exp  |   2 +-
 gdb/testsuite/gdb.python/py-frame.exp         |   2 +-
 .../gdb.python/py-framefilter-invalidarg.exp  |   2 +-
 gdb/testsuite/gdb.python/py-framefilter.exp   |   4 +-
 gdb/testsuite/gdb.python/py-inferior.exp      |   2 +-
 gdb/testsuite/gdb.python/py-infthread.exp     |   2 +-
 gdb/testsuite/gdb.python/py-nested-maps.exp   |   2 +-
 gdb/testsuite/gdb.python/py-objfile.exp       |   2 +-
 .../gdb.python/py-pending-frame-level.exp     |   2 +-
 gdb/testsuite/gdb.python/py-pp-maint.exp      |   2 +-
 gdb/testsuite/gdb.python/py-prettyprint.exp   |   4 +-
 gdb/testsuite/gdb.python/py-rbreak.exp        |   2 +-
 gdb/testsuite/gdb.python/py-record-btrace.exp |   2 +-
 gdb/testsuite/gdb.python/py-record-full.exp   |   2 +-
 .../gdb.python/py-recurse-unwind.exp          |   2 +-
 gdb/testsuite/gdb.python/py-shared.exp        |   2 +-
 gdb/testsuite/gdb.python/py-symbol.exp        |   6 +-
 gdb/testsuite/gdb.python/py-symtab.exp        |   2 +-
 gdb/testsuite/gdb.python/py-template.exp      |   2 +-
 gdb/testsuite/gdb.python/py-type.exp          |   2 +-
 gdb/testsuite/gdb.python/py-unwind-inline.exp |   2 +-
 gdb/testsuite/gdb.python/py-unwind-maint.exp  |   2 +-
 .../gdb.python/py-unwind-user-regs.exp        |   2 +-
 gdb/testsuite/gdb.python/py-unwind.exp        |   2 +-
 gdb/testsuite/gdb.python/py-value.exp         |   4 +-
 gdb/testsuite/gdb.python/python.exp           |   6 +-
 .../gdb.reverse/consecutive-precsave.exp      |   6 +-
 .../gdb.reverse/consecutive-reverse.exp       |   6 +-
 .../gdb.reverse/finish-reverse-bkpt.exp       |   2 +-
 gdb/testsuite/gdb.reverse/i386-precsave.exp   |   2 +-
 gdb/testsuite/gdb.reverse/i386-reverse.exp    |   2 +-
 .../gdb.reverse/i386-sse-reverse.exp          |   2 +-
 .../gdb.reverse/i387-env-reverse.exp          |   2 +-
 .../gdb.reverse/i387-stack-reverse.exp        |   2 +-
 gdb/testsuite/gdb.reverse/insn-reverse.exp    |   2 +-
 .../gdb.reverse/next-reverse-bkpt-over-sr.exp |   2 +-
 .../gdb.reverse/ppc_record_test_isa_2_06.exp  |   6 +-
 .../gdb.reverse/ppc_record_test_isa_3_1.exp   |   6 +-
 gdb/testsuite/gdb.reverse/sigall-precsave.exp |  10 +-
 gdb/testsuite/gdb.reverse/sigall-reverse.exp  |  10 +-
 .../gdb.reverse/test_ioctl_TCSETSW.exp        |   2 +-
 .../connect-with-no-symbol-file.exp           |   2 +-
 gdb/testsuite/gdb.server/ext-attach.exp       |   2 +-
 .../gdb.server/extended-remote-restart.exp    |   4 +-
 gdb/testsuite/gdb.stabs/exclfwd.exp           |   6 +-
 .../gdb.threads/clone-new-thread-event.exp    |   2 +-
 .../gdb.threads/current-lwp-dead.exp          |   2 +-
 .../gdb.threads/detach-step-over.exp          |   2 +-
 .../gdb.threads/fork-child-threads.exp        |   2 +-
 .../gdb.threads/fork-plus-threads.exp         |   2 +-
 .../gdb.threads/fork-thread-pending.exp       |   4 +-
 .../forking-threads-plus-breakpoint.exp       |   4 +-
 .../gdb.threads/gcore-stale-thread.exp        |   2 +-
 gdb/testsuite/gdb.threads/gcore-thread.exp    |   4 +-
 gdb/testsuite/gdb.threads/kill.exp            |   2 +-
 gdb/testsuite/gdb.threads/linux-dp.exp        |   2 +-
 .../gdb.threads/local-watch-wrong-thread.exp  |   2 +-
 .../multiple-successive-infcall.exp           |   2 +-
 .../next-while-other-thread-longjmps.exp      |   2 +-
 gdb/testsuite/gdb.threads/pending-step.exp    |   2 +-
 .../process-dies-while-handling-bp.exp        |   2 +-
 gdb/testsuite/gdb.threads/pthreads.exp        |  16 +-
 .../gdb.threads/reconnect-signal.exp          |   2 +-
 .../signal-command-handle-nopass.exp          |   2 +-
 ...ignal-command-multiple-signals-pending.exp |   2 +-
 .../signal-delivered-right-thread.exp         |   2 +-
 gdb/testsuite/gdb.threads/signal-sigtrap.exp  |   2 +-
 gdb/testsuite/gdb.threads/sigthread.exp       |   2 +-
 .../gdb.threads/stop-with-handle.exp          |   2 +-
 gdb/testsuite/gdb.threads/thread-find.exp     |  20 +-
 gdb/testsuite/gdb.threads/thread_check.exp    |   2 +-
 gdb/testsuite/gdb.threads/thread_events.exp   |   4 +-
 gdb/testsuite/gdb.threads/threadapply.exp     |   2 +-
 gdb/testsuite/gdb.threads/tls-nodebug-pie.exp |   2 +-
 gdb/testsuite/gdb.threads/tls-nodebug.exp     |   4 +-
 gdb/testsuite/gdb.threads/tls-shared.exp      |   2 +-
 gdb/testsuite/gdb.threads/tls-so_extern.exp   |   2 +-
 gdb/testsuite/gdb.threads/tls.exp             |   4 +-
 .../gdb.threads/vfork-follow-child-exec.exp   |   2 +-
 .../gdb.threads/vfork-follow-child-exit.exp   |   2 +-
 gdb/testsuite/gdb.threads/watchthreads.exp    |   2 +-
 gdb/testsuite/gdb.threads/watchthreads2.exp   |   2 +-
 gdb/testsuite/gdb.threads/wp-replication.exp  |   2 +-
 gdb/testsuite/gdb.trace/actions.exp           |   4 +-
 gdb/testsuite/gdb.trace/backtrace.exp         |   4 +-
 gdb/testsuite/gdb.trace/change-loc.exp        |   2 +-
 gdb/testsuite/gdb.trace/collection.exp        |   2 +-
 gdb/testsuite/gdb.trace/deltrace.exp          |   6 +-
 gdb/testsuite/gdb.trace/infotrace.exp         |   4 +-
 .../gdb.trace/mi-tracepoint-changed.exp       |   2 +-
 gdb/testsuite/gdb.trace/mi-tsv-changed.exp    |   2 +-
 gdb/testsuite/gdb.trace/no-attach-trace.exp   |   2 +-
 gdb/testsuite/gdb.trace/packetlen.exp         |   2 +-
 gdb/testsuite/gdb.trace/passc-dyn.exp         |   6 +-
 gdb/testsuite/gdb.trace/passcount.exp         |   4 +-
 gdb/testsuite/gdb.trace/report.exp            |   4 +-
 gdb/testsuite/gdb.trace/save-trace.exp        |   2 +-
 gdb/testsuite/gdb.trace/strace.exp            |   2 +-
 gdb/testsuite/gdb.trace/tfind.exp             |  10 +-
 gdb/testsuite/gdb.trace/tracecmd.exp          |   2 +-
 gdb/testsuite/gdb.trace/tspeed.exp            |   4 +-
 gdb/testsuite/gdb.trace/tsv.exp               |   6 +-
 gdb/testsuite/gdb.trace/unavailable.exp       |   2 +-
 gdb/testsuite/gdb.trace/while-dyn.exp         |   2 +-
 gdb/testsuite/gdb.trace/while-stepping.exp    |   2 +-
 gdb/testsuite/gdb.tui/tui-layout.exp          |   2 +-
 gdb/testsuite/gdb.xml/tdesc-reload.exp        |   4 +-
 gdb/testsuite/lib/cp-support.exp              |  64 +++---
 gdb/testsuite/lib/dwarf.exp                   |  10 +-
 gdb/testsuite/lib/gdb.exp                     |  62 +++---
 gdb/testsuite/lib/mi-support.exp              |  24 +--
 gdb/testsuite/lib/prompt.exp                  |   2 +-
 gdb/testsuite/lib/selftest-support.exp        |  12 +-
 gdb/testsuite/lib/trace-support.exp           |   6 +-
 625 files changed, 1215 insertions(+), 1215 deletions(-)


base-commit: db2e277d1a840091f56185d94f9d39c6736d2556
-- 
2.25.4


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH 01/14] gdb/testsuite: remove DOS line endings from a test script
  2022-11-15 10:42 [PATCH 00/14] Remove all uses of 'then' keyword from the testsuite Andrew Burgess
@ 2022-11-15 10:42 ` Andrew Burgess
  2022-11-15 10:42 ` [PATCH 02/14] gdb/testsuite: remove use of then keyword from gdb.ada/*.exp Andrew Burgess
                   ` (14 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: Andrew Burgess @ 2022-11-15 10:42 UTC (permalink / raw)
  To: gdb-patches; +Cc: Andrew Burgess

The gdb.fortran/nested-funcs.exp test script has DOS line endings.  I
can see no reason why this script needs DOS line endings.

Convert to UNIX line endings.

There should be no change in what is tested after this commit.
---
 gdb/testsuite/gdb.fortran/nested-funcs.exp | 184 ++++++++++-----------
 1 file changed, 92 insertions(+), 92 deletions(-)

diff --git a/gdb/testsuite/gdb.fortran/nested-funcs.exp b/gdb/testsuite/gdb.fortran/nested-funcs.exp
index d5ba7ce3c5e..ea3d66685be 100755
--- a/gdb/testsuite/gdb.fortran/nested-funcs.exp
+++ b/gdb/testsuite/gdb.fortran/nested-funcs.exp
@@ -1,92 +1,92 @@
-# Copyright 2016-2022 Free Software Foundation, Inc.
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-# This testcase is supposed to test DWARF static link which is usually
-# used together with nested functions.  
-
-if { [skip_fortran_tests] } { return -1 }
-
-standard_testfile .f90
-load_lib "fortran.exp"
-
-if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug f90}]} {
-    return -1
-}
-
-if ![fortran_runto_main] then {
-    perror "couldn't run to main"
-    continue
-}
-
-# Test if we can set a breakpoint in a nested function
-gdb_breakpoint "testnestedfuncs::sub_nested_outer"
-gdb_continue_to_breakpoint "testnestedfuncs::sub_nested_outer" \
-    ".*local_int = 19"
-
-# Test if we can access local and
-# non-local variables defined one level up.
-gdb_breakpoint [gdb_get_line_number "! BP_outer"]
-gdb_continue_to_breakpoint "! BP_outer" ".*! BP_outer"
-gdb_test "print index" "= 13" "print index at BP_outer"
-gdb_test_no_output "set variable index = 42"
-gdb_test "print index" "= 42" "print index at BP_outer, manipulated"
-gdb_test "print local_int" "= 19" "print local_int in outer function"
-
-# Non-local variable should be affected in one frame up as well.
-gdb_test "up"
-gdb_test "print index" "= 42" "print index at BP1, one frame up"
-
-# Test if we can set a breakpoint in a nested function
-gdb_breakpoint "testnestedfuncs::sub_nested_inner"
-gdb_continue_to_breakpoint "testnestedfuncs::sub_nested_inner" \
-    ".*local_int = 17"
-
-# Test if we can access local and
-# non-local variables defined two level up.
-gdb_breakpoint [gdb_get_line_number "! BP_inner"]
-gdb_continue_to_breakpoint "! BP_inner" ".*! BP_inner"
-gdb_test "print index" "= 42" "print index at BP_inner"
-gdb_test "print v_state%code" "= 61" "print v_state%code at BP_inner"
-gdb_test "print local_int" "= 17" "print local_int in inner function"
-
-# Test if local variable is still correct.
-gdb_breakpoint [gdb_get_line_number "! BP_outer_2"]
-gdb_continue_to_breakpoint "! BP_outer_2" ".*! BP_outer_2"
-gdb_test "print local_int" "= 19" \
-  "print local_int in outer function, after sub_nested_inner"
-
-# Test if we can set a breakpoint in public routine with the same name
-# as the internal
-gdb_breakpoint "sub_nested_outer"
-gdb_continue_to_breakpoint "sub_nested_outer" \
-    ".*name = 'sub_nested_outer external'"
-
-# Test if we can set a breakpoint in public routine with the same name
-# as the internal
-gdb_breakpoint "sub_with_sub_nested_outer::sub_nested_outer"
-gdb_continue_to_breakpoint \
-    "sub_with_sub_nested_outer::sub_nested_outer" ".*local_int = 11"
-
-# Test if we can set a breakpoint in public routine with the same name
-# as the internal
-gdb_breakpoint "mod1::sub_nested_outer"
-gdb_continue_to_breakpoint "mod1::sub_nested_outer" \
-    ".*name = 'sub_nested_outer_mod1'"
-
-# Sanity check in main.
-gdb_breakpoint [gdb_get_line_number "! BP_main"]
-gdb_continue_to_breakpoint "! BP_main" ".*! BP_main"
-gdb_test "print index" "= 42" "print index at BP_main"
-gdb_test "print v_state%code" "= 59" "print v_state%code at BP_main"
+# Copyright 2016-2022 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# This testcase is supposed to test DWARF static link which is usually
+# used together with nested functions.  
+
+if { [skip_fortran_tests] } { return -1 }
+
+standard_testfile .f90
+load_lib "fortran.exp"
+
+if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug f90}]} {
+    return -1
+}
+
+if ![fortran_runto_main] then {
+    perror "couldn't run to main"
+    continue
+}
+
+# Test if we can set a breakpoint in a nested function
+gdb_breakpoint "testnestedfuncs::sub_nested_outer"
+gdb_continue_to_breakpoint "testnestedfuncs::sub_nested_outer" \
+    ".*local_int = 19"
+
+# Test if we can access local and
+# non-local variables defined one level up.
+gdb_breakpoint [gdb_get_line_number "! BP_outer"]
+gdb_continue_to_breakpoint "! BP_outer" ".*! BP_outer"
+gdb_test "print index" "= 13" "print index at BP_outer"
+gdb_test_no_output "set variable index = 42"
+gdb_test "print index" "= 42" "print index at BP_outer, manipulated"
+gdb_test "print local_int" "= 19" "print local_int in outer function"
+
+# Non-local variable should be affected in one frame up as well.
+gdb_test "up"
+gdb_test "print index" "= 42" "print index at BP1, one frame up"
+
+# Test if we can set a breakpoint in a nested function
+gdb_breakpoint "testnestedfuncs::sub_nested_inner"
+gdb_continue_to_breakpoint "testnestedfuncs::sub_nested_inner" \
+    ".*local_int = 17"
+
+# Test if we can access local and
+# non-local variables defined two level up.
+gdb_breakpoint [gdb_get_line_number "! BP_inner"]
+gdb_continue_to_breakpoint "! BP_inner" ".*! BP_inner"
+gdb_test "print index" "= 42" "print index at BP_inner"
+gdb_test "print v_state%code" "= 61" "print v_state%code at BP_inner"
+gdb_test "print local_int" "= 17" "print local_int in inner function"
+
+# Test if local variable is still correct.
+gdb_breakpoint [gdb_get_line_number "! BP_outer_2"]
+gdb_continue_to_breakpoint "! BP_outer_2" ".*! BP_outer_2"
+gdb_test "print local_int" "= 19" \
+  "print local_int in outer function, after sub_nested_inner"
+
+# Test if we can set a breakpoint in public routine with the same name
+# as the internal
+gdb_breakpoint "sub_nested_outer"
+gdb_continue_to_breakpoint "sub_nested_outer" \
+    ".*name = 'sub_nested_outer external'"
+
+# Test if we can set a breakpoint in public routine with the same name
+# as the internal
+gdb_breakpoint "sub_with_sub_nested_outer::sub_nested_outer"
+gdb_continue_to_breakpoint \
+    "sub_with_sub_nested_outer::sub_nested_outer" ".*local_int = 11"
+
+# Test if we can set a breakpoint in public routine with the same name
+# as the internal
+gdb_breakpoint "mod1::sub_nested_outer"
+gdb_continue_to_breakpoint "mod1::sub_nested_outer" \
+    ".*name = 'sub_nested_outer_mod1'"
+
+# Sanity check in main.
+gdb_breakpoint [gdb_get_line_number "! BP_main"]
+gdb_continue_to_breakpoint "! BP_main" ".*! BP_main"
+gdb_test "print index" "= 42" "print index at BP_main"
+gdb_test "print v_state%code" "= 59" "print v_state%code at BP_main"
-- 
2.25.4


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH 02/14] gdb/testsuite: remove use of then keyword from gdb.ada/*.exp
  2022-11-15 10:42 [PATCH 00/14] Remove all uses of 'then' keyword from the testsuite Andrew Burgess
  2022-11-15 10:42 ` [PATCH 01/14] gdb/testsuite: remove DOS line endings from a test script Andrew Burgess
@ 2022-11-15 10:42 ` Andrew Burgess
  2022-11-15 10:42 ` [PATCH 03/14] gdb/testsuite: remove use of then keyword from gdb.base/*.exp Andrew Burgess
                   ` (13 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: Andrew Burgess @ 2022-11-15 10:42 UTC (permalink / raw)
  To: gdb-patches; +Cc: Andrew Burgess

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

There should be no changes in what is tested after this commit.
---
 gdb/testsuite/gdb.ada/O2_float_param.exp       | 2 +-
 gdb/testsuite/gdb.ada/access_tagged_param.exp  | 2 +-
 gdb/testsuite/gdb.ada/addr_arith.exp           | 2 +-
 gdb/testsuite/gdb.ada/arr_acc_idx_w_gap.exp    | 2 +-
 gdb/testsuite/gdb.ada/arr_arr.exp              | 2 +-
 gdb/testsuite/gdb.ada/arr_enum_idx_w_gap.exp   | 2 +-
 gdb/testsuite/gdb.ada/array_bounds.exp         | 2 +-
 gdb/testsuite/gdb.ada/array_return.exp         | 4 ++--
 gdb/testsuite/gdb.ada/arrayptr.exp             | 2 +-
 gdb/testsuite/gdb.ada/bp_c_mixed_case.exp      | 2 +-
 gdb/testsuite/gdb.ada/bp_inlined_func.exp      | 2 +-
 gdb/testsuite/gdb.ada/call_pn.exp              | 2 +-
 gdb/testsuite/gdb.ada/catch_assert_if.exp      | 4 ++--
 gdb/testsuite/gdb.ada/catch_ex.exp             | 6 +++---
 gdb/testsuite/gdb.ada/catch_ex_std.exp         | 2 +-
 gdb/testsuite/gdb.ada/convvar_comp.exp         | 2 +-
 gdb/testsuite/gdb.ada/disc_arr_bound.exp       | 2 +-
 gdb/testsuite/gdb.ada/discrete-char.exp        | 2 +-
 gdb/testsuite/gdb.ada/dot_all.exp              | 2 +-
 gdb/testsuite/gdb.ada/dyn_loc.exp              | 2 +-
 gdb/testsuite/gdb.ada/dyn_stride.exp           | 2 +-
 gdb/testsuite/gdb.ada/excep_handle.exp         | 2 +-
 gdb/testsuite/gdb.ada/frame_args.exp           | 2 +-
 gdb/testsuite/gdb.ada/fun_in_declare.exp       | 2 +-
 gdb/testsuite/gdb.ada/ghost.exp                | 2 +-
 gdb/testsuite/gdb.ada/info_addr_mixed_case.exp | 2 +-
 gdb/testsuite/gdb.ada/info_auto_lang.exp       | 2 +-
 gdb/testsuite/gdb.ada/info_exc.exp             | 2 +-
 gdb/testsuite/gdb.ada/local-enum.exp           | 2 +-
 gdb/testsuite/gdb.ada/mi_catch_assert.exp      | 2 +-
 gdb/testsuite/gdb.ada/mi_catch_ex.exp          | 2 +-
 gdb/testsuite/gdb.ada/mi_catch_ex_hand.exp     | 2 +-
 gdb/testsuite/gdb.ada/mi_ex_cond.exp           | 2 +-
 gdb/testsuite/gdb.ada/mi_task_arg.exp          | 2 +-
 gdb/testsuite/gdb.ada/mi_task_info.exp         | 2 +-
 gdb/testsuite/gdb.ada/minsyms.exp              | 2 +-
 gdb/testsuite/gdb.ada/mod_from_name.exp        | 2 +-
 gdb/testsuite/gdb.ada/optim_drec.exp           | 2 +-
 gdb/testsuite/gdb.ada/ptype_tagged_param.exp   | 2 +-
 gdb/testsuite/gdb.ada/rec_comp.exp             | 2 +-
 gdb/testsuite/gdb.ada/rec_return.exp           | 2 +-
 gdb/testsuite/gdb.ada/ref_param.exp            | 2 +-
 gdb/testsuite/gdb.ada/scalar_storage.exp       | 2 +-
 gdb/testsuite/gdb.ada/set_wstr.exp             | 2 +-
 gdb/testsuite/gdb.ada/small_reg_param.exp      | 2 +-
 gdb/testsuite/gdb.ada/str_uninit.exp           | 2 +-
 gdb/testsuite/gdb.ada/taft_type.exp            | 2 +-
 gdb/testsuite/gdb.ada/task_switch_in_core.exp  | 2 +-
 gdb/testsuite/gdb.ada/varsize_limit.exp        | 2 +-
 gdb/testsuite/gdb.ada/whatis_array_val.exp     | 2 +-
 gdb/testsuite/gdb.ada/widewide.exp             | 2 +-
 51 files changed, 55 insertions(+), 55 deletions(-)

diff --git a/gdb/testsuite/gdb.ada/O2_float_param.exp b/gdb/testsuite/gdb.ada/O2_float_param.exp
index 062a27572f5..f34dc86b0bc 100644
--- a/gdb/testsuite/gdb.ada/O2_float_param.exp
+++ b/gdb/testsuite/gdb.ada/O2_float_param.exp
@@ -20,7 +20,7 @@ if { [skip_ada_tests] } { return -1 }
 standard_ada_testfile foo
 
 set have_xfail 0
-if { [is_aarch64_target] } then {
+if {[is_aarch64_target]} {
     if { [gcc_major_version] <= 8 } {
        set have_xfail 1
     }
diff --git a/gdb/testsuite/gdb.ada/access_tagged_param.exp b/gdb/testsuite/gdb.ada/access_tagged_param.exp
index 931c7fb12a9..2103e4b5390 100644
--- a/gdb/testsuite/gdb.ada/access_tagged_param.exp
+++ b/gdb/testsuite/gdb.ada/access_tagged_param.exp
@@ -28,7 +28,7 @@ if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug]] != "" }
 
 clean_restart ${testfile}
 
-if ![runto "foo"] then {
+if {![runto "foo"]} {
   perror "Couldn't run ${testfile}"
   return
 }
diff --git a/gdb/testsuite/gdb.ada/addr_arith.exp b/gdb/testsuite/gdb.ada/addr_arith.exp
index 35a45c9f7c7..4e3059fcfae 100644
--- a/gdb/testsuite/gdb.ada/addr_arith.exp
+++ b/gdb/testsuite/gdb.ada/addr_arith.exp
@@ -26,7 +26,7 @@ if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug ]] != "" }
 clean_restart ${testfile}
 
 set bp_location [gdb_get_line_number "START" ${testdir}/foo_na07_019.adb]
-if ![runto "foo_na07_019.adb:$bp_location" ] then {
+if {![runto "foo_na07_019.adb:$bp_location"]} {
   perror "Couldn't run ${testfile}"
   return
 }
diff --git a/gdb/testsuite/gdb.ada/arr_acc_idx_w_gap.exp b/gdb/testsuite/gdb.ada/arr_acc_idx_w_gap.exp
index 0e20c5c4b2d..ac720ffa4d3 100644
--- a/gdb/testsuite/gdb.ada/arr_acc_idx_w_gap.exp
+++ b/gdb/testsuite/gdb.ada/arr_acc_idx_w_gap.exp
@@ -26,7 +26,7 @@ if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug ]] != "" }
 clean_restart ${testfile}
 
 set bp_location [gdb_get_line_number "BREAK" ${testdir}/enum_with_gap_main.adb]
-if ![runto "enum_with_gap_main.adb:$bp_location" ] then {
+if {![runto "enum_with_gap_main.adb:$bp_location"]} {
   perror "Couldn't run ${testfile}"
   return
 }
diff --git a/gdb/testsuite/gdb.ada/arr_arr.exp b/gdb/testsuite/gdb.ada/arr_arr.exp
index 390a518c0c1..488eb006789 100644
--- a/gdb/testsuite/gdb.ada/arr_arr.exp
+++ b/gdb/testsuite/gdb.ada/arr_arr.exp
@@ -26,7 +26,7 @@ if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug ]] != "" }
 clean_restart ${testfile}
 
 set bp_location [gdb_get_line_number "START" ${testdir}/foo.adb]
-if ![runto "foo.adb:$bp_location" ] then {
+if {![runto "foo.adb:$bp_location"]} {
   perror "Couldn't run ${testfile}"
   return
 }
diff --git a/gdb/testsuite/gdb.ada/arr_enum_idx_w_gap.exp b/gdb/testsuite/gdb.ada/arr_enum_idx_w_gap.exp
index f2c9451e0a9..3a6785fb095 100644
--- a/gdb/testsuite/gdb.ada/arr_enum_idx_w_gap.exp
+++ b/gdb/testsuite/gdb.ada/arr_enum_idx_w_gap.exp
@@ -29,7 +29,7 @@ foreach_with_prefix scenario {all minimal} {
     clean_restart ${testfile}-${scenario}
 
     set bp_location [gdb_get_line_number "BREAK" ${testdir}/foo_q418_043.adb]
-    if ![runto "foo_q418_043.adb:$bp_location" ] then {
+    if {![runto "foo_q418_043.adb:$bp_location"]} {
 	perror "Couldn't run ${testfile}-${scenario}"
 	return
     }
diff --git a/gdb/testsuite/gdb.ada/array_bounds.exp b/gdb/testsuite/gdb.ada/array_bounds.exp
index f6a39ccf6b6..b68e448747e 100644
--- a/gdb/testsuite/gdb.ada/array_bounds.exp
+++ b/gdb/testsuite/gdb.ada/array_bounds.exp
@@ -26,7 +26,7 @@ if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug ]] != "" }
 clean_restart ${testfile}
 
 set bp_location [gdb_get_line_number "START" ${testdir}/bar.adb]
-if ![runto "bar.adb:$bp_location" ] then {
+if {![runto "bar.adb:$bp_location"]} {
   perror "Couldn't run ${testfile}"
   return
 } 
diff --git a/gdb/testsuite/gdb.ada/array_return.exp b/gdb/testsuite/gdb.ada/array_return.exp
index 38127cc5e1b..97ba3bc4e59 100644
--- a/gdb/testsuite/gdb.ada/array_return.exp
+++ b/gdb/testsuite/gdb.ada/array_return.exp
@@ -27,7 +27,7 @@ clean_restart ${testfile}
 
 # Start the inferior
 
-if ![runto_main] then {
+if {![runto_main]} {
    return 0
 }
 
@@ -68,7 +68,7 @@ gdb_test "cont" \
 # Instead, it is returned using the struct convention, and the debugger
 # unfortunately cannot find the address of the result.  The following
 # test is therefore expected to fail for all hppa targets except hppa64.
-if { ! [istarget "hppa*64*-*-*"] } then {
+if {![istarget "hppa*64*-*-*"]} {
   setup_xfail "hppa*-*-*"
 }
 
diff --git a/gdb/testsuite/gdb.ada/arrayptr.exp b/gdb/testsuite/gdb.ada/arrayptr.exp
index 6f9e2cd51a3..d8429c4413b 100644
--- a/gdb/testsuite/gdb.ada/arrayptr.exp
+++ b/gdb/testsuite/gdb.ada/arrayptr.exp
@@ -29,7 +29,7 @@ foreach_with_prefix scenario {all minimal} {
     clean_restart ${testfile}-${scenario}
 
     set bp_location [gdb_get_line_number "STOP" ${testdir}/foo.adb]
-    if ![runto "foo.adb:$bp_location" ] then {
+    if {![runto "foo.adb:$bp_location"]} {
 	perror "Couldn't run ${testfile}-${scenario}"
 	return
     }
diff --git a/gdb/testsuite/gdb.ada/bp_c_mixed_case.exp b/gdb/testsuite/gdb.ada/bp_c_mixed_case.exp
index b6dd272a79c..d6eb9f5534c 100644
--- a/gdb/testsuite/gdb.ada/bp_c_mixed_case.exp
+++ b/gdb/testsuite/gdb.ada/bp_c_mixed_case.exp
@@ -46,7 +46,7 @@ if {[gdb_compile_ada "${srcfile}" "${binfile}" executable $options] != "" } {
 
 clean_restart ${testfile}
 
-if ![runto "foo_h731_021"] then {
+if {![runto "foo_h731_021"]} {
   perror "Couldn't run ${testfile}"
   return
 }
diff --git a/gdb/testsuite/gdb.ada/bp_inlined_func.exp b/gdb/testsuite/gdb.ada/bp_inlined_func.exp
index 076e8c2425f..be13bc26516 100644
--- a/gdb/testsuite/gdb.ada/bp_inlined_func.exp
+++ b/gdb/testsuite/gdb.ada/bp_inlined_func.exp
@@ -25,7 +25,7 @@ if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug ]] != "" }
 
 clean_restart ${testfile}
 
-if ![runto_main] then {
+if {![runto_main]} {
    return 0
 }
 
diff --git a/gdb/testsuite/gdb.ada/call_pn.exp b/gdb/testsuite/gdb.ada/call_pn.exp
index 6b403d4d4e7..c4f81245f92 100644
--- a/gdb/testsuite/gdb.ada/call_pn.exp
+++ b/gdb/testsuite/gdb.ada/call_pn.exp
@@ -26,7 +26,7 @@ if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug ]] != "" }
 clean_restart ${testfile}
 
 set bp_location [gdb_get_line_number "STOP" ${testdir}/foo.adb]
-if ![runto "foo.adb:$bp_location" ] then {
+if {![runto "foo.adb:$bp_location"]} {
   perror "Couldn't run ${testfile}"
   return
 }
diff --git a/gdb/testsuite/gdb.ada/catch_assert_if.exp b/gdb/testsuite/gdb.ada/catch_assert_if.exp
index 76a09b6c75c..0f0ec4ddfe9 100644
--- a/gdb/testsuite/gdb.ada/catch_assert_if.exp
+++ b/gdb/testsuite/gdb.ada/catch_assert_if.exp
@@ -32,7 +32,7 @@ clean_restart ${testfile}
 set eol "\[\r\n\]+"
 set sp "\[ \t\]*"
 
-if ![runto_main] then {
+if {![runto_main]} {
    return 0
 }
 
@@ -60,7 +60,7 @@ gdb_test_multiple "catch exception" $msg {
 #  - continue, we should see the second failed assertion
 #  - continue, the program exits.
 
-if ![runto_main] then {
+if {![runto_main]} {
    return 0
 }
 
diff --git a/gdb/testsuite/gdb.ada/catch_ex.exp b/gdb/testsuite/gdb.ada/catch_ex.exp
index 0da75d17578..d8fa04015fd 100644
--- a/gdb/testsuite/gdb.ada/catch_ex.exp
+++ b/gdb/testsuite/gdb.ada/catch_ex.exp
@@ -40,7 +40,7 @@ set catch_exception_info \
 # 1. Try catching all exceptions.  #
 ####################################
 
-if ![runto_main] then {
+if {![runto_main]} {
    return 0
 }
 
@@ -88,7 +88,7 @@ gdb_test "continue" \
 #  - continue, we should see the unhandled Constrait_Error exception
 #  - continue, the program exits.
 
-if ![runto_main] then {
+if {![runto_main]} {
    return 0
 }
 
@@ -148,7 +148,7 @@ gdb_test "continue" \
 #     at any of the other exceptions that are being raised inside
 #     the program.
 
-if ![runto_main] then {
+if {![runto_main]} {
    return 0
 }
 
diff --git a/gdb/testsuite/gdb.ada/catch_ex_std.exp b/gdb/testsuite/gdb.ada/catch_ex_std.exp
index 2d201a77717..4d6f2a91c19 100644
--- a/gdb/testsuite/gdb.ada/catch_ex_std.exp
+++ b/gdb/testsuite/gdb.ada/catch_ex_std.exp
@@ -67,7 +67,7 @@ clean_restart ${testfile}
 # loaded for remote targets.
 gdb_load_shlib $sofile
 
-if {![runto_main]} then {
+if {![runto_main]} {
    return 0
 }
 
diff --git a/gdb/testsuite/gdb.ada/convvar_comp.exp b/gdb/testsuite/gdb.ada/convvar_comp.exp
index 1923bd785c7..6908bc2da4f 100644
--- a/gdb/testsuite/gdb.ada/convvar_comp.exp
+++ b/gdb/testsuite/gdb.ada/convvar_comp.exp
@@ -25,7 +25,7 @@ if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug ]] != "" }
 
 clean_restart ${testfile}
 
-if ![runto "break_me" ] then {
+if {![runto "break_me"]} {
   perror "Couldn't run ${testfile}"
   return
 }
diff --git a/gdb/testsuite/gdb.ada/disc_arr_bound.exp b/gdb/testsuite/gdb.ada/disc_arr_bound.exp
index 53dc30b0379..8cbfe5d3276 100644
--- a/gdb/testsuite/gdb.ada/disc_arr_bound.exp
+++ b/gdb/testsuite/gdb.ada/disc_arr_bound.exp
@@ -26,7 +26,7 @@ if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug ]] != "" }
 clean_restart ${testfile}
 
 set bp_location [gdb_get_line_number "STOP" ${testdir}/foo_n612_026.adb]
-if ![runto "foo_n612_026.adb:$bp_location" ] then {
+if {![runto "foo_n612_026.adb:$bp_location"]} {
   perror "Couldn't run ${testfile}"
   return
 }
diff --git a/gdb/testsuite/gdb.ada/discrete-char.exp b/gdb/testsuite/gdb.ada/discrete-char.exp
index 762b3def4b9..1d380e4d597 100644
--- a/gdb/testsuite/gdb.ada/discrete-char.exp
+++ b/gdb/testsuite/gdb.ada/discrete-char.exp
@@ -28,7 +28,7 @@ if {[gdb_compile_ada "${srcfile}" "${binfile}" executable {debug}] != ""} {
 clean_restart ${testfile}
 
 set bp_location [gdb_get_line_number "STOP" ${testdir}/main.adb]
-if {![runto "main.adb:$bp_location"]} then {
+if {![runto "main.adb:$bp_location"]} {
   perror "Couldn't run ${testfile}"
   return
 }
diff --git a/gdb/testsuite/gdb.ada/dot_all.exp b/gdb/testsuite/gdb.ada/dot_all.exp
index c1f60f8ee2a..6064a7d505b 100644
--- a/gdb/testsuite/gdb.ada/dot_all.exp
+++ b/gdb/testsuite/gdb.ada/dot_all.exp
@@ -26,7 +26,7 @@ if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug ]] != "" }
 clean_restart ${testfile}
 
 set bp_location [gdb_get_line_number "STOP" ${testdir}/foo.adb]
-if ![runto "foo.adb:$bp_location" ] then {
+if {![runto "foo.adb:$bp_location"]} {
   perror "Couldn't run ${testfile}"
   return
 }
diff --git a/gdb/testsuite/gdb.ada/dyn_loc.exp b/gdb/testsuite/gdb.ada/dyn_loc.exp
index 46c7edb71aa..d2cf68d1dc7 100644
--- a/gdb/testsuite/gdb.ada/dyn_loc.exp
+++ b/gdb/testsuite/gdb.ada/dyn_loc.exp
@@ -26,7 +26,7 @@ if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug ]] != "" }
 clean_restart ${testfile}
 
 set bp_location [gdb_get_line_number "BREAK" ${testdir}/pack.adb]
-if ![runto "pack.adb:$bp_location" ] then {
+if {![runto "pack.adb:$bp_location"]} {
   return -1
 }
 
diff --git a/gdb/testsuite/gdb.ada/dyn_stride.exp b/gdb/testsuite/gdb.ada/dyn_stride.exp
index d9e6c6ae0d3..dad3f0c0cbd 100644
--- a/gdb/testsuite/gdb.ada/dyn_stride.exp
+++ b/gdb/testsuite/gdb.ada/dyn_stride.exp
@@ -26,7 +26,7 @@ if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug ]] != "" }
 clean_restart ${testfile}
 
 set bp_location [gdb_get_line_number "STOP" ${testdir}/foo.adb]
-if ![runto "foo.adb:$bp_location" ] then {
+if {![runto "foo.adb:$bp_location"]} {
   return -1
 }
 
diff --git a/gdb/testsuite/gdb.ada/excep_handle.exp b/gdb/testsuite/gdb.ada/excep_handle.exp
index 9475dd607a4..ddc1886b59d 100644
--- a/gdb/testsuite/gdb.ada/excep_handle.exp
+++ b/gdb/testsuite/gdb.ada/excep_handle.exp
@@ -44,7 +44,7 @@ set catchpoint_storage_error_msg \
 # Check that runtime supports catchpoint.  #
 ############################################
 
-if ![runto_main] then {
+if {![runto_main]} {
    return 0
 }
 
diff --git a/gdb/testsuite/gdb.ada/frame_args.exp b/gdb/testsuite/gdb.ada/frame_args.exp
index 1a37c79f072..9961780ad39 100644
--- a/gdb/testsuite/gdb.ada/frame_args.exp
+++ b/gdb/testsuite/gdb.ada/frame_args.exp
@@ -30,7 +30,7 @@ set any_addr "0x\[0-9a-zA-Z\]+"
 set eol "\[\r\n\]+"
 set sp "\[ \t\]*"
 
-if ![runto break_me] then {
+if {![runto break_me]} {
   perror "Couldn't run ${testfile}"
   return
 } 
diff --git a/gdb/testsuite/gdb.ada/fun_in_declare.exp b/gdb/testsuite/gdb.ada/fun_in_declare.exp
index 38802409bb1..4b30a777895 100644
--- a/gdb/testsuite/gdb.ada/fun_in_declare.exp
+++ b/gdb/testsuite/gdb.ada/fun_in_declare.exp
@@ -25,7 +25,7 @@ if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug ]] != "" }
 
 clean_restart ${testfile}
 
-if ![runto_main] then {
+if {![runto_main]} {
   perror "Couldn't run ${testfile}"
   return
 } 
diff --git a/gdb/testsuite/gdb.ada/ghost.exp b/gdb/testsuite/gdb.ada/ghost.exp
index ece03dbe2f8..93ab507e337 100644
--- a/gdb/testsuite/gdb.ada/ghost.exp
+++ b/gdb/testsuite/gdb.ada/ghost.exp
@@ -27,7 +27,7 @@ if {[gdb_compile_ada "${srcfile}" "${binfile}" executable $flags] != "" } {
 clean_restart ${testfile}
 
 set bp_location [gdb_get_line_number "START" ${testdir}/main.adb]
-if ![runto "main.adb:$bp_location" ] then {
+if {![runto "main.adb:$bp_location"]} {
   perror "Couldn't run ${testfile}"
   return
 }
diff --git a/gdb/testsuite/gdb.ada/info_addr_mixed_case.exp b/gdb/testsuite/gdb.ada/info_addr_mixed_case.exp
index 0a63873df24..d512ef42651 100644
--- a/gdb/testsuite/gdb.ada/info_addr_mixed_case.exp
+++ b/gdb/testsuite/gdb.ada/info_addr_mixed_case.exp
@@ -26,7 +26,7 @@ if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug ]] != "" }
 clean_restart ${testfile}
 
 set bp_location [gdb_get_line_number "START" ${testdir}/foo.adb]
-if ![runto "foo.adb:$bp_location" ] then {
+if {![runto "foo.adb:$bp_location"]} {
   perror "Couldn't run ${testfile}"
   return
 }
diff --git a/gdb/testsuite/gdb.ada/info_auto_lang.exp b/gdb/testsuite/gdb.ada/info_auto_lang.exp
index af882f7d8d2..9e17cf6c028 100644
--- a/gdb/testsuite/gdb.ada/info_auto_lang.exp
+++ b/gdb/testsuite/gdb.ada/info_auto_lang.exp
@@ -45,7 +45,7 @@ if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug]] != "" }
 clean_restart ${testfile}
 
 set bp_location [gdb_get_line_number "STOP" ${testdir}/some_c.c]
-if ![runto "some_c.c:$bp_location"] then {
+if {![runto "some_c.c:$bp_location"]} {
     return
 }
 
diff --git a/gdb/testsuite/gdb.ada/info_exc.exp b/gdb/testsuite/gdb.ada/info_exc.exp
index 4e0059ad3dc..c0a9e4dea53 100644
--- a/gdb/testsuite/gdb.ada/info_exc.exp
+++ b/gdb/testsuite/gdb.ada/info_exc.exp
@@ -25,7 +25,7 @@ if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug]] != "" }
 
 clean_restart ${testfile}
 
-if ![runto_main] then {
+if {![runto_main]} {
    return 0
 }
 
diff --git a/gdb/testsuite/gdb.ada/local-enum.exp b/gdb/testsuite/gdb.ada/local-enum.exp
index 99bc0c94b8a..908ee73b899 100644
--- a/gdb/testsuite/gdb.ada/local-enum.exp
+++ b/gdb/testsuite/gdb.ada/local-enum.exp
@@ -26,7 +26,7 @@ if {[gdb_compile_ada "${srcfile}" "${binfile}" executable debug] != ""} {
 clean_restart ${testfile}
 
 set bp_location [gdb_get_line_number "STOP" ${testdir}/local.adb]
-if ![runto "local.adb:$bp_location" ] then {
+if {![runto "local.adb:$bp_location"]} {
   perror "Couldn't run ${testfile}"
   return
 }
diff --git a/gdb/testsuite/gdb.ada/mi_catch_assert.exp b/gdb/testsuite/gdb.ada/mi_catch_assert.exp
index e586b4d7cd5..d34938fa181 100644
--- a/gdb/testsuite/gdb.ada/mi_catch_assert.exp
+++ b/gdb/testsuite/gdb.ada/mi_catch_assert.exp
@@ -34,7 +34,7 @@ set sp "\[ \t\]*"
 
 clean_restart ${testfile}
 
-if ![runto_main] then {
+if {![runto_main]} {
    return 0
 }
 
diff --git a/gdb/testsuite/gdb.ada/mi_catch_ex.exp b/gdb/testsuite/gdb.ada/mi_catch_ex.exp
index aeb3c388c56..3258476be56 100644
--- a/gdb/testsuite/gdb.ada/mi_catch_ex.exp
+++ b/gdb/testsuite/gdb.ada/mi_catch_ex.exp
@@ -34,7 +34,7 @@ set eol "\[\r\n\]+"
 
 clean_restart ${testfile}
 
-if ![runto_main] then {
+if {![runto_main]} {
    return 0
 }
 
diff --git a/gdb/testsuite/gdb.ada/mi_catch_ex_hand.exp b/gdb/testsuite/gdb.ada/mi_catch_ex_hand.exp
index 5a8e6cd71ce..9ca6688d430 100644
--- a/gdb/testsuite/gdb.ada/mi_catch_ex_hand.exp
+++ b/gdb/testsuite/gdb.ada/mi_catch_ex_hand.exp
@@ -33,7 +33,7 @@ set eol "\[\r\n\]+"
 
 clean_restart ${testfile}
 
-if ![runto_main] then {
+if {![runto_main]} {
    return 0
 }
 
diff --git a/gdb/testsuite/gdb.ada/mi_ex_cond.exp b/gdb/testsuite/gdb.ada/mi_ex_cond.exp
index 4de08dc6592..ddf9e0bbea7 100644
--- a/gdb/testsuite/gdb.ada/mi_ex_cond.exp
+++ b/gdb/testsuite/gdb.ada/mi_ex_cond.exp
@@ -34,7 +34,7 @@ set eol "\[\r\n\]+"
 
 clean_restart ${testfile}
 
-if ![runto_main] then {
+if {![runto_main]} {
    return 0
 }
 
diff --git a/gdb/testsuite/gdb.ada/mi_task_arg.exp b/gdb/testsuite/gdb.ada/mi_task_arg.exp
index 4713fda62fd..d80dfd47015 100644
--- a/gdb/testsuite/gdb.ada/mi_task_arg.exp
+++ b/gdb/testsuite/gdb.ada/mi_task_arg.exp
@@ -38,7 +38,7 @@ mi_gdb_load ${binfile}
 # This test won't work properly if system debuginfo is installed.
 mi_gdb_test "-gdb-set debug-file-directory \"\"" ".*"
 
-if ![mi_runto "task_switch.break_me"] then {
+if {![mi_runto "task_switch.break_me"]} {
    return 0
 }
 
diff --git a/gdb/testsuite/gdb.ada/mi_task_info.exp b/gdb/testsuite/gdb.ada/mi_task_info.exp
index 2a2a91d537e..62d0b834dca 100644
--- a/gdb/testsuite/gdb.ada/mi_task_info.exp
+++ b/gdb/testsuite/gdb.ada/mi_task_info.exp
@@ -39,7 +39,7 @@ mi_gdb_load ${binfile}
 # 1. Try catching all exceptions.  #
 ####################################
 
-if ![mi_runto "task_switch.break_me"] then {
+if {![mi_runto "task_switch.break_me"]} {
    return 0
 }
 
diff --git a/gdb/testsuite/gdb.ada/minsyms.exp b/gdb/testsuite/gdb.ada/minsyms.exp
index 1382f8ccdd8..7ce2d814475 100644
--- a/gdb/testsuite/gdb.ada/minsyms.exp
+++ b/gdb/testsuite/gdb.ada/minsyms.exp
@@ -25,7 +25,7 @@ if {[gdb_compile_ada "${srcfile}" "${binfile}" executable ""] != "" } {
 
 clean_restart ${testfile}
 
-if ![runto "_ada_foo_qb07_057" ] then {
+if {![runto "_ada_foo_qb07_057"]} {
   perror "Couldn't run ${testfile}"
   return
 }
diff --git a/gdb/testsuite/gdb.ada/mod_from_name.exp b/gdb/testsuite/gdb.ada/mod_from_name.exp
index 009e32d4dd1..8eb61565ff4 100644
--- a/gdb/testsuite/gdb.ada/mod_from_name.exp
+++ b/gdb/testsuite/gdb.ada/mod_from_name.exp
@@ -29,7 +29,7 @@ foreach_with_prefix scenario {all minimal} {
     clean_restart ${testfile}-${scenario}
 
     set bp_location [gdb_get_line_number "START" ${testdir}/foo.adb]
-    if ![runto "foo.adb:$bp_location" ] then {
+    if {![runto "foo.adb:$bp_location"]} {
 	perror "Couldn't run ${testfile}-${scenario}"
 	return
     } 
diff --git a/gdb/testsuite/gdb.ada/optim_drec.exp b/gdb/testsuite/gdb.ada/optim_drec.exp
index cccec6c2267..823156cd804 100644
--- a/gdb/testsuite/gdb.ada/optim_drec.exp
+++ b/gdb/testsuite/gdb.ada/optim_drec.exp
@@ -25,7 +25,7 @@ if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug ]] != "" }
 
 clean_restart ${testfile}
 
-if ![runto "foo" ] then {
+if {![runto "foo"]} {
   perror "Couldn't run ${testfile}"
   return
 }
diff --git a/gdb/testsuite/gdb.ada/ptype_tagged_param.exp b/gdb/testsuite/gdb.ada/ptype_tagged_param.exp
index 3a4a84a22ce..116748ab184 100644
--- a/gdb/testsuite/gdb.ada/ptype_tagged_param.exp
+++ b/gdb/testsuite/gdb.ada/ptype_tagged_param.exp
@@ -27,7 +27,7 @@ set has_runtime_debug_info [gnat_runtime_has_debug_info]
 
 clean_restart ${testfile}
 
-if ![runto "pck.adb:20" ] then {
+if {![runto "pck.adb:20"]} {
   return -1
 }
 
diff --git a/gdb/testsuite/gdb.ada/rec_comp.exp b/gdb/testsuite/gdb.ada/rec_comp.exp
index 9205a26548c..342fe3a0e07 100644
--- a/gdb/testsuite/gdb.ada/rec_comp.exp
+++ b/gdb/testsuite/gdb.ada/rec_comp.exp
@@ -26,7 +26,7 @@ if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug ]] != "" }
 clean_restart ${testfile}
 
 set bp_location [gdb_get_line_number "STOP" ${testdir}/bar_o203_012.adb]
-if ![runto "bar_o203_012.adb:$bp_location" ] then {
+if {![runto "bar_o203_012.adb:$bp_location"]} {
   perror "Couldn't run ${testfile}"
   return
 }
diff --git a/gdb/testsuite/gdb.ada/rec_return.exp b/gdb/testsuite/gdb.ada/rec_return.exp
index b68537ee41c..723244fc576 100644
--- a/gdb/testsuite/gdb.ada/rec_return.exp
+++ b/gdb/testsuite/gdb.ada/rec_return.exp
@@ -26,7 +26,7 @@ if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug ]] != "" }
 clean_restart ${testfile}
 
 set bp_location [gdb_get_line_number "STOP" ${testdir}/foo.adb]
-if ![runto "foo.adb:$bp_location" ] then {
+if {![runto "foo.adb:$bp_location"]} {
   perror "Couldn't run ${testfile}"
   return
 }
diff --git a/gdb/testsuite/gdb.ada/ref_param.exp b/gdb/testsuite/gdb.ada/ref_param.exp
index 56347932564..871e755ff39 100644
--- a/gdb/testsuite/gdb.ada/ref_param.exp
+++ b/gdb/testsuite/gdb.ada/ref_param.exp
@@ -25,7 +25,7 @@ if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug ]] != "" }
 
 clean_restart ${testfile}
 
-if ![runto pck.adb:20] then {
+if {![runto pck.adb:20]} {
   perror "Couldn't run ${testfile}"
   return
 } 
diff --git a/gdb/testsuite/gdb.ada/scalar_storage.exp b/gdb/testsuite/gdb.ada/scalar_storage.exp
index 8180e6e8bb1..106413e9528 100644
--- a/gdb/testsuite/gdb.ada/scalar_storage.exp
+++ b/gdb/testsuite/gdb.ada/scalar_storage.exp
@@ -29,7 +29,7 @@ if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug ]] != "" }
 clean_restart ${testfile}
 
 set bp_location [gdb_get_line_number "START" ${testdir}/storage.adb]
-if ![runto "storage.adb:$bp_location" ] then {
+if {![runto "storage.adb:$bp_location"]} {
   perror "Couldn't run ${testfile}"
   return
 }
diff --git a/gdb/testsuite/gdb.ada/set_wstr.exp b/gdb/testsuite/gdb.ada/set_wstr.exp
index 9e58df25352..97a683dd37a 100644
--- a/gdb/testsuite/gdb.ada/set_wstr.exp
+++ b/gdb/testsuite/gdb.ada/set_wstr.exp
@@ -26,7 +26,7 @@ if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug ]] != "" }
 clean_restart ${testfile}
 
 set bp_location [gdb_get_line_number "STOP" ${testdir}/a.adb]
-if ![runto "a.adb:$bp_location" ] then {
+if {![runto "a.adb:$bp_location"]} {
   perror "Couldn't run ${testfile}"
   return
 }
diff --git a/gdb/testsuite/gdb.ada/small_reg_param.exp b/gdb/testsuite/gdb.ada/small_reg_param.exp
index a07843d2596..cb3c3bf4b4d 100644
--- a/gdb/testsuite/gdb.ada/small_reg_param.exp
+++ b/gdb/testsuite/gdb.ada/small_reg_param.exp
@@ -25,7 +25,7 @@ if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug optimize=-
 
 clean_restart ${testfile}
 
-if ![runto_main] then {
+if {![runto_main]} {
   perror "Couldn't run ${testfile}"
   return
 }
diff --git a/gdb/testsuite/gdb.ada/str_uninit.exp b/gdb/testsuite/gdb.ada/str_uninit.exp
index cda1439d48b..96862909e87 100644
--- a/gdb/testsuite/gdb.ada/str_uninit.exp
+++ b/gdb/testsuite/gdb.ada/str_uninit.exp
@@ -26,7 +26,7 @@ if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug ]] != "" }
 clean_restart ${testfile}
 
 set bp_location [gdb_get_line_number "START" ${testdir}/parse.adb]
-if ![runto "parse.adb:$bp_location" ] then {
+if {![runto "parse.adb:$bp_location"]} {
   perror "Couldn't run ${testfile}"
   return
 }
diff --git a/gdb/testsuite/gdb.ada/taft_type.exp b/gdb/testsuite/gdb.ada/taft_type.exp
index 10c6f477e9c..a791cd179a6 100644
--- a/gdb/testsuite/gdb.ada/taft_type.exp
+++ b/gdb/testsuite/gdb.ada/taft_type.exp
@@ -26,7 +26,7 @@ if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug ]] != "" }
 clean_restart ${testfile}
 
 set bp_location [gdb_get_line_number "START" ${testdir}/p.adb]
-if ![runto "p.adb:$bp_location" ] then {
+if {![runto "p.adb:$bp_location"]} {
   perror "Couldn't run ${testfile}"
   return
 } 
diff --git a/gdb/testsuite/gdb.ada/task_switch_in_core.exp b/gdb/testsuite/gdb.ada/task_switch_in_core.exp
index 02d60cd20e6..7a56693e656 100644
--- a/gdb/testsuite/gdb.ada/task_switch_in_core.exp
+++ b/gdb/testsuite/gdb.ada/task_switch_in_core.exp
@@ -30,7 +30,7 @@ clean_restart ${testfile}
 # testcase is to generate this core file, so we can then exercise
 # task-switching when debugging from core files.
 
-if { ![runto request_for_crash ]} then {
+if {![runto request_for_crash]} {
     untested "couldn't run to Request_For_Crash"
     return -1
 }
diff --git a/gdb/testsuite/gdb.ada/varsize_limit.exp b/gdb/testsuite/gdb.ada/varsize_limit.exp
index 5cd6d1adbd6..af5a394f38b 100644
--- a/gdb/testsuite/gdb.ada/varsize_limit.exp
+++ b/gdb/testsuite/gdb.ada/varsize_limit.exp
@@ -26,7 +26,7 @@ if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug ]] != "" }
 clean_restart ${testfile}
 
 set bp_location [gdb_get_line_number "STOP" ${testdir}/vsizelim.adb]
-if ![runto "vsizelim.adb:$bp_location" ] then {
+if {![runto "vsizelim.adb:$bp_location"]} {
   perror "Couldn't run ${testfile}"
   return
 }
diff --git a/gdb/testsuite/gdb.ada/whatis_array_val.exp b/gdb/testsuite/gdb.ada/whatis_array_val.exp
index 69f90e1f22b..eadd6ed2da2 100644
--- a/gdb/testsuite/gdb.ada/whatis_array_val.exp
+++ b/gdb/testsuite/gdb.ada/whatis_array_val.exp
@@ -26,7 +26,7 @@ if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug ]] != "" }
 clean_restart ${testfile}
 
 set bp_location [gdb_get_line_number "STOP" ${testdir}/foo.adb]
-if ![runto "foo.adb:$bp_location" ] then {
+if {![runto "foo.adb:$bp_location"]} {
   perror "Couldn't run ${testfile}"
   return
 } 
diff --git a/gdb/testsuite/gdb.ada/widewide.exp b/gdb/testsuite/gdb.ada/widewide.exp
index 56c9e12abd2..34f5967ec04 100644
--- a/gdb/testsuite/gdb.ada/widewide.exp
+++ b/gdb/testsuite/gdb.ada/widewide.exp
@@ -26,7 +26,7 @@ if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug ]] != "" }
 clean_restart ${testfile}
 
 set bp_location [gdb_get_line_number "START" ${testdir}/foo.adb]
-if ![runto "foo.adb:$bp_location" ] then {
+if {![runto "foo.adb:$bp_location"]} {
   perror "Couldn't run ${testfile}"
   return
 }
-- 
2.25.4


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH 03/14] gdb/testsuite: remove use of then keyword from gdb.base/*.exp
  2022-11-15 10:42 [PATCH 00/14] Remove all uses of 'then' keyword from the testsuite Andrew Burgess
  2022-11-15 10:42 ` [PATCH 01/14] gdb/testsuite: remove DOS line endings from a test script Andrew Burgess
  2022-11-15 10:42 ` [PATCH 02/14] gdb/testsuite: remove use of then keyword from gdb.ada/*.exp Andrew Burgess
@ 2022-11-15 10:42 ` Andrew Burgess
  2022-11-15 10:42 ` [PATCH 04/14] gdb/testsuite: remove use of then keyword from gdb.arch/*.exp Andrew Burgess
                   ` (12 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: Andrew Burgess @ 2022-11-15 10:42 UTC (permalink / raw)
  To: gdb-patches; +Cc: Andrew Burgess

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

There should be no changes in what is tested after this commit.
---
 gdb/testsuite/gdb.base/a2-run.exp             |  4 +-
 gdb/testsuite/gdb.base/advance.exp            |  2 +-
 gdb/testsuite/gdb.base/alias.exp              |  2 +-
 gdb/testsuite/gdb.base/all-bin.exp            |  2 +-
 .../gdb.base/annota-input-while-running.exp   |  2 +-
 gdb/testsuite/gdb.base/annota1.exp            |  2 +-
 gdb/testsuite/gdb.base/anon.exp               |  2 +-
 gdb/testsuite/gdb.base/arithmet.exp           |  2 +-
 gdb/testsuite/gdb.base/arrayidx.exp           |  2 +-
 gdb/testsuite/gdb.base/assign.exp             |  2 +-
 gdb/testsuite/gdb.base/async.exp              |  2 +-
 gdb/testsuite/gdb.base/attach-wait-input.exp  |  2 +-
 gdb/testsuite/gdb.base/attach.exp             |  2 +-
 .../gdb.base/auto-connect-native-target.exp   |  2 +-
 gdb/testsuite/gdb.base/auxv.exp               |  2 +-
 gdb/testsuite/gdb.base/backtrace.exp          |  2 +-
 gdb/testsuite/gdb.base/bfp-test.exp           |  2 +-
 gdb/testsuite/gdb.base/bigcore.exp            |  4 +-
 gdb/testsuite/gdb.base/bitfields2.exp         |  8 +--
 gdb/testsuite/gdb.base/bp-permanent.exp       |  2 +-
 gdb/testsuite/gdb.base/break-idempotent.exp   |  2 +-
 gdb/testsuite/gdb.base/break-unload-file.exp  |  2 +-
 gdb/testsuite/gdb.base/break.exp              | 14 ++---
 .../gdb.base/bt-on-error-and-warning.exp      |  2 +-
 gdb/testsuite/gdb.base/bt-on-fatal-signal.exp |  2 +-
 gdb/testsuite/gdb.base/bt-selected-frame.exp  |  2 +-
 gdb/testsuite/gdb.base/call-ar-st.exp         |  4 +-
 gdb/testsuite/gdb.base/call-rt-st.exp         |  2 +-
 gdb/testsuite/gdb.base/call-sc.exp            |  2 +-
 gdb/testsuite/gdb.base/call-strs.exp          |  2 +-
 gdb/testsuite/gdb.base/callfuncs.exp          | 10 ++--
 gdb/testsuite/gdb.base/catch-fork-static.exp  |  2 +-
 .../gdb.base/catch-signal-siginfo-cond.exp    |  2 +-
 gdb/testsuite/gdb.base/catch-syscall.exp      | 28 ++++-----
 gdb/testsuite/gdb.base/checkpoint.exp         |  2 +-
 gdb/testsuite/gdb.base/clear_non_user_bp.exp  |  2 +-
 gdb/testsuite/gdb.base/compare-sections.exp   |  2 +-
 gdb/testsuite/gdb.base/completion.exp         |  2 +-
 gdb/testsuite/gdb.base/complex-parts.exp      |  2 +-
 gdb/testsuite/gdb.base/complex.exp            |  6 +-
 gdb/testsuite/gdb.base/cond-eval-mode.exp     |  2 +-
 gdb/testsuite/gdb.base/cond-expr.exp          |  2 +-
 .../gdb.base/condbreak-call-false.exp         |  2 +-
 .../gdb.base/consecutive-step-over.exp        |  2 +-
 gdb/testsuite/gdb.base/consecutive.exp        |  8 +--
 gdb/testsuite/gdb.base/constvars.exp          |  4 +-
 gdb/testsuite/gdb.base/coredump-filter.exp    |  2 +-
 gdb/testsuite/gdb.base/corefile.exp           |  6 +-
 gdb/testsuite/gdb.base/corefile2.exp          |  4 +-
 gdb/testsuite/gdb.base/ctf-constvars.exp      |  2 +-
 gdb/testsuite/gdb.base/ctf-ptype.exp          | 10 ++--
 gdb/testsuite/gdb.base/decl-before-def.exp    |  2 +-
 gdb/testsuite/gdb.base/default.exp            | 10 ++--
 gdb/testsuite/gdb.base/define.exp             |  2 +-
 gdb/testsuite/gdb.base/dfp-test.exp           |  2 +-
 gdb/testsuite/gdb.base/disabled-location.exp  |  2 +-
 gdb/testsuite/gdb.base/display.exp            |  2 +-
 gdb/testsuite/gdb.base/dprintf-detach.exp     |  2 +-
 gdb/testsuite/gdb.base/dump.exp               | 20 +++----
 gdb/testsuite/gdb.base/duplicate-bp.exp       |  2 +-
 gdb/testsuite/gdb.base/eh_return.exp          |  2 +-
 gdb/testsuite/gdb.base/ena-dis-br.exp         | 16 ++---
 gdb/testsuite/gdb.base/endianity.exp          |  2 +-
 gdb/testsuite/gdb.base/enum_cond.exp          |  2 +-
 gdb/testsuite/gdb.base/eval-skip.exp          |  2 +-
 gdb/testsuite/gdb.base/exe-lock.exp           |  2 +-
 .../gdb.base/exec-invalid-sysroot.exp         |  2 +-
 .../gdb.base/execl-update-breakpoints.exp     |  6 +-
 gdb/testsuite/gdb.base/exprs.exp              |  2 +-
 gdb/testsuite/gdb.base/fileio.exp             |  2 +-
 gdb/testsuite/gdb.base/finish.exp             |  4 +-
 gdb/testsuite/gdb.base/fixsection.exp         |  2 +-
 gdb/testsuite/gdb.base/float.exp              | 30 +++++-----
 gdb/testsuite/gdb.base/float128.exp           |  2 +-
 gdb/testsuite/gdb.base/floatn.exp             |  2 +-
 gdb/testsuite/gdb.base/foll-exec-mode.exp     |  6 +-
 gdb/testsuite/gdb.base/foll-exec.exp          | 14 ++---
 gdb/testsuite/gdb.base/foll-vfork.exp         |  2 +-
 gdb/testsuite/gdb.base/fork-running-state.exp |  2 +-
 gdb/testsuite/gdb.base/frame-args.exp         |  2 +-
 .../gdb.base/frame-info-consistent.exp        |  2 +-
 gdb/testsuite/gdb.base/frameapply.exp         |  2 +-
 gdb/testsuite/gdb.base/funcargs.exp           | 28 ++++-----
 .../gdb.base/gcore-buffer-overflow.exp        |  2 +-
 gdb/testsuite/gdb.base/gcore.exp              |  8 +--
 gdb/testsuite/gdb.base/gdb1090.exp            |  2 +-
 gdb/testsuite/gdb.base/gdb11530.exp           |  2 +-
 gdb/testsuite/gdb.base/gdb11531.exp           |  2 +-
 gdb/testsuite/gdb.base/gdb1250.exp            |  2 +-
 gdb/testsuite/gdb.base/gdb1555.exp            |  2 +-
 gdb/testsuite/gdb.base/gdb1821.exp            |  2 +-
 gdb/testsuite/gdb.base/gnu-ifunc.exp          |  4 +-
 gdb/testsuite/gdb.base/gnu_vector.exp         |  2 +-
 gdb/testsuite/gdb.base/gold-gdb-index.exp     |  2 +-
 .../gdb.base/hbreak-in-shr-unsupported.exp    |  2 +-
 gdb/testsuite/gdb.base/hbreak2.exp            |  8 +--
 gdb/testsuite/gdb.base/hook-stop.exp          |  2 +-
 gdb/testsuite/gdb.base/huge.exp               |  2 +-
 gdb/testsuite/gdb.base/infcall-input.exp      |  2 +-
 gdb/testsuite/gdb.base/inferior-args.exp      |  2 +-
 gdb/testsuite/gdb.base/inferior-died.exp      |  2 +-
 gdb/testsuite/gdb.base/info-fun.exp           |  2 +-
 .../info-locals-unused-static-var.exp         |  2 +-
 gdb/testsuite/gdb.base/info-os.exp            |  6 +-
 gdb/testsuite/gdb.base/info-proc.exp          |  2 +-
 gdb/testsuite/gdb.base/info-program.exp       |  2 +-
 gdb/testsuite/gdb.base/info_qt.exp            |  2 +-
 .../gdb.base/inline-frame-cycle-unwind.exp    |  2 +-
 gdb/testsuite/gdb.base/interp.exp             |  2 +-
 gdb/testsuite/gdb.base/interrupt.exp          |  4 +-
 gdb/testsuite/gdb.base/jit-reader-exec.exp    |  2 +-
 gdb/testsuite/gdb.base/jump.exp               |  2 +-
 .../gdb.base/label-without-address.exp        |  2 +-
 gdb/testsuite/gdb.base/langs.exp              | 12 ++--
 gdb/testsuite/gdb.base/large-frame.exp        |  2 +-
 .../gdb.base/list-missing-source.exp          |  2 +-
 gdb/testsuite/gdb.base/list.exp               |  8 +--
 gdb/testsuite/gdb.base/logical.exp            |  2 +-
 .../gdb.base/long-inferior-output.exp         |  2 +-
 gdb/testsuite/gdb.base/long_long.exp          |  2 +-
 gdb/testsuite/gdb.base/longjmp.exp            |  2 +-
 .../gdb.base/maint-info-sections.exp          |  2 +-
 .../gdb.base/maint-print-frame-id.exp         |  2 +-
 gdb/testsuite/gdb.base/maint.exp              |  2 +-
 gdb/testsuite/gdb.base/max-value-size.exp     |  6 +-
 gdb/testsuite/gdb.base/memattr.exp            | 16 ++---
 gdb/testsuite/gdb.base/mips_pro.exp           |  6 +-
 gdb/testsuite/gdb.base/miscexprs.exp          |  2 +-
 gdb/testsuite/gdb.base/multi-forks.exp        |  2 +-
 gdb/testsuite/gdb.base/nodebug.exp            |  4 +-
 .../gdb.base/non-lazy-array-index.exp         |  2 +-
 gdb/testsuite/gdb.base/noreturn-finish.exp    |  2 +-
 gdb/testsuite/gdb.base/noreturn-return.exp    |  2 +-
 gdb/testsuite/gdb.base/opaque.exp             | 10 ++--
 gdb/testsuite/gdb.base/overlays.exp           | 14 ++---
 .../paginate-after-ctrl-c-running.exp         |  2 +-
 .../gdb.base/paginate-bg-execution.exp        |  2 +-
 .../gdb.base/paginate-inferior-exit.exp       |  2 +-
 gdb/testsuite/gdb.base/pc-fp.exp              |  2 +-
 gdb/testsuite/gdb.base/permissions.exp        |  2 +-
 gdb/testsuite/gdb.base/pie-execl.exp          |  4 +-
 gdb/testsuite/gdb.base/pointers.exp           |  2 +-
 gdb/testsuite/gdb.base/pr11022.exp            |  2 +-
 .../premature-dummy-frame-removal.exp         |  2 +-
 gdb/testsuite/gdb.base/printcmds.exp          |  2 +-
 gdb/testsuite/gdb.base/prologue.exp           |  2 +-
 gdb/testsuite/gdb.base/ptype.exp              | 12 ++--
 gdb/testsuite/gdb.base/quit-live.exp          |  2 +-
 gdb/testsuite/gdb.base/radix.exp              |  4 +-
 gdb/testsuite/gdb.base/readnever.exp          |  2 +-
 gdb/testsuite/gdb.base/recurse.exp            |  2 +-
 gdb/testsuite/gdb.base/reggroups.exp          |  2 +-
 gdb/testsuite/gdb.base/relational.exp         |  2 +-
 gdb/testsuite/gdb.base/remote.exp             | 10 ++--
 gdb/testsuite/gdb.base/return.exp             |  2 +-
 gdb/testsuite/gdb.base/return2.exp            |  6 +-
 gdb/testsuite/gdb.base/savedregs.exp          |  2 +-
 gdb/testsuite/gdb.base/scope.exp              | 60 +++++++++----------
 gdb/testsuite/gdb.base/sect-cmd.exp           |  2 +-
 gdb/testsuite/gdb.base/sepdebug.exp           | 16 ++---
 gdb/testsuite/gdb.base/set-noassign.exp       |  2 +-
 gdb/testsuite/gdb.base/setshow.exp            |  4 +-
 gdb/testsuite/gdb.base/setvar.exp             |  4 +-
 gdb/testsuite/gdb.base/shlib-call.exp         |  2 +-
 gdb/testsuite/gdb.base/shreloc.exp            |  2 +-
 gdb/testsuite/gdb.base/sigall.exp             |  8 +--
 gdb/testsuite/gdb.base/sigaltstack.exp        |  2 +-
 gdb/testsuite/gdb.base/sigbpt.exp             |  2 +-
 gdb/testsuite/gdb.base/siginfo-addr.exp       |  2 +-
 gdb/testsuite/gdb.base/siginfo-obj.exp        |  4 +-
 gdb/testsuite/gdb.base/siginfo-thread.exp     |  2 +-
 gdb/testsuite/gdb.base/siginfo.exp            |  2 +-
 .../gdb.base/signals-state-child.exp          |  2 +-
 gdb/testsuite/gdb.base/signals.exp            |  2 +-
 gdb/testsuite/gdb.base/signest.exp            |  2 +-
 gdb/testsuite/gdb.base/signull.exp            |  2 +-
 gdb/testsuite/gdb.base/sigrepeat.exp          |  2 +-
 gdb/testsuite/gdb.base/sizeof.exp             |  2 +-
 gdb/testsuite/gdb.base/so-impl-ld.exp         |  2 +-
 gdb/testsuite/gdb.base/solib-disc.exp         |  2 +-
 gdb/testsuite/gdb.base/solib-display.exp      |  2 +-
 gdb/testsuite/gdb.base/solib-symbol.exp       |  2 +-
 gdb/testsuite/gdb.base/source-dir.exp         |  2 +-
 gdb/testsuite/gdb.base/source-execution.exp   |  2 +-
 gdb/testsuite/gdb.base/sss-bp-on-user-bp.exp  |  2 +-
 gdb/testsuite/gdb.base/stack-checking.exp     |  2 +-
 gdb/testsuite/gdb.base/stack-protector.exp    |  2 +-
 gdb/testsuite/gdb.base/step-break.exp         |  2 +-
 gdb/testsuite/gdb.base/step-line.exp          |  2 +-
 gdb/testsuite/gdb.base/step-over-syscall.exp  |  4 +-
 gdb/testsuite/gdb.base/step-test.exp          |  4 +-
 gdb/testsuite/gdb.base/store.exp              |  2 +-
 gdb/testsuite/gdb.base/structs.exp            |  2 +-
 gdb/testsuite/gdb.base/structs2.exp           |  2 +-
 gdb/testsuite/gdb.base/sym-file.exp           | 12 ++--
 gdb/testsuite/gdb.base/symbol-alias.exp       |  2 +-
 gdb/testsuite/gdb.base/term.exp               |  2 +-
 gdb/testsuite/gdb.base/twice.exp              |  2 +-
 gdb/testsuite/gdb.base/type-opaque.exp        |  2 +-
 gdb/testsuite/gdb.base/until.exp              |  2 +-
 .../gdb.base/unwind-on-each-insn.exp          |  2 +-
 gdb/testsuite/gdb.base/varargs.exp            |  2 +-
 gdb/testsuite/gdb.base/volatile.exp           |  4 +-
 gdb/testsuite/gdb.base/watch-cond-infcall.exp |  2 +-
 gdb/testsuite/gdb.base/watch-cond.exp         |  6 +-
 gdb/testsuite/gdb.base/watch-non-mem.exp      |  2 +-
 gdb/testsuite/gdb.base/watch-read.exp         |  2 +-
 gdb/testsuite/gdb.base/watch-vfork.exp        |  2 +-
 gdb/testsuite/gdb.base/watch_thread_num.exp   |  2 +-
 .../gdb.base/watchpoint-reuse-slot.exp        |  2 +-
 .../watchpoint-stops-at-right-insn.exp        |  4 +-
 gdb/testsuite/gdb.base/watchpoint.exp         | 18 +++---
 gdb/testsuite/gdb.base/wchar.exp              |  2 +-
 gdb/testsuite/gdb.base/whatis-exp.exp         |  2 +-
 .../gdb.base/whatis-ptype-typedefs.exp        |  4 +-
 gdb/testsuite/gdb.base/whatis.exp             |  6 +-
 216 files changed, 433 insertions(+), 433 deletions(-)

diff --git a/gdb/testsuite/gdb.base/a2-run.exp b/gdb/testsuite/gdb.base/a2-run.exp
index 0b814335053..5c94becc592 100644
--- a/gdb/testsuite/gdb.base/a2-run.exp
+++ b/gdb/testsuite/gdb.base/a2-run.exp
@@ -124,7 +124,7 @@ if {$res == 0} {
 
 # The remaining tests don't work for targets can't take arguments...
 
-if [target_info exists noargs] then {
+if {[target_info exists noargs]} {
     verbose "Skipping rest of a2-run.exp because of noargs."
     return
 }
@@ -166,7 +166,7 @@ gdb_test_stdio "" "720" "" "run \"$testfile\" again after setting args"
 
 # GOAL: Test that shell is being used with "run".  For remote debugging
 # targets, there is no guarantee that a "shell" (whatever that is) is used.
-if ![is_remote target] then {
+if {![is_remote target]} {
     gdb_test_stdio "run `echo 8`" \
 	"40320" "" "run \"$testfile\" with shell"
 }
diff --git a/gdb/testsuite/gdb.base/advance.exp b/gdb/testsuite/gdb.base/advance.exp
index cbc7515749d..10f81174ad0 100644
--- a/gdb/testsuite/gdb.base/advance.exp
+++ b/gdb/testsuite/gdb.base/advance.exp
@@ -21,7 +21,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
     return -1
 }
 
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 
diff --git a/gdb/testsuite/gdb.base/alias.exp b/gdb/testsuite/gdb.base/alias.exp
index d73a2183c98..98f660ae771 100644
--- a/gdb/testsuite/gdb.base/alias.exp
+++ b/gdb/testsuite/gdb.base/alias.exp
@@ -32,7 +32,7 @@ proc test_abbrev_not_present { alias_name } {
 	    exp_continue
 	}
 	-re ".*$gdb_prompt $" {
-	    if { !$alias_present } then {
+	    if {!$alias_present} {
 		pass $test_name
 	    } else {
 		fail $test_name
diff --git a/gdb/testsuite/gdb.base/all-bin.exp b/gdb/testsuite/gdb.base/all-bin.exp
index cf53cd7997e..2bb9cfe900e 100644
--- a/gdb/testsuite/gdb.base/all-bin.exp
+++ b/gdb/testsuite/gdb.base/all-bin.exp
@@ -37,7 +37,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
 # set it up at a breakpoint so we can play with the variable values
 #
 
-if ![runto_main] then {
+if {![runto_main]} {
     perror "couldn't run to breakpoint"
     return
 }
diff --git a/gdb/testsuite/gdb.base/annota-input-while-running.exp b/gdb/testsuite/gdb.base/annota-input-while-running.exp
index 2b4c5e17321..2eff5be733f 100644
--- a/gdb/testsuite/gdb.base/annota-input-while-running.exp
+++ b/gdb/testsuite/gdb.base/annota-input-while-running.exp
@@ -24,7 +24,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug] == -1} {
 
 # Because runto_main doesn't know how to handle the prompt with annotations,
 # run to main before we set the annotation level.
-if ![runto_main] then {
+if {![runto_main]} {
    return 1
 }
 
diff --git a/gdb/testsuite/gdb.base/annota1.exp b/gdb/testsuite/gdb.base/annota1.exp
index 8060d3c8934..675f3afe2d4 100644
--- a/gdb/testsuite/gdb.base/annota1.exp
+++ b/gdb/testsuite/gdb.base/annota1.exp
@@ -501,7 +501,7 @@ proc thread_test {} {
 	gdb_start
 	gdb_reinitialize_dir $srcdir/$subdir
 	gdb_load ${binfile}
-	if { ![runto_main] } then {
+	if {![runto_main]} {
 	    return
 	}
 
diff --git a/gdb/testsuite/gdb.base/anon.exp b/gdb/testsuite/gdb.base/anon.exp
index 83db599bf72..8d67b8e1b07 100644
--- a/gdb/testsuite/gdb.base/anon.exp
+++ b/gdb/testsuite/gdb.base/anon.exp
@@ -20,7 +20,7 @@ if { [prepare_for_testing "failed to prepare" $testfile $srcfile {debug}] } {
     return -1
 }
 
-if { ![runto_main] } then {
+if {![runto_main]} {
     return
 }
 
diff --git a/gdb/testsuite/gdb.base/arithmet.exp b/gdb/testsuite/gdb.base/arithmet.exp
index 4905c2e2706..4fa2ab2f888 100644
--- a/gdb/testsuite/gdb.base/arithmet.exp
+++ b/gdb/testsuite/gdb.base/arithmet.exp
@@ -37,7 +37,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug nowarning
 # set it up at a breakpoint so we can play with the variable values
 #
 
-if ![runto_main] then {
+if {![runto_main]} {
     perror "couldn't run to breakpoint"
     return
 }
diff --git a/gdb/testsuite/gdb.base/arrayidx.exp b/gdb/testsuite/gdb.base/arrayidx.exp
index 7df03346045..677e4f0fcc3 100644
--- a/gdb/testsuite/gdb.base/arrayidx.exp
+++ b/gdb/testsuite/gdb.base/arrayidx.exp
@@ -26,7 +26,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debu
 
 clean_restart ${binfile}
 
-if ![runto_main] then {
+if {![runto_main]} {
     perror "couldn't run to breakpoint"
     return
 }
diff --git a/gdb/testsuite/gdb.base/assign.exp b/gdb/testsuite/gdb.base/assign.exp
index a0dd46d7bb2..526e0638fcc 100644
--- a/gdb/testsuite/gdb.base/assign.exp
+++ b/gdb/testsuite/gdb.base/assign.exp
@@ -40,7 +40,7 @@ clean_restart ${binfile}
 # set it up at a breakpoint so we can play with the variable values
 #
 
-if ![runto_main] then {
+if {![runto_main]} {
     perror "couldn't run to breakpoint"
     return
 }
diff --git a/gdb/testsuite/gdb.base/async.exp b/gdb/testsuite/gdb.base/async.exp
index 83e56e71580..7630581edca 100644
--- a/gdb/testsuite/gdb.base/async.exp
+++ b/gdb/testsuite/gdb.base/async.exp
@@ -27,7 +27,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
 #
 # set it up at a breakpoint so we can play with it
 #
-if ![runto_main] then {
+if {![runto_main]} {
     perror "couldn't run to breakpoint"
     return
 }
diff --git a/gdb/testsuite/gdb.base/attach-wait-input.exp b/gdb/testsuite/gdb.base/attach-wait-input.exp
index 2f02c14f1d2..b4b19ac8592 100644
--- a/gdb/testsuite/gdb.base/attach-wait-input.exp
+++ b/gdb/testsuite/gdb.base/attach-wait-input.exp
@@ -47,7 +47,7 @@ proc start_program {binfile} {
 
     clean_restart $binfile
 
-    if ![runto setup_done] then {
+    if {![runto setup_done]} {
 	return 0
     }
 
diff --git a/gdb/testsuite/gdb.base/attach.exp b/gdb/testsuite/gdb.base/attach.exp
index cfe806bb9dd..453fdbc7857 100644
--- a/gdb/testsuite/gdb.base/attach.exp
+++ b/gdb/testsuite/gdb.base/attach.exp
@@ -453,7 +453,7 @@ proc_with_prefix do_command_attach_tests {} {
     global gdb_prompt
     global binfile
 
-    if ![isnative] then {
+    if {![isnative]} {
 	unsupported "command attach test"
 	return 0
     }
diff --git a/gdb/testsuite/gdb.base/auto-connect-native-target.exp b/gdb/testsuite/gdb.base/auto-connect-native-target.exp
index 94220464d7a..b60cf8fad01 100644
--- a/gdb/testsuite/gdb.base/auto-connect-native-target.exp
+++ b/gdb/testsuite/gdb.base/auto-connect-native-target.exp
@@ -68,7 +68,7 @@ if { $topmost != "exec" } {
 
 # Check which target this board connects to.  If testing with a native
 # target board, this should cause the native target to auto connect.
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 
diff --git a/gdb/testsuite/gdb.base/auxv.exp b/gdb/testsuite/gdb.base/auxv.exp
index 390f559a4a3..a1bb38d4b2c 100644
--- a/gdb/testsuite/gdb.base/auxv.exp
+++ b/gdb/testsuite/gdb.base/auxv.exp
@@ -56,7 +56,7 @@ if {$core_works} {
     }
 }
 
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 set print_core_line [gdb_get_line_number "ABORT;"]
diff --git a/gdb/testsuite/gdb.base/backtrace.exp b/gdb/testsuite/gdb.base/backtrace.exp
index dec4ed6abb4..6e584287ad9 100644
--- a/gdb/testsuite/gdb.base/backtrace.exp
+++ b/gdb/testsuite/gdb.base/backtrace.exp
@@ -21,7 +21,7 @@ if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } {
     return -1
 }
 
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 
diff --git a/gdb/testsuite/gdb.base/bfp-test.exp b/gdb/testsuite/gdb.base/bfp-test.exp
index 07282595b44..174152140f9 100644
--- a/gdb/testsuite/gdb.base/bfp-test.exp
+++ b/gdb/testsuite/gdb.base/bfp-test.exp
@@ -25,7 +25,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debu
 
 clean_restart ${binfile}
 
-if ![runto_main] then {
+if {![runto_main]} {
     perror "couldn't run to breakpoint"
     return
 }
diff --git a/gdb/testsuite/gdb.base/bigcore.exp b/gdb/testsuite/gdb.base/bigcore.exp
index 13b70f7dd5d..8acb716c9b5 100644
--- a/gdb/testsuite/gdb.base/bigcore.exp
+++ b/gdb/testsuite/gdb.base/bigcore.exp
@@ -20,7 +20,7 @@
 # Are we on a target board?  As of 2004-02-12, GDB didn't have a
 # mechanism that would let it efficiently access a remote corefile.
 
-if ![isnative] then {
+if {![isnative]} {
     untested "remote system"
     return
 }
@@ -55,7 +55,7 @@ gdb_test_no_output "set width 0"
 # Get the core into the output directory.
 set_inferior_cwd_to_output_dir
 
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 set print_core_line [gdb_get_line_number "Dump core"]
diff --git a/gdb/testsuite/gdb.base/bitfields2.exp b/gdb/testsuite/gdb.base/bitfields2.exp
index f71ca423f5d..5b89455572d 100644
--- a/gdb/testsuite/gdb.base/bitfields2.exp
+++ b/gdb/testsuite/gdb.base/bitfields2.exp
@@ -160,7 +160,7 @@ proc bitfield_signedness {} {
     }
 
     set test "most negative signed bitfield values"
-    if $has_signed_bitfields then {
+    if {$has_signed_bitfields} {
         gdb_test "print flags" "u1 = 0, u2 = 0, u3 = 0, s1 = -16384, s2 = -4294967296, s3 = -32768.*" $test
     } else {
 	unsupported $test
@@ -169,7 +169,7 @@ proc bitfield_signedness {} {
     continue_test break4 "#2"
 
     set test "signed bitfields containing -1"
-    if $has_signed_bitfields then {
+    if {$has_signed_bitfields} {
 	gdb_test "print flags" "u1 = 0, u2 = 0, u3 = 0, s1 = -1, s2 = -1, s3 = -1.*" $test
     } else {
 	unsupported $test
@@ -212,7 +212,7 @@ proc bitfield_set {} {
     gdb_test "print flags" "u1 = 0, u2 = 4294967296, u3 = 0, s1 = 0, s2 = 2147483648, s3 = 0.*" "long long bitfield values after set"
 
     set test "set long long signed bitfield negative"
-    if $has_signed_bitfields then {
+    if {$has_signed_bitfields} {
 	gdb_test_multiple "print flags.s2 = -1" $test {
 	    -re "warning: Value does not fit.*$gdb_prompt $" {
 		fail "$test"
@@ -226,7 +226,7 @@ proc bitfield_set {} {
     }
 
     set test  "long long bitfield values after set negative"
-    if $has_signed_bitfields then {
+    if {$has_signed_bitfields} {
 	gdb_test "print flags" "u1 = 0, u2 = 4294967296, u3 = 0, s1 = 0, s2 = -1, s3 = 0.*" $test
     } else {
 	unsupported $test
diff --git a/gdb/testsuite/gdb.base/bp-permanent.exp b/gdb/testsuite/gdb.base/bp-permanent.exp
index 1ad9a698db8..5997b5685d0 100644
--- a/gdb/testsuite/gdb.base/bp-permanent.exp
+++ b/gdb/testsuite/gdb.base/bp-permanent.exp
@@ -44,7 +44,7 @@ proc test {always_inserted sw_watchpoint} {
 
     clean_restart $binfile
 
-    if ![runto_main] then {
+    if {![runto_main]} {
 	return -1
     }
 
diff --git a/gdb/testsuite/gdb.base/break-idempotent.exp b/gdb/testsuite/gdb.base/break-idempotent.exp
index 837ac000b57..b3500101a1a 100644
--- a/gdb/testsuite/gdb.base/break-idempotent.exp
+++ b/gdb/testsuite/gdb.base/break-idempotent.exp
@@ -115,7 +115,7 @@ proc test_break { always_inserted break_command } {
     with_test_prefix "$cmd" {
 	delete_breakpoints
 
-	if ![runto_main] then {
+	if {![runto_main]} {
 	    return
 	}
 
diff --git a/gdb/testsuite/gdb.base/break-unload-file.exp b/gdb/testsuite/gdb.base/break-unload-file.exp
index ed14772e71c..83edaedb45c 100644
--- a/gdb/testsuite/gdb.base/break-unload-file.exp
+++ b/gdb/testsuite/gdb.base/break-unload-file.exp
@@ -59,7 +59,7 @@ proc test_break { initial_load always_inserted break_command } {
 	gdb_reload
 	set GDBFLAGS $saved_gdbflags
 
-	if ![runto_main] then {
+	if {![runto_main]} {
 	    return
 	}
 
diff --git a/gdb/testsuite/gdb.base/break.exp b/gdb/testsuite/gdb.base/break.exp
index 4421459154f..d5051bc5d99 100644
--- a/gdb/testsuite/gdb.base/break.exp
+++ b/gdb/testsuite/gdb.base/break.exp
@@ -176,7 +176,7 @@ gdb_test_multiple "info break 2 4 6" "info break 2 4 6" {
 	exp_continue
     }
     -re ".*$gdb_prompt $" {
-	if { !$see1 && $see2 && !$see3 && $see4 && !$see5 && $see6 } then {
+	if {!$see1 && $see2 && !$see3 && $see4 && !$see5 && $see6} {
 	    pass "info break 2 4 6"
 	} else {
 	    fail "info break 2 4 6"
@@ -217,7 +217,7 @@ gdb_test_multiple "info break 3-5" "info break 3-5" {
 	exp_continue
     }
     -re ".*$gdb_prompt $" {
-	if { !$see1 && !$see2 && $see3 && $see4 && $see5 && !$see6 } then {
+	if {!$see1 && !$see2 && $see3 && $see4 && $see5 && !$see6} {
 	    pass "info break 3-5"
 	} else {
 	    fail "info break 3-5"
@@ -275,7 +275,7 @@ with_test_prefix "with value history" {
 	    exp_continue
 	}
 	-re ".*$gdb_prompt $" {
-	    if { $see1 && $see2 && $see3 && $see4 && $see5 && $see6 } then {
+	    if {$see1 && $see2 && $see3 && $see4 && $see5 && $see6} {
 		pass "check disable with history values"
 	    } else {
 		fail "check disable with history values"
@@ -323,7 +323,7 @@ with_test_prefix "with convenience vars" {
 	    exp_continue
 	}
 	-re ".*$gdb_prompt $" {
-	    if { $see1 && $see2 && $see3 && $see4 && $see5 && $see6 } then {
+	    if {$see1 && $see2 && $see3 && $see4 && $see5 && $see6} {
 		pass "check disable with convenience values"
 	    } else {
 		fail "check disable with convenience values"
@@ -479,7 +479,7 @@ gdb_test "info break" "Num     Type.*Disp Enb Address.*What.*\[\r\n\]
 # inappropriately.  (There are no calls to those system functions
 # in this test program.)
 #
-if ![runto_main] then {
+if {![runto_main]} {
     return
 }
 
@@ -534,7 +534,7 @@ gdb_test "break if (1)" \
 # Verify that a "silent" breakpoint can be set, and that GDB is indeed
 # "silent" about its triggering.
 #
-if ![runto_main] then {
+if {![runto_main]} {
     return
 }
 
@@ -652,7 +652,7 @@ gdb_test_multiple "finish" "finish from called function" {
 # Verify that GDB responds gracefully to a "finish" command with
 # arguments.
 #
-if ![runto_main] then {
+if {![runto_main]} {
     return
 }
 
diff --git a/gdb/testsuite/gdb.base/bt-on-error-and-warning.exp b/gdb/testsuite/gdb.base/bt-on-error-and-warning.exp
index 0dfd13c2428..a9026e1d69c 100644
--- a/gdb/testsuite/gdb.base/bt-on-error-and-warning.exp
+++ b/gdb/testsuite/gdb.base/bt-on-error-and-warning.exp
@@ -25,7 +25,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile]} {
 
 # Check we can run to main.  If this works this time then we just
 # assume that it will work later on (when we repeatedly restart GDB).
-if ![runto_main] then {
+if {![runto_main]} {
     return -1
 }
 
diff --git a/gdb/testsuite/gdb.base/bt-on-fatal-signal.exp b/gdb/testsuite/gdb.base/bt-on-fatal-signal.exp
index 8f9d857106d..0c23ac7b026 100644
--- a/gdb/testsuite/gdb.base/bt-on-fatal-signal.exp
+++ b/gdb/testsuite/gdb.base/bt-on-fatal-signal.exp
@@ -34,7 +34,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile]} {
 
 # Check we can run to main.  If this works this time then we just
 # assume that it will work later on (when we repeatedly restart GDB).
-if ![runto_main] then {
+if {![runto_main]} {
     return -1
 }
 
diff --git a/gdb/testsuite/gdb.base/bt-selected-frame.exp b/gdb/testsuite/gdb.base/bt-selected-frame.exp
index e1018e4992a..912b87512ad 100644
--- a/gdb/testsuite/gdb.base/bt-selected-frame.exp
+++ b/gdb/testsuite/gdb.base/bt-selected-frame.exp
@@ -28,7 +28,7 @@ proc check_selected_frame_after_bt { bt_cmd stack_pattern } {
 
     with_test_prefix $bt_cmd {
 
-	if ![runto_main] then {
+	if {![runto_main]} {
 	    return 0
 	}
 
diff --git a/gdb/testsuite/gdb.base/call-ar-st.exp b/gdb/testsuite/gdb.base/call-ar-st.exp
index 2da438ccd96..a5599d741a6 100644
--- a/gdb/testsuite/gdb.base/call-ar-st.exp
+++ b/gdb/testsuite/gdb.base/call-ar-st.exp
@@ -44,7 +44,7 @@ gdb_test_no_output "set print address off"
 gdb_test_no_output "set width 0"
 
 
-if ![runto_main] then {
+if {![runto_main]} {
     perror "couldn't run to breakpoint"
     return
 }
@@ -432,7 +432,7 @@ if {!$skip_float_test && \
     # On 32-bit SPARC, some of the args are passed by ref, others by
     # value, and GDB gets confused and says "Invalid cast" because it
     # thinks it has to cast the structure into a pointer to structure.
-    if { [test_debug_format "stabs"] } then {
+    if {[test_debug_format "stabs"]} {
 	setup_kfail "gdb/1539" "sparc-*-*"
     }
 
diff --git a/gdb/testsuite/gdb.base/call-rt-st.exp b/gdb/testsuite/gdb.base/call-rt-st.exp
index 00af32c13a1..63792ee73e5 100644
--- a/gdb/testsuite/gdb.base/call-rt-st.exp
+++ b/gdb/testsuite/gdb.base/call-rt-st.exp
@@ -45,7 +45,7 @@ gdb_test_no_output "set print address off"
 gdb_test_no_output "set width 0"
 
 
-if ![runto_main] then {
+if {![runto_main]} {
     perror "couldn't run to breakpoint"
     return
 }
diff --git a/gdb/testsuite/gdb.base/call-sc.exp b/gdb/testsuite/gdb.base/call-sc.exp
index ddf2ceedf96..46da6506b25 100644
--- a/gdb/testsuite/gdb.base/call-sc.exp
+++ b/gdb/testsuite/gdb.base/call-sc.exp
@@ -61,7 +61,7 @@ proc start_scalars_test { type } {
     }
 
     # Advance to main
-    if { ![runto_main] } then {
+    if {![runto_main]} {
 	return
     }
 
diff --git a/gdb/testsuite/gdb.base/call-strs.exp b/gdb/testsuite/gdb.base/call-strs.exp
index 58cb3cda38d..f9335815da3 100644
--- a/gdb/testsuite/gdb.base/call-strs.exp
+++ b/gdb/testsuite/gdb.base/call-strs.exp
@@ -42,7 +42,7 @@ gdb_test_no_output "set print address off"
 gdb_test_no_output "set print symbol off"
 gdb_test_no_output "set width 0"
 
-if ![runto_main] then {
+if {![runto_main]} {
     perror "couldn't run to breakpoint"
     return
 }
diff --git a/gdb/testsuite/gdb.base/callfuncs.exp b/gdb/testsuite/gdb.base/callfuncs.exp
index 44289eebc8b..9b98f681fc1 100644
--- a/gdb/testsuite/gdb.base/callfuncs.exp
+++ b/gdb/testsuite/gdb.base/callfuncs.exp
@@ -368,7 +368,7 @@ proc perform_all_tests {prototypes} {
     # Check if all registers still have the same value.
     set new_reg_content [fetch_all_registers \
 			     "register contents after gdb function calls"]
-    if {$old_reg_content == $new_reg_content} then {
+    if {$old_reg_content == $new_reg_content} {
 	pass "gdb function calls preserve register contents"
     } else {
 	set old_reg_content $new_reg_content
@@ -394,7 +394,7 @@ proc perform_all_tests {prototypes} {
 	     "bt after continuing from call dummy breakpoint"] then {
 		 set new_reg_content [fetch_all_registers \
 					  "register contents after stop in call dummy"]
-		 if {$old_reg_content == $new_reg_content} then {
+		 if {$old_reg_content == $new_reg_content} {
 		     pass "continue after stop in call dummy preserves register contents"
 		 } else {
 		     fail "continue after stop in call dummy preserves register contents"
@@ -420,7 +420,7 @@ proc perform_all_tests {prototypes} {
 	     "bt after finishing from call dummy breakpoint"] then {
 		 set new_reg_content [fetch_all_registers \
 					  "register contents after finish in call dummy"]
-		 if {$old_reg_content == $new_reg_content} then {
+		 if {$old_reg_content == $new_reg_content} {
 		     pass "finish after stop in call dummy preserves register contents"
 		 } else {
 		     fail "finish after stop in call dummy preserves register contents"
@@ -445,7 +445,7 @@ proc perform_all_tests {prototypes} {
 	     "y"] then {
 		 set new_reg_content [fetch_all_registers \
 					  "register contents after return in call dummy"]
-		 if {$old_reg_content == $new_reg_content} then {
+		 if {$old_reg_content == $new_reg_content} {
 		     pass "return after stop in call dummy preserves register contents"
 		 } else {
 		     fail "return after stop in call dummy preserves register contents"
@@ -508,7 +508,7 @@ proc perform_all_tests {prototypes} {
 
     set new_reg_content [fetch_all_registers \
 			     "register contents after nested call dummies"]
-    if {$old_reg_content == $new_reg_content} then {
+    if {$old_reg_content == $new_reg_content} {
 	pass "nested call dummies preserve register contents"
     } else {
 	fail "nested call dummies preserve register contents"
diff --git a/gdb/testsuite/gdb.base/catch-fork-static.exp b/gdb/testsuite/gdb.base/catch-fork-static.exp
index 51031a84fbd..07f05951e2d 100644
--- a/gdb/testsuite/gdb.base/catch-fork-static.exp
+++ b/gdb/testsuite/gdb.base/catch-fork-static.exp
@@ -23,7 +23,7 @@
 
 # Until "catch fork" is implemented on other targets...
 #
-if { ![istarget "*-*-linux*"] && ![istarget "*-*-openbsd*"] } then {
+if {![istarget "*-*-linux*"] && ![istarget "*-*-openbsd*"]} {
     return
 }
 
diff --git a/gdb/testsuite/gdb.base/catch-signal-siginfo-cond.exp b/gdb/testsuite/gdb.base/catch-signal-siginfo-cond.exp
index 85a55b29ea5..c18c5fb0cb8 100644
--- a/gdb/testsuite/gdb.base/catch-signal-siginfo-cond.exp
+++ b/gdb/testsuite/gdb.base/catch-signal-siginfo-cond.exp
@@ -41,7 +41,7 @@ if { [prepare_for_testing "failed to prepare" "${testfile}" $srcfile {debug}] }
     return -1
 }
 
-if ![runto_main] then {
+if {![runto_main]} {
     return -1
 }
 
diff --git a/gdb/testsuite/gdb.base/catch-syscall.exp b/gdb/testsuite/gdb.base/catch-syscall.exp
index d8b6898b3e0..2364b47bf7e 100644
--- a/gdb/testsuite/gdb.base/catch-syscall.exp
+++ b/gdb/testsuite/gdb.base/catch-syscall.exp
@@ -26,7 +26,7 @@ if  { [prepare_for_testing "failed to prepare" $testfile ${testfile}.c] } {
 }
 
 # Check target supports catch syscall or not.
-if ![runto_main] then {
+if {![runto_main]} {
     return
 }
 
@@ -464,40 +464,40 @@ proc do_syscall_tests {} {
 
     # Testing the 'catch syscall' command without arguments.
     # This test should catch any syscalls.
-    if [runto_main] then { test_catch_syscall_without_args }
+    if {[runto_main]} { test_catch_syscall_without_args }
 
     # Testing the 'catch syscall' command with arguments.
     # This test should only catch the specified syscall.
-    if [runto_main] then { test_catch_syscall_with_args }
+    if {[runto_main]} { test_catch_syscall_with_args }
 
     # Testing the 'catch syscall' command with many arguments.
     # This test should catch $all_syscalls.
-    if [runto_main] then { test_catch_syscall_with_many_args }
+    if {[runto_main]} { test_catch_syscall_with_many_args }
 
     # Testing the 'catch syscall' command with WRONG arguments.
     # This test should not trigger any catchpoints.
-    if [runto_main] then { test_catch_syscall_with_wrong_args }
+    if {[runto_main]} { test_catch_syscall_with_wrong_args }
 
     # Testing the 'catch syscall' command during a restart of
     # the inferior.
-    if [runto_main] then { test_catch_syscall_restarting_inferior }
+    if {[runto_main]} { test_catch_syscall_restarting_inferior }
 
     # Testing the 'catch syscall' command toggling off past a
     # syscall return, then resuming entry/return as normal.
-    if [runto_main] then { test_catch_syscall_skipping_return }
+    if {[runto_main]} { test_catch_syscall_skipping_return }
 
     # Testing the 'catch syscall' command starting mid-vfork.
-    if [runto_main] then { test_catch_syscall_mid_vfork }
+    if {[runto_main]} { test_catch_syscall_mid_vfork }
 
     # Testing that 'catch syscall' entry/return tracks across execve.
-    if [runto_main] then { test_catch_syscall_execve }
+    if {[runto_main]} { test_catch_syscall_execve }
 
     # Testing if the 'catch syscall' command works when switching to
     # different architectures on-the-fly (PR gdb/10737).
-    if [runto_main] then { test_catch_syscall_multi_arch }
+    if {[runto_main]} { test_catch_syscall_multi_arch }
 
     # Testing the 'catch' syscall command for a group of syscalls.
-    if [runto_main] then { test_catch_syscall_group }
+    if {[runto_main]} { test_catch_syscall_group }
 }
 
 proc test_catch_syscall_without_args_noxml {} {
@@ -662,16 +662,16 @@ proc do_syscall_tests_without_xml {} {
 
     # Let's test if we can catch syscalls without XML support.
     # We should succeed, but GDB is not supposed to print syscall names.
-    if [runto_main] then { test_catch_syscall_without_args_noxml }
+    if {[runto_main]} { test_catch_syscall_without_args_noxml }
 
     # The only valid argument "catch syscall" should accept is the
     # syscall number, and not the name (since it can't translate a
     # name to a number).
-    if [runto_main] then { test_catch_syscall_with_args_noxml }
+    if {[runto_main]} { test_catch_syscall_with_args_noxml }
 
     # Now, we'll try to provide a syscall name (valid or not) to the command,
     # and expect it to fail.
-    if [runto_main] then { test_catch_syscall_with_wrong_args_noxml }
+    if {[runto_main]} { test_catch_syscall_with_wrong_args_noxml }
 }
 
 # This procedure fills the vector "all_syscalls_numbers" with the proper
diff --git a/gdb/testsuite/gdb.base/checkpoint.exp b/gdb/testsuite/gdb.base/checkpoint.exp
index e81e4f44e48..0fef9c551bd 100644
--- a/gdb/testsuite/gdb.base/checkpoint.exp
+++ b/gdb/testsuite/gdb.base/checkpoint.exp
@@ -16,7 +16,7 @@
 # Until "set follow-fork-mode" and "catch fork" are implemented on
 # other targets...
 #
-if {![istarget "*-*-linux*"]} then {
+if {![istarget "*-*-linux*"]} {
     return
 }
 
diff --git a/gdb/testsuite/gdb.base/clear_non_user_bp.exp b/gdb/testsuite/gdb.base/clear_non_user_bp.exp
index da694351c87..2995f0d567f 100644
--- a/gdb/testsuite/gdb.base/clear_non_user_bp.exp
+++ b/gdb/testsuite/gdb.base/clear_non_user_bp.exp
@@ -49,7 +49,7 @@ if  { [gdb_compile "${srcdir}/${subdir}/main.c" "${binfile}" executable {debug}]
 # Start with a fresh gdb.
 clean_restart ${binfile}
 
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 
diff --git a/gdb/testsuite/gdb.base/compare-sections.exp b/gdb/testsuite/gdb.base/compare-sections.exp
index d9d10d42680..9885b0c0602 100644
--- a/gdb/testsuite/gdb.base/compare-sections.exp
+++ b/gdb/testsuite/gdb.base/compare-sections.exp
@@ -79,7 +79,7 @@ gdb_test_multiple $command $test {
 }
 
 # Now get past startup code.
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 
diff --git a/gdb/testsuite/gdb.base/completion.exp b/gdb/testsuite/gdb.base/completion.exp
index e3803c9d2d5..2a46d4fd21b 100644
--- a/gdb/testsuite/gdb.base/completion.exp
+++ b/gdb/testsuite/gdb.base/completion.exp
@@ -57,7 +57,7 @@ if {[prepare_for_testing "failed to prepare" $testfile \
     return -1
 }
 
-if ![runto_main] then {
+if {![runto_main]} {
         perror "tests suppressed"
 }
 
diff --git a/gdb/testsuite/gdb.base/complex-parts.exp b/gdb/testsuite/gdb.base/complex-parts.exp
index 7fa94c72cd4..0075b8333e3 100644
--- a/gdb/testsuite/gdb.base/complex-parts.exp
+++ b/gdb/testsuite/gdb.base/complex-parts.exp
@@ -19,7 +19,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
     return -1
 }
 
-if { ![runto_main] } then {
+if {![runto_main]} {
     return 0
 }
 
diff --git a/gdb/testsuite/gdb.base/complex.exp b/gdb/testsuite/gdb.base/complex.exp
index e2c60029593..5d97c87e42a 100644
--- a/gdb/testsuite/gdb.base/complex.exp
+++ b/gdb/testsuite/gdb.base/complex.exp
@@ -20,16 +20,16 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
     return -1
 }
 
-if [runto f2] then {
+if {[runto f2]} {
     get_debug_format
-    if { [test_compiler_info gcc-2-*] && [test_debug_format "DWARF \[0-9\]"] } then {
+    if {[test_compiler_info gcc-2-*] && [test_debug_format "DWARF \[0-9\]"]} {
 	setup_xfail "*-*-*"
     }
     gdb_test "p *y" "\\\$\[0-9\]* = \{c = 42 '\\*', f = 1 \\+ 0i\}" \
 	    "print complex packed value in C"
 }
 
-if [runto f4] then {
+if {[runto f4]} {
     gdb_test "p *y" "\\\$\[0-9\]* = \{c = 42 '\\*', f = 1 \\+ 0i\}" \
 	    "print complex value in C"
 }
diff --git a/gdb/testsuite/gdb.base/cond-eval-mode.exp b/gdb/testsuite/gdb.base/cond-eval-mode.exp
index f6e8b3e71b2..61c28b5925d 100644
--- a/gdb/testsuite/gdb.base/cond-eval-mode.exp
+++ b/gdb/testsuite/gdb.base/cond-eval-mode.exp
@@ -29,7 +29,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
     return -1
 }
 
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 
diff --git a/gdb/testsuite/gdb.base/cond-expr.exp b/gdb/testsuite/gdb.base/cond-expr.exp
index f0c4c328594..36754f92158 100644
--- a/gdb/testsuite/gdb.base/cond-expr.exp
+++ b/gdb/testsuite/gdb.base/cond-expr.exp
@@ -42,7 +42,7 @@ if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb
 clean_restart ${binfile}
 
 
-if ![runto_main] then {
+if {![runto_main]} {
     perror "couldn't run to breakpoint"
     return
 }
diff --git a/gdb/testsuite/gdb.base/condbreak-call-false.exp b/gdb/testsuite/gdb.base/condbreak-call-false.exp
index 2d0325df18d..4b1ed1b57bc 100644
--- a/gdb/testsuite/gdb.base/condbreak-call-false.exp
+++ b/gdb/testsuite/gdb.base/condbreak-call-false.exp
@@ -22,7 +22,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
     return -1
 }
 
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 
diff --git a/gdb/testsuite/gdb.base/consecutive-step-over.exp b/gdb/testsuite/gdb.base/consecutive-step-over.exp
index 5cb12414555..a8cecb50d62 100644
--- a/gdb/testsuite/gdb.base/consecutive-step-over.exp
+++ b/gdb/testsuite/gdb.base/consecutive-step-over.exp
@@ -24,7 +24,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
     return -1
 }
 
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 
diff --git a/gdb/testsuite/gdb.base/consecutive.exp b/gdb/testsuite/gdb.base/consecutive.exp
index 4b38de0c3bc..b517b42e623 100644
--- a/gdb/testsuite/gdb.base/consecutive.exp
+++ b/gdb/testsuite/gdb.base/consecutive.exp
@@ -26,7 +26,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug nowarning
     return -1
 }
 
-if ![runto_main] then {
+if {![runto_main]} {
     perror "couldn't run to breakpoint"
     return
 }
@@ -55,7 +55,7 @@ gdb_test "break \*$bp_addr" "Breakpoint $decimal at $bp_addr: file .*" \
 gdb_test_multiple "step" "stopped at bp, 2nd instr" {
     -re -wrap "Breakpoint $decimal, ($hex) in foo.*" {
 	set stop_addr $expect_out(1,string)
-	if [eval expr "$bp_addr == $stop_addr"] then {
+	if {[eval expr "$bp_addr == $stop_addr"]} {
 	    pass "stopped at bp, 2nd instr"
 	} else {
 	    fail "stopped at bp, 2nd instr (wrong address)"
@@ -64,9 +64,9 @@ gdb_test_multiple "step" "stopped at bp, 2nd instr" {
     -re -wrap "Breakpoint $decimal, foo.*" {
 	set stop_addr [get_valueof "/x" "\$pc" "" "value of pc"]
 	set stop_addr_is_stmt [hex_in_list $stop_addr $is_stmt]
-	if { ! $stop_addr_is_stmt } {
+	if {!$stop_addr_is_stmt} {
 	    fail "stopped at bp, 2nd instr (missing hex prefix)"
-	} elseif [eval expr "$bp_addr == $stop_addr"] then {
+	} elseif {[eval expr "$bp_addr == $stop_addr"]} {
 	    pass "stopped at bp, 2nd instr"
 	} else {
 	    fail "stopped at bp, 2nd instr (wrong address)"
diff --git a/gdb/testsuite/gdb.base/constvars.exp b/gdb/testsuite/gdb.base/constvars.exp
index 671baf62f01..8d1af0b4fdc 100644
--- a/gdb/testsuite/gdb.base/constvars.exp
+++ b/gdb/testsuite/gdb.base/constvars.exp
@@ -40,7 +40,7 @@ clean_restart ${binfile}
 #
 # set it up at a breakpoint so we can play with the variable values
 #
-if ![runto_main] then {
+if {![runto_main]} {
     perror "couldn't run to breakpoint"
     return
 }
@@ -51,7 +51,7 @@ get_debug_format
 # TODO: check out the hp side of this.
 
 proc local_compiler_xfail_check { } {
-    if { [test_compiler_info gcc-2-*] } then {
+    if {[test_compiler_info gcc-2-*]} {
 	if { ![test_debug_format "HP"] \
 		&& ![test_debug_format "DWARF \[0-9\]"] } then {
 	    setup_xfail "*-*-*" 
diff --git a/gdb/testsuite/gdb.base/coredump-filter.exp b/gdb/testsuite/gdb.base/coredump-filter.exp
index 14c3db44f51..499bfae0fff 100644
--- a/gdb/testsuite/gdb.base/coredump-filter.exp
+++ b/gdb/testsuite/gdb.base/coredump-filter.exp
@@ -16,7 +16,7 @@
 standard_testfile
 
 # This test is Linux-only.
-if ![istarget *-*-linux*] then {
+if {![istarget *-*-linux*]} {
     untested "coredump-filter.exp"
     return -1
 }
diff --git a/gdb/testsuite/gdb.base/corefile.exp b/gdb/testsuite/gdb.base/corefile.exp
index 0a44c2da49b..f15e1e9e81d 100644
--- a/gdb/testsuite/gdb.base/corefile.exp
+++ b/gdb/testsuite/gdb.base/corefile.exp
@@ -17,7 +17,7 @@
 
 
 # are we on a target board
-if ![isnative] then {
+if {![isnative]} {
     return
 }
 
@@ -49,7 +49,7 @@ if {$corefile == ""} {
 # it a pass, but note that the program name is bad.
 
 gdb_exit
-if $verbose>1 then {
+if {$verbose>1} {
     send_user "Spawning $GDB $INTERNAL_GDBFLAGS $GDBFLAGS -core=$corefile\n"
 }
 
@@ -82,7 +82,7 @@ expect {
 
 close
 
-if $verbose>1 then {
+if {$verbose>1} {
     send_user "Spawning $GDB $INTERNAL_GDBFLAGS $GDBFLAGS $binfile -core=$corefile\n"
 }
 
diff --git a/gdb/testsuite/gdb.base/corefile2.exp b/gdb/testsuite/gdb.base/corefile2.exp
index 5ae681b06fb..b08bd714ca9 100644
--- a/gdb/testsuite/gdb.base/corefile2.exp
+++ b/gdb/testsuite/gdb.base/corefile2.exp
@@ -18,7 +18,7 @@
 # coremaker2.c for details.
 
 # are we on a target board
-if ![isnative] then {
+if {![isnative]} {
     return
 }
 
@@ -174,7 +174,7 @@ with_test_prefix "renamed binfile" {
 
 clean_restart $binfile
 
-if ![runto_main] then {
+if {![runto_main]} {
     return
 }
 
diff --git a/gdb/testsuite/gdb.base/ctf-constvars.exp b/gdb/testsuite/gdb.base/ctf-constvars.exp
index a5e7fe0b015..4a8307e05bf 100644
--- a/gdb/testsuite/gdb.base/ctf-constvars.exp
+++ b/gdb/testsuite/gdb.base/ctf-constvars.exp
@@ -46,7 +46,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} \
 #
 # set it up at a breakpoint so we can play with the variable values
 #
-if ![runto_main] then {
+if {![runto_main]} {
     perror "couldn't run to breakpoint"
     return
 }
diff --git a/gdb/testsuite/gdb.base/ctf-ptype.exp b/gdb/testsuite/gdb.base/ctf-ptype.exp
index 28deabb6ac5..2e3b972ebe9 100644
--- a/gdb/testsuite/gdb.base/ctf-ptype.exp
+++ b/gdb/testsuite/gdb.base/ctf-ptype.exp
@@ -64,16 +64,16 @@ gdb_test "ptype struct t_struct" "type = struct t_struct \{.*\[\r\n\]    (unsign
 
 # Test the equivalence between '.' and '->' for struct member references.
 
-if [gdb_test "ptype v_struct1.v_float_member"	"type = float"]<0 then {
+if {[gdb_test "ptype v_struct1.v_float_member"	"type = float"] < 0} {
     return -1
 }
-if [gdb_test "ptype v_struct1->v_float_member"	"type = float"]<0 then {
+if {[gdb_test "ptype v_struct1->v_float_member"	"type = float"] < 0} {
     return -1
 }
-if [gdb_test "ptype v_t_struct_p.v_float_member"	"type = float"]<0 then {
+if {[gdb_test "ptype v_t_struct_p.v_float_member"	"type = float"] < 0} {
     return -1
 }
-if [gdb_test "ptype v_t_struct_p->v_float_member"	"type = float"]<0 then {
+if {[gdb_test "ptype v_t_struct_p->v_float_member"	"type = float"] < 0} {
     return -1
 }
 
@@ -278,7 +278,7 @@ ptype_maybe_prototyped "fffptr" "int (*(*(*)(char))(short int))(long int)" \
 # requires a running process.  These call malloc, and can take a long
 # time to execute over a slow serial link, so increase the timeout.
 
-if [runto_main] then {
+if {[runto_main]} {
 
   if [target_info exists gdb,cannot_call_functions] {
     unsupported "this target can not call functions"
diff --git a/gdb/testsuite/gdb.base/decl-before-def.exp b/gdb/testsuite/gdb.base/decl-before-def.exp
index c4120a2b813..206d5e31b11 100644
--- a/gdb/testsuite/gdb.base/decl-before-def.exp
+++ b/gdb/testsuite/gdb.base/decl-before-def.exp
@@ -25,7 +25,7 @@ gdb_test "maint expand-symtabs"
 
 gdb_test "p a" { = \{1, 2\}} "no running process: p a"
 
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 
diff --git a/gdb/testsuite/gdb.base/default.exp b/gdb/testsuite/gdb.base/default.exp
index 29e76642830..0fcd623f818 100644
--- a/gdb/testsuite/gdb.base/default.exp
+++ b/gdb/testsuite/gdb.base/default.exp
@@ -184,7 +184,7 @@ gdb_expect {
     }
     -re "exec-file.*A program is being debugged already.  Kill it. .y or n.*$" {
 	send_gdb "n\n"
-	if $verbose>1 then {
+	if {$verbose > 1} {
 	    send_user "\tDidn't kill program being debugged\n"
 	}
 	gdb_expect -re "$gdb_prompt $" { }
@@ -208,7 +208,7 @@ gdb_expect {
 	    { pass "file" }
     -re ".*A program is being debugged already.  Kill it. .y or n.*$" {
 	send_gdb "n\n"
-	if $verbose>1 then {
+	if {$verbose > 1} {
 	    send_user "\t\tDidn't kill program being debugged\n"
 	}
 	gdb_expect -re "$gdb_prompt $" { }
@@ -747,7 +747,7 @@ gdb_expect {
     -re "No core file specified..*$gdb_prompt $" { pass "target core" }
     -re ".*A program is being debugged already.  Kill it. .y or n.*$" {
 	send_gdb "n\n"
-	if $verbose>1 then {
+	if {$verbose > 1} {
 	    send_user "\t\tDidn't kill program being debugged\n"
 	}
 	gdb_expect -re "$gdb_prompt $" { }
@@ -765,7 +765,7 @@ gdb_expect {
 			{ pass "target exec" }
 	-re ".*A program is being debugged already.  Kill it. .y or n.*$" {
 	    send_gdb "n\n"
-	    if $verbose>1 then {
+	    if {$verbose > 1} {
 		send_user "\t\tDidn't kill program being debugged\n"
 	    }
 	    gdb_expect -re "$gdb_prompt $" { }
@@ -782,7 +782,7 @@ gdb_expect {
 	{ pass "target remote" }
     -re ".*A program is being debugged already.  Kill it. .y or n.*$" {
 	send_gdb "n\n"
-	if $verbose>1 then {
+	if {$verbose > 1} {
 	    send_user "\t\tDidn't kill program being debugged\n"
 	}
 	gdb_expect -re "$gdb_prompt $" { }
diff --git a/gdb/testsuite/gdb.base/define.exp b/gdb/testsuite/gdb.base/define.exp
index 52a4f0d5e5c..e5616341e6d 100644
--- a/gdb/testsuite/gdb.base/define.exp
+++ b/gdb/testsuite/gdb.base/define.exp
@@ -30,7 +30,7 @@ if {[prepare_for_testing "failed to prepare" ${testfile} \
 set bp_location1 [gdb_get_line_number "set breakpoint 1 here"]
 set bp_location11 [gdb_get_line_number "set breakpoint 11 here"]
 
-if ![runto_main] then {
+if {![runto_main]} {
     return
 }
 
diff --git a/gdb/testsuite/gdb.base/dfp-test.exp b/gdb/testsuite/gdb.base/dfp-test.exp
index 30795212291..0d7314f247b 100644
--- a/gdb/testsuite/gdb.base/dfp-test.exp
+++ b/gdb/testsuite/gdb.base/dfp-test.exp
@@ -30,7 +30,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {quie
 
 clean_restart ${binfile}
 
-if ![runto_main] then {
+if {![runto_main]} {
     perror "couldn't run to breakpoint"
     return
 }
diff --git a/gdb/testsuite/gdb.base/disabled-location.exp b/gdb/testsuite/gdb.base/disabled-location.exp
index d90bc5b91cf..1fc2e155ec2 100644
--- a/gdb/testsuite/gdb.base/disabled-location.exp
+++ b/gdb/testsuite/gdb.base/disabled-location.exp
@@ -19,7 +19,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile}] } {
     return -1
 }
 
-if ![runto_main] then {
+if {![runto_main]} {
    return 0
 }
 
diff --git a/gdb/testsuite/gdb.base/display.exp b/gdb/testsuite/gdb.base/display.exp
index b26c08433b8..d8ca284da3e 100644
--- a/gdb/testsuite/gdb.base/display.exp
+++ b/gdb/testsuite/gdb.base/display.exp
@@ -60,7 +60,7 @@ if !$use_gdb_stub {
 
 # Ok, on to real life
 #
-if ![runto_main] then {
+if {![runto_main]} {
     return
 }
 
diff --git a/gdb/testsuite/gdb.base/dprintf-detach.exp b/gdb/testsuite/gdb.base/dprintf-detach.exp
index b6da01a2845..6c71c61cba8 100644
--- a/gdb/testsuite/gdb.base/dprintf-detach.exp
+++ b/gdb/testsuite/gdb.base/dprintf-detach.exp
@@ -21,7 +21,7 @@
 load_lib gdbserver-support.exp
 
 # The test relies on "detach/attach".
-if { [use_gdb_stub] } then {
+if {[use_gdb_stub]} {
     return 0
 }
 
diff --git a/gdb/testsuite/gdb.base/dump.exp b/gdb/testsuite/gdb.base/dump.exp
index c7dd1b139fc..1efc3c881b1 100644
--- a/gdb/testsuite/gdb.base/dump.exp
+++ b/gdb/testsuite/gdb.base/dump.exp
@@ -26,7 +26,7 @@ set endian "auto"
 
 set formats {binary ihex srec tekhex  verilog}
 
-if [istarget "alpha*-*-*"] then {
+if {[istarget "alpha*-*-*"]} {
     # SREC etc cannot handle 64-bit addresses.  Force the test
     # program into the low 31 bits of the address space.
     lappend options "ldflags=-Wl,-taso"
@@ -68,7 +68,7 @@ gdb_load ${binfile}
 # IHEX and TEKHEX.  We skip those tests then.
 set max_32bit_address "0xffffffff"
 set data_address [get_hexadecimal_valueof "&intarray" 0x100000000]
-if {${data_address} > ${max_32bit_address}} then {
+if {${data_address} > ${max_32bit_address}} {
     set is64bitonly "yes"
 }
 
@@ -105,7 +105,7 @@ remote_exec host "rm -f $filenames"
 
 # Run target program until data structs are initialized.
 
-if { ! [ runto checkpoint1 ] } then {
+if {![runto checkpoint1]} {
     untested "couldn't run to checkpoint"
     return -1
 }
@@ -283,7 +283,7 @@ proc test_restore_saved_value { restore_args msg oldval newval } {
     }
 }
 
-if ![string compare $is64bitonly "no"] then {
+if {![string compare $is64bitonly "no"]} {
 
 
   test_restore_saved_value "[set intarr1.srec]" "array as value, srec" \
@@ -365,7 +365,7 @@ set struct2_offset \
 print_zero_all
 
 
-if ![string compare $is64bitonly "no"] then {
+if {![string compare $is64bitonly "no"]} {
   test_restore_saved_value "[set intarr1.srec] $array2_offset" \
 	"array copy, srec" \
 	$array_val "intarray2"
@@ -421,7 +421,7 @@ set element3_offset \
 set element4_offset \
 	[capture_value "/x (char *) &intarray\[4\] - (char *) &intarray\[0\]"]
 
-if ![string compare $is64bitonly "no"] then {
+if {![string compare $is64bitonly "no"]} {
   print_zero_all
 
   test_restore_saved_value "[set intarr1.srec] 0 $element3_start $element4_start" \
@@ -456,7 +456,7 @@ test_restore_saved_value \
 gdb_test "print intarray\[2\] == 0" " = 1" "element 2 not changed - 4"
 gdb_test "print intarray\[4\] == 0" " = 1" "element 4 not changed - 4"
 
-if ![string compare $is64bitonly "no"] then {
+if {![string compare $is64bitonly "no"]} {
   print_zero_all
 
   # restore with expressions 
@@ -520,7 +520,7 @@ proc test_reload_saved_value { filename msg oldval newval } {
 }
 
 # srec format can not be loaded for 64-bit-only platforms
-if ![string compare $is64bitonly "no"] then {
+if {![string compare $is64bitonly "no"]} {
   test_reload_saved_value "[set intarr1.srec]" "reload array as value, srec" \
 	$array_val "\*$array_ptr_type"
   test_reload_saved_value "[set intstr1.srec]" "reload struct as value, srec" \
@@ -532,7 +532,7 @@ if ![string compare $is64bitonly "no"] then {
 }
 
 # ihex format can not be loaded for 64-bit-only platforms
-if ![string compare $is64bitonly "no"] then {
+if {![string compare $is64bitonly "no"]} {
 
   test_reload_saved_value "[set intarr1.ihex]" \
       "reload array as value, intel hex" \
@@ -549,7 +549,7 @@ if ![string compare $is64bitonly "no"] then {
 }
 
 # tekhex format can not be loaded for 64-bit-only platforms
-if ![string compare $is64bitonly "no"] then {
+if {![string compare $is64bitonly "no"]} {
   test_reload_saved_value "[set intarr1.tekhex]" \
       "reload array as value, tekhex" \
 	$array_val "\*$array_ptr_type"
diff --git a/gdb/testsuite/gdb.base/duplicate-bp.exp b/gdb/testsuite/gdb.base/duplicate-bp.exp
index 9a512928bae..39ba3a5cbf7 100644
--- a/gdb/testsuite/gdb.base/duplicate-bp.exp
+++ b/gdb/testsuite/gdb.base/duplicate-bp.exp
@@ -26,7 +26,7 @@ proc test_setup { count } {
 
     clean_restart ${binfile}
 
-    if ![runto_main] then {
+    if {![runto_main]} {
 	return 0
     }
 
diff --git a/gdb/testsuite/gdb.base/eh_return.exp b/gdb/testsuite/gdb.base/eh_return.exp
index a6dda78e013..e4781e302a0 100644
--- a/gdb/testsuite/gdb.base/eh_return.exp
+++ b/gdb/testsuite/gdb.base/eh_return.exp
@@ -19,7 +19,7 @@
 standard_testfile
 
 # Set compiler flags.
-if {[istarget "powerpc*"]} then {
+if {[istarget "powerpc*"]} {
     # PowerPC generates a Traceback Table, as defined in the PPC64 ABI,
     # following each function by default.  The Traceback Table information is
     # typically interpreted by the disassembler as data represented with
diff --git a/gdb/testsuite/gdb.base/ena-dis-br.exp b/gdb/testsuite/gdb.base/ena-dis-br.exp
index 24925cf7185..410dbec7706 100644
--- a/gdb/testsuite/gdb.base/ena-dis-br.exp
+++ b/gdb/testsuite/gdb.base/ena-dis-br.exp
@@ -34,7 +34,7 @@ set bp_location14 [gdb_get_line_number "set breakpoint 14 here" $srcfile2]
 set bp_location15 [gdb_get_line_number "set breakpoint 15 here" $srcfile2]
 set bp_location17 [gdb_get_line_number "set breakpoint 17 here" $srcfile2]
 
-if ![runto_main] then {
+if {![runto_main]} {
     return
 }
 
@@ -116,7 +116,7 @@ gdb_continue_to_end "no stop at auto-disabled break marker2"
 
 # Verify that we can set a breakpoint to be self-deleting after the
 # first time it triggers.
-if ![runto_main] then {
+if {![runto_main]} {
     return
 }
 
@@ -147,7 +147,7 @@ gdb_test "info break $bp" \
     "\[0-9\]*\[ \t\]+breakpoint\[ \t\]+keep\[ \t\]+n.*" \
     "info break marker4"
 
-if ![runto_main] then {
+if {![runto_main]} {
     return
 }
 
@@ -186,7 +186,7 @@ gdb_test "continue" \
 # should cause the next N triggers of the bp to be ignored.  (This is
 # a flavor of enablement/disablement, after all.)
 
-if ![runto_main] then {
+if {![runto_main]} {
     return
 }
 
@@ -247,7 +247,7 @@ gdb_test_multiple "continue" "$test" {
 
 # Verify that we can specify both an ignore count and an auto-delete.
 
-if ![runto_main] then {
+if {![runto_main]} {
     return
 }
 
@@ -279,7 +279,7 @@ gdb_test "continue" \
 # Verify that a disabled breakpoint's ignore count isn't updated when
 # the bp is encountered.
 
-if ![runto_main] then {
+if {![runto_main]} {
     return
 }
 
@@ -308,7 +308,7 @@ gdb_test "info break $bp" \
 # (Also verify that GDB gracefully handles the case where the inferior
 # isn't stopped at a breakpoint.)
 #
-if ![runto_main] then {
+if {![runto_main]} {
     return
 }
 
@@ -336,7 +336,7 @@ gdb_test_multiple "continue 2" "$test" {
 # Verify that GDB correctly handles the "enable/disable" command
 # with arguments, that include multiple locations.
 #
-if ![runto_main] then {
+if {![runto_main]} {
     return
 }
 
diff --git a/gdb/testsuite/gdb.base/endianity.exp b/gdb/testsuite/gdb.base/endianity.exp
index a6a87e66a44..243af1c3da7 100644
--- a/gdb/testsuite/gdb.base/endianity.exp
+++ b/gdb/testsuite/gdb.base/endianity.exp
@@ -25,7 +25,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} \
 }
 
 set bp_location [gdb_get_line_number "START"]
-if ![runto "endianity.c:$bp_location" ] then {
+if {![runto "endianity.c:$bp_location"]} {
   return -1
 }
 
diff --git a/gdb/testsuite/gdb.base/enum_cond.exp b/gdb/testsuite/gdb.base/enum_cond.exp
index 0f03f0296d9..bb5d6c29548 100644
--- a/gdb/testsuite/gdb.base/enum_cond.exp
+++ b/gdb/testsuite/gdb.base/enum_cond.exp
@@ -27,7 +27,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable $opts
 
 clean_restart $testfile
 
-if ![runto_main] then {
+if {![runto_main]} {
     perror "could not run to main"
     return
 }
diff --git a/gdb/testsuite/gdb.base/eval-skip.exp b/gdb/testsuite/gdb.base/eval-skip.exp
index 659a8b8a61e..fe6f7f0f52a 100644
--- a/gdb/testsuite/gdb.base/eval-skip.exp
+++ b/gdb/testsuite/gdb.base/eval-skip.exp
@@ -42,7 +42,7 @@ if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb
 clean_restart ${binfile}
 
 
-if ![runto_main] then {
+if {![runto_main]} {
     perror "couldn't run to breakpoint"
     return
 }
diff --git a/gdb/testsuite/gdb.base/exe-lock.exp b/gdb/testsuite/gdb.base/exe-lock.exp
index 19b4e1a8732..1276ec0984f 100644
--- a/gdb/testsuite/gdb.base/exe-lock.exp
+++ b/gdb/testsuite/gdb.base/exe-lock.exp
@@ -37,7 +37,7 @@ if { ! [file exists $binfile] } {
     return -1
     }
 
-if ![runto_main] then {
+if {![runto_main]} {
     perror "couldn't run to breakpoint"
     return
 }
diff --git a/gdb/testsuite/gdb.base/exec-invalid-sysroot.exp b/gdb/testsuite/gdb.base/exec-invalid-sysroot.exp
index cacd5a092a2..c4e5a4edd4e 100644
--- a/gdb/testsuite/gdb.base/exec-invalid-sysroot.exp
+++ b/gdb/testsuite/gdb.base/exec-invalid-sysroot.exp
@@ -46,7 +46,7 @@ proc do_exec_sysroot_test {} {
 
     # Start the program running, and stop at main.
     #
-    if ![runto_main] then {
+    if {![runto_main]} {
 	return
     }
 
diff --git a/gdb/testsuite/gdb.base/execl-update-breakpoints.exp b/gdb/testsuite/gdb.base/execl-update-breakpoints.exp
index 29647958e65..fdea0b442ad 100644
--- a/gdb/testsuite/gdb.base/execl-update-breakpoints.exp
+++ b/gdb/testsuite/gdb.base/execl-update-breakpoints.exp
@@ -42,7 +42,7 @@ if { [gdb_compile $objfile $exec1 executable {debug text_segment=0x1000000}] !=
 # exec2.  If it is, then skip the test as unsupported.
 
 clean_restart ${exec1}
-if ![runto_main] then {
+if {![runto_main]} {
     return -1
 }
 
@@ -56,7 +56,7 @@ gdb_test_multiple "p/x &main" $test {
 }
 
 clean_restart ${exec2}
-if ![runto_main] then {
+if {![runto_main]} {
     return -1
 }
 
@@ -88,7 +88,7 @@ proc test { always_inserted } {
 
     gdb_test_no_output "set breakpoint always-inserted $always_inserted"
 
-    if ![runto_main] then {
+    if {![runto_main]} {
 	return -1
     }
 
diff --git a/gdb/testsuite/gdb.base/exprs.exp b/gdb/testsuite/gdb.base/exprs.exp
index 0605dd62480..7b081ec91f9 100644
--- a/gdb/testsuite/gdb.base/exprs.exp
+++ b/gdb/testsuite/gdb.base/exprs.exp
@@ -32,7 +32,7 @@ clean_restart ${binfile}
 # set it up at a breakpoint so we can play with the variable values
 #
 
-if ![runto_main] then {
+if {![runto_main]} {
     perror "couldn't run to breakpoint"
     return
 }
diff --git a/gdb/testsuite/gdb.base/fileio.exp b/gdb/testsuite/gdb.base/fileio.exp
index e00a1cefa0a..18e429c7553 100644
--- a/gdb/testsuite/gdb.base/fileio.exp
+++ b/gdb/testsuite/gdb.base/fileio.exp
@@ -55,7 +55,7 @@ gdb_test_no_output "set print sevenbit-strings"
 gdb_test_no_output "set print address off"
 gdb_test_no_output "set width 0"
 
-if ![runto_main] then {
+if {![runto_main]} {
     perror "couldn't run to breakpoint"
     return
 }
diff --git a/gdb/testsuite/gdb.base/finish.exp b/gdb/testsuite/gdb.base/finish.exp
index e60c33b4d96..a0f5ced718b 100644
--- a/gdb/testsuite/gdb.base/finish.exp
+++ b/gdb/testsuite/gdb.base/finish.exp
@@ -76,7 +76,7 @@ proc finish_void { } {
 
 proc finish_abbreviation { abbrev } {
 
-    if { ! [ runto "int_func" ] } then {
+    if {![runto "int_func"]} {
         return -1
     }
 
@@ -102,7 +102,7 @@ proc finish_no_print {} {
 proc finish_tests { } {
     global gdb_prompt skip_float_test
 
-    if { ! [ runto_main ] } then {
+    if {![runto_main]} {
 	return -1
     }
 
diff --git a/gdb/testsuite/gdb.base/fixsection.exp b/gdb/testsuite/gdb.base/fixsection.exp
index 5734fcaae74..0872017e015 100644
--- a/gdb/testsuite/gdb.base/fixsection.exp
+++ b/gdb/testsuite/gdb.base/fixsection.exp
@@ -42,7 +42,7 @@ gdb_reinitialize_dir $srcdir/$subdir
 gdb_load ${binfile}
 gdb_load_shlib ${lib_sl}
 
-if ![runto_main] then {
+if {![runto_main]} {
     return 1
 }
 
diff --git a/gdb/testsuite/gdb.base/float.exp b/gdb/testsuite/gdb.base/float.exp
index 7fff2b90727..b9c5057c6ee 100644
--- a/gdb/testsuite/gdb.base/float.exp
+++ b/gdb/testsuite/gdb.base/float.exp
@@ -29,18 +29,18 @@ if { [prepare_for_testing "failed to prepare" float float.c] } {
 
 # Set it up at a breakpoint so we have its registers.
 
-if ![runto_main] then {
+if {![runto_main]} {
     perror "couldn't run to breakpoint"
     return
 }
 
 # Test "info float".
 
-if { [is_aarch64_target] } then {
+if {[is_aarch64_target]} {
     gdb_test "info float" "d0.*d1.*d31.*s0.*s1.*s31.*"
-} elseif { [istarget "alpha*-*-*"] } then {
+} elseif {[istarget "alpha*-*-*"]} {
     gdb_test "info float" "f0.*"
-} elseif { [is_aarch32_target] } then {
+} elseif {[is_aarch32_target]} {
     gdb_test_multiple "info float" "info float" {
 	-re "Software FPU type.*mask:.*flags:.*$gdb_prompt $" {
 	    pass "info float (FPA)"
@@ -54,11 +54,11 @@ if { [is_aarch64_target] } then {
             pass "info float (without FPU)"
 	}
     }
-} elseif { [istarget "i?86-*-*"] || [istarget "x86_64-*-*"] } then {
+} elseif {[istarget "i?86-*-*"] || [istarget "x86_64-*-*"]} {
     gdb_test "info float" "R7:.*Status Word:.*Opcode:.*"
-} elseif [istarget "ia64-*-*"] then {
+} elseif {[istarget "ia64-*-*"]} {
     gdb_test "info float" "f0.*f1.*f127.*"
-} elseif [istarget "m68k-*-*"] then {
+} elseif {[istarget "m68k-*-*"]} {
     gdb_test_multiple "info float" "info_float" {
         -re "fp0.*fp1.*fp7.*$gdb_prompt $" {
             pass "info float (with FPU)"
@@ -67,7 +67,7 @@ if { [is_aarch64_target] } then {
             pass "info float (without FPU)"
 	}
     }
-} elseif [istarget "mips*-*-*"] then {
+} elseif {[istarget "mips*-*-*"]} {
     gdb_test_multiple "info float" "info float" {
 	-re "fpu type: none / unused\r\n$gdb_prompt $" {
 	      pass "info float (without FPU)"
@@ -76,7 +76,7 @@ if { [is_aarch64_target] } then {
 	      pass "info float (with FPU)"
 	  }
     }
-} elseif [istarget "nds32*-*-*"] then {
+} elseif {[istarget "nds32*-*-*"]} {
     gdb_test_multiple "info float" "info_float" {
         -re "fd0.*fd3.*$gdb_prompt $" {
             pass "info float (with FPU)"
@@ -85,7 +85,7 @@ if { [is_aarch64_target] } then {
             pass "info float (without FPU)"
 	}
     }
-} elseif [istarget "powerpc*-*-*"] then {
+} elseif {[istarget "powerpc*-*-*"]} {
     gdb_test_multiple "info float" "info_float" {
         -re "f0.*f1.*f31.*fpscr.*$gdb_prompt $" {
             pass "info float (with FPU)"
@@ -94,9 +94,9 @@ if { [is_aarch64_target] } then {
             pass "info float (without FPU)"
 	}
     }
-} elseif [istarget "s390*-*-*"] then {
+} elseif {[istarget "s390*-*-*"]} {
     gdb_test "info float" "fpc.*f0.*f1.*f15.*" "info float"
-} elseif [istarget "sh*-*"] then {
+} elseif {[istarget "sh*-*"]} {
     # SH may or may not have an FPU
     gdb_test_multiple "info float" "info float" {
 	-re "fpul.*fr0.*fr1.*fr15.*$gdb_prompt $" {
@@ -106,11 +106,11 @@ if { [is_aarch64_target] } then {
 	      pass "info float (without FPU)"
 	}
     }
-} elseif [istarget "hppa*-*"] then {
+} elseif {[istarget "hppa*-*"]} {
     gdb_test "info float" "fr4.*fr4R.*fr31R.*" "info float"
-} elseif [istarget "sparc*-*-*"] then {
+} elseif {[istarget "sparc*-*-*"]} {
     gdb_test "info float" "f0.*f1.*f31.*d0.*d30.*" "info float"
-} elseif [istarget "riscv*-*-*"] then {
+} elseif {[istarget "riscv*-*-*"]} {
     # RISC-V may or may not have an FPU.  Additionally, the order of
     # fcsr relative to fflags and frm can change depending on whether
     # the fflags and frm registers are implemented as real registers
diff --git a/gdb/testsuite/gdb.base/float128.exp b/gdb/testsuite/gdb.base/float128.exp
index 5e471b39d22..a4d94d4c162 100644
--- a/gdb/testsuite/gdb.base/float128.exp
+++ b/gdb/testsuite/gdb.base/float128.exp
@@ -32,7 +32,7 @@ if { [do_compile] != "" && [do_compile {-mfloat128}] != "" } {
 
 clean_restart ${binfile}
 
-if ![runto_main] then {
+if {![runto_main]} {
     perror "couldn't run to breakpoint"
     return
 }
diff --git a/gdb/testsuite/gdb.base/floatn.exp b/gdb/testsuite/gdb.base/floatn.exp
index 1e4f94a70e0..58be8eb4c37 100644
--- a/gdb/testsuite/gdb.base/floatn.exp
+++ b/gdb/testsuite/gdb.base/floatn.exp
@@ -32,7 +32,7 @@ if { [do_compile] != "" && [do_compile {-mfloat128}] != "" } {
 
 clean_restart ${binfile}
 
-if ![runto_main] then {
+if {![runto_main]} {
     perror "couldn't run to breakpoint"
     return
 }
diff --git a/gdb/testsuite/gdb.base/foll-exec-mode.exp b/gdb/testsuite/gdb.base/foll-exec-mode.exp
index 918f3e4fd5f..77637763eee 100644
--- a/gdb/testsuite/gdb.base/foll-exec-mode.exp
+++ b/gdb/testsuite/gdb.base/foll-exec-mode.exp
@@ -35,7 +35,7 @@ if { [target_info exists gdb_protocol]
 
 # Until "catch exec" is implemented on other targets...
 #
-if {![istarget "*-linux*"]} then {
+if {![istarget "*-linux*"]} {
      return
 }
 
@@ -68,7 +68,7 @@ proc do_catch_exec_test { } {
 
     # Start the program running, and stop at main.
     #
-    if ![runto_main] then {
+    if {![runto_main]} {
 	return
     }
 
@@ -107,7 +107,7 @@ proc do_follow_exec_mode_tests { mode cmd infswitch } {
 
 	# Start the program running, and stop at main.
 	#
-	if ![runto_main] then {
+	if {![runto_main]} {
 	    return
 	}
 
diff --git a/gdb/testsuite/gdb.base/foll-exec.exp b/gdb/testsuite/gdb.base/foll-exec.exp
index 8cddfa52c3b..dad8103788c 100644
--- a/gdb/testsuite/gdb.base/foll-exec.exp
+++ b/gdb/testsuite/gdb.base/foll-exec.exp
@@ -18,7 +18,7 @@
 
 # Until "catch exec" is implemented on other targets...
 #
-if { ![istarget "*-linux*"] } then {
+if {![istarget "*-linux*"]} {
     return
 }
 
@@ -47,7 +47,7 @@ proc do_exec_tests {} {
 
    # Start the program running, and stop at main.
    #
-   if ![runto_main] then {
+   if {![runto_main]} {
      return
    }
 
@@ -73,7 +73,7 @@ proc do_exec_tests {} {
 
    # Start the program running, and stop at main.
    #
-   if ![runto_main] then {
+   if {![runto_main]} {
      return
    }
 
@@ -162,7 +162,7 @@ proc do_exec_tests {} {
 
    # Start the program running, and stop at main.
    #
-   if ![runto_main] then {
+   if {![runto_main]} {
      return
    }
 
@@ -230,7 +230,7 @@ proc do_exec_tests {} {
 
    # Start the program running, and stop at main.
    #
-   if ![runto_main] then {
+   if {![runto_main]} {
      return
    }
 
@@ -297,7 +297,7 @@ proc do_exec_tests {} {
 
    # Start the program running, and stop at main.
    #
-   if ![runto_main] then {
+   if {![runto_main]} {
      return
    }
 
@@ -358,7 +358,7 @@ proc do_exec_tests {} {
 
    # Start the program running, and stop at main.
    #
-   if ![runto_main] then {
+   if {![runto_main]} {
      return
    }
 
diff --git a/gdb/testsuite/gdb.base/foll-vfork.exp b/gdb/testsuite/gdb.base/foll-vfork.exp
index e4f75728600..c48db214ccc 100644
--- a/gdb/testsuite/gdb.base/foll-vfork.exp
+++ b/gdb/testsuite/gdb.base/foll-vfork.exp
@@ -21,7 +21,7 @@
 # Until "set follow-fork-mode" and "catch vfork" are implemented on
 # other targets...
 #
-if {![istarget "*-linux*"]} then {
+if {![istarget "*-linux*"]} {
     continue
 }
 
diff --git a/gdb/testsuite/gdb.base/fork-running-state.exp b/gdb/testsuite/gdb.base/fork-running-state.exp
index 961852ebab1..4dab3532009 100644
--- a/gdb/testsuite/gdb.base/fork-running-state.exp
+++ b/gdb/testsuite/gdb.base/fork-running-state.exp
@@ -35,7 +35,7 @@ proc do_test { detach_on_fork follow_fork non_stop schedule_multiple } {
 	}
     }
 
-    if ![runto_main] then {
+    if {![runto_main]} {
 	return 0
     }
 
diff --git a/gdb/testsuite/gdb.base/frame-args.exp b/gdb/testsuite/gdb.base/frame-args.exp
index a0674068573..adc2a9e8bb8 100644
--- a/gdb/testsuite/gdb.base/frame-args.exp
+++ b/gdb/testsuite/gdb.base/frame-args.exp
@@ -21,7 +21,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debu
 
 clean_restart ${binfile}
 
-if ![runto break_me] then {
+if {![runto break_me]} {
   perror "Couldn't run ${testfile}"
   return
 }
diff --git a/gdb/testsuite/gdb.base/frame-info-consistent.exp b/gdb/testsuite/gdb.base/frame-info-consistent.exp
index 1a8c567a75e..966c350bcb3 100644
--- a/gdb/testsuite/gdb.base/frame-info-consistent.exp
+++ b/gdb/testsuite/gdb.base/frame-info-consistent.exp
@@ -97,7 +97,7 @@ proc test {dwarf_unwinder} {
 
     gdb_test_no_output "maint set dwarf unwinder $dwarf_unwinder"
 
-    if ![runto_main] then {
+    if {![runto_main]} {
 	return 0
     }
 
diff --git a/gdb/testsuite/gdb.base/frameapply.exp b/gdb/testsuite/gdb.base/frameapply.exp
index 7ea1cb92598..ed48e5cd651 100644
--- a/gdb/testsuite/gdb.base/frameapply.exp
+++ b/gdb/testsuite/gdb.base/frameapply.exp
@@ -24,7 +24,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile}] } {
     return -1
 }
 
-if ![runto setup_done] then {
+if {![runto setup_done]} {
     return 0
 }
 
diff --git a/gdb/testsuite/gdb.base/funcargs.exp b/gdb/testsuite/gdb.base/funcargs.exp
index 483fbd94263..e260001beae 100644
--- a/gdb/testsuite/gdb.base/funcargs.exp
+++ b/gdb/testsuite/gdb.base/funcargs.exp
@@ -49,7 +49,7 @@ proc_with_prefix integral_args {} {
     gdb_breakpoint call0e
 
     # Run; should stop at call0a and print actual arguments.
-    if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
+    if {!$gcc_compiled} { setup_xfail "rs6000-*-*" }
     gdb_run_cmd
     gdb_test "" " call0a \\(c=97 'a', s=1, i=2, l=3\\) .*" "run to call0a"
 
@@ -91,7 +91,7 @@ proc unsigned_integral_args {} {
     gdb_breakpoint call1e
 
     # Run; should stop at call1a and print actual arguments.
-    if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
+    if {!$gcc_compiled} { setup_xfail "rs6000-*-*" }
     gdb_run_cmd
     gdb_test "" " call1a \\(uc=98 'b', us=6, ui=7, ul=8\\) .*" "run to call1a"
 
@@ -137,7 +137,7 @@ proc float_and_integral_args {} {
 
     # Run; should stop at call2a and print actual arguments.
 
-    if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
+    if {!$gcc_compiled} { setup_xfail "rs6000-*-*" }
     gdb_run_cmd
     set test "run to call2a"
     gdb_test_multiple "" $test {
@@ -637,7 +637,7 @@ proc_with_prefix shuffle_round_robin {} {
     gdb_run_cmd
     gdb_test "" "Breakpoint $decimal, call7a .*" "run to call7a"
 
-    if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
+    if {!$gcc_compiled} { setup_xfail "rs6000-*-*" }
     gdb_test_multiple "backtrace 100" "backtrace from call7a" {
 	-re " call7a \\(c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7\\) .* main \\(.*\\) .*$gdb_prompt $" {
 	    pass "backtrace from call7a"
@@ -652,7 +652,7 @@ proc_with_prefix shuffle_round_robin {} {
 
     gdb_continue call7b
 
-    if {$gcc_compiled} then { setup_xfail "rs6000-*-*" }
+    if {$gcc_compiled} { setup_xfail "rs6000-*-*" }
 
     gdb_test_sequence "backtrace 100" "backtrace from call7b" {
 	"\[\r\n\]#0 .* call7b \\(i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a'\\) "
@@ -853,9 +853,9 @@ proc_with_prefix localvars_after_alloca { } {
     # Print each arg as a double check to see if we can print
     # them here as well as with backtrace.
 
-    if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
+    if {!$gcc_compiled} { setup_xfail "rs6000-*-*" }
     gdb_test "print c" " = 97 'a'" "print c after runto localvars_after_alloca"
-    if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
+    if {!$gcc_compiled} { setup_xfail "rs6000-*-*" }
     gdb_test "print s" " = 1" "print s after runto localvars_after_alloca"
     gdb_test "print i" " = 2" "print i after runto localvars_after_alloca"
     gdb_test "print l" " = 3" "print l after runto localvars_after_alloca"
@@ -887,14 +887,14 @@ proc_with_prefix call_after_alloca { } {
     # Print each arg as a double check to see if we can print
     # them here as well as with backtrace.
 
-    if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
+    if {!$gcc_compiled} { setup_xfail "rs6000-*-*" }
     gdb_test "print c" " = 97 'a'" "print c in call_after_alloca"
-    if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
+    if {!$gcc_compiled} { setup_xfail "rs6000-*-*" }
     gdb_test "print s" " = 1" "print s in call_after_alloca"
     gdb_test "print i" " = 2" "print i in call_after_alloca"
     gdb_test "print l" " = 3" "print l in call_after_alloca"
 
-    if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
+    if {!$gcc_compiled} { setup_xfail "rs6000-*-*" }
     gdb_test "backtrace 8" "#0.*call_after_alloca_subr \\(c=97 'a', s=1, i=2, l=3, uc=98 'b', us=11, ui=12, ul=13\\).*#1.*call_after_alloca \\(c=97 'a', s=1, i=2, l=3\\).*#2.*main.*" "backtrace from call_after_alloca_subr"
 }
 
@@ -925,14 +925,14 @@ proc_with_prefix localvars_in_indirect_call { } {
     # Print each arg as a double check to see if we can print
     # them here as well as with backtrace.
 
-    if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
+    if {!$gcc_compiled} { setup_xfail "rs6000-*-*" }
     gdb_test "print c" " = 97 'a'" "print c in localvars_in_indirect_call"
-    if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
+    if {!$gcc_compiled} { setup_xfail "rs6000-*-*" }
     gdb_test "print s" " = 1" "print s in localvars_in_indirect_call"
     gdb_test "print i" " = 2" "print i in localvars_in_indirect_call"
     gdb_test "print l" " = 3" "print l in localvars_in_indirect_call"
 
-    if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
+    if {!$gcc_compiled} { setup_xfail "rs6000-*-*" }
     gdb_test "backtrace 8" \
 	"#0.*call0a \\(c=97 'a', s=1, i=2, l=3\\).*#1.*main.*" \
 	"backtrace in indirectly called function"
@@ -965,7 +965,7 @@ proc_with_prefix localvars_in_indirect_call { } {
 	}
     }
 
-    if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
+    if {!$gcc_compiled} { setup_xfail "rs6000-*-*" }
     gdb_test "step" "call0a \\(c=97 'a', s=1, i=2, l=3\\).*" \
 	"stepping into indirectly called function"
 }
diff --git a/gdb/testsuite/gdb.base/gcore-buffer-overflow.exp b/gdb/testsuite/gdb.base/gcore-buffer-overflow.exp
index 609d61328f4..ead21e62593 100644
--- a/gdb/testsuite/gdb.base/gcore-buffer-overflow.exp
+++ b/gdb/testsuite/gdb.base/gcore-buffer-overflow.exp
@@ -34,7 +34,7 @@ clean_restart ${binfile}
 gdb_test_no_output "set args ${pattern}"	\
     "set buffer exceeding arguments"
 
-if { ! [ runto_main ] } then {
+if {![runto_main]} {
     return -1
 }
 
diff --git a/gdb/testsuite/gdb.base/gcore.exp b/gdb/testsuite/gdb.base/gcore.exp
index 93d943c32e4..1c836c29d25 100644
--- a/gdb/testsuite/gdb.base/gcore.exp
+++ b/gdb/testsuite/gdb.base/gcore.exp
@@ -23,7 +23,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
     return -1
 }
 
-if { ! [ runto_main ] } then {
+if {![runto_main]} {
     return -1
 }
 
@@ -81,21 +81,21 @@ gdb_test_sequence "where" "where in corefile" {
 }
 
 set post_corefile_regs [capture_command_output "info registers" ""]
-if ![string compare $pre_corefile_regs $post_corefile_regs] then {
+if {![string compare $pre_corefile_regs $post_corefile_regs]} {
     pass "corefile restored general registers"
 } else {
     fail "corefile restored general registers"
 }
 
 set post_corefile_allregs [capture_command_output "info all-reg" ""]
-if ![string compare $pre_corefile_allregs $post_corefile_allregs] then {
+if {![string compare $pre_corefile_allregs $post_corefile_allregs]} {
     pass "corefile restored all registers"
 } else {
     fail "corefile restored all registers"
 }
 
 set post_corefile_sysregs [capture_command_output "info reg system" ""]
-if ![string compare $pre_corefile_sysregs $post_corefile_sysregs] then {
+if {![string compare $pre_corefile_sysregs $post_corefile_sysregs]} {
     pass "corefile restored system registers"
 } else {
     fail "corefile restored system registers"
diff --git a/gdb/testsuite/gdb.base/gdb1090.exp b/gdb/testsuite/gdb.base/gdb1090.exp
index 16bc19b2a80..36f5fa0fb68 100644
--- a/gdb/testsuite/gdb.base/gdb1090.exp
+++ b/gdb/testsuite/gdb.base/gdb1090.exp
@@ -28,7 +28,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
     return -1
 }
 
-if ![runto_main] then {
+if {![runto_main]} {
     return 1
 }
 
diff --git a/gdb/testsuite/gdb.base/gdb11530.exp b/gdb/testsuite/gdb.base/gdb11530.exp
index 7f16965d11d..77d61c7cbbd 100644
--- a/gdb/testsuite/gdb.base/gdb11530.exp
+++ b/gdb/testsuite/gdb.base/gdb11530.exp
@@ -31,7 +31,7 @@ if { [prepare_for_testing "failed to prepare" $testfile $testfile.c {debug}] } {
 }
 
 
-if { ![runto_main] } then {
+if {![runto_main]} {
     return
 }
 
diff --git a/gdb/testsuite/gdb.base/gdb11531.exp b/gdb/testsuite/gdb.base/gdb11531.exp
index 4520a0dc125..d27dcfe8fc0 100644
--- a/gdb/testsuite/gdb.base/gdb11531.exp
+++ b/gdb/testsuite/gdb.base/gdb11531.exp
@@ -38,7 +38,7 @@ if {$skip_hw_watchpoint_tests_p} {
    gdb_test_no_output "set can-use-hw-watchpoints 0" ""
 }
 
-if { ![runto_main] } then {
+if {![runto_main]} {
     return
 }
 
diff --git a/gdb/testsuite/gdb.base/gdb1250.exp b/gdb/testsuite/gdb.base/gdb1250.exp
index 06390b1002b..70e219ce580 100644
--- a/gdb/testsuite/gdb.base/gdb1250.exp
+++ b/gdb/testsuite/gdb.base/gdb1250.exp
@@ -31,7 +31,7 @@ if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb
 
 clean_restart ${binfile}
 
-if ![runto abort {allow-pending}] then {
+if {![runto abort {allow-pending}]} {
     return
 }
 
diff --git a/gdb/testsuite/gdb.base/gdb1555.exp b/gdb/testsuite/gdb.base/gdb1555.exp
index c8c86edbc23..1d603ab94c0 100644
--- a/gdb/testsuite/gdb.base/gdb1555.exp
+++ b/gdb/testsuite/gdb.base/gdb1555.exp
@@ -39,7 +39,7 @@ if { [gdb_compile_shlib $libsrc $libobj {debug}] != ""
 clean_restart ${binfile}
 gdb_load_shlib $libobj
 
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 
diff --git a/gdb/testsuite/gdb.base/gdb1821.exp b/gdb/testsuite/gdb.base/gdb1821.exp
index cfa95aa5c24..40dcb0cc75b 100644
--- a/gdb/testsuite/gdb.base/gdb1821.exp
+++ b/gdb/testsuite/gdb.base/gdb1821.exp
@@ -28,7 +28,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
     return -1
 }
 
-if ![runto_main] then {
+if {![runto_main]} {
     perror "couldn't run to breakpoint"
     return
 } 
diff --git a/gdb/testsuite/gdb.base/gnu-ifunc.exp b/gdb/testsuite/gdb.base/gnu-ifunc.exp
index 3fbf237c71c..715f5be04cb 100644
--- a/gdb/testsuite/gdb.base/gnu-ifunc.exp
+++ b/gdb/testsuite/gdb.base/gnu-ifunc.exp
@@ -105,7 +105,7 @@ proc_with_prefix set-break {resolver_attr resolver_debug final_debug} {
     clean_restart $binfile-$suffix
     gdb_load_shlib ${lib_so}
 
-    if ![runto_main] then {
+    if {![runto_main]} {
 	return 1
     }
 
@@ -227,7 +227,7 @@ proc misc_tests {resolver_attr resolver_debug final_debug} {
     clean_restart $binfile-$suffix
     gdb_load_shlib ${lib_so}
 
-    if ![runto_main] then {
+    if {![runto_main]} {
 	return 1
     }
 
diff --git a/gdb/testsuite/gdb.base/gnu_vector.exp b/gdb/testsuite/gdb.base/gnu_vector.exp
index 796d9e947e1..5b6eb7af5a0 100644
--- a/gdb/testsuite/gdb.base/gnu_vector.exp
+++ b/gdb/testsuite/gdb.base/gnu_vector.exp
@@ -105,7 +105,7 @@ gdb_test "ptype (char4) 0x01010101" \
 gdb_test "ptype (int2) lla" \
     "type = int __attribute__ \\(\\(vector_size\\(2\\)\\)\\)"
 
-if { ![string compare $endian big] } then {
+if {![string compare $endian big]} {
     gdb_test "print (char4) ia" "\\\$$decimal = \\{0, 0, 0, 2\\}"
 } else {
     gdb_test "print (char4) ia" "\\\$$decimal = \\{2, 0, 0, 0\\}"
diff --git a/gdb/testsuite/gdb.base/gold-gdb-index.exp b/gdb/testsuite/gdb.base/gold-gdb-index.exp
index 6073a64d0a1..f9a1d07b0d0 100644
--- a/gdb/testsuite/gdb.base/gold-gdb-index.exp
+++ b/gdb/testsuite/gdb.base/gold-gdb-index.exp
@@ -34,7 +34,7 @@ if { [have_index $binfile] != "gdb_index" } {
 
 gdb_test_no_output "set auto-solib-add off"
 
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 
diff --git a/gdb/testsuite/gdb.base/hbreak-in-shr-unsupported.exp b/gdb/testsuite/gdb.base/hbreak-in-shr-unsupported.exp
index a521637e17e..4836e133107 100644
--- a/gdb/testsuite/gdb.base/hbreak-in-shr-unsupported.exp
+++ b/gdb/testsuite/gdb.base/hbreak-in-shr-unsupported.exp
@@ -39,7 +39,7 @@ if { [gdb_compile_shlib ${srcdir}/${subdir}/${lib_src} ${lib_so} $lib_opts] != "
 clean_restart $binfile
 gdb_load_shlib $lib_so
 
-if ![runto_main] then {
+if {![runto_main]} {
     return -1
 }
 
diff --git a/gdb/testsuite/gdb.base/hbreak2.exp b/gdb/testsuite/gdb.base/hbreak2.exp
index aecf613643d..a5e870a5708 100644
--- a/gdb/testsuite/gdb.base/hbreak2.exp
+++ b/gdb/testsuite/gdb.base/hbreak2.exp
@@ -25,7 +25,7 @@ if { [prepare_for_testing "failed to prepare" "hbreak2" {break.c break1.c} {debu
 set srcfile break.c
 set srcfile1 break1.c
 
-if ![runto_main] then {
+if {![runto_main]} {
     return
 }
 
@@ -287,7 +287,7 @@ gdb_test "info break" \
 
 #***********
 
-if ![runto_main] then {
+if {![runto_main]} {
     return
 }
 
@@ -315,7 +315,7 @@ gdb_test "hbreak" "Hardware assisted breakpoint \[0-9\]*.*" \
 # Verify that a "silent" breakpoint can be set, and that GDB is indeed
 # "silent" about its triggering.
 #
-if ![runto_main] then {
+if {![runto_main]} {
     return
 }
 
@@ -520,7 +520,7 @@ if { [prepare_for_testing "failed to prepare" "hbreak2o2" {break.c break1.c} {de
     return -1
 }
 
-if ![runto_main] then {
+if {![runto_main]} {
     return
 }
 
diff --git a/gdb/testsuite/gdb.base/hook-stop.exp b/gdb/testsuite/gdb.base/hook-stop.exp
index f861709e491..a4f5ec2b82a 100644
--- a/gdb/testsuite/gdb.base/hook-stop.exp
+++ b/gdb/testsuite/gdb.base/hook-stop.exp
@@ -39,7 +39,7 @@ proc setup {commands} {
 
     clean_restart $binfile
 
-    if ![runto_main] then {
+    if {![runto_main]} {
 	return -code return
     }
 
diff --git a/gdb/testsuite/gdb.base/huge.exp b/gdb/testsuite/gdb.base/huge.exp
index e8274626e8a..9be4f328f87 100644
--- a/gdb/testsuite/gdb.base/huge.exp
+++ b/gdb/testsuite/gdb.base/huge.exp
@@ -42,7 +42,7 @@ clean_restart ${binfile}
 set prev_timeout $timeout
 set timeout 30
 
-if { ! [ runto_main ] } then {
+if {![runto_main]} {
     return -1
 }
 
diff --git a/gdb/testsuite/gdb.base/infcall-input.exp b/gdb/testsuite/gdb.base/infcall-input.exp
index a09a28a6904..a1e98ee1945 100644
--- a/gdb/testsuite/gdb.base/infcall-input.exp
+++ b/gdb/testsuite/gdb.base/infcall-input.exp
@@ -27,7 +27,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
     return -1
 }
 
-if ![runto_main] then {
+if {![runto_main]} {
     return -1
 }
 
diff --git a/gdb/testsuite/gdb.base/inferior-args.exp b/gdb/testsuite/gdb.base/inferior-args.exp
index 691ce0ae884..30ce0761612 100644
--- a/gdb/testsuite/gdb.base/inferior-args.exp
+++ b/gdb/testsuite/gdb.base/inferior-args.exp
@@ -16,7 +16,7 @@
 # Test running an inferior with arguments.
 
 # This does not work on boards that don't support inferior arguments.
-if [target_info exists noargs] then {
+if {[target_info exists noargs]} {
     verbose "skipping gdb.base/inferior-args.exp because of noargs"
     return
 }
diff --git a/gdb/testsuite/gdb.base/inferior-died.exp b/gdb/testsuite/gdb.base/inferior-died.exp
index 28ea8df1e74..fc0a722d4b4 100644
--- a/gdb/testsuite/gdb.base/inferior-died.exp
+++ b/gdb/testsuite/gdb.base/inferior-died.exp
@@ -16,7 +16,7 @@
 # Until "set follow-fork-mode" and "catch fork" are implemented on
 # other targets...
 #
-if { ![istarget "*-*-linux*"] } then {
+if {![istarget "*-*-linux*"]} {
     unsupported "inferior-died.exp"
     return
 }
diff --git a/gdb/testsuite/gdb.base/info-fun.exp b/gdb/testsuite/gdb.base/info-fun.exp
index e683bc3aa70..f2ebd6f19b7 100644
--- a/gdb/testsuite/gdb.base/info-fun.exp
+++ b/gdb/testsuite/gdb.base/info-fun.exp
@@ -53,7 +53,7 @@ foreach_with_prefix n_flag { 0 1 } {
 
 	clean_restart $executable
 
-	if ![runto_main] then {
+	if {![runto_main]} {
 	    return 0
 	}
 
diff --git a/gdb/testsuite/gdb.base/info-locals-unused-static-var.exp b/gdb/testsuite/gdb.base/info-locals-unused-static-var.exp
index 8c4027bcc8a..221e416e2af 100644
--- a/gdb/testsuite/gdb.base/info-locals-unused-static-var.exp
+++ b/gdb/testsuite/gdb.base/info-locals-unused-static-var.exp
@@ -32,7 +32,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
     return -1
 }
 
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 
diff --git a/gdb/testsuite/gdb.base/info-os.exp b/gdb/testsuite/gdb.base/info-os.exp
index d12f8750a9c..f4eb42fcb8b 100644
--- a/gdb/testsuite/gdb.base/info-os.exp
+++ b/gdb/testsuite/gdb.base/info-os.exp
@@ -16,13 +16,13 @@
 standard_testfile .c
 
 # This test is Linux-only.
-if ![istarget *-*-linux*] then {
+if {![istarget *-*-linux*]} {
     unsupported "info-os.exp"
     return -1
 }
 
 # Support for XML-output is needed to run this test.
-if [gdb_skip_xml_test] then {
+if {[gdb_skip_xml_test]} {
     unsupported "info-os.exp"
     return -1
 }
@@ -32,7 +32,7 @@ if { [prepare_for_testing "failed to prepare" $testfile $srcfile {debug pthreads
     return -1
 }
 
-if ![runto_main] then {
+if {![runto_main]} {
     return -1
 }
 
diff --git a/gdb/testsuite/gdb.base/info-proc.exp b/gdb/testsuite/gdb.base/info-proc.exp
index f90c9c45c71..179efb40855 100644
--- a/gdb/testsuite/gdb.base/info-proc.exp
+++ b/gdb/testsuite/gdb.base/info-proc.exp
@@ -48,7 +48,7 @@ if { ! [use_gdb_stub] } {
     gdb_test_no_output "set args $cmdline" "set args"
 }
 
-if { ! [ runto_main ] } then {
+if {![runto_main]} {
     return -1
 }
 
diff --git a/gdb/testsuite/gdb.base/info-program.exp b/gdb/testsuite/gdb.base/info-program.exp
index 1dc470b6e79..1496ea518dd 100644
--- a/gdb/testsuite/gdb.base/info-program.exp
+++ b/gdb/testsuite/gdb.base/info-program.exp
@@ -33,7 +33,7 @@ gdb_test "next" ".*" "step before info program"
 gdb_test "info program" "Program stopped at $hex\.\r\nIt stopped after being stepped\.\r\nType \"info stack\" or \"info registers\" for more information\." \
     "info program after next"
 
-if { ![runto_main] } then {
+if {![runto_main]} {
     return -1
 }
 
diff --git a/gdb/testsuite/gdb.base/info_qt.exp b/gdb/testsuite/gdb.base/info_qt.exp
index e51d0279d70..ee61c277be0 100644
--- a/gdb/testsuite/gdb.base/info_qt.exp
+++ b/gdb/testsuite/gdb.base/info_qt.exp
@@ -27,7 +27,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile}] } {
     return -1
 }
 
-if ![runto setup_done] then {
+if {![runto setup_done]} {
     return 0
 }
 
diff --git a/gdb/testsuite/gdb.base/inline-frame-cycle-unwind.exp b/gdb/testsuite/gdb.base/inline-frame-cycle-unwind.exp
index c1273f148b1..4001bc9b7ca 100644
--- a/gdb/testsuite/gdb.base/inline-frame-cycle-unwind.exp
+++ b/gdb/testsuite/gdb.base/inline-frame-cycle-unwind.exp
@@ -58,7 +58,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}]} {
 # Skip this test if Python scripting is not enabled.
 if { [skip_python_tests] } { continue }
 
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 
diff --git a/gdb/testsuite/gdb.base/interp.exp b/gdb/testsuite/gdb.base/interp.exp
index 3db90f64103..a42d4ae60ae 100644
--- a/gdb/testsuite/gdb.base/interp.exp
+++ b/gdb/testsuite/gdb.base/interp.exp
@@ -90,7 +90,7 @@ gdb_test "$commands\nend" "" "finish defining hello command"
 
 gdb_test "hello" [string_to_regexp "^done,value=\"23\""]
 
-if ![runto_main] then {
+if {![runto_main]} {
   return -1
 }
 
diff --git a/gdb/testsuite/gdb.base/interrupt.exp b/gdb/testsuite/gdb.base/interrupt.exp
index 26741d59112..143116c4124 100644
--- a/gdb/testsuite/gdb.base/interrupt.exp
+++ b/gdb/testsuite/gdb.base/interrupt.exp
@@ -38,7 +38,7 @@ if {[build_executable $testfile.exp $testfile $srcfile $options] == -1} {
 gdb_start
 
 
-if ![file exists $binfile] then {
+if {![file exists $binfile]} {
     perror "$binfile does not exist."
     return 0
 } else {
@@ -47,7 +47,7 @@ if ![file exists $binfile] then {
     # Hope this is unix :-)
     gdb_test "shell stty intr '^C'" ".*" \
 	"set interrupt character"
-    if [runto_main] then {
+    if {[runto_main]} {
 	global inferior_spawn_id gdb_spawn_id
 
 	set msg "process is alive"
diff --git a/gdb/testsuite/gdb.base/jit-reader-exec.exp b/gdb/testsuite/gdb.base/jit-reader-exec.exp
index c5ee8ef89a3..eafa4758549 100644
--- a/gdb/testsuite/gdb.base/jit-reader-exec.exp
+++ b/gdb/testsuite/gdb.base/jit-reader-exec.exp
@@ -17,7 +17,7 @@
 # inferior that used the JIT API then exec'd a program that did not
 # use it.
 
-if { ![istarget "*-linux*"] } then {
+if {![istarget "*-linux*"]} {
     return
 }
 
diff --git a/gdb/testsuite/gdb.base/jump.exp b/gdb/testsuite/gdb.base/jump.exp
index 91fde018b4d..527a1ae22d5 100644
--- a/gdb/testsuite/gdb.base/jump.exp
+++ b/gdb/testsuite/gdb.base/jump.exp
@@ -29,7 +29,7 @@ if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb
 
 clean_restart ${binfile}
 
-if ![runto_main] then {
+if {![runto_main]} {
   perror "Couldn't run to main"
   return -1
 }
diff --git a/gdb/testsuite/gdb.base/label-without-address.exp b/gdb/testsuite/gdb.base/label-without-address.exp
index 9c4a9491115..e55cf7ffdac 100644
--- a/gdb/testsuite/gdb.base/label-without-address.exp
+++ b/gdb/testsuite/gdb.base/label-without-address.exp
@@ -19,7 +19,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
     return -1
 }
 
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 
diff --git a/gdb/testsuite/gdb.base/langs.exp b/gdb/testsuite/gdb.base/langs.exp
index fdc81333647..1957927dbfe 100644
--- a/gdb/testsuite/gdb.base/langs.exp
+++ b/gdb/testsuite/gdb.base/langs.exp
@@ -49,7 +49,7 @@ set isfixed 0
 set foo_func foo__Fi
 set do_func langs0__2do
 
-if [runto csub] then {
+if {[runto csub]} {
 
     if { !$isfixed } { set lang c }
     gdb_test "show language" "currently $lang\".*" \
@@ -58,20 +58,20 @@ if [runto csub] then {
     gdb_test "bt" "#0.*csub.*#1.*(foo|$foo_func) \\(.*#2.*cppsub_ .*#3.*fsub.*#4.*$do_func \\(.*#5  \[0-9a-fx\]* in main.*" "backtrace"
 
     if { !$isfixed } { set lang c\\+\\+; set ext cxx }
-    if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
+    if {!$gcc_compiled} { setup_xfail "rs6000-*-*" }
     gdb_test "up" ".* in (foo|$foo_func).* at .*langs2\\.$ext.*return csub \\(.*" \
 	"up to foo"
     gdb_test "show language" "currently $lang.*" \
 	"show language at foo"
 
-    if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
+    if {!$gcc_compiled} { setup_xfail "rs6000-*-*" }
     gdb_test "up" ".* in cppsub_ .* at .*langs2\\.$ext.*return foo \\(.*" \
 	"up to cppsub_"
     gdb_test "show language" "currently $lang.*" \
 	"show language at cppsub_"
 
     if { !$isfixed } { set lang fortran }
-    if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
+    if {!$gcc_compiled} { setup_xfail "rs6000-*-*" }
     gdb_test "up" ".* in fsub.* at .*langs1\\.f.*" \
 	"up to fsub"
     gdb_test "show language" "currently $lang.*" \
@@ -100,7 +100,7 @@ gdb_load $binfile
 
 # Try exercising the "minimal" language a bit...
 
-if [runto csub] then {
+if {[runto csub]} {
     gdb_test "set lang minimal" \
              "Warning: the current language does not match this frame." \
              "set lang to minimal"
@@ -117,7 +117,7 @@ if [runto csub] then {
 	"set lang back to auto for verbose test"
     gdb_test_no_output "set verbose on"
     if { !$isfixed } { set lang c\\+\\+; set ext cxx }
-    if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
+    if {!$gcc_compiled} { setup_xfail "rs6000-*-*" }
     gdb_test "up" \
 	".* in (foo|$foo_func).* at .*langs2\\.$ext.*return csub \\(.*Current language:  auto.*" \
 	"up to foo when verbose"
diff --git a/gdb/testsuite/gdb.base/large-frame.exp b/gdb/testsuite/gdb.base/large-frame.exp
index b58a43f81a3..94bfd5527f1 100644
--- a/gdb/testsuite/gdb.base/large-frame.exp
+++ b/gdb/testsuite/gdb.base/large-frame.exp
@@ -39,7 +39,7 @@ proc run_test { opt_level } {
 	return
     }
 
-    if { ![runto_main] } then {
+    if {![runto_main]} {
 	return
     }
 
diff --git a/gdb/testsuite/gdb.base/list-missing-source.exp b/gdb/testsuite/gdb.base/list-missing-source.exp
index 6801ab4289c..e3b8d142f10 100644
--- a/gdb/testsuite/gdb.base/list-missing-source.exp
+++ b/gdb/testsuite/gdb.base/list-missing-source.exp
@@ -45,7 +45,7 @@ remote_file host delete $srcfile
 # Now start GDB, run to main and try to list the source.
 clean_restart ${binfile}
 
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 
diff --git a/gdb/testsuite/gdb.base/list.exp b/gdb/testsuite/gdb.base/list.exp
index fe894a0098e..9cd1daacc33 100644
--- a/gdb/testsuite/gdb.base/list.exp
+++ b/gdb/testsuite/gdb.base/list.exp
@@ -98,7 +98,7 @@ proc test_listsize {} {
 
     # Try small listsize > 2 that is an even number.
 
-    if [ set_listsize 4 ] then {
+    if {[set_listsize 4]} {
 	gdb_test "list 1" "1\[ \t\]+#include \"list0.h\".*4\[ \t\]+\{" "list line 1 with listsize 4"
 	gdb_test "list 2" "1\[ \t\]+#include \"list0.h\".*4\[ \t\]+\{" "list line 2 with listsize 4"
 	
@@ -108,7 +108,7 @@ proc test_listsize {} {
 
     # Try a size larger than the entire file.
 
-    if [ set_listsize 100 ] then {
+    if {[set_listsize 100]} {
 	gdb_test "list 1" "1\[ \t\]+#include \"list0.h\".*\r\n${last_line_re}" "list line 1 with listsize 100"
 	
 	gdb_test "list 10" "1\[ \t\]+#include \"list0.h\".*\r\n${last_line_re}" "list line 10 with listsize 100"
@@ -411,7 +411,7 @@ gdb_test_no_output "set width 0"
 
 test_listsize
 get_debug_format
-if [ set_listsize 10 ] then {
+if {[set_listsize 10]} {
     test_list_include_file
     test_list_filename_and_number
     test_list_function
@@ -466,7 +466,7 @@ proc test_list {command listsize1 listsize2 linerange1 linerange2} {
 	global binfile
 
 	clean_restart $binfile
-	if ![runto_main] then {
+	if {![runto_main]} {
 	    return
 	}
 
diff --git a/gdb/testsuite/gdb.base/logical.exp b/gdb/testsuite/gdb.base/logical.exp
index b1d3c757768..25eb0711b82 100644
--- a/gdb/testsuite/gdb.base/logical.exp
+++ b/gdb/testsuite/gdb.base/logical.exp
@@ -39,7 +39,7 @@ clean_restart ${binfile}
 # set it up at a breakpoint so we can play with the variable values
 #
 
-if ![runto_main] then {
+if {![runto_main]} {
     perror "couldn't run to breakpoint"
     return
 }
diff --git a/gdb/testsuite/gdb.base/long-inferior-output.exp b/gdb/testsuite/gdb.base/long-inferior-output.exp
index 784eaf9b5a0..e3d1f991f7d 100644
--- a/gdb/testsuite/gdb.base/long-inferior-output.exp
+++ b/gdb/testsuite/gdb.base/long-inferior-output.exp
@@ -39,7 +39,7 @@ if [prepare_for_testing "failed to prepare" $testfile {} {debug}] {
     return -1
 }
 
-if { ![runto_main] } then {
+if {![runto_main]} {
     return
 }
 
diff --git a/gdb/testsuite/gdb.base/long_long.exp b/gdb/testsuite/gdb.base/long_long.exp
index 9c8dd16b7eb..81d006f7379 100644
--- a/gdb/testsuite/gdb.base/long_long.exp
+++ b/gdb/testsuite/gdb.base/long_long.exp
@@ -34,7 +34,7 @@ if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [con
 
 clean_restart ${binfile}
 
-if { ![runto known_types] } then { 
+if {![runto known_types]} {
    return 
 }
 
diff --git a/gdb/testsuite/gdb.base/longjmp.exp b/gdb/testsuite/gdb.base/longjmp.exp
index f301cac2897..bd2fc21a442 100644
--- a/gdb/testsuite/gdb.base/longjmp.exp
+++ b/gdb/testsuite/gdb.base/longjmp.exp
@@ -27,7 +27,7 @@ if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb
 
 clean_restart ${binfile}
 
-if ![runto_main] then {
+if {![runto_main]} {
    return 0
 }
 
diff --git a/gdb/testsuite/gdb.base/maint-info-sections.exp b/gdb/testsuite/gdb.base/maint-info-sections.exp
index 4c7987e84c7..766a3af8f2b 100644
--- a/gdb/testsuite/gdb.base/maint-info-sections.exp
+++ b/gdb/testsuite/gdb.base/maint-info-sections.exp
@@ -25,7 +25,7 @@ if {[prepare_for_testing "failed to prepare" $testfile \
     return -1
 }
 
-if ![runto_main] then {
+if {![runto_main]} {
     return -1
 }
 
diff --git a/gdb/testsuite/gdb.base/maint-print-frame-id.exp b/gdb/testsuite/gdb.base/maint-print-frame-id.exp
index 395927a22c4..17190ccea5a 100644
--- a/gdb/testsuite/gdb.base/maint-print-frame-id.exp
+++ b/gdb/testsuite/gdb.base/maint-print-frame-id.exp
@@ -22,7 +22,7 @@ if {[prepare_for_testing "failed to prepare" $testfile \
     return -1
 }
 
-if ![runto_main] then {
+if {![runto_main]} {
     return -1
 }
 
diff --git a/gdb/testsuite/gdb.base/maint.exp b/gdb/testsuite/gdb.base/maint.exp
index 16628b4a8b6..981c2f626ac 100644
--- a/gdb/testsuite/gdb.base/maint.exp
+++ b/gdb/testsuite/gdb.base/maint.exp
@@ -113,7 +113,7 @@ gdb_test "mt set per off" ".*" "mt set per off for expand-symtabs"
 
 gdb_load ${binfile}
 
-if ![runto_main] then {
+if {![runto_main]} {
         perror "tests suppressed"
 }
 
diff --git a/gdb/testsuite/gdb.base/max-value-size.exp b/gdb/testsuite/gdb.base/max-value-size.exp
index 94e2ff6154a..a05cca32574 100644
--- a/gdb/testsuite/gdb.base/max-value-size.exp
+++ b/gdb/testsuite/gdb.base/max-value-size.exp
@@ -19,7 +19,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
     return -1
 }
 
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 
@@ -46,7 +46,7 @@ proc get_max_value_size {} {
 proc do_value_printing { max_value_size test_prefix } {
     with_test_prefix ${test_prefix} {
 	gdb_test "p/d one" " = 0"
-	if { $max_value_size != "unlimited" && $max_value_size < 100 } then {
+	if {$max_value_size != "unlimited" && $max_value_size < 100} {
 	    gdb_test "p/d one_hundred" \
 		"value requires 100 bytes, which is more than max-value-size"
 	} else {
@@ -59,7 +59,7 @@ proc do_value_printing { max_value_size test_prefix } {
 # Install SET_VALUE as the value for max-value-size, then print the
 # test values.
 proc set_and_check_max_value_size { set_value } {
-    if { $set_value == "unlimited" } then {
+    if {$set_value == "unlimited"} {
 	set check_pattern "unlimited"
     } else {
 	set check_pattern "${set_value} bytes"
diff --git a/gdb/testsuite/gdb.base/memattr.exp b/gdb/testsuite/gdb.base/memattr.exp
index 3420e6c5cae..28ca8293b5e 100644
--- a/gdb/testsuite/gdb.base/memattr.exp
+++ b/gdb/testsuite/gdb.base/memattr.exp
@@ -142,7 +142,7 @@ gdb_test_multiple "info mem" "info mem(1)" {
 	exp_continue
     }
     -re "$gdb_prompt $" {
-	if { $see1 && $see2 && $see3 && $see4 && $see5 } then {
+	if {$see1 && $see2 && $see3 && $see4 && $see5} {
 	    pass "info mem (1)"
 	} else {
 	    fail "info mem (1)"
@@ -216,7 +216,7 @@ gdb_test_multiple "info mem" "mem 2 and 4 were disabled" {
 	exp_continue
     }
     -re "$gdb_prompt $" {
-	if { $see1 && $see2 && $see3 && $see4 && $see5 } then {
+	if {$see1 && $see2 && $see3 && $see4 && $see5} {
 	    pass "mem 2 and 4 were disabled"
 	} else {
 	    fail "mem 2 and 4 were disabled"
@@ -258,7 +258,7 @@ gdb_test_multiple "info mem" "mem 2-4 were enabled" {
 	exp_continue
     }
     -re "$gdb_prompt $" {
-	if { $see1 && $see2 && $see3 && $see4 && $see5 } then {
+	if {$see1 && $see2 && $see3 && $see4 && $see5} {
 	    pass "mem 2-4 were enabled"
 	} else {
 	    fail "mem 2-4 were enabled"
@@ -300,7 +300,7 @@ gdb_test_multiple "info mem" "mem 1 to 5 were disabled" {
 	exp_continue
     }
     -re "$gdb_prompt $" {
-	if { $see1 && $see2 && $see3 && $see4 && $see5 } then {
+	if {$see1 && $see2 && $see3 && $see4 && $see5} {
 	    pass "mem 1 to 5 were disabled"
 	} else {
 	    fail "mem 1 to 5 were disabled"
@@ -342,7 +342,7 @@ gdb_test_multiple "info mem" "mem 1 to 5 were enabled" {
 	exp_continue
     }
     -re "$gdb_prompt $" {
-	if { $see1 && $see2 && $see3 && $see4 && $see5 } then {
+	if {$see1 && $see2 && $see3 && $see4 && $see5} {
 	    pass "mem 1 to 5 were enabled"
 	} else {
 	    fail "mem 1 to 5 were enabled"
@@ -391,7 +391,7 @@ gdb_test_multiple "info mem" "mem 1 was deleted" {
 	exp_continue
     }
     -re "$gdb_prompt $" {
-	if { !$see1 && $see2 && $see3 && $see4 && $see5 } then {
+	if {!$see1 && $see2 && $see3 && $see4 && $see5} {
 	    pass "mem 1 was deleted"
 	} else {
 	    fail "mem 1 was deleted"
@@ -432,7 +432,7 @@ gdb_test_multiple "info mem" "mem 2 and 4 were deleted" {
 	exp_continue
     }
     -re "$gdb_prompt $" {
-	if { !$see1 && !$see2 && $see3 && !$see4 && $see5 } then {
+	if {!$see1 && !$see2 && $see3 && !$see4 && $see5} {
 	    pass "mem 2 and 4 were deleted"
 	} else {
 	    fail "mem 2 and 4 were deleted"
@@ -474,7 +474,7 @@ gdb_test_multiple "info mem" "mem 2-4 were deleted" {
 	exp_continue
     }
     -re "$gdb_prompt $" {
-	if { !$see1 && !$see2 && !$see3 && !$see4 && $see5 } then {
+	if {!$see1 && !$see2 && !$see3 && !$see4 && $see5} {
 	    pass "mem 2-4 were deleted"
 	} else {
 	    fail "mem 2-4 were deleted"
diff --git a/gdb/testsuite/gdb.base/mips_pro.exp b/gdb/testsuite/gdb.base/mips_pro.exp
index fe5eb94f001..45186161cb7 100644
--- a/gdb/testsuite/gdb.base/mips_pro.exp
+++ b/gdb/testsuite/gdb.base/mips_pro.exp
@@ -19,7 +19,7 @@ standard_testfile
 # This test must be compiled with -O2 if using gcc.
 
 set options debug
-if { [test_compiler_info gcc-*-*] } then {
+if {[test_compiler_info gcc-*-*]} {
     lappend options additional_flags=-O2 additional_flags=-fno-inline
 }
 
@@ -27,11 +27,11 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile $options]} {
     return -1
 }
 
-if [runto middle] then {
+if {[runto middle]} {
     # PR 3016
     #   warning: Hit heuristic-fence-post without finding
     #   warning: enclosing function for pc 0x1006ead0
-    if { [test_compiler_info gcc-*-*] } then {
+    if {[test_compiler_info gcc-*-*]} {
 	setup_xfail "mips64*-*-elf"
     }
     # The call chain is main -> top -> middle.  But gcc can optimize a tail
diff --git a/gdb/testsuite/gdb.base/miscexprs.exp b/gdb/testsuite/gdb.base/miscexprs.exp
index 7d9542fbeba..1cf121751b4 100644
--- a/gdb/testsuite/gdb.base/miscexprs.exp
+++ b/gdb/testsuite/gdb.base/miscexprs.exp
@@ -50,7 +50,7 @@ clean_restart ${binfile}
 #
 # set it up at a breakpoint so we can play with the variable values
 #
-if ![runto_main] then {
+if {![runto_main]} {
     perror "couldn't run to breakpoint"
     return
 }
diff --git a/gdb/testsuite/gdb.base/multi-forks.exp b/gdb/testsuite/gdb.base/multi-forks.exp
index 0e35fbbc422..14ff95c53bb 100644
--- a/gdb/testsuite/gdb.base/multi-forks.exp
+++ b/gdb/testsuite/gdb.base/multi-forks.exp
@@ -16,7 +16,7 @@
 # Until "set follow-fork-mode" and "catch fork" are implemented on
 # other targets...
 #
-if { ![istarget "*-*-linux*"] } then {
+if {![istarget "*-*-linux*"]} {
     return
 }
 
diff --git a/gdb/testsuite/gdb.base/nodebug.exp b/gdb/testsuite/gdb.base/nodebug.exp
index 906dc7e8239..8eca167da80 100644
--- a/gdb/testsuite/gdb.base/nodebug.exp
+++ b/gdb/testsuite/gdb.base/nodebug.exp
@@ -84,7 +84,7 @@ proc test_call_promotion {} {
     gdb_test "p /d ((uint8 (*) ()) add8_noproto)((uint8) 2, (uint8) 3)" " = 5"
 }
 
-if [nodebug_runto inner] then {
+if {[nodebug_runto inner]} {
     
     # Expect to find global/local symbols in each of text/data/bss.
     
@@ -292,7 +292,7 @@ if [nodebug_runto inner] then {
 
     # Now, try that we can give names of file-local symbols which happen
     # to be unique, and have it still work
-    if [nodebug_runto middle] then {
+    if {[nodebug_runto middle]} {
 	gdb_test "backtrace 10" "#0.*middle.*#1.*top.*#2.*main.*" \
 	    "backtrace from middle"
     }
diff --git a/gdb/testsuite/gdb.base/non-lazy-array-index.exp b/gdb/testsuite/gdb.base/non-lazy-array-index.exp
index 66686cfdd63..e35cfd9122f 100644
--- a/gdb/testsuite/gdb.base/non-lazy-array-index.exp
+++ b/gdb/testsuite/gdb.base/non-lazy-array-index.exp
@@ -22,7 +22,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile]} {
     return -1
 }
 
-if ![runto_main] then {
+if {![runto_main]} {
     return -1
 }
 
diff --git a/gdb/testsuite/gdb.base/noreturn-finish.exp b/gdb/testsuite/gdb.base/noreturn-finish.exp
index b4e358e14c2..140fb91968c 100644
--- a/gdb/testsuite/gdb.base/noreturn-finish.exp
+++ b/gdb/testsuite/gdb.base/noreturn-finish.exp
@@ -22,7 +22,7 @@ if [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {debug}] {
 proc noreturn_finish_test { } {
     global gdb_prompt
 
-    if { ! [ runto_main ] } then {
+    if {![runto_main]} {
 	return -1
     }
 
diff --git a/gdb/testsuite/gdb.base/noreturn-return.exp b/gdb/testsuite/gdb.base/noreturn-return.exp
index 2560908d58d..6db7023c181 100644
--- a/gdb/testsuite/gdb.base/noreturn-return.exp
+++ b/gdb/testsuite/gdb.base/noreturn-return.exp
@@ -22,7 +22,7 @@ if [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {debug}] {
 proc noreturn_test { } {
     global gdb_prompt
 
-    if { ! [ runto_main ] } then {
+    if {![runto_main]} {
 	return -1
     }
 
diff --git a/gdb/testsuite/gdb.base/opaque.exp b/gdb/testsuite/gdb.base/opaque.exp
index 4d7a3257880..4d3f11b32a9 100644
--- a/gdb/testsuite/gdb.base/opaque.exp
+++ b/gdb/testsuite/gdb.base/opaque.exp
@@ -51,7 +51,7 @@ proc setup_xfail_on_opaque_pointer {} {
 	global gcc_compiled
 
 	setup_xfail "vax-*-*" "i*86-sequent-bsd*"
-       if {!$gcc_compiled} then {
+       if {!$gcc_compiled} {
                setup_xfail "alpha-*-*"
        }
 }
@@ -59,7 +59,7 @@ proc setup_xfail_on_opaque_pointer {} {
 # This seems easier than trying to track different versions of xlc; I'm
 # not sure there is much rhyme or reason regarding which tests it fails
 # and which ones it passes.
-if {[istarget "rs6000-*-aix*"] && !$gcc_compiled} then {
+if {[istarget "rs6000-*-aix*"] && !$gcc_compiled} {
     warning "xfails in opaque.exp may not be set up correctly for xlc"
 }
 
@@ -72,7 +72,7 @@ gdb_test "whatis foop" \
 # Ensure that we know the form of the structure that foop points to.
 
 setup_xfail_on_opaque_pointer
-if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
+if {!$gcc_compiled} { setup_xfail "rs6000-*-*" }
 gdb_test "ptype foop" \
     "type = struct foo \{\[\r\n\]+    int a;\[\r\n\]+    int b;\[\r\n\]+\} \[*\]+" \
     "ptype on opaque struct pointer (statically)"
@@ -128,7 +128,7 @@ gdb_test "whatis foop" \
 # Ensure that we know the form of the thing foop points to.
 
 setup_xfail_on_opaque_pointer
-if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
+if {!$gcc_compiled} { setup_xfail "rs6000-*-*" }
 gdb_test "ptype foop" \
     "type = struct foo \{\[\r\n\]+    int a;\[\r\n\]+    int b;\[\r\n\]+\} \[*\]+" \
     "ptype on opaque struct pointer (dynamically) 1"
@@ -147,7 +147,7 @@ gdb_test "ptype afoo" \
 
 # Ensure that we know the form of an explicit struct foo.
 
-if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
+if {!$gcc_compiled} { setup_xfail "rs6000-*-*" }
 gdb_test "ptype struct foo" \
     "type = struct foo \{\[\r\n\]+    int a;\[\r\n\]+    int b;\[\r\n\]+\}" \
     "ptype on opaque struct tagname (dynamically) 1"
diff --git a/gdb/testsuite/gdb.base/overlays.exp b/gdb/testsuite/gdb.base/overlays.exp
index e3c94ac03d9..2c741072974 100644
--- a/gdb/testsuite/gdb.base/overlays.exp
+++ b/gdb/testsuite/gdb.base/overlays.exp
@@ -22,14 +22,14 @@
 
 set data_overlays 1
 
-if [istarget "m32r-*-*"] then {
+if {[istarget "m32r-*-*"]} {
     set linker_script "${srcdir}/${subdir}/m32r.ld"
 } else {
     verbose "Skipping overlay test -- not implemented for this target."
     return 
 }
 
-if [istarget "*-*-linux*"] then {
+if {[istarget "*-*-linux*"]} {
     verbose "Skipping overlay test -- Linux doesn't support overlayed programs."
     return 
 }
@@ -54,7 +54,7 @@ gdb_load ${binfile}
 # set it up at a breakpoint so we can play with the variable values
 #
 
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 
@@ -95,7 +95,7 @@ set bar_lma  [get_func_address "bar"  "\\*bar\\*"  "bar  load address"]
 set baz_lma  [get_func_address "baz"  "\\*baz\\*"  "baz  load address"]
 set grbx_lma [get_func_address "grbx" "\\*grbx\\*" "grbx load address"]
 
-if $data_overlays then {
+if {$data_overlays} {
     gdb_test "print \$foox_lma = &foox" \
 	".* $iptrcast 0x.*"  "foox load addr"
     gdb_test "print \$barx_lma = &barx" \
@@ -125,7 +125,7 @@ gdb_test "overlay map .ovly3" ""
 gdb_test "overlay list" "Section .ovly3, loaded at.*, mapped at.*" "list ovly3"
 set grbx_vma [get_func_address "grbx" "grbx" "grbx runtime address"]
 
-if $data_overlays then {
+if {$data_overlays} {
     gdb_test "overlay map .data00" "" 
     gdb_test "overlay list" "Section .data00, loaded .*, mapped .*" "list data00"
     gdb_test "print \$foox_vma = &foox" \
@@ -152,7 +152,7 @@ gdb_test "print $foo_lma   != $foo_vma" ".* = 1"   "foo's LMA   != VMA"
 gdb_test "print $bar_lma   != $bar_vma" ".* = 1"   "bar's LMA   != VMA"
 gdb_test "print $baz_lma   != $baz_vma" ".* = 1"   "baz's LMA   != VMA"
 gdb_test "print $grbx_lma  != $grbx_vma" ".* = 1"  "grbx's LMA  != VMA"
-if $data_overlays then {
+if {$data_overlays} {
     gdb_test "print \$foox_lma  != \$foox_vma" ".* = 1"  "foox's LMA  != VMA"
     gdb_test "print \$barx_lma  != \$barx_vma" ".* = 1"  "barx's LMA  != VMA"
     gdb_test "print \$bazx_lma  != \$bazx_vma" ".* = 1"  "bazx's LMA  != VMA"
@@ -203,7 +203,7 @@ simultaneous_pair .ovly0 .ovly3
 simultaneous_pair .ovly1 .ovly2
 simultaneous_pair .ovly1 .ovly3
 
-if $data_overlays then {
+if {$data_overlays} {
     simultaneous_pair .data00 .data02
     simultaneous_pair .data00 .data03
     simultaneous_pair .data01 .data02
diff --git a/gdb/testsuite/gdb.base/paginate-after-ctrl-c-running.exp b/gdb/testsuite/gdb.base/paginate-after-ctrl-c-running.exp
index df466f2193f..6ab88a18f87 100644
--- a/gdb/testsuite/gdb.base/paginate-after-ctrl-c-running.exp
+++ b/gdb/testsuite/gdb.base/paginate-after-ctrl-c-running.exp
@@ -36,7 +36,7 @@ proc test_ctrlc_while_target_running_does_not_paginate {} {
     with_test_prefix "ctrlc target running" {
 	clean_restart $binfile
 
-	if ![runto_main] then {
+	if {![runto_main]} {
 	    return 0
 	}
 
diff --git a/gdb/testsuite/gdb.base/paginate-bg-execution.exp b/gdb/testsuite/gdb.base/paginate-bg-execution.exp
index 34d5ceb1703..3074eea74c8 100644
--- a/gdb/testsuite/gdb.base/paginate-bg-execution.exp
+++ b/gdb/testsuite/gdb.base/paginate-bg-execution.exp
@@ -32,7 +32,7 @@ proc test_bg_execution_pagination_return {} {
     with_test_prefix "paginate" {
 	clean_restart $binfile
 
-	if ![runto_main] then {
+	if {![runto_main]} {
 	    return 0
 	}
 
diff --git a/gdb/testsuite/gdb.base/paginate-inferior-exit.exp b/gdb/testsuite/gdb.base/paginate-inferior-exit.exp
index 63cb98a82c3..eb38daf8f8c 100644
--- a/gdb/testsuite/gdb.base/paginate-inferior-exit.exp
+++ b/gdb/testsuite/gdb.base/paginate-inferior-exit.exp
@@ -31,7 +31,7 @@ proc test_paginate_inferior_exited {} {
     with_test_prefix "paginate" {
 	clean_restart $binfile
 
-	if ![runto_main] then {
+	if {![runto_main]} {
 	    return 0
 	}
 
diff --git a/gdb/testsuite/gdb.base/pc-fp.exp b/gdb/testsuite/gdb.base/pc-fp.exp
index b0e7ec9b335..191c842af24 100644
--- a/gdb/testsuite/gdb.base/pc-fp.exp
+++ b/gdb/testsuite/gdb.base/pc-fp.exp
@@ -30,7 +30,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug nowarning
     return -1
 }
 
-if ![runto_main] then {
+if {![runto_main]} {
     perror "couldn't run to breakpoint"
     return
 }
diff --git a/gdb/testsuite/gdb.base/permissions.exp b/gdb/testsuite/gdb.base/permissions.exp
index f13e985e77e..af6c7f47ac8 100644
--- a/gdb/testsuite/gdb.base/permissions.exp
+++ b/gdb/testsuite/gdb.base/permissions.exp
@@ -81,7 +81,7 @@ gdb_test_no_output "set non-stop off"
 
 gdb_load ${binfile}
 
-if ![runto_main] then {
+if {![runto_main]} {
     perror "couldn't run to breakpoint"
     return
 }
diff --git a/gdb/testsuite/gdb.base/pie-execl.exp b/gdb/testsuite/gdb.base/pie-execl.exp
index f5dce989e28..85affd3e2c2 100644
--- a/gdb/testsuite/gdb.base/pie-execl.exp
+++ b/gdb/testsuite/gdb.base/pie-execl.exp
@@ -25,8 +25,8 @@ if ![istarget *-linux*] {
 
 # In remote mode we cannot use the 'set args' command, and this
 # test requires it.
-if { [target_info exists gdb_protocol] } then {
-    if { [target_info gdb_protocol] == "remote" } then {
+if {[target_info exists gdb_protocol]} {
+    if {[target_info gdb_protocol] == "remote"} {
 	return
     }
 }
diff --git a/gdb/testsuite/gdb.base/pointers.exp b/gdb/testsuite/gdb.base/pointers.exp
index 41981ee6623..5fb7cf67023 100644
--- a/gdb/testsuite/gdb.base/pointers.exp
+++ b/gdb/testsuite/gdb.base/pointers.exp
@@ -39,7 +39,7 @@ clean_restart ${binfile}
 # set it up at a breakpoint so we can play with the variable values
 #
 
-if ![runto_main] then {
+if {![runto_main]} {
     perror "couldn't run to breakpoint"
     return
 }
diff --git a/gdb/testsuite/gdb.base/pr11022.exp b/gdb/testsuite/gdb.base/pr11022.exp
index 3e16255b4c9..56d26ccd132 100644
--- a/gdb/testsuite/gdb.base/pr11022.exp
+++ b/gdb/testsuite/gdb.base/pr11022.exp
@@ -28,7 +28,7 @@ if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb
 
 clean_restart ${binfile}
 
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 
diff --git a/gdb/testsuite/gdb.base/premature-dummy-frame-removal.exp b/gdb/testsuite/gdb.base/premature-dummy-frame-removal.exp
index c22dea400c0..973e46e366d 100644
--- a/gdb/testsuite/gdb.base/premature-dummy-frame-removal.exp
+++ b/gdb/testsuite/gdb.base/premature-dummy-frame-removal.exp
@@ -40,7 +40,7 @@ if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } {
     return -1
 }
 
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 
diff --git a/gdb/testsuite/gdb.base/printcmds.exp b/gdb/testsuite/gdb.base/printcmds.exp
index 60b9de47e52..13479ab3ca8 100644
--- a/gdb/testsuite/gdb.base/printcmds.exp
+++ b/gdb/testsuite/gdb.base/printcmds.exp
@@ -1105,7 +1105,7 @@ gdb_test "p ctable1\[120\]" "120 'x'" "p ctable1\[120\] #1"
 
 gdb_load ${binfile}
 
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 
diff --git a/gdb/testsuite/gdb.base/prologue.exp b/gdb/testsuite/gdb.base/prologue.exp
index 8a3545299c9..9d5d40a8a42 100644
--- a/gdb/testsuite/gdb.base/prologue.exp
+++ b/gdb/testsuite/gdb.base/prologue.exp
@@ -25,7 +25,7 @@ if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb
 
 clean_restart ${binfile}
 
-if ![runto_main] then {
+if {![runto_main]} {
     perror "couldn't run to breakpoint"
     return
 }
diff --git a/gdb/testsuite/gdb.base/ptype.exp b/gdb/testsuite/gdb.base/ptype.exp
index 0fee624d1db..be190e2ae71 100644
--- a/gdb/testsuite/gdb.base/ptype.exp
+++ b/gdb/testsuite/gdb.base/ptype.exp
@@ -56,16 +56,16 @@ gdb_test "ptype struct t_struct" "type = struct t_struct \{.*\[\r\n\]    (unsign
 
 # Test the equivalence between '.' and '->' for struct member references.
 
-if [gdb_test "ptype v_struct1.v_float_member"	"type = float"]<0 then {
+if {[gdb_test "ptype v_struct1.v_float_member" "type = float"] < 0} {
     return -1
 }
-if [gdb_test "ptype v_struct1->v_float_member"	"type = float"]<0 then {
+if {[gdb_test "ptype v_struct1->v_float_member" "type = float"] < 0} {
     return -1
 }
-if [gdb_test "ptype v_t_struct_p.v_float_member"	"type = float"]<0 then {
+if {[gdb_test "ptype v_t_struct_p.v_float_member" "type = float"] < 0} {
     return -1
 }
-if [gdb_test "ptype v_t_struct_p->v_float_member"	"type = float"]<0 then {
+if {[gdb_test "ptype v_t_struct_p->v_float_member" "type = float"] < 0} {
     return -1
 }
 
@@ -346,7 +346,7 @@ gdb_test "ptype v_int" "type = int.*" "ptype int"
 #}
 #
 
-if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" "i*86-*-sysv4*" }
+if {!$gcc_compiled} { setup_xfail "rs6000-*-*" "i*86-*-sysv4*" }
 gdb_test "ptype t_char_array" "type = (|unsigned )char \\\[0?\\\]"
 
 gdb_test "ptype pv_char_array" "type = (|unsigned )char \\(\\*\\)\\\[0?\\\]"
@@ -584,7 +584,7 @@ gdb_test "ptype foo" "type = char" "ptype foo typedef after second list of charf
 # requires a running process.  These call malloc, and can take a long
 # time to execute over a slow serial link, so increase the timeout.
 
-if [runto_main] then {
+if {[runto_main]} {
 
   if [target_info exists gdb,cannot_call_functions] {
     unsupported "this target can not call functions"
diff --git a/gdb/testsuite/gdb.base/quit-live.exp b/gdb/testsuite/gdb.base/quit-live.exp
index 00e4af14a9a..78fd7b5fbc2 100644
--- a/gdb/testsuite/gdb.base/quit-live.exp
+++ b/gdb/testsuite/gdb.base/quit-live.exp
@@ -101,7 +101,7 @@ proc quit_with_live_inferior {appear_how extra_inferior quit_how} {
     }
 
     if {$appear_how == "run"} {
-	if ![runto_main] then {
+	if {![runto_main]} {
 	    return
 	}
     } elseif {$appear_how == "attach" || $appear_how == "attach-nofile"} {
diff --git a/gdb/testsuite/gdb.base/radix.exp b/gdb/testsuite/gdb.base/radix.exp
index 50191de9a55..1c4cf3074ef 100644
--- a/gdb/testsuite/gdb.base/radix.exp
+++ b/gdb/testsuite/gdb.base/radix.exp
@@ -37,7 +37,7 @@ proc test_input_radix { iradix iradixhex iradixoctal } {
 	"initialize radix, input radix $iradix"
     gdb_test "set input-radix $iradix" \
 	"Input radix now set to decimal $iradix, hex $iradixhex, octal $iradixoctal."
-    if { $iradix == 10 } then {
+    if {$iradix == 10} {
 	gdb_test "show radix" \
 	    "Input and output radices set to decimal 10, hex a, octal 12." \
 	    "show radix, input radix $iradix"
@@ -110,7 +110,7 @@ proc test_output_radix { oradix oradixhex oradixoctal } {
 	"initialize radix, output radix $oradix"
     gdb_test "set output-radix $oradix" \
 	"Output radix now set to decimal $oradix, hex $oradixhex, octal $oradixoctal."
-    if { $oradix == 10 } then {
+    if {$oradix == 10} {
 	gdb_test "show radix" \
 	    "Input and output radices set to decimal 10, hex a, octal 12." \
 	    "show radix, output radix $oradix"
diff --git a/gdb/testsuite/gdb.base/readnever.exp b/gdb/testsuite/gdb.base/readnever.exp
index 3dfecdd021f..f475633df3c 100644
--- a/gdb/testsuite/gdb.base/readnever.exp
+++ b/gdb/testsuite/gdb.base/readnever.exp
@@ -34,7 +34,7 @@ save_vars { GDBFLAGS } {
     }
 }
 
-if ![runto_main] then {
+if {![runto_main]} {
     perror "couldn't run to breakpoint"
     return
 }
diff --git a/gdb/testsuite/gdb.base/recurse.exp b/gdb/testsuite/gdb.base/recurse.exp
index 681cdb52a84..3505f440b06 100644
--- a/gdb/testsuite/gdb.base/recurse.exp
+++ b/gdb/testsuite/gdb.base/recurse.exp
@@ -38,7 +38,7 @@ proc recurse_tests {} {
 	 gdb_test_no_output "set can-use-hw-watchpoints 0" ""
     }
 
-    if [runto recurse] then {
+    if {[runto recurse]} {
 	# First we need to step over the assignment of b, so it has a known
 	# value.
 	gdb_test "next" "if \\(a == 1\\)" "next over b = 0 in first instance"
diff --git a/gdb/testsuite/gdb.base/reggroups.exp b/gdb/testsuite/gdb.base/reggroups.exp
index f3fc7d7fe0e..db48705000b 100644
--- a/gdb/testsuite/gdb.base/reggroups.exp
+++ b/gdb/testsuite/gdb.base/reggroups.exp
@@ -23,7 +23,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
     return -1
 }
 
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 
diff --git a/gdb/testsuite/gdb.base/relational.exp b/gdb/testsuite/gdb.base/relational.exp
index 80185052f20..98f43791d5c 100644
--- a/gdb/testsuite/gdb.base/relational.exp
+++ b/gdb/testsuite/gdb.base/relational.exp
@@ -33,7 +33,7 @@ if { [prepare_for_testing "failed to prepare" relational int-type.c {debug nowar
 # set it up at a breakpoint so we can play with the variable values
 #
 
-if ![runto_main] then {
+if {![runto_main]} {
     perror "couldn't run to breakpoint"
     return
 }
diff --git a/gdb/testsuite/gdb.base/remote.exp b/gdb/testsuite/gdb.base/remote.exp
index 579dcd40e5c..4c2bc251d47 100644
--- a/gdb/testsuite/gdb.base/remote.exp
+++ b/gdb/testsuite/gdb.base/remote.exp
@@ -22,7 +22,7 @@ if {[target_info gdb_protocol] != "remote"
 standard_testfile .c
 
 set result [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}]
-if {$result != "" } then {
+if {$result != ""} {
     untested "failed to compile"
     return -1
 }
@@ -87,7 +87,7 @@ proc gdb_load_timed {executable class writesize} {
     global test gdb_prompt
     set test "timed download `[file tail $executable]' - $class, $writesize"
 
-    if {$writesize != ""} then {
+    if {$writesize != ""} {
 	gdb_test_no_output "set remote memory-write-packet-size $writesize" \
 	    "$test - set packet size"
 
@@ -121,7 +121,7 @@ proc gdb_load_timed {executable class writesize} {
     set load_begin_time [clock clicks]
     set result [gdb_load $executable]
     set load_end_time [clock clicks]
-    if { $result != 0 } then {
+    if {$result != 0} {
 	fail "$test - loading executable"
 	return
     }
@@ -158,7 +158,7 @@ set sizeof_random_data [get_sizeof "random_data" 48*1024]
 #
 # Part THREE: Check the upload behavour
 #
-if ![runto_main] then {
+if {![runto_main]} {
     return
 }
 
@@ -171,7 +171,7 @@ gdb_test "x/8ub random_data" \
 gdb_test "x/8ub random_data + 400 - 4" \
 	"<random_data\\+396>:\[ \t\]+185\[ \t\]+255\[ \t\]+50\[ \t\]+140\[ \t\]+237\[ \t\]+172\[ \t\]+143\[ \t\]+93"
 
-if {$sizeof_random_data > 16380 } then {
+if {$sizeof_random_data > 16380} {
     gdb_test "x/8ub random_data + 16384 - 4" \
 	"<random_data\\+16380>:\[ \t\]+178\[ \t\]+180\[ \t\]+135\[ \t\]+93\[ \t\]+70\[ \t\]+62\[ \t\]+205\[ \t\]+76"
 }
diff --git a/gdb/testsuite/gdb.base/return.exp b/gdb/testsuite/gdb.base/return.exp
index e3e47026fd1..82a18fa8239 100644
--- a/gdb/testsuite/gdb.base/return.exp
+++ b/gdb/testsuite/gdb.base/return.exp
@@ -25,7 +25,7 @@ proc return_tests { } {
     global gdb_prompt skip_float_test
 
 
-    if { ! [ runto func1 ] } then { return 0 }
+    if {![runto func1]} { return 0 }
 
     gdb_test_multiple "return" "simple return" {
 	-re "Make .* return now.*y or n. $" {
diff --git a/gdb/testsuite/gdb.base/return2.exp b/gdb/testsuite/gdb.base/return2.exp
index b5eb2da4406..50c67e51a5c 100644
--- a/gdb/testsuite/gdb.base/return2.exp
+++ b/gdb/testsuite/gdb.base/return2.exp
@@ -81,7 +81,7 @@ proc return_void { } {
 proc return2_tests { } {
     global gdb_prompt skip_float_test
 
-    if { ! [ runto_main ] } then {
+    if {![runto_main]} {
 	return -1
     }
 
@@ -90,12 +90,12 @@ proc return2_tests { } {
     return_1 "short"
     return_1 "int"
     return_1 "long"
-    if { ! [istarget "m6811-*-*"] && ![istarget "h8300*-*"] } then {
+    if {![istarget "m6811-*-*"] && ![istarget "h8300*-*"]} {
         return_1 "long_long"
     }
     if {!$skip_float_test} {
 	return_1 "float"
-	if { ! [istarget "m6811-*-*"] } then {
+	if {![istarget "m6811-*-*"]} {
 	    return_1 "double"
 	}
     }
diff --git a/gdb/testsuite/gdb.base/savedregs.exp b/gdb/testsuite/gdb.base/savedregs.exp
index 8cd71384261..b092cb9a49d 100644
--- a/gdb/testsuite/gdb.base/savedregs.exp
+++ b/gdb/testsuite/gdb.base/savedregs.exp
@@ -41,7 +41,7 @@ if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb
 clean_restart ${binfile}
 
 # Advance to main
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 
diff --git a/gdb/testsuite/gdb.base/scope.exp b/gdb/testsuite/gdb.base/scope.exp
index 18544962893..e807a1cdd96 100644
--- a/gdb/testsuite/gdb.base/scope.exp
+++ b/gdb/testsuite/gdb.base/scope.exp
@@ -52,40 +52,40 @@ proc_with_prefix test_at_main {} {
     # Print scope0.c::filelocal_ro, which is 201
 
     # No clue why the rs6000 fails this test.
-    if { [test_compiler_info gcc-*-*] } then { setup_xfail "rs6000-*-*" }
+    if {[test_compiler_info gcc-*-*]} { setup_xfail "rs6000-*-*" }
     gdb_test "print filelocal_ro" "\\\$$decimal = 201" "print filelocal_ro in test_at_main"
 
-    if { [test_compiler_info gcc-*-*] } then { setup_xfail "rs6000-*-*" }
+    if {[test_compiler_info gcc-*-*]} { setup_xfail "rs6000-*-*" }
     gdb_test "print 'scope0.c'::filelocal_ro" "\\\$$decimal = 201" "print 'scope0.c'::filelocal_ro"
 
     # Print scope1.c::filelocal, which is 2
-    if { [test_compiler_info gcc-*-*] } then { setup_xfail "rs6000-*-*" }
+    if {[test_compiler_info gcc-*-*]} { setup_xfail "rs6000-*-*" }
     gdb_test "print 'scope1.c'::filelocal" "\\\$$decimal = 2" "print 'scope1.c'::filelocal"
 
     # Print scope1.c::filelocal_bss, which is 102
-    if { [test_compiler_info gcc-*-*] } then { setup_xfail "rs6000-*-*" }
+    if {[test_compiler_info gcc-*-*]} { setup_xfail "rs6000-*-*" }
     gdb_test "print 'scope1.c'::filelocal_bss" "\\\$$decimal = 102" "print 'scope1.c'::filelocal_bss"
 
     # Print scope1.c::filelocal_ro, which is 202
-    if { [test_compiler_info gcc-*-*] } then { setup_xfail "rs6000-*-*" }
+    if {[test_compiler_info gcc-*-*]} { setup_xfail "rs6000-*-*" }
     gdb_test "print 'scope1.c'::filelocal_ro" "\\\$$decimal = 202" "print 'scope1.c'::filelocal_ro"
 
     # Print scope1.c::foo::funclocal, which is 3
     gdb_test "print foo::funclocal" "\\\$$decimal = 3"
 
-    if { [test_compiler_info gcc-*-*] } then { setup_xfail "rs6000-*-*" }
+    if {[test_compiler_info gcc-*-*]} { setup_xfail "rs6000-*-*" }
     gdb_test "print 'scope1.c'::foo::funclocal" "\\\$$decimal = 3" "print 'scope1.c'::foo::funclocal"
 
     # Print scope1.c::foo::funclocal_ro, which is 203
     gdb_test "print foo::funclocal_ro" "\\\$$decimal = 203"
 
-    if { [test_compiler_info gcc-*-*] } then { setup_xfail "rs6000-*-*" }
+    if {[test_compiler_info gcc-*-*]} { setup_xfail "rs6000-*-*" }
     gdb_test "print 'scope1.c'::foo::funclocal_ro" "\\\$$decimal = 203" "print 'scope1.c'::foo::funclocal_ro"
 
     # Print scope1.c::bar::funclocal, which is 4
     gdb_test "print bar::funclocal" "\\\$$decimal = 4"
 
-    if { [test_compiler_info gcc-*-*] } then { setup_xfail "rs6000-*-*" }
+    if {[test_compiler_info gcc-*-*]} { setup_xfail "rs6000-*-*" }
     gdb_test "print 'scope1.c'::bar::funclocal" "\\\$$decimal = 4" "print 'scope1.c'::bar::funclocal"
 }
 
@@ -105,27 +105,27 @@ proc_with_prefix test_at_foo {} {
     gdb_test "print 'scope0.c'::filelocal_bss" "\\\$$decimal = 101" "print 'scope0.c'::filelocal_bss in test_at_foo"
 
     # Print scope0.c::filelocal_ro, which is 201
-    if { [test_compiler_info gcc-*-*] } then { setup_xfail "rs6000-*-*" }
+    if {[test_compiler_info gcc-*-*]} { setup_xfail "rs6000-*-*" }
     gdb_test "print 'scope0.c'::filelocal_ro" "\\\$$decimal = 201" "print 'scope0.c'::filelocal_ro"
 
 
     # Print scope1.c::filelocal, which is 2
     gdb_test "print filelocal" "\\\$$decimal = 2" "print filelocal at foo"
 
-    if { [test_compiler_info gcc-*-*] } then { setup_xfail "rs6000-*-*" }
+    if {[test_compiler_info gcc-*-*]} { setup_xfail "rs6000-*-*" }
     gdb_test "print 'scope1.c'::filelocal" "\\\$$decimal = 2" "print 'scope1.c'::filelocal at foo"
 
     gdb_test "print filelocal_bss" "\\\$$decimal = 102" \
 	"print filelocal_bss at foo"
 
-    if { [test_compiler_info gcc-*-*] } then { setup_xfail "rs6000-*-*" }
+    if {[test_compiler_info gcc-*-*]} { setup_xfail "rs6000-*-*" }
     gdb_test "print 'scope1.c'::filelocal_bss" "\\\$$decimal = 102" "print 'scope1.c'::filelocal_bss at foo"
 
 
     gdb_test "print filelocal_ro" "\\\$$decimal = 202" \
 	"print filelocal_ro at foo"
 
-    if { [test_compiler_info gcc-*-*] } then { setup_xfail "rs6000-*-*" }
+    if {[test_compiler_info gcc-*-*]} { setup_xfail "rs6000-*-*" }
     gdb_test "print 'scope1.c'::filelocal_ro" "\\\$$decimal = 202" "print 'scope1.c'::filelocal_ro at foo"
 
 
@@ -136,7 +136,7 @@ proc_with_prefix test_at_foo {} {
     gdb_test "print foo::funclocal" "\\\$$decimal = 3" \
 	"print foo::funclocal at foo"
 
-    if { [test_compiler_info gcc-*-*] } then { setup_xfail "rs6000-*-*" }
+    if {[test_compiler_info gcc-*-*]} { setup_xfail "rs6000-*-*" }
     gdb_test "print 'scope1.c'::foo::funclocal" "\\\$$decimal = 3" "print 'scope1.c'::foo::funclocal at foo"
 
 
@@ -148,7 +148,7 @@ proc_with_prefix test_at_foo {} {
     gdb_test "print foo::funclocal_bss" "\\\$$decimal = 103" \
 	"print foo::funclocal_bss at foo"
 
-    if { [test_compiler_info gcc-*-*] } then { setup_xfail "rs6000-*-*" }
+    if {[test_compiler_info gcc-*-*]} { setup_xfail "rs6000-*-*" }
     gdb_test "print 'scope1.c'::foo::funclocal_bss" "\\\$$decimal = 103" "print 'scope1.c'::foo::funclocal_bss at foo"
 
 
@@ -160,7 +160,7 @@ proc_with_prefix test_at_foo {} {
     gdb_test "print foo::funclocal_ro" "\\\$$decimal = 203" \
 	"print foo::funclocal_ro at foo"
 
-    if { [test_compiler_info gcc-*-*] } then { setup_xfail "rs6000-*-*" }
+    if {[test_compiler_info gcc-*-*]} { setup_xfail "rs6000-*-*" }
     gdb_test "print 'scope1.c'::foo::funclocal_ro" "\\\$$decimal = 203" "print 'scope1.c'::foo::funclocal_ro at foo"
 
 
@@ -169,7 +169,7 @@ proc_with_prefix test_at_foo {} {
     gdb_test "print bar::funclocal" "\\\$$decimal = 4" \
 	"print bar::funclocal at foo"
 
-    if { [test_compiler_info gcc-*-*] } then { setup_xfail "rs6000-*-*" }
+    if {[test_compiler_info gcc-*-*]} { setup_xfail "rs6000-*-*" }
     gdb_test "print 'scope1.c'::bar::funclocal" "\\\$$decimal = 4" "print 'scope1.c'::bar::funclocal at foo"
 
 }
@@ -190,57 +190,57 @@ proc_with_prefix test_at_bar {} {
     gdb_test "print 'scope0.c'::filelocal_bss" "\\\$$decimal = 101" "print 'scope0.c'::filelocal_bss in test_at_bar"
 
     # Print scope0.c::filelocal_ro, which is 201
-    if { [test_compiler_info gcc-*-*] } then { setup_xfail "rs6000-*-*" }
+    if {[test_compiler_info gcc-*-*]} { setup_xfail "rs6000-*-*" }
     gdb_test "print 'scope0.c'::filelocal_ro" "\\\$$decimal = 201" "print 'scope0.c'::filelocal_ro at bar"
 
     # Print scope1.c::filelocal, which is 2
     gdb_test "print filelocal" "\\\$$decimal = 2" "print filelocal at bar"
 
-    if { [test_compiler_info gcc-*-*] } then { setup_xfail "rs6000-*-*" }
+    if {[test_compiler_info gcc-*-*]} { setup_xfail "rs6000-*-*" }
     gdb_test "print 'scope1.c'::filelocal" "\\\$$decimal = 2" "print 'scope1.c'::filelocal at bar"
 
     # Print scope1.c::filelocal_bss, which is 102
     gdb_test "print filelocal_bss" "\\\$$decimal = 102" "print filelocal_bss at bar"
 
-    if { [test_compiler_info gcc-*-*] } then { setup_xfail "rs6000-*-*" }
+    if {[test_compiler_info gcc-*-*]} { setup_xfail "rs6000-*-*" }
     gdb_test "print 'scope1.c'::filelocal_bss" "\\\$$decimal = 102" "print 'scope1.c'::filelocal_bss at bar"
 
     # Print scope1.c::filelocal_ro, which is 202
     gdb_test "print filelocal_ro" "\\\$$decimal = 202" "print filelocal_ro in test_at_bar"
 
-    if { [test_compiler_info gcc-*-*] } then { setup_xfail "rs6000-*-*" }
+    if {[test_compiler_info gcc-*-*]} { setup_xfail "rs6000-*-*" }
     gdb_test "print 'scope1.c'::filelocal_ro" "\\\$$decimal = 202" "print 'scope1.c'::filelocal_ro at bar"
 
     # Print scope1.c::foo::funclocal, which is 3
     gdb_test "print foo::funclocal" "\\\$$decimal = 3" "print foo::funclocal at bar"
 
-    if { [test_compiler_info gcc-*-*] } then { setup_xfail "rs6000-*-*" }
+    if {[test_compiler_info gcc-*-*]} { setup_xfail "rs6000-*-*" }
     gdb_test "print 'scope1.c'::foo::funclocal" "\\\$$decimal = 3" "print 'scope1.c'::foo::funclocal at bar"
 
     # Print scope1.c::foo::funclocal_bss, which is 103
     gdb_test "print foo::funclocal_bss" "\\\$$decimal = 103" "print foo::funclocal_bss at bar"
 
-    if { [test_compiler_info gcc-*-*] } then { setup_xfail "rs6000-*-*" }
+    if {[test_compiler_info gcc-*-*]} { setup_xfail "rs6000-*-*" }
     gdb_test "print 'scope1.c'::foo::funclocal_bss" "\\\$$decimal = 103" "print 'scope1.c'::foo::funclocal_bss at bar"
 
     # Print scope1.c::foo::funclocal_ro, which is 203
     gdb_test "print foo::funclocal_ro" "\\\$$decimal = 203" "print foo::funclocal_ro at bar"
 
-    if { [test_compiler_info gcc-*-*] } then { setup_xfail "rs6000-*-*" }
+    if {[test_compiler_info gcc-*-*]} { setup_xfail "rs6000-*-*" }
     gdb_test "print 'scope1.c'::foo::funclocal_ro" "\\\$$decimal = 203" "print 'scope1.c'::foo::funclocal_ro at bar"
 
     # Print scope1.c::bar::funclocal, which is 4
     gdb_test "print funclocal" "\\\$$decimal = 4" "print funclocal at bar"
     gdb_test "print bar::funclocal" "\\\$$decimal = 4" "print bar::funclocal at bar"
 
-    if { [test_compiler_info gcc-*-*] } then { setup_xfail "rs6000-*-*" }
+    if {[test_compiler_info gcc-*-*]} { setup_xfail "rs6000-*-*" }
     gdb_test "print 'scope1.c'::bar::funclocal" "\\\$$decimal = 4" "print 'scope1.c'::bar::funclocal at bar"
 
     # Print scope1.c::bar::funclocal_bss, which is 104
     gdb_test "print funclocal_bss" "\\\$$decimal = 104" "print funclocal_bss at bar"
     gdb_test "print bar::funclocal_bss" "\\\$$decimal = 104" "print bar::funclocal_bss at bar"
 
-    if { [test_compiler_info gcc-*-*] } then { setup_xfail "rs6000-*-*" }
+    if {[test_compiler_info gcc-*-*]} { setup_xfail "rs6000-*-*" }
     gdb_test "print 'scope1.c'::bar::funclocal_bss" "\\\$$decimal = 104" "print 'scope1.c'::bar::funclocal_bss at bar"
 }
 
@@ -347,8 +347,8 @@ gdb_test "print 'scope0.c'::filelocal_bss" "= 0" \
 gdb_test "print 'scope0.c'::filelocal" "= 1" \
     "print 'scope0.c'::filelocal before run"
 
-if [runto_main] then { test_at_main }
-if [runto foo] then { test_at_foo }
-if [runto bar] then { test_at_bar }
-if [runto localscopes] then { test_at_localscopes }
-if [runto autovars] then { test_at_autovars }
+if {[runto_main]} { test_at_main }
+if {[runto foo]} { test_at_foo }
+if {[runto bar]} { test_at_bar }
+if {[runto localscopes]} { test_at_localscopes }
+if {[runto autovars]} { test_at_autovars }
diff --git a/gdb/testsuite/gdb.base/sect-cmd.exp b/gdb/testsuite/gdb.base/sect-cmd.exp
index 8e778eec716..c0e2cd00373 100644
--- a/gdb/testsuite/gdb.base/sect-cmd.exp
+++ b/gdb/testsuite/gdb.base/sect-cmd.exp
@@ -22,7 +22,7 @@ if { [prepare_for_testing "failed to prepare" "sect-cmd" \
 set srcfile break.c
 set srcfile1 break1.c
 
-if ![runto_main] then {
+if {![runto_main]} {
     return
 }
 
diff --git a/gdb/testsuite/gdb.base/sepdebug.exp b/gdb/testsuite/gdb.base/sepdebug.exp
index 20a7f346994..75811ff93bd 100644
--- a/gdb/testsuite/gdb.base/sepdebug.exp
+++ b/gdb/testsuite/gdb.base/sepdebug.exp
@@ -62,7 +62,7 @@ remote_exec build "rm -rf [file dirname $new_name]"
 remote_exec build "mkdir [file dirname $new_name]"
 remote_exec build "ln -s ${binfile}${EXEEXT} $new_name"
 clean_restart ${testfile}${EXEEXT}
-if { $gdb_file_cmd_debug_info != "debug" } then {
+if {$gdb_file_cmd_debug_info != "debug"} {
     fail "no debug information found."
 }
 
@@ -70,7 +70,7 @@ if { $gdb_file_cmd_debug_info != "debug" } then {
 set subdir ${old_subdir}
 
 clean_restart ${testfile}${EXEEXT}
-if { $gdb_file_cmd_debug_info != "debug" } then {
+if {$gdb_file_cmd_debug_info != "debug"} {
     fail "no debug information found."
 }
 
@@ -278,7 +278,7 @@ gdb_test "info break" "Num     Type.*Disp Enb Address.*What.*\[\r\n\]
 # inappropriately.  (There are no calls to those system functions
 # in this test program.)
 #
-if ![runto_main] then { 
+if {![runto_main]} {
     return
 }
 
@@ -329,7 +329,7 @@ gdb_test "break" \
 # Verify that a "silent" breakpoint can be set, and that GDB is indeed
 # "silent" about its triggering.
 #
-if ![runto_main] then {
+if {![runto_main]} {
     return
 }
 
@@ -451,7 +451,7 @@ gdb_test_multiple "finish" "finish from called function" {
 # Verify that GDB responds gracefully to a "finish" command with
 # arguments.
 #
-if ![runto_main] then {
+if {![runto_main]} {
     return
 }
 
@@ -669,7 +669,7 @@ if {[build_executable sepdebug.exp sepdebug2 sepdebug2.c debug] != -1
 # NT_GNU_BUILD_ID / .note.gnu.build-id test:
 
 set build_id_debug_filename [build_id_debug_filename_get $binfile$EXEEXT]
-if ![string compare $build_id_debug_filename ""] then {
+if {![string compare $build_id_debug_filename ""]} {
     unsupported "build-id is not supported by the compiler"
 
     # Spare debug files may confuse testsuite runs in the future.
@@ -678,10 +678,10 @@ if ![string compare $build_id_debug_filename ""] then {
     set build_id_debugself_filename [build_id_debug_filename_get $debugfile]
     set test "build-id support by binutils"
     set xfail 0
-    if ![string compare $build_id_debugself_filename ""] then {
+    if {![string compare $build_id_debugself_filename ""]} {
 	unsupported $test
 	set xfail 1
-    } elseif {[string compare $build_id_debugself_filename $build_id_debug_filename] != 0} then {
+    } elseif {[string compare $build_id_debugself_filename $build_id_debug_filename] != 0} {
 	fail $test
     } else {
 	pass $test
diff --git a/gdb/testsuite/gdb.base/set-noassign.exp b/gdb/testsuite/gdb.base/set-noassign.exp
index c3f2a0cce89..f91ca5d417b 100644
--- a/gdb/testsuite/gdb.base/set-noassign.exp
+++ b/gdb/testsuite/gdb.base/set-noassign.exp
@@ -18,7 +18,7 @@ if { [prepare_for_testing "failed to prepare" "set-noassign" start.c {debug nowa
     return -1
 }
 
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 
diff --git a/gdb/testsuite/gdb.base/setshow.exp b/gdb/testsuite/gdb.base/setshow.exp
index c90d13292df..26fad28d89a 100644
--- a/gdb/testsuite/gdb.base/setshow.exp
+++ b/gdb/testsuite/gdb.base/setshow.exp
@@ -31,7 +31,7 @@ proc_with_prefix test_setshow_annotate {} {
     # Start with a fresh gdb
     clean_restart $::binfile
 
-    if ![runto_main] then {
+    if {![runto_main]} {
 	return
     }
 
@@ -80,7 +80,7 @@ proc_with_prefix test_setshow_annotate {} {
 proc_with_prefix test_setshow_args {} {
     clean_restart $::binfile
 
-    if ![runto_main] then {
+    if {![runto_main]} {
 	return
     }
 
diff --git a/gdb/testsuite/gdb.base/setvar.exp b/gdb/testsuite/gdb.base/setvar.exp
index 3d6c5700a49..673df0a188b 100644
--- a/gdb/testsuite/gdb.base/setvar.exp
+++ b/gdb/testsuite/gdb.base/setvar.exp
@@ -35,7 +35,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
 #
 gdb_test_no_output "set print sevenbit-strings" 
 
-if ![runto_main] then {
+if {![runto_main]} {
     perror "couldn't run to breakpoint"
     return
 }
@@ -389,7 +389,7 @@ set timeout $prev_timeout
 # Test printing of enumeration bitfields.
 # GNU C supports them, some other compilers don't.
 
-if {[is_c_compiler_gcc]} then {
+if {[is_c_compiler_gcc]} {
     gdb_test "print sef.field=sm1" ".*.\[0-9\]* = sm1"
     gdb_test "print sef.field" ".*.\[0-9\]* = sm1" "print sef.field (sm1)"
     gdb_test "print sef.field=s1" ".*.\[0-9\]* = s1"
diff --git a/gdb/testsuite/gdb.base/shlib-call.exp b/gdb/testsuite/gdb.base/shlib-call.exp
index c6925709676..5db6b128536 100644
--- a/gdb/testsuite/gdb.base/shlib-call.exp
+++ b/gdb/testsuite/gdb.base/shlib-call.exp
@@ -61,7 +61,7 @@ gdb_load_shlib $lib1
 gdb_load_shlib $lib2
 
 
-if ![runto_main] then {
+if {![runto_main]} {
         perror "C function calling tests suppressed"
 }
 
diff --git a/gdb/testsuite/gdb.base/shreloc.exp b/gdb/testsuite/gdb.base/shreloc.exp
index 25032400ee6..ad10d5f3497 100644
--- a/gdb/testsuite/gdb.base/shreloc.exp
+++ b/gdb/testsuite/gdb.base/shreloc.exp
@@ -72,7 +72,7 @@ gdb_load_shlib $lib1_sl
 gdb_load_shlib $lib2_sl
 
 # Load up the shared objects
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 
diff --git a/gdb/testsuite/gdb.base/sigall.exp b/gdb/testsuite/gdb.base/sigall.exp
index f2c99c8a2a6..923499bffc5 100644
--- a/gdb/testsuite/gdb.base/sigall.exp
+++ b/gdb/testsuite/gdb.base/sigall.exp
@@ -37,7 +37,7 @@ proc test_one_sig {nextsig} {
 
     set need_another_continue 1
     set missed_handler 0
-    if $this_sig_supported then {
+    if {$this_sig_supported} {
 	set esig $thissig
 
 	if { $thissig == "IO" } {
@@ -45,7 +45,7 @@ proc test_one_sig {nextsig} {
 	}
 	# On Linux SPARC64 systems SIGLOST==SIGPWR and gdb identifies
 	# the raised signal as PWR.
-	if { $thissig == "LOST" && [ istarget "sparc64-*-linux*" ] } then {
+	if {$thissig == "LOST" && [istarget "sparc64-*-linux*"]} {
 	    set esig "PWR"
 	}
 
@@ -54,7 +54,7 @@ proc test_one_sig {nextsig} {
 		"get signal $esig"
     }
 
-    if $need_another_continue then {
+    if {$need_another_continue} {
 	if { $thissig == "URG" } {
 	    setup_xfail "i*86-pc-linuxoldld-gnu" "i*86-pc-linuxaout-gnu"
 	}
@@ -73,7 +73,7 @@ proc test_one_sig {nextsig} {
 	}
     }
 
-    if { $missed_handler == "0" } then {
+    if {$missed_handler == "0"} {
 	gdb_test_multiple "signal 0" "advance to $nextsig" {
 	    -re "Breakpoint.*gen_$nextsig.*\r\n\[0-9\]+\[ \t\]+kill \\(.*\r\n$gdb_prompt $" {
 	        pass "advance to $nextsig"
diff --git a/gdb/testsuite/gdb.base/sigaltstack.exp b/gdb/testsuite/gdb.base/sigaltstack.exp
index 6bddc0749a9..e0d351348d7 100644
--- a/gdb/testsuite/gdb.base/sigaltstack.exp
+++ b/gdb/testsuite/gdb.base/sigaltstack.exp
@@ -44,7 +44,7 @@ gdb_test "handle SIGVTALRM print pass nostop"
 gdb_test "handle SIGPROF print pass nostop"
 
 # Advance to main
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 
diff --git a/gdb/testsuite/gdb.base/sigbpt.exp b/gdb/testsuite/gdb.base/sigbpt.exp
index eb44533eacd..0fa63f166f6 100644
--- a/gdb/testsuite/gdb.base/sigbpt.exp
+++ b/gdb/testsuite/gdb.base/sigbpt.exp
@@ -44,7 +44,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
 # Run to `main' where we begin our tests.
 #
 
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 
diff --git a/gdb/testsuite/gdb.base/siginfo-addr.exp b/gdb/testsuite/gdb.base/siginfo-addr.exp
index 961bc54bcb1..8d6c6418cbf 100644
--- a/gdb/testsuite/gdb.base/siginfo-addr.exp
+++ b/gdb/testsuite/gdb.base/siginfo-addr.exp
@@ -34,7 +34,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
 gdb_test "display/i \$pc"
 
 # Advance to main
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 
diff --git a/gdb/testsuite/gdb.base/siginfo-obj.exp b/gdb/testsuite/gdb.base/siginfo-obj.exp
index 221f0e9a294..5efff68d721 100644
--- a/gdb/testsuite/gdb.base/siginfo-obj.exp
+++ b/gdb/testsuite/gdb.base/siginfo-obj.exp
@@ -39,7 +39,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
 }
 
 # Advance to main
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 
@@ -99,7 +99,7 @@ with_test_prefix "validate siginfo fields" {
 # the changed value.
 
 # Advance to main
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 
diff --git a/gdb/testsuite/gdb.base/siginfo-thread.exp b/gdb/testsuite/gdb.base/siginfo-thread.exp
index 8ced509cd5f..abd328a2a78 100644
--- a/gdb/testsuite/gdb.base/siginfo-thread.exp
+++ b/gdb/testsuite/gdb.base/siginfo-thread.exp
@@ -36,7 +36,7 @@ if  {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" \
 clean_restart $binfile
 
 # Advance to main
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 
diff --git a/gdb/testsuite/gdb.base/siginfo.exp b/gdb/testsuite/gdb.base/siginfo.exp
index 2a1ceb89bdc..075b9979e8b 100644
--- a/gdb/testsuite/gdb.base/siginfo.exp
+++ b/gdb/testsuite/gdb.base/siginfo.exp
@@ -38,7 +38,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
 gdb_test "display/i \$pc"
 
 # Advance to main
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 
diff --git a/gdb/testsuite/gdb.base/signals-state-child.exp b/gdb/testsuite/gdb.base/signals-state-child.exp
index e1d7f3a844c..53ec5e36e00 100644
--- a/gdb/testsuite/gdb.base/signals-state-child.exp
+++ b/gdb/testsuite/gdb.base/signals-state-child.exp
@@ -81,7 +81,7 @@ remote_close target
 
 clean_restart $binfile
 
-if { ! [ runto_main ] } then {
+if {![runto_main]} {
     return -1
 }
 
diff --git a/gdb/testsuite/gdb.base/signals.exp b/gdb/testsuite/gdb.base/signals.exp
index 2b3fc1c6662..997024842e5 100644
--- a/gdb/testsuite/gdb.base/signals.exp
+++ b/gdb/testsuite/gdb.base/signals.exp
@@ -63,7 +63,7 @@ test_handle_all_print
 
 clean_restart $binfile
 
-if [runto_main] then {
+if {[runto_main]} {
 
     # Since count is a static variable outside main, runto_main is no
     # guarantee that count will be 0 at this point.
diff --git a/gdb/testsuite/gdb.base/signest.exp b/gdb/testsuite/gdb.base/signest.exp
index ccbe7700d29..14302d2a567 100644
--- a/gdb/testsuite/gdb.base/signest.exp
+++ b/gdb/testsuite/gdb.base/signest.exp
@@ -26,7 +26,7 @@ if [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {debug}] {
     return -1
 }
 
-if ![runto_main] then {
+if {![runto_main]} {
     return -1
 }
 
diff --git a/gdb/testsuite/gdb.base/signull.exp b/gdb/testsuite/gdb.base/signull.exp
index e7ce39d3669..7a33b61868c 100644
--- a/gdb/testsuite/gdb.base/signull.exp
+++ b/gdb/testsuite/gdb.base/signull.exp
@@ -46,7 +46,7 @@ clean_restart ${binfile}
 # Run to `main' where we begin our tests.
 #
 
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 
diff --git a/gdb/testsuite/gdb.base/sigrepeat.exp b/gdb/testsuite/gdb.base/sigrepeat.exp
index ab1ce9beb26..0bcd46b5d79 100644
--- a/gdb/testsuite/gdb.base/sigrepeat.exp
+++ b/gdb/testsuite/gdb.base/sigrepeat.exp
@@ -36,7 +36,7 @@ if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb
 clean_restart ${binfile}
 
 # Advance to main
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 
diff --git a/gdb/testsuite/gdb.base/sizeof.exp b/gdb/testsuite/gdb.base/sizeof.exp
index 3237c212a0a..7cdbace56c5 100644
--- a/gdb/testsuite/gdb.base/sizeof.exp
+++ b/gdb/testsuite/gdb.base/sizeof.exp
@@ -29,7 +29,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
 # set it up at a breakpoint so we can play with the variable values
 #
 
-if ![runto_main] then {
+if {![runto_main]} {
     perror "couldn't run to breakpoint"
     return
 }
diff --git a/gdb/testsuite/gdb.base/so-impl-ld.exp b/gdb/testsuite/gdb.base/so-impl-ld.exp
index 3c5d1070a5b..1822c03138c 100644
--- a/gdb/testsuite/gdb.base/so-impl-ld.exp
+++ b/gdb/testsuite/gdb.base/so-impl-ld.exp
@@ -40,7 +40,7 @@ gdb_load_shlib $lib_sl
 
 # This program implicitly loads SOM shared libraries.
 #
-if ![runto_main] then {
+if {![runto_main]} {
     return
 }
 
diff --git a/gdb/testsuite/gdb.base/solib-disc.exp b/gdb/testsuite/gdb.base/solib-disc.exp
index 8f686ce6e89..2433425bf00 100644
--- a/gdb/testsuite/gdb.base/solib-disc.exp
+++ b/gdb/testsuite/gdb.base/solib-disc.exp
@@ -51,7 +51,7 @@ gdb_reinitialize_dir $srcdir/$subdir
 gdb_load ${binfile}
 gdb_load_shlib $libobj
 
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 
diff --git a/gdb/testsuite/gdb.base/solib-display.exp b/gdb/testsuite/gdb.base/solib-display.exp
index 4c4da6aee9d..6da4b8d4d4a 100644
--- a/gdb/testsuite/gdb.base/solib-display.exp
+++ b/gdb/testsuite/gdb.base/solib-display.exp
@@ -85,7 +85,7 @@ foreach libsepdebug {NO IN SEP} { with_test_prefix "$libsepdebug" {
 
     clean_restart $executable
 
-    if ![runto_main] then {
+    if {![runto_main]} {
       return 0
     }
 
diff --git a/gdb/testsuite/gdb.base/solib-symbol.exp b/gdb/testsuite/gdb.base/solib-symbol.exp
index 02b2028ce92..ff812a7e87b 100644
--- a/gdb/testsuite/gdb.base/solib-symbol.exp
+++ b/gdb/testsuite/gdb.base/solib-symbol.exp
@@ -49,7 +49,7 @@ gdb_test "br foo2" \
 
 delete_breakpoints
 
-if ![runto_main] then {
+if {![runto_main]} {
   return 0
 }
 
diff --git a/gdb/testsuite/gdb.base/source-dir.exp b/gdb/testsuite/gdb.base/source-dir.exp
index fff1c1f8717..e0aa7b4f64c 100644
--- a/gdb/testsuite/gdb.base/source-dir.exp
+++ b/gdb/testsuite/gdb.base/source-dir.exp
@@ -119,7 +119,7 @@ proc test_truncated_comp_dir {} {
     gdb_test "show directories" \
 	"\r\nSource directories searched: \\\$cdir\[:;\]\\\$cwd"
 
-    if ![runto_main] then {
+    if {![runto_main]} {
 	return 0
     }
 
diff --git a/gdb/testsuite/gdb.base/source-execution.exp b/gdb/testsuite/gdb.base/source-execution.exp
index 31aa4832b28..f9c889b4d2b 100644
--- a/gdb/testsuite/gdb.base/source-execution.exp
+++ b/gdb/testsuite/gdb.base/source-execution.exp
@@ -23,7 +23,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
     return -1
 }
 
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 
diff --git a/gdb/testsuite/gdb.base/sss-bp-on-user-bp.exp b/gdb/testsuite/gdb.base/sss-bp-on-user-bp.exp
index 2e479d6ebe2..600dc52bbf5 100644
--- a/gdb/testsuite/gdb.base/sss-bp-on-user-bp.exp
+++ b/gdb/testsuite/gdb.base/sss-bp-on-user-bp.exp
@@ -24,7 +24,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
     return -1
 }
 
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 
diff --git a/gdb/testsuite/gdb.base/stack-checking.exp b/gdb/testsuite/gdb.base/stack-checking.exp
index 9f85302f13c..ce6d2d0cca7 100644
--- a/gdb/testsuite/gdb.base/stack-checking.exp
+++ b/gdb/testsuite/gdb.base/stack-checking.exp
@@ -23,7 +23,7 @@ if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [con
 
 clean_restart ${binfile}
 
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 
diff --git a/gdb/testsuite/gdb.base/stack-protector.exp b/gdb/testsuite/gdb.base/stack-protector.exp
index e63b55729eb..782d12a03fe 100644
--- a/gdb/testsuite/gdb.base/stack-protector.exp
+++ b/gdb/testsuite/gdb.base/stack-protector.exp
@@ -44,7 +44,7 @@ proc simple_func_break_test { protection } {
 	return -1
     }
 
-    if { ![runto_main] } then {
+    if {![runto_main]} {
 	return -1
     }
 
diff --git a/gdb/testsuite/gdb.base/step-break.exp b/gdb/testsuite/gdb.base/step-break.exp
index 61675e598f2..a5c96f33b99 100644
--- a/gdb/testsuite/gdb.base/step-break.exp
+++ b/gdb/testsuite/gdb.base/step-break.exp
@@ -21,7 +21,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
      return -1
 }
 
-if ![runto_main] then {
+if {![runto_main]} {
    return 0
 }
 
diff --git a/gdb/testsuite/gdb.base/step-line.exp b/gdb/testsuite/gdb.base/step-line.exp
index 807475a29b6..cbd73cfb463 100644
--- a/gdb/testsuite/gdb.base/step-line.exp
+++ b/gdb/testsuite/gdb.base/step-line.exp
@@ -27,7 +27,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
     return -1
 }
 
-if ![runto_main] then {
+if {![runto_main]} {
    return 0
 }
 
diff --git a/gdb/testsuite/gdb.base/step-over-syscall.exp b/gdb/testsuite/gdb.base/step-over-syscall.exp
index 788f6e3f5d0..e0d5edcbd1c 100644
--- a/gdb/testsuite/gdb.base/step-over-syscall.exp
+++ b/gdb/testsuite/gdb.base/step-over-syscall.exp
@@ -115,7 +115,7 @@ proc setup { syscall } {
 
     clean_restart $testfile
 
-    if { ![runto_main] } then {
+    if {![runto_main]} {
 	return -1
     }
 
@@ -386,7 +386,7 @@ step_over_syscall "clone"
 
 set testfile "step-over-fork"
 clean_restart $testfile
-if { ![runto_main] } then {
+if {![runto_main]} {
     return -1
 }
 
diff --git a/gdb/testsuite/gdb.base/step-test.exp b/gdb/testsuite/gdb.base/step-test.exp
index e73539b22ec..8dfbe86c79d 100644
--- a/gdb/testsuite/gdb.base/step-test.exp
+++ b/gdb/testsuite/gdb.base/step-test.exp
@@ -26,7 +26,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debu
 
 clean_restart ${binfile}
 
-if ![runto_main] then {
+if {![runto_main]} {
    return 0
 }
 
@@ -143,7 +143,7 @@ gdb_test_multiple "finish" "$test" {
     }
     -re ".*(Program received|$inferior_exited_re).*$gdb_prompt $" {
 	# Oops... We ran to the end of the program...  Better reset     
-	if {![runto_main]} then {
+	if {![runto_main]} {
 	    return 0
 	}
 	if {![runto step-test.c:45]} {
diff --git a/gdb/testsuite/gdb.base/store.exp b/gdb/testsuite/gdb.base/store.exp
index 65847c7fbd5..6fc22f27c55 100644
--- a/gdb/testsuite/gdb.base/store.exp
+++ b/gdb/testsuite/gdb.base/store.exp
@@ -26,7 +26,7 @@ if { [prepare_for_testing "failed to prepare" $executable $srcfile] } {
 # set it up at a breakpoint so we can play with the variable values
 #
 
-if ![runto_main] then {
+if {![runto_main]} {
     perror "couldn't run to breakpoint"
     return
 }
diff --git a/gdb/testsuite/gdb.base/structs.exp b/gdb/testsuite/gdb.base/structs.exp
index 71c07ebe368..ed10d24ba57 100644
--- a/gdb/testsuite/gdb.base/structs.exp
+++ b/gdb/testsuite/gdb.base/structs.exp
@@ -70,7 +70,7 @@ proc start_structs_test { types } {
     gdb_test_no_output "set print elements 300"
 
     # Advance to main
-    if { ![runto_main] } then {
+    if {![runto_main]} {
 	return
     }
 
diff --git a/gdb/testsuite/gdb.base/structs2.exp b/gdb/testsuite/gdb.base/structs2.exp
index eecc19bba3e..eb4a89b477f 100644
--- a/gdb/testsuite/gdb.base/structs2.exp
+++ b/gdb/testsuite/gdb.base/structs2.exp
@@ -19,7 +19,7 @@ if { [prepare_for_testing "failed to prepare" $binfile $srcfile {debug}] } {
     return -1
 }
 
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 
diff --git a/gdb/testsuite/gdb.base/sym-file.exp b/gdb/testsuite/gdb.base/sym-file.exp
index 66273f19e9c..c73facb1658 100644
--- a/gdb/testsuite/gdb.base/sym-file.exp
+++ b/gdb/testsuite/gdb.base/sym-file.exp
@@ -71,7 +71,7 @@ if {[prepare_for_testing "failed to prepare"  $binfile "$srcfile $srcfile2" $exe
 
 gdb_load_shlib ${lib_so}
 
-if ![runto_main] then {
+if {![runto_main]} {
     return
 }
 
@@ -82,7 +82,7 @@ gdb_continue_to_breakpoint gdb_add_symbol_file
 
 # 2) Set a pending breakpoint at bar in $srcfile3.
 set result [gdb_breakpoint bar allow-pending]
-if {!$result} then {
+if {!$result} {
    return
 }
 
@@ -93,7 +93,7 @@ set result [gdb_test "add-symbol-file ${lib_syms} addr" \
 		     "add symbol table from file \".*${lib_basename}\\.so\"\
  at.*\\(y or n\\) " \
 		     "y"]
-if {$result != 0} then {
+if {$result != 0} {
    return
 }
 
@@ -109,7 +109,7 @@ gdb_continue_to_breakpoint bar ".*${lib_basename}\\.c:$lnum_bar.*"
 
 # 6) Set a breakpoint at foo in $srcfile3.
 set result [gdb_breakpoint foo]
-if {!$result} then {
+if {!$result} {
     return
 }
 
@@ -121,7 +121,7 @@ gdb_continue_to_breakpoint foo ".*${lib_basename}\\.c:$lnum_foo.*"
 # 8) Set a breakpoint at gdb_remove_symbol_file in $srcfile for
 #    removing the library's symbols.
 set result [gdb_breakpoint gdb_remove_symbol_file]
-if {!$result} then {
+if {!$result} {
     return
 }
 
@@ -135,7 +135,7 @@ set result [gdb_test "remove-symbol-file -a addr" \
 		     "Remove symbol table from file \".*${lib_basename}\\.so\"\\?\
 .*\\(y or n\\) " \
 		     "y"]
-if {$result != 0} then {
+if {$result != 0} {
     return
 }
 
diff --git a/gdb/testsuite/gdb.base/symbol-alias.exp b/gdb/testsuite/gdb.base/symbol-alias.exp
index 9cc26bb66e5..ac0aba986c0 100644
--- a/gdb/testsuite/gdb.base/symbol-alias.exp
+++ b/gdb/testsuite/gdb.base/symbol-alias.exp
@@ -23,7 +23,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} [list $srcfile $srcfil
     return -1
 }
 
-if ![runto_main] then {
+if {![runto_main]} {
     return
 }
 
diff --git a/gdb/testsuite/gdb.base/term.exp b/gdb/testsuite/gdb.base/term.exp
index 21a0c1a979d..e9310045ac3 100644
--- a/gdb/testsuite/gdb.base/term.exp
+++ b/gdb/testsuite/gdb.base/term.exp
@@ -25,7 +25,7 @@ gdb_test "info terminal" \
     "No saved terminal information.*" \
     "test info terminal pre-execution"
 
-if ![runto break_here] then {
+if {![runto break_here]} {
     return 0
 }
 
diff --git a/gdb/testsuite/gdb.base/twice.exp b/gdb/testsuite/gdb.base/twice.exp
index c1296992229..f7671e1a2ae 100644
--- a/gdb/testsuite/gdb.base/twice.exp
+++ b/gdb/testsuite/gdb.base/twice.exp
@@ -34,7 +34,7 @@ if  { [gdb_compile $local_srcfile "${binfile}" executable $options] != "" } {
 
 clean_restart $binfile
 
-if [runto_main] then {
+if {[runto_main]} {
     # Test that GDB can still detect whether we have line numbers
     # even if we're executing code in an include file.
 
diff --git a/gdb/testsuite/gdb.base/type-opaque.exp b/gdb/testsuite/gdb.base/type-opaque.exp
index 6370c995657..35ccfb7ec68 100644
--- a/gdb/testsuite/gdb.base/type-opaque.exp
+++ b/gdb/testsuite/gdb.base/type-opaque.exp
@@ -37,7 +37,7 @@ if { [gdb_compile_shlib $libsrc $libobj {debug}] != ""
 clean_restart ${binfile}
 gdb_load_shlib ${libobj}
 
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 
diff --git a/gdb/testsuite/gdb.base/until.exp b/gdb/testsuite/gdb.base/until.exp
index 40945e3374f..87ebe39c895 100644
--- a/gdb/testsuite/gdb.base/until.exp
+++ b/gdb/testsuite/gdb.base/until.exp
@@ -25,7 +25,7 @@ set bp_location19 [gdb_get_line_number "set breakpoint 19 here"]
 set bp_location20 [gdb_get_line_number "set breakpoint 20 here"]
 set bp_location21 [gdb_get_line_number "set breakpoint 21 here"]
 
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 
diff --git a/gdb/testsuite/gdb.base/unwind-on-each-insn.exp b/gdb/testsuite/gdb.base/unwind-on-each-insn.exp
index d8863ad2895..58fb1267aa4 100644
--- a/gdb/testsuite/gdb.base/unwind-on-each-insn.exp
+++ b/gdb/testsuite/gdb.base/unwind-on-each-insn.exp
@@ -31,7 +31,7 @@ if {[prepare_for_testing_full "failed to prepare" \
     return -1
 }
 
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 
diff --git a/gdb/testsuite/gdb.base/varargs.exp b/gdb/testsuite/gdb.base/varargs.exp
index 7fa464f09ad..a7807ea469d 100644
--- a/gdb/testsuite/gdb.base/varargs.exp
+++ b/gdb/testsuite/gdb.base/varargs.exp
@@ -58,7 +58,7 @@ if [gdb_skip_stdio_test "varargs.exp"] {
     return
 }
 
-if ![runto test] then {
+if {![runto test]} {
     perror "couldn't run to breakpoint"
     return
 }
diff --git a/gdb/testsuite/gdb.base/volatile.exp b/gdb/testsuite/gdb.base/volatile.exp
index 4c56eb40fe9..7fda22647c3 100644
--- a/gdb/testsuite/gdb.base/volatile.exp
+++ b/gdb/testsuite/gdb.base/volatile.exp
@@ -42,7 +42,7 @@ if { [prepare_for_testing "failed to prepare" volatile constvars.c] } {
 #
 # set it up at a breakpoint so we can play with the variable values
 #
-if ![runto_main] then {
+if {![runto_main]} {
     perror "couldn't run to breakpoint"
     return
 }
@@ -52,7 +52,7 @@ get_debug_format
 # Many tests xfail with gcc 2 -gstabs+.
 
 proc local_compiler_xfail_check { } {
-    if { [test_compiler_info gcc-2-*] } then {
+    if {[test_compiler_info gcc-2-*]} {
 	if { ![test_debug_format "HP"] \
 		&& ![test_debug_format "DWARF \[0-9\]"] } then {
 	    setup_xfail "*-*-*" 
diff --git a/gdb/testsuite/gdb.base/watch-cond-infcall.exp b/gdb/testsuite/gdb.base/watch-cond-infcall.exp
index 5dc0ebc2bb4..026f12b2d83 100644
--- a/gdb/testsuite/gdb.base/watch-cond-infcall.exp
+++ b/gdb/testsuite/gdb.base/watch-cond-infcall.exp
@@ -41,7 +41,7 @@ proc test_watchpoint { hw } {
 
     clean_restart ${testfile}
 
-    if { ![runto_main] } then {
+    if {![runto_main]} {
 	return
     }
 
diff --git a/gdb/testsuite/gdb.base/watch-cond.exp b/gdb/testsuite/gdb.base/watch-cond.exp
index 18fabfc69c9..379fdc71ce4 100644
--- a/gdb/testsuite/gdb.base/watch-cond.exp
+++ b/gdb/testsuite/gdb.base/watch-cond.exp
@@ -36,7 +36,7 @@ if {$skip_hw_watchpoint_tests_p} {
     gdb_test_no_output "set can-use-hw-watchpoints 0" ""
 }
 
-if ![runto_main] then {
+if {![runto_main]} {
     return
 }
 
@@ -55,7 +55,7 @@ if {$skip_hw_watchpoint_tests_p} {
     gdb_test_no_output "set can-use-hw-watchpoints 0" ""
 }
 
-if ![runto_main] then {
+if {![runto_main]} {
     return
 }
 
@@ -74,7 +74,7 @@ if {$skip_hw_watchpoint_tests_p} {
     gdb_test_no_output "set can-use-hw-watchpoints 0" ""
 }
 
-if ![runto_main] then {
+if {![runto_main]} {
     return
 }
 
diff --git a/gdb/testsuite/gdb.base/watch-non-mem.exp b/gdb/testsuite/gdb.base/watch-non-mem.exp
index 61497f87eaf..02d87ed9944 100644
--- a/gdb/testsuite/gdb.base/watch-non-mem.exp
+++ b/gdb/testsuite/gdb.base/watch-non-mem.exp
@@ -23,7 +23,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
     return -1
 }
 
-if ![runto_main] then {
+if {![runto_main]} {
     return
 }
 
diff --git a/gdb/testsuite/gdb.base/watch-read.exp b/gdb/testsuite/gdb.base/watch-read.exp
index 4b8c87f193d..d73bc5c4ab3 100644
--- a/gdb/testsuite/gdb.base/watch-read.exp
+++ b/gdb/testsuite/gdb.base/watch-read.exp
@@ -32,7 +32,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
     return -1
 }
 
-if { ![runto_main] } then {
+if {![runto_main]} {
     return
 }
 
diff --git a/gdb/testsuite/gdb.base/watch-vfork.exp b/gdb/testsuite/gdb.base/watch-vfork.exp
index 0ba5af021a8..2771e4efddb 100644
--- a/gdb/testsuite/gdb.base/watch-vfork.exp
+++ b/gdb/testsuite/gdb.base/watch-vfork.exp
@@ -27,7 +27,7 @@ proc test_watchpoint_across_vfork { hw teststr } {
 
     clean_restart ${testfile}
 
-    if { ![runto_main] } then {
+    if {![runto_main]} {
 	return
     }
 
diff --git a/gdb/testsuite/gdb.base/watch_thread_num.exp b/gdb/testsuite/gdb.base/watch_thread_num.exp
index 7d4f19ddc06..da921a72346 100644
--- a/gdb/testsuite/gdb.base/watch_thread_num.exp
+++ b/gdb/testsuite/gdb.base/watch_thread_num.exp
@@ -35,7 +35,7 @@ if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executab
 
 clean_restart ${binfile}
 
-if { ![runto_main] } then {
+if {![runto_main]} {
    return
 }
 
diff --git a/gdb/testsuite/gdb.base/watchpoint-reuse-slot.exp b/gdb/testsuite/gdb.base/watchpoint-reuse-slot.exp
index 7ea6a7467c9..431f78856d8 100644
--- a/gdb/testsuite/gdb.base/watchpoint-reuse-slot.exp
+++ b/gdb/testsuite/gdb.base/watchpoint-reuse-slot.exp
@@ -38,7 +38,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
     return -1
 }
 
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 
diff --git a/gdb/testsuite/gdb.base/watchpoint-stops-at-right-insn.exp b/gdb/testsuite/gdb.base/watchpoint-stops-at-right-insn.exp
index 6c445d4cbd8..0364591d745 100644
--- a/gdb/testsuite/gdb.base/watchpoint-stops-at-right-insn.exp
+++ b/gdb/testsuite/gdb.base/watchpoint-stops-at-right-insn.exp
@@ -79,7 +79,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
     return -1
 }
 
-if { ![runto_main] } then {
+if {![runto_main]} {
     return
 }
 
@@ -133,7 +133,7 @@ proc test {always_inserted} {
 
 	clean_restart $binfile
 
-	if { ![runto_main] } then {
+	if {![runto_main]} {
 	    return
 	}
 
diff --git a/gdb/testsuite/gdb.base/watchpoint.exp b/gdb/testsuite/gdb.base/watchpoint.exp
index a8c98578cb9..7c379cb316f 100644
--- a/gdb/testsuite/gdb.base/watchpoint.exp
+++ b/gdb/testsuite/gdb.base/watchpoint.exp
@@ -272,7 +272,7 @@ proc test_disabling_watchpoints {} {
 proc test_stepping {} {
     global gdb_prompt
 
-    if [runto marker1] then {
+    if {[runto marker1]} {
 	gdb_test "watch ival2" ".*\[Ww\]atchpoint \[0-9\]*: ival2"
 
 	# Well, let's not be too mundane.  It should be a *bit* of a challenge
@@ -351,7 +351,7 @@ proc test_watchpoint_triggered_in_syscall {} {
     set x 0
     set y 0
     set testname "watch buffer passed to read syscall"
-    if [runto marker2] then {
+    if {[runto marker2]} {
 	gdb_test "watch buf\[0\]" ".*\[Ww\]atchpoint \[0-9\]*: buf\\\[0\\\]"
 	gdb_test "watch buf\[1\]" ".*\[Ww\]atchpoint \[0-9\]*: buf\\\[1\\\]"
 	gdb_test "watch buf\[2\]" ".*\[Ww\]atchpoint \[0-9\]*: buf\\\[2\\\]"
@@ -409,7 +409,7 @@ proc test_watchpoint_triggered_in_syscall {} {
 	}
 
 	# Did we find what we were looking for?  If not, flunk it.
-	if [expr $x==$y] then { pass $testname } else { fail "$testname (only triggered $x watchpoints, expected $y)"}
+	if {[expr $x==$y]} { pass $testname } else { fail "$testname (only triggered $x watchpoints, expected $y)"}
 
 	# Continue until we hit the finishing marker function.
 	# Make sure we hit no more watchpoints.
@@ -431,7 +431,7 @@ proc test_watchpoint_triggered_in_syscall {} {
 proc test_complex_watchpoint {} {
     global gdb_prompt
 
-    if [runto marker4] then {
+    if {[runto marker4]} {
 	gdb_test "watch ptr1->val" ".*\[Ww\]atchpoint \[0-9\]*: ptr1->val"
 	gdb_test "break marker5" ".*Breakpoint.*"
 
@@ -559,7 +559,7 @@ proc test_watchpoint_and_breakpoint {} {
     # This is a test for PR breakpoints/7143, which involves setting a
     # watchpoint right after you've reached a breakpoint.
 
-    if [runto func3] then {
+    if {[runto func3]} {
 	gdb_breakpoint [gdb_get_line_number "second x assignment"]
 	gdb_continue_to_breakpoint "second x assignment"
 	gdb_test "watch x" ".*atchpoint \[0-9\]+: x"
@@ -730,7 +730,7 @@ proc test_inaccessible_watchpoint {} {
     # This is a test for watchpoints on currently inaccessible (but later
     # valid) memory.
 
-    if [runto func4] then {
+    if {[runto func4]} {
 	# Make sure we only allow memory access errors.
 	set msg "watchpoint refused to insert on nonexistent struct member"
 	gdb_test_multiple "watch struct1.nosuchmember" $msg {
@@ -811,7 +811,7 @@ proc test_no_hw_watchpoints {} {
     # (This proves rather little on kernels that don't support
     # fast watchpoints, but still...)
     #
-    if ![runto_main] then {
+    if {![runto_main]} {
 	return
     }
 
@@ -936,7 +936,7 @@ proc do_tests {} {
 	    "disable fast watches, 1"
     }
 
-    if [initialize] then {
+    if {[initialize]} {
 
 	test_simple_watchpoint
 
@@ -960,7 +960,7 @@ proc do_tests {} {
     # elsewhere.
     # On sparc-sun-sunos4.1.3, GDB was running all the way to the marker4 
     # breakpoint before stopping for the watchpoint.  I don't know why.
-    if {[istarget "hppa*-*-*"]} then {
+    if {[istarget "hppa*-*-*"]} {
 	test_watchpoint_triggered_in_syscall
     }
 
diff --git a/gdb/testsuite/gdb.base/wchar.exp b/gdb/testsuite/gdb.base/wchar.exp
index f6dce17238c..d42a41aa398 100644
--- a/gdb/testsuite/gdb.base/wchar.exp
+++ b/gdb/testsuite/gdb.base/wchar.exp
@@ -20,7 +20,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
 }
 
 set bp_location [gdb_get_line_number "START"]
-if ![runto "wchar.c:$bp_location" ] then {
+if {![runto "wchar.c:$bp_location"]} {
   return -1
 }
 
diff --git a/gdb/testsuite/gdb.base/whatis-exp.exp b/gdb/testsuite/gdb.base/whatis-exp.exp
index 655fbb8e8fa..132eee7f5a1 100644
--- a/gdb/testsuite/gdb.base/whatis-exp.exp
+++ b/gdb/testsuite/gdb.base/whatis-exp.exp
@@ -37,7 +37,7 @@ if { [prepare_for_testing "failed to prepare" whatis-exp int-type.c {debug nowar
 # set it up at a breakpoint so we can play with the variable values
 #
 
-if ![runto_main] then {
+if {![runto_main]} {
     perror "couldn't run to breakpoint"
     return
 }
diff --git a/gdb/testsuite/gdb.base/whatis-ptype-typedefs.exp b/gdb/testsuite/gdb.base/whatis-ptype-typedefs.exp
index be76183ca79..615b159a695 100644
--- a/gdb/testsuite/gdb.base/whatis-ptype-typedefs.exp
+++ b/gdb/testsuite/gdb.base/whatis-ptype-typedefs.exp
@@ -48,7 +48,7 @@ proc prepare {lang} {
 	return 0
     }
 
-    if ![runto_main] then {
+    if {![runto_main]} {
 	return 0
     }
 
@@ -301,7 +301,7 @@ proc run_tests {lang} {
 }
 
 foreach_with_prefix lang {"c" "c++"} {
-    if { [prepare $lang] } then {
+    if {[prepare $lang]} {
 	run_tests $lang
     }
 }
diff --git a/gdb/testsuite/gdb.base/whatis.exp b/gdb/testsuite/gdb.base/whatis.exp
index 5a3ff536bd9..c455c675051 100644
--- a/gdb/testsuite/gdb.base/whatis.exp
+++ b/gdb/testsuite/gdb.base/whatis.exp
@@ -100,14 +100,14 @@ proc do_test {dir options} {
 
     setup_xfail_on_long_vs_int
     # AIX xlc gets this wrong and unsigned long right.  Go figure.
-    if {!$gcc_compiled} then {setup_xfail "rs6000-*-aix*"}
+    if {!$gcc_compiled} {setup_xfail "rs6000-*-aix*"}
     gdb_test "whatis v_long" \
 	"type = (long|long int)" \
 	"whatis long"
 
     setup_xfail_on_long_vs_int
     # AIX xlc gets this wrong and unsigned long right.  Go figure.
-    if {!$gcc_compiled} then {setup_xfail "rs6000-*-aix*"}
+    if {!$gcc_compiled} {setup_xfail "rs6000-*-aix*"}
     gdb_test "whatis v_signed_long" \
 	"type = (signed |)(long|long int)" \
 	"whatis signed long"
@@ -475,7 +475,7 @@ proc do_test {dir options} {
 	}
 
 	# Sun /bin/cc calls this a function returning double.
-	if {!$gcc_compiled} then {setup_xfail "*-sun-sunos4*"}
+	if {!$gcc_compiled} {setup_xfail "*-sun-sunos4*"}
 	gdb_test "whatis v_float_func" \
 	    "type = float \\($void\\)" \
 	    "whatis float function"
-- 
2.25.4


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH 04/14] gdb/testsuite: remove use of then keyword from gdb.arch/*.exp
  2022-11-15 10:42 [PATCH 00/14] Remove all uses of 'then' keyword from the testsuite Andrew Burgess
                   ` (2 preceding siblings ...)
  2022-11-15 10:42 ` [PATCH 03/14] gdb/testsuite: remove use of then keyword from gdb.base/*.exp Andrew Burgess
@ 2022-11-15 10:42 ` Andrew Burgess
  2022-11-15 10:42 ` [PATCH 05/14] gdb/testsuite: remove use of then keyword from gdb.cp/*.exp Andrew Burgess
                   ` (11 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: Andrew Burgess @ 2022-11-15 10:42 UTC (permalink / raw)
  To: gdb-patches; +Cc: Andrew Burgess

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

There should be no changes in what is tested after this commit.
---
 gdb/testsuite/gdb.arch/aarch64-unwind-pc.exp       |  2 +-
 gdb/testsuite/gdb.arch/alpha-step.exp              |  4 ++--
 gdb/testsuite/gdb.arch/altivec-abi.exp             |  4 ++--
 gdb/testsuite/gdb.arch/altivec-regs.exp            |  4 ++--
 gdb/testsuite/gdb.arch/amd64-byte.exp              |  2 +-
 gdb/testsuite/gdb.arch/amd64-disp-step-avx.exp     |  2 +-
 gdb/testsuite/gdb.arch/amd64-disp-step.exp         |  2 +-
 gdb/testsuite/gdb.arch/amd64-dword.exp             |  2 +-
 gdb/testsuite/gdb.arch/amd64-gs_base.exp           |  2 +-
 gdb/testsuite/gdb.arch/amd64-init-x87-values.exp   |  8 ++++----
 gdb/testsuite/gdb.arch/amd64-word.exp              |  2 +-
 gdb/testsuite/gdb.arch/arc-analyze-prologue.exp    |  2 +-
 gdb/testsuite/gdb.arch/arc-decode-insn.exp         |  2 +-
 .../gdb.arch/arc-disassembler-options.exp          |  2 +-
 .../gdb.arch/arm-disassembler-options.exp          |  2 +-
 gdb/testsuite/gdb.arch/arm-disp-step.exp           |  4 ++--
 gdb/testsuite/gdb.arch/e500-abi.exp                |  4 ++--
 gdb/testsuite/gdb.arch/e500-prologue.exp           |  4 ++--
 gdb/testsuite/gdb.arch/e500-regs.exp               |  6 +++---
 gdb/testsuite/gdb.arch/gdb1291.exp                 |  4 ++--
 gdb/testsuite/gdb.arch/gdb1431.exp                 |  4 ++--
 gdb/testsuite/gdb.arch/gdb1558.exp                 |  2 +-
 gdb/testsuite/gdb.arch/i386-avx.exp                |  4 ++--
 gdb/testsuite/gdb.arch/i386-biarch-core.exp        |  2 +-
 gdb/testsuite/gdb.arch/i386-bp_permanent.exp       |  4 ++--
 gdb/testsuite/gdb.arch/i386-byte.exp               |  4 ++--
 gdb/testsuite/gdb.arch/i386-disp-step.exp          |  4 ++--
 gdb/testsuite/gdb.arch/i386-dr3-watch.exp          |  4 ++--
 gdb/testsuite/gdb.arch/i386-float.exp              |  4 ++--
 gdb/testsuite/gdb.arch/i386-gnu-cfi.exp            |  4 ++--
 gdb/testsuite/gdb.arch/i386-permbkpt.exp           |  2 +-
 gdb/testsuite/gdb.arch/i386-prologue.exp           |  4 ++--
 gdb/testsuite/gdb.arch/i386-signal.exp             |  2 +-
 gdb/testsuite/gdb.arch/i386-size-overlap.exp       |  2 +-
 gdb/testsuite/gdb.arch/i386-size.exp               |  2 +-
 gdb/testsuite/gdb.arch/i386-sse-stack-align.exp    |  2 +-
 gdb/testsuite/gdb.arch/i386-sse.exp                |  2 +-
 gdb/testsuite/gdb.arch/i386-unwind.exp             |  2 +-
 gdb/testsuite/gdb.arch/i386-word.exp               |  4 ++--
 gdb/testsuite/gdb.arch/iwmmxt-regs.exp             |  4 ++--
 .../gdb.arch/mips-disassembler-options.exp         |  2 +-
 gdb/testsuite/gdb.arch/mips-fcr.exp                |  2 +-
 gdb/testsuite/gdb.arch/mips-fpregset-core.exp      |  4 ++--
 gdb/testsuite/gdb.arch/mips16-thunks.exp           | 14 +++++++-------
 gdb/testsuite/gdb.arch/pa-nullify.exp              |  6 +++---
 gdb/testsuite/gdb.arch/powerpc-addpcis.exp         |  2 +-
 gdb/testsuite/gdb.arch/powerpc-aix-prologue.exp    |  4 ++--
 gdb/testsuite/gdb.arch/powerpc-altivec.exp         |  2 +-
 gdb/testsuite/gdb.arch/powerpc-altivec2.exp        |  2 +-
 gdb/testsuite/gdb.arch/powerpc-altivec3.exp        |  2 +-
 gdb/testsuite/gdb.arch/powerpc-d128-regs.exp       |  4 ++--
 .../gdb.arch/powerpc-disassembler-options.exp      |  2 +-
 gdb/testsuite/gdb.arch/powerpc-fpscr-gcore.exp     |  4 ++--
 gdb/testsuite/gdb.arch/powerpc-htm-regs.exp        |  2 +-
 gdb/testsuite/gdb.arch/powerpc-lnia.exp            |  2 +-
 gdb/testsuite/gdb.arch/powerpc-plxv-nonrel.exp     |  2 +-
 gdb/testsuite/gdb.arch/powerpc-power10.exp         |  2 +-
 gdb/testsuite/gdb.arch/powerpc-power7.exp          |  2 +-
 gdb/testsuite/gdb.arch/powerpc-power8.exp          |  2 +-
 gdb/testsuite/gdb.arch/powerpc-power9.exp          |  2 +-
 gdb/testsuite/gdb.arch/powerpc-ppr-dscr.exp        |  2 +-
 gdb/testsuite/gdb.arch/powerpc-prologue.exp        |  4 ++--
 gdb/testsuite/gdb.arch/powerpc-stackless.exp       |  2 +-
 gdb/testsuite/gdb.arch/powerpc-tar.exp             |  2 +-
 gdb/testsuite/gdb.arch/powerpc-vsx-gcore.exp       |  4 ++--
 gdb/testsuite/gdb.arch/powerpc-vsx.exp             |  2 +-
 gdb/testsuite/gdb.arch/powerpc-vsx2.exp            |  2 +-
 gdb/testsuite/gdb.arch/powerpc-vsx3.exp            |  2 +-
 gdb/testsuite/gdb.arch/powerpc64-prologue.exp      |  4 ++--
 gdb/testsuite/gdb.arch/ppc-dfp.exp                 |  2 +-
 gdb/testsuite/gdb.arch/ppc-fp.exp                  |  2 +-
 gdb/testsuite/gdb.arch/ppc-longdouble.exp          |  6 +++---
 gdb/testsuite/gdb.arch/ppc64-atomic-inst.exp       |  2 +-
 gdb/testsuite/gdb.arch/ppc64-break-on-_exit.exp    |  2 +-
 .../gdb.arch/ppc64-isa207-atomic-inst.exp          |  2 +-
 gdb/testsuite/gdb.arch/pr25124.exp                 |  2 +-
 gdb/testsuite/gdb.arch/riscv-bp-infcall.exp        |  2 +-
 gdb/testsuite/gdb.arch/riscv-info-fcsr.exp         |  2 +-
 gdb/testsuite/gdb.arch/riscv-reg-aliases.exp       |  2 +-
 gdb/testsuite/gdb.arch/riscv-unwind-long-insn.exp  |  2 +-
 .../riscv64-unwind-prologue-with-ld-lw.exp         |  2 +-
 .../gdb.arch/riscv64-unwind-prologue-with-mv.exp   |  2 +-
 .../gdb.arch/s390-disassembler-options.exp         |  2 +-
 gdb/testsuite/gdb.arch/s390-stackless.exp          |  2 +-
 gdb/testsuite/gdb.arch/s390-tdbregs.exp            |  2 +-
 gdb/testsuite/gdb.arch/sparc-sysstep.exp           |  2 +-
 gdb/testsuite/gdb.arch/sparc64-adi.exp             |  4 ++--
 gdb/testsuite/gdb.arch/sparc64-regs.exp            |  4 ++--
 gdb/testsuite/gdb.arch/thumb-bx-pc.exp             |  4 ++--
 gdb/testsuite/gdb.arch/thumb-prologue.exp          |  4 ++--
 gdb/testsuite/gdb.arch/thumb-singlestep.exp        |  4 ++--
 gdb/testsuite/gdb.arch/thumb2-it.exp               |  4 ++--
 gdb/testsuite/gdb.arch/vsx-regs.exp                |  4 ++--
 gdb/testsuite/gdb.arch/vsx-vsr-float28.exp         |  4 ++--
 94 files changed, 142 insertions(+), 142 deletions(-)

diff --git a/gdb/testsuite/gdb.arch/aarch64-unwind-pc.exp b/gdb/testsuite/gdb.arch/aarch64-unwind-pc.exp
index 105b9a9cc3a..a6d549a9830 100644
--- a/gdb/testsuite/gdb.arch/aarch64-unwind-pc.exp
+++ b/gdb/testsuite/gdb.arch/aarch64-unwind-pc.exp
@@ -17,7 +17,7 @@
 
 # Test explicitly unwinding the PC DWARF register on aarch64
 
-if {![is_aarch64_target]} then {
+if {![is_aarch64_target]} {
     verbose "Skipping ${gdb_test_file_name}."
     return
 }
diff --git a/gdb/testsuite/gdb.arch/alpha-step.exp b/gdb/testsuite/gdb.arch/alpha-step.exp
index b65ed8124b9..2f046752c63 100644
--- a/gdb/testsuite/gdb.arch/alpha-step.exp
+++ b/gdb/testsuite/gdb.arch/alpha-step.exp
@@ -14,7 +14,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 
-if ![istarget "alpha*-*-*"] then {
+if {![istarget "alpha*-*-*"]} {
     verbose "Skipping alpha step tests."
     return
 }
@@ -37,7 +37,7 @@ proc test_stepi {function } {
     # Restart the program from scratch. If GDB got confused during one
     # of the previous tests, this makes sure that it doesn't affect
     # this series of tests.
-    if ![runto_main] then {
+    if {![runto_main]} {
         return 0
     }
 
diff --git a/gdb/testsuite/gdb.arch/altivec-abi.exp b/gdb/testsuite/gdb.arch/altivec-abi.exp
index d46882ad7ac..d32cac71699 100644
--- a/gdb/testsuite/gdb.arch/altivec-abi.exp
+++ b/gdb/testsuite/gdb.arch/altivec-abi.exp
@@ -21,7 +21,7 @@
 # This file uses altivec-abi.c for input.
 #
 
-if {![istarget "powerpc*"] || [skip_altivec_tests]} then {
+if {![istarget "powerpc*"] || [skip_altivec_tests]} {
     verbose "Skipping altivec abi tests."
     return
 }
@@ -56,7 +56,7 @@ proc altivec_abi_tests { extra_flags force_abi } {
     gdb_load ${binfile}
 
     # Run to `main' where we begin our tests.
-    if ![runto_main] then {
+    if {![runto_main]} {
 	return -1
     }
 
diff --git a/gdb/testsuite/gdb.arch/altivec-regs.exp b/gdb/testsuite/gdb.arch/altivec-regs.exp
index 42521a0a9ab..43ef5ed25c8 100644
--- a/gdb/testsuite/gdb.arch/altivec-regs.exp
+++ b/gdb/testsuite/gdb.arch/altivec-regs.exp
@@ -22,7 +22,7 @@
 #
 
 
-if {![istarget "powerpc*"] || [skip_altivec_tests]} then {
+if {![istarget "powerpc*"] || [skip_altivec_tests]} {
     verbose "Skipping altivec register tests."
     return
 }
@@ -52,7 +52,7 @@ gdb_load ${binfile}
 # Run to `main' where we begin our tests.
 #
 
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 
diff --git a/gdb/testsuite/gdb.arch/amd64-byte.exp b/gdb/testsuite/gdb.arch/amd64-byte.exp
index 085963230cc..8ab7b68bf6b 100644
--- a/gdb/testsuite/gdb.arch/amd64-byte.exp
+++ b/gdb/testsuite/gdb.arch/amd64-byte.exp
@@ -33,7 +33,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list
 
 clean_restart ${binfile}
 
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 
diff --git a/gdb/testsuite/gdb.arch/amd64-disp-step-avx.exp b/gdb/testsuite/gdb.arch/amd64-disp-step-avx.exp
index a64c85bc0e9..1d79f274f73 100644
--- a/gdb/testsuite/gdb.arch/amd64-disp-step-avx.exp
+++ b/gdb/testsuite/gdb.arch/amd64-disp-step-avx.exp
@@ -42,7 +42,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} $options] }
 gdb_test "set displaced-stepping on" ""
 gdb_test "show displaced-stepping" ".* displaced stepping .* is on.*"
 
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 
diff --git a/gdb/testsuite/gdb.arch/amd64-disp-step.exp b/gdb/testsuite/gdb.arch/amd64-disp-step.exp
index 7bd2d5fac51..eb303af1b09 100644
--- a/gdb/testsuite/gdb.arch/amd64-disp-step.exp
+++ b/gdb/testsuite/gdb.arch/amd64-disp-step.exp
@@ -35,7 +35,7 @@ if { [prepare_for_testing "failed to prepare" $testfile $srcfile $opts] } {
 gdb_test "set displaced-stepping on" ""
 gdb_test "show displaced-stepping" ".* displaced stepping .* is on.*"
 
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 
diff --git a/gdb/testsuite/gdb.arch/amd64-dword.exp b/gdb/testsuite/gdb.arch/amd64-dword.exp
index 0c297529dc0..5151a60da4a 100644
--- a/gdb/testsuite/gdb.arch/amd64-dword.exp
+++ b/gdb/testsuite/gdb.arch/amd64-dword.exp
@@ -33,7 +33,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list
 
 clean_restart ${binfile}
 
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 
diff --git a/gdb/testsuite/gdb.arch/amd64-gs_base.exp b/gdb/testsuite/gdb.arch/amd64-gs_base.exp
index 477e78eb842..f0a1013f2b2 100644
--- a/gdb/testsuite/gdb.arch/amd64-gs_base.exp
+++ b/gdb/testsuite/gdb.arch/amd64-gs_base.exp
@@ -15,7 +15,7 @@
 
 standard_testfile
 
-if { ![is_amd64_regs_target] } then {
+if {![is_amd64_regs_target]} {
     verbose "Untested x86_64 fs_base and gs_base tests."
     return
 }
diff --git a/gdb/testsuite/gdb.arch/amd64-init-x87-values.exp b/gdb/testsuite/gdb.arch/amd64-init-x87-values.exp
index fdc633042b4..6a99afb4725 100644
--- a/gdb/testsuite/gdb.arch/amd64-init-x87-values.exp
+++ b/gdb/testsuite/gdb.arch/amd64-init-x87-values.exp
@@ -18,7 +18,7 @@
 # Test initial values of x87 control registers, before any x87
 # instructions have been executed in the inferior.
 
-if ![is_amd64_regs_target] then {
+if {![is_amd64_regs_target]} {
     return
 }
 
@@ -45,7 +45,7 @@ proc_with_prefix check_x87_regs_around_init {} {
     clean_restart ${binfile}
 
     # Get things started.
-    if ![runto_main] then {
+    if {![runto_main]} {
 	return 0
     }
 
@@ -119,7 +119,7 @@ proc_with_prefix check_setting_mxcsr_before_enable {} {
 
     clean_restart ${binfile}
 
-    if ![runto_main] then {
+    if {![runto_main]} {
 	return 0
     }
 
@@ -153,7 +153,7 @@ proc_with_prefix check_setting_x87_regs_before_enable {} {
 
     clean_restart ${binfile}
 
-    if ![runto_main] then {
+    if {![runto_main]} {
 	return 0
     }
 
diff --git a/gdb/testsuite/gdb.arch/amd64-word.exp b/gdb/testsuite/gdb.arch/amd64-word.exp
index c518dc96c86..51eac6620a1 100644
--- a/gdb/testsuite/gdb.arch/amd64-word.exp
+++ b/gdb/testsuite/gdb.arch/amd64-word.exp
@@ -33,7 +33,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list
 
 clean_restart ${binfile}
 
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 
diff --git a/gdb/testsuite/gdb.arch/arc-analyze-prologue.exp b/gdb/testsuite/gdb.arch/arc-analyze-prologue.exp
index c7f2dfd9a39..cf50bd9e3e6 100644
--- a/gdb/testsuite/gdb.arch/arc-analyze-prologue.exp
+++ b/gdb/testsuite/gdb.arch/arc-analyze-prologue.exp
@@ -15,7 +15,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if {![istarget "arc*-*-*"]} then {
+if {![istarget "arc*-*-*"]} {
     verbose "Skipping ARC prologue test."
     return
 }
diff --git a/gdb/testsuite/gdb.arch/arc-decode-insn.exp b/gdb/testsuite/gdb.arch/arc-decode-insn.exp
index 5564373a49a..182132bab82 100644
--- a/gdb/testsuite/gdb.arch/arc-decode-insn.exp
+++ b/gdb/testsuite/gdb.arch/arc-decode-insn.exp
@@ -31,7 +31,7 @@
 # about requirements to actual test cases can be found in corresponding
 # assembly file of this test case (arc-decode-insn.S).
 
-if {![istarget "arc*-*-*"]} then {
+if {![istarget "arc*-*-*"]} {
     verbose "Skipping ARC decoder test."
     return
 }
diff --git a/gdb/testsuite/gdb.arch/arc-disassembler-options.exp b/gdb/testsuite/gdb.arch/arc-disassembler-options.exp
index 86f4acad656..167359a0119 100644
--- a/gdb/testsuite/gdb.arch/arc-disassembler-options.exp
+++ b/gdb/testsuite/gdb.arch/arc-disassembler-options.exp
@@ -15,7 +15,7 @@
 
 # Test ARC disassembler options.
 
-if { ![istarget "arc-*-*"] } then {
+if {![istarget "arc-*-*"]} {
     verbose "Skipping ARC disassembler option test."
     return
 }
diff --git a/gdb/testsuite/gdb.arch/arm-disassembler-options.exp b/gdb/testsuite/gdb.arch/arm-disassembler-options.exp
index 4e84ff9d4a7..e562112badd 100644
--- a/gdb/testsuite/gdb.arch/arm-disassembler-options.exp
+++ b/gdb/testsuite/gdb.arch/arm-disassembler-options.exp
@@ -18,7 +18,7 @@
 # This test exercises set/show disassembler-options results are preserved
 # across multiple set architecture calls.
 
-if {![istarget "arm*-*-*"]} then {
+if {![istarget "arm*-*-*"]} {
     verbose "Skipping ARM disassembler options."
     return
 }
diff --git a/gdb/testsuite/gdb.arch/arm-disp-step.exp b/gdb/testsuite/gdb.arch/arm-disp-step.exp
index e60ef7b1120..ec6578257b3 100644
--- a/gdb/testsuite/gdb.arch/arm-disp-step.exp
+++ b/gdb/testsuite/gdb.arch/arm-disp-step.exp
@@ -17,7 +17,7 @@
 
 # Test arm displaced stepping.
 
-if {![is_aarch32_target]} then {
+if {![is_aarch32_target]} {
     verbose "Skipping arm displaced stepping tests."
     return
 }
@@ -409,7 +409,7 @@ proc test_add_rn_pc {} {
 # which is in library might be compiled in Thumb.
 gdb_test_no_output "set displaced-stepping off"
 
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 
diff --git a/gdb/testsuite/gdb.arch/e500-abi.exp b/gdb/testsuite/gdb.arch/e500-abi.exp
index cb5e46a68db..0a94d4346bc 100644
--- a/gdb/testsuite/gdb.arch/e500-abi.exp
+++ b/gdb/testsuite/gdb.arch/e500-abi.exp
@@ -22,7 +22,7 @@
 #
 
 
-if ![istarget "powerpc-*eabispe"] then {
+if {![istarget "powerpc-*eabispe"]} {
     verbose "Skipping e500 abi tests."
     return
 }
@@ -45,7 +45,7 @@ gdb_load ${binfile}
 # Run to `main' where we begin our tests.
 #
 
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 
diff --git a/gdb/testsuite/gdb.arch/e500-prologue.exp b/gdb/testsuite/gdb.arch/e500-prologue.exp
index 2887a83f23e..94b4a960e8e 100644
--- a/gdb/testsuite/gdb.arch/e500-prologue.exp
+++ b/gdb/testsuite/gdb.arch/e500-prologue.exp
@@ -18,7 +18,7 @@
 # Test PowerPC E500 prologue analyzer.
 
 
-if ![istarget "powerpc-*"] then {
+if {![istarget "powerpc-*"]} {
     verbose "Skipping powerpc E500 prologue tests."
     return
 }
@@ -62,7 +62,7 @@ proc insert_breakpoint {function expected_location} {
     # instruction at that address (we're not interested in the insn
     # itself, but rather at the address printed at the begining of
     # the instruction).
-    if { $address != "" } then {
+    if {$address != ""} {
        gdb_test "x /i $address" \
                 ".*<$function\\+$expected_location>.*" \
                 "check $function breakpoint address"
diff --git a/gdb/testsuite/gdb.arch/e500-regs.exp b/gdb/testsuite/gdb.arch/e500-regs.exp
index 254246d1a65..d5fd7656937 100644
--- a/gdb/testsuite/gdb.arch/e500-regs.exp
+++ b/gdb/testsuite/gdb.arch/e500-regs.exp
@@ -22,7 +22,7 @@
 #
 
 
-if ![istarget "powerpc-*eabispe"] then {
+if {![istarget "powerpc-*eabispe"]} {
     verbose "Skipping e500 register tests."
     return
 }
@@ -44,7 +44,7 @@ gdb_load ${binfile}
 # Run to `main' where we begin our tests.
 #
 
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 
@@ -144,7 +144,7 @@ gdb_exit
 gdb_start
 gdb_reinitialize_dir $srcdir/$subdir
 gdb_load ${binfile}
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 
diff --git a/gdb/testsuite/gdb.arch/gdb1291.exp b/gdb/testsuite/gdb.arch/gdb1291.exp
index cc60ebfc3a1..47487513a6e 100644
--- a/gdb/testsuite/gdb.arch/gdb1291.exp
+++ b/gdb/testsuite/gdb.arch/gdb1291.exp
@@ -24,7 +24,7 @@
 # Test SH backtraces with >256 byte frame stack. (PR:1291)
 
 
-if ![istarget "sh-*-*"] then {
+if {![istarget "sh-*-*"]} {
     verbose "Skipping SH backtrace tests."
     return
 }
@@ -46,7 +46,7 @@ gdb_load ${binfile}
 # Run to `main' where we begin our tests.
 #
 
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 
diff --git a/gdb/testsuite/gdb.arch/gdb1431.exp b/gdb/testsuite/gdb.arch/gdb1431.exp
index 78ff651df73..d4585b38a39 100644
--- a/gdb/testsuite/gdb.arch/gdb1431.exp
+++ b/gdb/testsuite/gdb.arch/gdb1431.exp
@@ -26,7 +26,7 @@
 # Observe that the until command doesn't go all the way to sub2.
 
 
-if ![istarget "sh-*-*"] then {
+if {![istarget "sh-*-*"]} {
     verbose "Skipping SH backtrace tests."
     return
 }
@@ -48,7 +48,7 @@ gdb_load ${binfile}
 # Run to `main' where we begin our tests.
 #
 
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 
diff --git a/gdb/testsuite/gdb.arch/gdb1558.exp b/gdb/testsuite/gdb.arch/gdb1558.exp
index 13f92ddf601..a1094e221b2 100644
--- a/gdb/testsuite/gdb.arch/gdb1558.exp
+++ b/gdb/testsuite/gdb.arch/gdb1558.exp
@@ -22,7 +22,7 @@
 # from main.
 
 
-if ![istarget "sh-*-*"] then {
+if {![istarget "sh-*-*"]} {
     verbose "Skipping SH breakpoint test."
     return
 }
diff --git a/gdb/testsuite/gdb.arch/i386-avx.exp b/gdb/testsuite/gdb.arch/i386-avx.exp
index 950b411809e..2a2c17115e7 100644
--- a/gdb/testsuite/gdb.arch/i386-avx.exp
+++ b/gdb/testsuite/gdb.arch/i386-avx.exp
@@ -48,7 +48,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable \
 
 clean_restart ${binfile}
 
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 
@@ -100,7 +100,7 @@ with_test_prefix "force-disable xml descriptions" {
 	    clean_restart ${binfile}
 	}
 
-	if ![runto_main] then {
+	if {![runto_main]} {
 	    return
 	}
 
diff --git a/gdb/testsuite/gdb.arch/i386-biarch-core.exp b/gdb/testsuite/gdb.arch/i386-biarch-core.exp
index 607a3aaaf85..fe034fe148a 100644
--- a/gdb/testsuite/gdb.arch/i386-biarch-core.exp
+++ b/gdb/testsuite/gdb.arch/i386-biarch-core.exp
@@ -21,7 +21,7 @@
 # #define EM_X86_64       62              /* AMD x86-64 architecture */
 # patch @0x12: 0x3E -> 0x03
 
-if { ![istarget "i?86-*-*"] && ![istarget "x86_64-*-*"] } then {
+if {![istarget "i?86-*-*"] && ![istarget "x86_64-*-*"]} {
     verbose "Skipping i386 biarch core test."
     return
 }
diff --git a/gdb/testsuite/gdb.arch/i386-bp_permanent.exp b/gdb/testsuite/gdb.arch/i386-bp_permanent.exp
index f45871c4b58..975c3559af8 100644
--- a/gdb/testsuite/gdb.arch/i386-bp_permanent.exp
+++ b/gdb/testsuite/gdb.arch/i386-bp_permanent.exp
@@ -18,7 +18,7 @@
 
 # Test stepping over permanent breakpoints on i386.
 
-if { ![istarget "i?86-*-*"] && ![istarget "x86_64-*-*"] } then {
+if {![istarget "i?86-*-*"] && ![istarget "x86_64-*-*"]} {
     verbose "Skipping skip over permanent breakpoint on i386 tests."
     return
 }
@@ -45,7 +45,7 @@ gdb_load ${binfile}
 # Run to `main' where we begin our tests.
 #
 
-if ![runto_main] then {
+if {![runto_main]} {
   return -1
 }
 
diff --git a/gdb/testsuite/gdb.arch/i386-byte.exp b/gdb/testsuite/gdb.arch/i386-byte.exp
index f29d54ec1bc..e6564f73162 100644
--- a/gdb/testsuite/gdb.arch/i386-byte.exp
+++ b/gdb/testsuite/gdb.arch/i386-byte.exp
@@ -19,7 +19,7 @@
 # This file is part of the gdb testsuite.
 
 
-if {(![istarget "x86_64-*-*"] && ![istarget "i?86-*-*"])} then {
+if {(![istarget "x86_64-*-*"] && ![istarget "i?86-*-*"])} {
     verbose "Skipping i386 byte register tests."
     return
 }
@@ -33,7 +33,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list
 
 clean_restart ${binfile}
 
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 
diff --git a/gdb/testsuite/gdb.arch/i386-disp-step.exp b/gdb/testsuite/gdb.arch/i386-disp-step.exp
index c02b31f8b9a..dba61a67736 100644
--- a/gdb/testsuite/gdb.arch/i386-disp-step.exp
+++ b/gdb/testsuite/gdb.arch/i386-disp-step.exp
@@ -18,7 +18,7 @@
 # Test i386 displaced stepping.
 
 
-if { ![is_x86_like_target] } then {
+if {![is_x86_like_target]} {
     verbose "Skipping x86 displaced stepping tests."
     return
 }
@@ -32,7 +32,7 @@ if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } {
 gdb_test "set displaced-stepping on" ""
 gdb_test "show displaced-stepping" ".* displaced stepping .* is on.*"
 
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 
diff --git a/gdb/testsuite/gdb.arch/i386-dr3-watch.exp b/gdb/testsuite/gdb.arch/i386-dr3-watch.exp
index bab118b0ea0..305cfea5e68 100644
--- a/gdb/testsuite/gdb.arch/i386-dr3-watch.exp
+++ b/gdb/testsuite/gdb.arch/i386-dr3-watch.exp
@@ -19,7 +19,7 @@
 # This test relies on being able to set 4 hardware watchpoints.  Since
 # that is not a valid assumption across most targets, and we're
 # testing a x86 specific bug, skip everywhere else.
-if { ![istarget "i?86-*-*"] && ![istarget "x86_64-*-*"] } then {
+if {![istarget "i?86-*-*"] && ![istarget "x86_64-*-*"]} {
     return 0
 }
 
@@ -29,7 +29,7 @@ if [prepare_for_testing "failed to prepare" ${binfile} ${srcfile} {debug $additi
     return -1
 }
 
-if ![runto_main] then {
+if {![runto_main]} {
     return -1
 }
 
diff --git a/gdb/testsuite/gdb.arch/i386-float.exp b/gdb/testsuite/gdb.arch/i386-float.exp
index 033c0eac900..69f673534d4 100644
--- a/gdb/testsuite/gdb.arch/i386-float.exp
+++ b/gdb/testsuite/gdb.arch/i386-float.exp
@@ -18,7 +18,7 @@
 
 # Test the x87 floating point information printout.
 
-if { ![istarget "i?86-*-*"] && ![istarget "x86_64-*-*"] } then {
+if {![istarget "i?86-*-*"] && ![istarget "x86_64-*-*"]} {
     verbose "Skipping i386 tests for x87 floating point support."
     return
 }
@@ -32,7 +32,7 @@ if { [prepare_for_testing "failed to prepare" $testfile $srcfile [list debug nop
     return -1
 }
 
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 
diff --git a/gdb/testsuite/gdb.arch/i386-gnu-cfi.exp b/gdb/testsuite/gdb.arch/i386-gnu-cfi.exp
index 68aae8f9236..04f80acf44a 100644
--- a/gdb/testsuite/gdb.arch/i386-gnu-cfi.exp
+++ b/gdb/testsuite/gdb.arch/i386-gnu-cfi.exp
@@ -23,7 +23,7 @@
 # Test i386 unwinder.
 
 
-if { ![is_x86_like_target] } then {
+if {![is_x86_like_target]} {
     verbose "Skipping i386 unwinder tests."
     return
 }
@@ -86,7 +86,7 @@ gdb_test "frame $gate_n" \
 gdb_test_multiple "info frame" "existence of the CFI inserted register" {
     -re "Stack level $gate_n, frame at (0x\[0-9a-f\]+):.*Saved registers:.* ecx at (0x\[0-9a-f\]+),.*" {
 	pass "existence of the CFI inserted register"
-	if { [string compare $expect_out(1,string) $expect_out(2,string)] } then {
+	if {[string compare $expect_out(1,string) $expect_out(2,string)]} {
 	    fail "value of the CFI inserted register"
 	} else {
 	    pass "value of the CFI inserted register"
diff --git a/gdb/testsuite/gdb.arch/i386-permbkpt.exp b/gdb/testsuite/gdb.arch/i386-permbkpt.exp
index 48b6b1574a5..3e8c6b52acc 100644
--- a/gdb/testsuite/gdb.arch/i386-permbkpt.exp
+++ b/gdb/testsuite/gdb.arch/i386-permbkpt.exp
@@ -18,7 +18,7 @@
 
 # Test inserting breakpoints over permanent breakpoints on i386 and amd64.
 
-if { ![istarget "i?86-*-*"] && ![istarget "x86_64-*-*"] } then {
+if {![istarget "i?86-*-*"] && ![istarget "x86_64-*-*"]} {
     verbose "Skipping i386 test for multi break at permanent breakpoint location."
     return
 }
diff --git a/gdb/testsuite/gdb.arch/i386-prologue.exp b/gdb/testsuite/gdb.arch/i386-prologue.exp
index 9cfd7e5ccc5..1988e0b7b85 100644
--- a/gdb/testsuite/gdb.arch/i386-prologue.exp
+++ b/gdb/testsuite/gdb.arch/i386-prologue.exp
@@ -21,7 +21,7 @@
 # Test i386 prologue analyzer.
 
 
-if { ![is_x86_like_target] } then {
+if {![is_x86_like_target]} {
     verbose "Skipping i386 prologue tests."
     return
 }
@@ -65,7 +65,7 @@ gdb_load ${binfile}
 # Run to `main' where we begin our tests.
 #
 
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 
diff --git a/gdb/testsuite/gdb.arch/i386-signal.exp b/gdb/testsuite/gdb.arch/i386-signal.exp
index 7e8f62350a3..d7677c8bb01 100644
--- a/gdb/testsuite/gdb.arch/i386-signal.exp
+++ b/gdb/testsuite/gdb.arch/i386-signal.exp
@@ -15,7 +15,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if { ![istarget "i?86-*-*"] && ![istarget "x86_64-*-*"] } then {
+if {![istarget "i?86-*-*"] && ![istarget "x86_64-*-*"]} {
     verbose "Skipping i386 unwinder tests."
     return
 }
diff --git a/gdb/testsuite/gdb.arch/i386-size-overlap.exp b/gdb/testsuite/gdb.arch/i386-size-overlap.exp
index e7ea47e4aca..ecdbb0a8e11 100644
--- a/gdb/testsuite/gdb.arch/i386-size-overlap.exp
+++ b/gdb/testsuite/gdb.arch/i386-size-overlap.exp
@@ -17,7 +17,7 @@
 
 # Test that GDB can handle overlapping sizes of symbols.
 
-if { ![is_x86_like_target] } then {
+if {![is_x86_like_target]} {
     verbose "Skipping i386 unwinder tests."
     return
 }
diff --git a/gdb/testsuite/gdb.arch/i386-size.exp b/gdb/testsuite/gdb.arch/i386-size.exp
index 4fdd3305c4b..19c5552631a 100644
--- a/gdb/testsuite/gdb.arch/i386-size.exp
+++ b/gdb/testsuite/gdb.arch/i386-size.exp
@@ -20,7 +20,7 @@
 
 # Test that GDB can see the sizes of symbols.
 
-if { ![is_x86_like_target] } then {
+if {![is_x86_like_target]} {
     verbose "Skipping i386 unwinder tests."
     return
 }
diff --git a/gdb/testsuite/gdb.arch/i386-sse-stack-align.exp b/gdb/testsuite/gdb.arch/i386-sse-stack-align.exp
index c66a352a9d1..e4699fe511b 100644
--- a/gdb/testsuite/gdb.arch/i386-sse-stack-align.exp
+++ b/gdb/testsuite/gdb.arch/i386-sse-stack-align.exp
@@ -37,7 +37,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable $opts
 
 clean_restart $executable
 
-if ![runto_main] then {
+if {![runto_main]} {
     return -1
 }
 
diff --git a/gdb/testsuite/gdb.arch/i386-sse.exp b/gdb/testsuite/gdb.arch/i386-sse.exp
index 6565f15aa76..2f94fc4521d 100644
--- a/gdb/testsuite/gdb.arch/i386-sse.exp
+++ b/gdb/testsuite/gdb.arch/i386-sse.exp
@@ -43,7 +43,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable \
 
 clean_restart ${binfile}
 
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 
diff --git a/gdb/testsuite/gdb.arch/i386-unwind.exp b/gdb/testsuite/gdb.arch/i386-unwind.exp
index 66f30bcb8c4..f9f0307674f 100644
--- a/gdb/testsuite/gdb.arch/i386-unwind.exp
+++ b/gdb/testsuite/gdb.arch/i386-unwind.exp
@@ -21,7 +21,7 @@
 # Test i386 unwinder.
 
 
-if { ![is_x86_like_target] } then {
+if {![is_x86_like_target]} {
     verbose "Skipping i386 unwinder tests."
     return
 }
diff --git a/gdb/testsuite/gdb.arch/i386-word.exp b/gdb/testsuite/gdb.arch/i386-word.exp
index 5ad01eb20f1..16d7dbfcc53 100644
--- a/gdb/testsuite/gdb.arch/i386-word.exp
+++ b/gdb/testsuite/gdb.arch/i386-word.exp
@@ -19,7 +19,7 @@
 # This file is part of the gdb testsuite.
 
 
-if {(![istarget "x86_64-*-*"] && ![istarget "i?86-*-*"])} then {
+if {(![istarget "x86_64-*-*"] && ![istarget "i?86-*-*"])} {
     verbose "Skipping i386 word register tests."
     return
 }
@@ -33,7 +33,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list
 
 clean_restart ${binfile}
 
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 
diff --git a/gdb/testsuite/gdb.arch/iwmmxt-regs.exp b/gdb/testsuite/gdb.arch/iwmmxt-regs.exp
index 1e96937f679..1d8be6e7066 100644
--- a/gdb/testsuite/gdb.arch/iwmmxt-regs.exp
+++ b/gdb/testsuite/gdb.arch/iwmmxt-regs.exp
@@ -16,7 +16,7 @@
 
 # Tests for ARM iWMMXt register setting and fetching.
 
-if ![istarget "arm*-*-*"] then {
+if {![istarget "arm*-*-*"]} {
     verbose "Skipping iWMMXt register tests."
     return
 }
@@ -40,7 +40,7 @@ gdb_load ${binfile}
 # Run to `main' where we begin our tests.
 #
 
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 
diff --git a/gdb/testsuite/gdb.arch/mips-disassembler-options.exp b/gdb/testsuite/gdb.arch/mips-disassembler-options.exp
index fd363b727de..97a2d5b4f66 100644
--- a/gdb/testsuite/gdb.arch/mips-disassembler-options.exp
+++ b/gdb/testsuite/gdb.arch/mips-disassembler-options.exp
@@ -15,7 +15,7 @@
 
 # Test MIPS disassembler options.
 
-if { ![istarget "mips*-*-*"] } then {
+if {![istarget "mips*-*-*"]} {
     verbose "Skipping MIPS disassembler option tests."
     return
 }
diff --git a/gdb/testsuite/gdb.arch/mips-fcr.exp b/gdb/testsuite/gdb.arch/mips-fcr.exp
index 294e6f0c34d..77b48bfe181 100644
--- a/gdb/testsuite/gdb.arch/mips-fcr.exp
+++ b/gdb/testsuite/gdb.arch/mips-fcr.exp
@@ -17,7 +17,7 @@
 
 # Test MIPS Floating Point Control Register handling.
 
-if { ![istarget "mips*-*-*"] } then {
+if {![istarget "mips*-*-*"]} {
     verbose "Skipping MIPS Floating Point Control Register tests."
     return
 }
diff --git a/gdb/testsuite/gdb.arch/mips-fpregset-core.exp b/gdb/testsuite/gdb.arch/mips-fpregset-core.exp
index 059c227aab8..bbfa1b5e6c1 100644
--- a/gdb/testsuite/gdb.arch/mips-fpregset-core.exp
+++ b/gdb/testsuite/gdb.arch/mips-fpregset-core.exp
@@ -15,7 +15,7 @@
 
 # Test MIPS Floating Point General Register handling in core files.
 
-if { ![istarget "mips*-*-*"] } then {
+if {![istarget "mips*-*-*"]} {
     verbose "Skipping MIPS Floating Point General Register tests."
     return
 }
@@ -133,7 +133,7 @@ proc mips_fpregset_core_test { supported corefile } {
 	set test "core file FGR register contents"
 	set core_fgr_contents \
 	    [mips_fpregset_core_fetch_float_registers "retrieve $test"]
-	if { $core_fgr_contents == $live_fgr_contents } then {
+	if {$core_fgr_contents == $live_fgr_contents} {
 	    pass $test
 	} else {
 	    fail $test
diff --git a/gdb/testsuite/gdb.arch/mips16-thunks.exp b/gdb/testsuite/gdb.arch/mips16-thunks.exp
index 00ebeecb507..d0b9038544a 100644
--- a/gdb/testsuite/gdb.arch/mips16-thunks.exp
+++ b/gdb/testsuite/gdb.arch/mips16-thunks.exp
@@ -25,7 +25,7 @@
 # toolchain for a subset of ABIs, so we need to check that a MIPS16
 # executable can be built and run at all before we attempt the actual test.
 
-if { ![istarget "mips*-*-*"] } then {
+if {![istarget "mips*-*-*"]} {
     verbose "Skipping MIPS16 thunk support tests."
     return
 }
@@ -37,7 +37,7 @@ proc set_src_and_obj { filename { suffix "" } } {
     global srcdir
     global subdir
 
-    if ![string equal "$suffix" ""] then {
+    if {![string equal "$suffix" ""]} {
 	set suffix "-$suffix"
     }
     set srcfile ${srcdir}/${subdir}/${filename}.c
@@ -61,7 +61,7 @@ gdb_compile ${srcfile} ${objfile} object ${options}
 
 set binfile [standard_output_file ${testname}]
 set options [list debug nowarnings]
-if { [gdb_compile ${objfiles} ${binfile} executable ${options}] != "" } then {
+if {[gdb_compile ${objfiles} ${binfile} executable ${options}] != ""} {
     unsupported "no MIPS16 support in the toolchain."
     return
 }
@@ -116,7 +116,7 @@ gdb_compile ${srcfile} ${objfile} object ${options}
 
 set binfile [standard_output_file ${testname}]
 set options [list debug nowarnings additional_flags=-fPIC]
-if { [gdb_compile ${objfiles} ${binfile} executable ${options}] == "" } then {
+if {[gdb_compile ${objfiles} ${binfile} executable ${options}] == ""} {
     clean_restart ${testname}
     gdb_breakpoint inmain
     gdb_run_cmd
@@ -189,7 +189,7 @@ set binfile [standard_output_file ${testname}]
 set options [list debug nowarnings]
 gdb_compile ${objfiles} ${binfile} executable ${options}
 clean_restart ${testname}
-if ![runto_main] then {
+if {![runto_main]} {
     return
 }
 
@@ -291,7 +291,7 @@ proc finish_through { id funcs } {
 
 # Report PASS if VAL is equal to EXP, otherwise report FAIL, using MSG.
 proc pass_if_eq { val exp msg } {
-    if [string equal "$val" "$exp"] then {
+    if {[string equal "$val" "$exp"]} {
 	pass "$msg"
     } else {
 	fail "$msg"
@@ -304,7 +304,7 @@ proc pass_if_eq { val exp msg } {
 # for the same function.  If successful, then return the name of the
 # function we have stopped in.
 proc finish_if_ne { id func want funcs } {
-    if ![string equal "$func" "$want"] then {
+    if {![string equal "$func" "$want"]} {
 	set call "$func"
 	set want [lindex $funcs 0]
 	set func [finish_through "$id" [linsert $funcs 0 "$func"]]
diff --git a/gdb/testsuite/gdb.arch/pa-nullify.exp b/gdb/testsuite/gdb.arch/pa-nullify.exp
index bb00f57249b..2c30f06224b 100644
--- a/gdb/testsuite/gdb.arch/pa-nullify.exp
+++ b/gdb/testsuite/gdb.arch/pa-nullify.exp
@@ -88,7 +88,7 @@ proc get_addr_of_sym { sym } {
   return $addr
 }
 
-if  ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 
@@ -124,7 +124,7 @@ proc test_core_bt { test } {
 }
 
 set test "core at last insn in foo"
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 gdb_breakpoint "*$foo_last"
@@ -134,7 +134,7 @@ if [gen_core $test] {
 }
 
 set test "core at nullified insn"
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 gdb_breakpoint "*$foo_last"
diff --git a/gdb/testsuite/gdb.arch/powerpc-addpcis.exp b/gdb/testsuite/gdb.arch/powerpc-addpcis.exp
index 12b2141cdb0..e7eecf4ffa5 100644
--- a/gdb/testsuite/gdb.arch/powerpc-addpcis.exp
+++ b/gdb/testsuite/gdb.arch/powerpc-addpcis.exp
@@ -38,7 +38,7 @@ if { [prepare_for_testing "failed to prepare" $testfile "$srcfile" \
     return -1
 }
 
-if ![runto_main] then {
+if {![runto_main]} {
       return
 }
 
diff --git a/gdb/testsuite/gdb.arch/powerpc-aix-prologue.exp b/gdb/testsuite/gdb.arch/powerpc-aix-prologue.exp
index a85891bab9f..bd959bb056b 100644
--- a/gdb/testsuite/gdb.arch/powerpc-aix-prologue.exp
+++ b/gdb/testsuite/gdb.arch/powerpc-aix-prologue.exp
@@ -18,7 +18,7 @@
 # Test rs6000 prologue analyzer.
 
 
-if ![istarget "powerpc-*-aix*"] then {
+if {![istarget "powerpc-*-aix*"]} {
     verbose "Skipping powerpc-aix prologue tests."
     return
 }
@@ -62,7 +62,7 @@ proc insert_breakpoint {function expected_location} {
     # instruction at that address (we're not interested in the insn
     # itself, but rather at the address printed at the begining of
     # the instruction).
-    if { $address != "" } then {
+    if {$address != ""} {
        gdb_test "x /i $address" \
                 ".*<$function\\+$expected_location>.*" \
                 "check $function breakpoint address"
diff --git a/gdb/testsuite/gdb.arch/powerpc-altivec.exp b/gdb/testsuite/gdb.arch/powerpc-altivec.exp
index 93c6d8cd960..20f4d07ce19 100644
--- a/gdb/testsuite/gdb.arch/powerpc-altivec.exp
+++ b/gdb/testsuite/gdb.arch/powerpc-altivec.exp
@@ -20,7 +20,7 @@
 standard_testfile .s
 set objfile [standard_output_file ${testfile}.o]
 
-if {![istarget "powerpc*-*-*"]} then {
+if {![istarget "powerpc*-*-*"]} {
     verbose "Skipping PowerPC instructions disassembly."
     return
 }
diff --git a/gdb/testsuite/gdb.arch/powerpc-altivec2.exp b/gdb/testsuite/gdb.arch/powerpc-altivec2.exp
index 7efc4fb750d..05edfbd8573 100644
--- a/gdb/testsuite/gdb.arch/powerpc-altivec2.exp
+++ b/gdb/testsuite/gdb.arch/powerpc-altivec2.exp
@@ -20,7 +20,7 @@
 standard_testfile .s
 set objfile [standard_output_file ${testfile}.o]
 
-if {![istarget "powerpc*-*-*"]} then {
+if {![istarget "powerpc*-*-*"]} {
     verbose "Skipping PowerPC instructions disassembly."
     return
 }
diff --git a/gdb/testsuite/gdb.arch/powerpc-altivec3.exp b/gdb/testsuite/gdb.arch/powerpc-altivec3.exp
index a2d481b0c2f..dc36c5fc456 100644
--- a/gdb/testsuite/gdb.arch/powerpc-altivec3.exp
+++ b/gdb/testsuite/gdb.arch/powerpc-altivec3.exp
@@ -20,7 +20,7 @@
 standard_testfile .s
 set objfile [standard_output_file ${testfile}.o]
 
-if {![istarget "powerpc*-*-*"]} then {
+if {![istarget "powerpc*-*-*"]} {
     verbose "Skipping PowerPC instructions disassembly."
     return
 }
diff --git a/gdb/testsuite/gdb.arch/powerpc-d128-regs.exp b/gdb/testsuite/gdb.arch/powerpc-d128-regs.exp
index 6e7bb675c8d..5c2c556d113 100644
--- a/gdb/testsuite/gdb.arch/powerpc-d128-regs.exp
+++ b/gdb/testsuite/gdb.arch/powerpc-d128-regs.exp
@@ -20,7 +20,7 @@
 
 # Testcase for ppc decimal128 pseudo-registers.
 
-if ![istarget "powerpc64*-*"] then {
+if {![istarget "powerpc64*-*"]} {
     verbose "Skipping powerpc Decimal128 pseudo-registers testcase."
     return
 }
@@ -39,7 +39,7 @@ gdb_start
 gdb_reinitialize_dir $srcdir/$subdir
 gdb_load ${binfile}
 
-if { ![runto_main] } then {
+if {![runto_main]} {
    return
 }
 
diff --git a/gdb/testsuite/gdb.arch/powerpc-disassembler-options.exp b/gdb/testsuite/gdb.arch/powerpc-disassembler-options.exp
index beea9cff247..3c096b012b9 100644
--- a/gdb/testsuite/gdb.arch/powerpc-disassembler-options.exp
+++ b/gdb/testsuite/gdb.arch/powerpc-disassembler-options.exp
@@ -18,7 +18,7 @@
 # This test exercises set/show disassembler-options results are preserved
 # across multiple set architecture calls.
 
-if {![istarget "powerpc*-*-*"]} then {
+if {![istarget "powerpc*-*-*"]} {
     verbose "Skipping PowerPC disassembler options."
     return
 }
diff --git a/gdb/testsuite/gdb.arch/powerpc-fpscr-gcore.exp b/gdb/testsuite/gdb.arch/powerpc-fpscr-gcore.exp
index 4703bc65adb..30032ee5f8c 100644
--- a/gdb/testsuite/gdb.arch/powerpc-fpscr-gcore.exp
+++ b/gdb/testsuite/gdb.arch/powerpc-fpscr-gcore.exp
@@ -18,7 +18,7 @@
 # This tests checks that generating and loading a core file preserves
 # the correct FPSCR size.
 
-if {![istarget "powerpc*-*-linux*"]} then {
+if {![istarget "powerpc*-*-linux*"]} {
     verbose "Skipping PowerPC test for corefiles with FPSCR."
     return
 }
@@ -39,7 +39,7 @@ if {[build_executable "compile" $binfile $gen_src] == -1} {
 
 clean_restart $binfile
 
-if ![runto_main] then {
+if {![runto_main]} {
     return -1
 }
 
diff --git a/gdb/testsuite/gdb.arch/powerpc-htm-regs.exp b/gdb/testsuite/gdb.arch/powerpc-htm-regs.exp
index ff49e1dd83a..236e88065e2 100644
--- a/gdb/testsuite/gdb.arch/powerpc-htm-regs.exp
+++ b/gdb/testsuite/gdb.arch/powerpc-htm-regs.exp
@@ -25,7 +25,7 @@
 # registers are then checked against the saved values, because the
 # abort should have reverted the registers to these values.
 
-if {![istarget "powerpc*-*-linux*"]} then {
+if {![istarget "powerpc*-*-linux*"]} {
     verbose "Skipping PowerPC test for HTM registers."
     return
 }
diff --git a/gdb/testsuite/gdb.arch/powerpc-lnia.exp b/gdb/testsuite/gdb.arch/powerpc-lnia.exp
index e680a531d5f..f2beca1f15d 100644
--- a/gdb/testsuite/gdb.arch/powerpc-lnia.exp
+++ b/gdb/testsuite/gdb.arch/powerpc-lnia.exp
@@ -37,7 +37,7 @@ if { [prepare_for_testing "failed to prepare" $testfile "$srcfile" \
     return -1
 }
 
-if ![runto_main] then {
+if {![runto_main]} {
       return
 }
 
diff --git a/gdb/testsuite/gdb.arch/powerpc-plxv-nonrel.exp b/gdb/testsuite/gdb.arch/powerpc-plxv-nonrel.exp
index 8a79e810fbd..d5a1671a9e4 100644
--- a/gdb/testsuite/gdb.arch/powerpc-plxv-nonrel.exp
+++ b/gdb/testsuite/gdb.arch/powerpc-plxv-nonrel.exp
@@ -33,7 +33,7 @@ if { [prepare_for_testing "failed to prepare" $testfile "$srcfile" \
 gdb_test "set radix 0b10000"
 gdb_test "set debug displaced"
 
-if ![runto_main] then {
+if {![runto_main]} {
       return
 }
 
diff --git a/gdb/testsuite/gdb.arch/powerpc-power10.exp b/gdb/testsuite/gdb.arch/powerpc-power10.exp
index b9383d8bd2a..10cd3942bbf 100644
--- a/gdb/testsuite/gdb.arch/powerpc-power10.exp
+++ b/gdb/testsuite/gdb.arch/powerpc-power10.exp
@@ -20,7 +20,7 @@
 standard_testfile .s
 set objfile [standard_output_file ${testfile}.o]
 
-if {![istarget "powerpc*-*-*"]} then {
+if {![istarget "powerpc*-*-*"]} {
     verbose "Skipping PowerPC instructions disassembly."
     return
 }
diff --git a/gdb/testsuite/gdb.arch/powerpc-power7.exp b/gdb/testsuite/gdb.arch/powerpc-power7.exp
index 10f7eebefc9..3e4b51a89cf 100644
--- a/gdb/testsuite/gdb.arch/powerpc-power7.exp
+++ b/gdb/testsuite/gdb.arch/powerpc-power7.exp
@@ -20,7 +20,7 @@
 standard_testfile .s
 set objfile [standard_output_file ${testfile}.o]
 
-if {![istarget "powerpc*-*-*"]} then {
+if {![istarget "powerpc*-*-*"]} {
     verbose "Skipping PowerPC instructions disassembly."
     return
 }
diff --git a/gdb/testsuite/gdb.arch/powerpc-power8.exp b/gdb/testsuite/gdb.arch/powerpc-power8.exp
index cb0b3eb5233..7cb6ca1a126 100644
--- a/gdb/testsuite/gdb.arch/powerpc-power8.exp
+++ b/gdb/testsuite/gdb.arch/powerpc-power8.exp
@@ -20,7 +20,7 @@
 standard_testfile .s
 set objfile [standard_output_file ${testfile}.o]
 
-if {![istarget "powerpc*-*-*"]} then {
+if {![istarget "powerpc*-*-*"]} {
     verbose "Skipping PowerPC instructions disassembly."
     return
 }
diff --git a/gdb/testsuite/gdb.arch/powerpc-power9.exp b/gdb/testsuite/gdb.arch/powerpc-power9.exp
index b43cd3baf37..1a44e5520c9 100644
--- a/gdb/testsuite/gdb.arch/powerpc-power9.exp
+++ b/gdb/testsuite/gdb.arch/powerpc-power9.exp
@@ -20,7 +20,7 @@
 standard_testfile .s
 set objfile [standard_output_file ${testfile}.o]
 
-if {![istarget "powerpc*-*-*"]} then {
+if {![istarget "powerpc*-*-*"]} {
     verbose "Skipping PowerPC instructions disassembly."
     return
 }
diff --git a/gdb/testsuite/gdb.arch/powerpc-ppr-dscr.exp b/gdb/testsuite/gdb.arch/powerpc-ppr-dscr.exp
index a2d5a171f48..5d4581b3550 100644
--- a/gdb/testsuite/gdb.arch/powerpc-ppr-dscr.exp
+++ b/gdb/testsuite/gdb.arch/powerpc-ppr-dscr.exp
@@ -20,7 +20,7 @@
 # values, then write to the registers trough GDB, step once, and check
 # again if we read back the same values.
 
-if {![istarget "powerpc*-*-linux*"]} then {
+if {![istarget "powerpc*-*-linux*"]} {
     verbose "Skipping PowerPC test for PPR and DSCR registers."
     return
 }
diff --git a/gdb/testsuite/gdb.arch/powerpc-prologue.exp b/gdb/testsuite/gdb.arch/powerpc-prologue.exp
index b31c046c5f7..1403fa318ea 100644
--- a/gdb/testsuite/gdb.arch/powerpc-prologue.exp
+++ b/gdb/testsuite/gdb.arch/powerpc-prologue.exp
@@ -17,7 +17,7 @@
 
 # Do not run on AIX (where we won't be able to build the tests without
 # some surgery) or on PowerPC64 (ditto, dot symbols).
-if {[istarget *-*-aix*] || ![istarget "powerpc-*-*"]} then {
+if {[istarget *-*-aix*] || ![istarget "powerpc-*-*"]} {
     verbose "Skipping PowerPC prologue tests."
     return
 }
@@ -43,7 +43,7 @@ gdb_load ${binfile}
 # Run to `main' where we begin our tests.
 #
 
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 
diff --git a/gdb/testsuite/gdb.arch/powerpc-stackless.exp b/gdb/testsuite/gdb.arch/powerpc-stackless.exp
index 2323929e9a3..4fcb76419fc 100644
--- a/gdb/testsuite/gdb.arch/powerpc-stackless.exp
+++ b/gdb/testsuite/gdb.arch/powerpc-stackless.exp
@@ -15,7 +15,7 @@
 
 # Testcase for PR tdep/17379.
 
-if {![istarget "powerpc*-*-*"]} then {
+if {![istarget "powerpc*-*-*"]} {
     verbose "Skipping powerpc-stackless.exp"
     return
 }
diff --git a/gdb/testsuite/gdb.arch/powerpc-tar.exp b/gdb/testsuite/gdb.arch/powerpc-tar.exp
index 7b6d186050b..6d82a2a23df 100644
--- a/gdb/testsuite/gdb.arch/powerpc-tar.exp
+++ b/gdb/testsuite/gdb.arch/powerpc-tar.exp
@@ -22,7 +22,7 @@
 # branch to TAR and check that we stop at the address that we wrote to
 # register.
 
-if {![istarget "powerpc*-*-linux*"]} then {
+if {![istarget "powerpc*-*-linux*"]} {
     verbose "Skipping PowerPC test for the TAR register."
     return
 }
diff --git a/gdb/testsuite/gdb.arch/powerpc-vsx-gcore.exp b/gdb/testsuite/gdb.arch/powerpc-vsx-gcore.exp
index b65db282d38..076a99afd8c 100644
--- a/gdb/testsuite/gdb.arch/powerpc-vsx-gcore.exp
+++ b/gdb/testsuite/gdb.arch/powerpc-vsx-gcore.exp
@@ -18,7 +18,7 @@
 # This test checks that generating and loading a core file preserves
 # the correct VSX register state.
 
-if {![istarget "powerpc*-*-linux*"] || [skip_vsx_tests]} then {
+if {![istarget "powerpc*-*-linux*"] || [skip_vsx_tests]} {
     verbose "Skipping PowerPC test for corefiles with VSX registers."
     return
 }
@@ -39,7 +39,7 @@ if {[build_executable "compile" $binfile $gen_src] == -1} {
 
 clean_restart $binfile
 
-if ![runto_main] then {
+if {![runto_main]} {
     return -1
 }
 
diff --git a/gdb/testsuite/gdb.arch/powerpc-vsx.exp b/gdb/testsuite/gdb.arch/powerpc-vsx.exp
index c4e13c154f0..2cb891b65d6 100644
--- a/gdb/testsuite/gdb.arch/powerpc-vsx.exp
+++ b/gdb/testsuite/gdb.arch/powerpc-vsx.exp
@@ -20,7 +20,7 @@
 standard_testfile .s
 set objfile [standard_output_file ${testfile}.o]
 
-if {![istarget "powerpc*-*-*"]} then {
+if {![istarget "powerpc*-*-*"]} {
     verbose "Skipping PowerPC instructions disassembly."
     return
 }
diff --git a/gdb/testsuite/gdb.arch/powerpc-vsx2.exp b/gdb/testsuite/gdb.arch/powerpc-vsx2.exp
index 05e4e98aee1..3181fda91d5 100644
--- a/gdb/testsuite/gdb.arch/powerpc-vsx2.exp
+++ b/gdb/testsuite/gdb.arch/powerpc-vsx2.exp
@@ -20,7 +20,7 @@
 standard_testfile .s
 set objfile [standard_output_file ${testfile}.o]
 
-if {![istarget "powerpc*-*-*"]} then {
+if {![istarget "powerpc*-*-*"]} {
     verbose "Skipping PowerPC instructions disassembly."
     return
 }
diff --git a/gdb/testsuite/gdb.arch/powerpc-vsx3.exp b/gdb/testsuite/gdb.arch/powerpc-vsx3.exp
index ad9f5b76e68..27ad96f37d0 100644
--- a/gdb/testsuite/gdb.arch/powerpc-vsx3.exp
+++ b/gdb/testsuite/gdb.arch/powerpc-vsx3.exp
@@ -20,7 +20,7 @@
 standard_testfile .s
 set objfile [standard_output_file ${testfile}.o]
 
-if {![istarget "powerpc*-*-*"]} then {
+if {![istarget "powerpc*-*-*"]} {
     verbose "Skipping PowerPC instructions disassembly."
     return
 }
diff --git a/gdb/testsuite/gdb.arch/powerpc64-prologue.exp b/gdb/testsuite/gdb.arch/powerpc64-prologue.exp
index 30ae74ed54f..ea2339252bb 100644
--- a/gdb/testsuite/gdb.arch/powerpc64-prologue.exp
+++ b/gdb/testsuite/gdb.arch/powerpc64-prologue.exp
@@ -17,7 +17,7 @@
 
 # Do not run on AIX (where we won't be able to build the tests without
 # some surgery) or on PowerPC64 (ditto, dot symbols).
-if {[istarget *-*-aix*] || ![istarget "powerpc*-*-*"]} then {
+if {[istarget *-*-aix*] || ![istarget "powerpc*-*-*"]} {
     verbose "Skipping PowerPC prologue tests."
     return
 }
@@ -37,7 +37,7 @@ if { [prepare_for_testing "failed to prepare" $testfile "$srcfile" \
 }
 
 # Run to `main' where we begin our tests.
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 
diff --git a/gdb/testsuite/gdb.arch/ppc-dfp.exp b/gdb/testsuite/gdb.arch/ppc-dfp.exp
index ecaf2499a0f..29eb7a31cb2 100644
--- a/gdb/testsuite/gdb.arch/ppc-dfp.exp
+++ b/gdb/testsuite/gdb.arch/ppc-dfp.exp
@@ -16,7 +16,7 @@
 
 # Tests for Powerpc Decimal Floating Point registers setting and fetching
 
-if ![istarget "powerpc*"] then {
+if {![istarget "powerpc*"]} {
     verbose "Skipping powerpc decimal floating point register tests."
     return
 }
diff --git a/gdb/testsuite/gdb.arch/ppc-fp.exp b/gdb/testsuite/gdb.arch/ppc-fp.exp
index bf1a1c59082..f5e7d64e4d0 100644
--- a/gdb/testsuite/gdb.arch/ppc-fp.exp
+++ b/gdb/testsuite/gdb.arch/ppc-fp.exp
@@ -16,7 +16,7 @@
 
 # Tests for Powerpc floating point register setting and fetching
 
-if ![istarget "powerpc*"] then {
+if {![istarget "powerpc*"]} {
     verbose "Skipping powerpc floating point register tests."
     return
 }
diff --git a/gdb/testsuite/gdb.arch/ppc-longdouble.exp b/gdb/testsuite/gdb.arch/ppc-longdouble.exp
index 44f23d39381..76573fbbd51 100644
--- a/gdb/testsuite/gdb.arch/ppc-longdouble.exp
+++ b/gdb/testsuite/gdb.arch/ppc-longdouble.exp
@@ -13,7 +13,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if ![istarget "powerpc*"] then {
+if {![istarget "powerpc*"]} {
     verbose "Skipping powerpc long-double floating point tests."
     return
 }
@@ -27,13 +27,13 @@ proc do_test { name {opts {}} } {
     set lines [gdb_compile "${srcdir}/${subdir}/${srcfile}" "$binfile.$name" executable $ccopts]
     # We get this warning even with the nowarnings option ...
     regsub -all "(^|\n)\[^\n\]*using \[^\n\]* extended precision long double" $lines "" lines
-    if { $lines != "" } then {
+    if {$lines != ""} {
         return
     }
 
     clean_restart ${binfile}.${name}
 
-    if ![runto_main] then {
+    if {![runto_main]} {
         return
     }
 
diff --git a/gdb/testsuite/gdb.arch/ppc64-atomic-inst.exp b/gdb/testsuite/gdb.arch/ppc64-atomic-inst.exp
index 4fc9f9e2475..919b1a9a549 100644
--- a/gdb/testsuite/gdb.arch/ppc64-atomic-inst.exp
+++ b/gdb/testsuite/gdb.arch/ppc64-atomic-inst.exp
@@ -36,7 +36,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {debug quie
 proc do_test { displaced } {
     global decimal hex
 
-    if ![runto_main] then {
+    if {![runto_main]} {
 	return -1
     }
 
diff --git a/gdb/testsuite/gdb.arch/ppc64-break-on-_exit.exp b/gdb/testsuite/gdb.arch/ppc64-break-on-_exit.exp
index 4d1da73d7dd..c22bbf7f887 100644
--- a/gdb/testsuite/gdb.arch/ppc64-break-on-_exit.exp
+++ b/gdb/testsuite/gdb.arch/ppc64-break-on-_exit.exp
@@ -45,7 +45,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} \
     return -1
 }
 
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 
diff --git a/gdb/testsuite/gdb.arch/ppc64-isa207-atomic-inst.exp b/gdb/testsuite/gdb.arch/ppc64-isa207-atomic-inst.exp
index 0f7ecd08e27..4316505c4dc 100644
--- a/gdb/testsuite/gdb.arch/ppc64-isa207-atomic-inst.exp
+++ b/gdb/testsuite/gdb.arch/ppc64-isa207-atomic-inst.exp
@@ -40,7 +40,7 @@ proc do_test { displaced } {
     global decimal hex
     global gdb_prompt inferior_exited_re srcfile srcfile2
 
-    if ![runto_main] then {
+    if {![runto_main]} {
 	return -1
     }
 
diff --git a/gdb/testsuite/gdb.arch/pr25124.exp b/gdb/testsuite/gdb.arch/pr25124.exp
index e4bbea22373..a68a3d1b7df 100644
--- a/gdb/testsuite/gdb.arch/pr25124.exp
+++ b/gdb/testsuite/gdb.arch/pr25124.exp
@@ -16,7 +16,7 @@
 # Test proper disassembling of ARM thumb instructions when reloading a symbol
 # file.
 
-if {![is_aarch32_target]} then {
+if {![is_aarch32_target]} {
     verbose "Skipping ARM tests."
     return
 }
diff --git a/gdb/testsuite/gdb.arch/riscv-bp-infcall.exp b/gdb/testsuite/gdb.arch/riscv-bp-infcall.exp
index 6506f62fb1e..511e327226d 100644
--- a/gdb/testsuite/gdb.arch/riscv-bp-infcall.exp
+++ b/gdb/testsuite/gdb.arch/riscv-bp-infcall.exp
@@ -27,7 +27,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
     return -1
 }
 
-if ![runto_main] then {
+if {![runto_main]} {
    return 0
 }
 
diff --git a/gdb/testsuite/gdb.arch/riscv-info-fcsr.exp b/gdb/testsuite/gdb.arch/riscv-info-fcsr.exp
index bf319650db3..0bc5009fac3 100644
--- a/gdb/testsuite/gdb.arch/riscv-info-fcsr.exp
+++ b/gdb/testsuite/gdb.arch/riscv-info-fcsr.exp
@@ -32,7 +32,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
     return -1
 }
 
-if ![runto_main] then {
+if {![runto_main]} {
    return 0
 }
 
diff --git a/gdb/testsuite/gdb.arch/riscv-reg-aliases.exp b/gdb/testsuite/gdb.arch/riscv-reg-aliases.exp
index 4c188b78b1f..8ee237a7411 100644
--- a/gdb/testsuite/gdb.arch/riscv-reg-aliases.exp
+++ b/gdb/testsuite/gdb.arch/riscv-reg-aliases.exp
@@ -24,7 +24,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
     return -1
 }
 
-if ![runto_main] then {
+if {![runto_main]} {
    return 0
 }
 
diff --git a/gdb/testsuite/gdb.arch/riscv-unwind-long-insn.exp b/gdb/testsuite/gdb.arch/riscv-unwind-long-insn.exp
index 385e16b575f..6d750b5e3a9 100644
--- a/gdb/testsuite/gdb.arch/riscv-unwind-long-insn.exp
+++ b/gdb/testsuite/gdb.arch/riscv-unwind-long-insn.exp
@@ -39,7 +39,7 @@ foreach_with_prefix {insn_size} {6 8} {
 	return -1
     }
 
-    if ![runto_main] then {
+    if {![runto_main]} {
 	return 0
     }
 
diff --git a/gdb/testsuite/gdb.arch/riscv64-unwind-prologue-with-ld-lw.exp b/gdb/testsuite/gdb.arch/riscv64-unwind-prologue-with-ld-lw.exp
index 04466e7184e..f07c04c71a6 100644
--- a/gdb/testsuite/gdb.arch/riscv64-unwind-prologue-with-ld-lw.exp
+++ b/gdb/testsuite/gdb.arch/riscv64-unwind-prologue-with-ld-lw.exp
@@ -28,7 +28,7 @@ if {[prepare_for_testing "failed to prepare" $testfile \
     return -1
 }
 
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 
diff --git a/gdb/testsuite/gdb.arch/riscv64-unwind-prologue-with-mv.exp b/gdb/testsuite/gdb.arch/riscv64-unwind-prologue-with-mv.exp
index c90bebb3f49..212affb1f6d 100644
--- a/gdb/testsuite/gdb.arch/riscv64-unwind-prologue-with-mv.exp
+++ b/gdb/testsuite/gdb.arch/riscv64-unwind-prologue-with-mv.exp
@@ -27,7 +27,7 @@ if {[prepare_for_testing "failed to prepare" $testfile \
     return -1
 }
 
-if ![runto_main] then {
+if {![runto_main]} {
     fail "can't run to main"
     return 0
 }
diff --git a/gdb/testsuite/gdb.arch/s390-disassembler-options.exp b/gdb/testsuite/gdb.arch/s390-disassembler-options.exp
index e27808abeaf..7ba9e51cc3c 100644
--- a/gdb/testsuite/gdb.arch/s390-disassembler-options.exp
+++ b/gdb/testsuite/gdb.arch/s390-disassembler-options.exp
@@ -18,7 +18,7 @@
 # This test exercises set/show disassembler-options results are preserved
 # across multiple set architecture calls.
 
-if {![istarget "s390*-*-*"]} then {
+if {![istarget "s390*-*-*"]} {
     verbose "Skipping S390 disassembler options."
     return
 }
diff --git a/gdb/testsuite/gdb.arch/s390-stackless.exp b/gdb/testsuite/gdb.arch/s390-stackless.exp
index aeaf3235ad6..41354832775 100644
--- a/gdb/testsuite/gdb.arch/s390-stackless.exp
+++ b/gdb/testsuite/gdb.arch/s390-stackless.exp
@@ -13,7 +13,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if {![istarget "s390*-*-*"]} then {
+if {![istarget "s390*-*-*"]} {
     verbose "Skipping s390 stackless test."
     return
 }
diff --git a/gdb/testsuite/gdb.arch/s390-tdbregs.exp b/gdb/testsuite/gdb.arch/s390-tdbregs.exp
index 35690103e09..6bbccb60833 100644
--- a/gdb/testsuite/gdb.arch/s390-tdbregs.exp
+++ b/gdb/testsuite/gdb.arch/s390-tdbregs.exp
@@ -35,7 +35,7 @@ if { [prepare_for_testing "failed to prepare" $testfile $srcfile \
     return -1
 }
 
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 
diff --git a/gdb/testsuite/gdb.arch/sparc-sysstep.exp b/gdb/testsuite/gdb.arch/sparc-sysstep.exp
index c88abaa82c8..124811ca7ea 100644
--- a/gdb/testsuite/gdb.arch/sparc-sysstep.exp
+++ b/gdb/testsuite/gdb.arch/sparc-sysstep.exp
@@ -21,7 +21,7 @@
 # PC must be extracted from the sigreturn register save area in the
 # stack.
 
-if ![istarget "sparc*-*-linux*"] then {
+if {![istarget "sparc*-*-linux*"]} {
     return 0
 }
 
diff --git a/gdb/testsuite/gdb.arch/sparc64-adi.exp b/gdb/testsuite/gdb.arch/sparc64-adi.exp
index ba1bce884c6..d0934564956 100644
--- a/gdb/testsuite/gdb.arch/sparc64-adi.exp
+++ b/gdb/testsuite/gdb.arch/sparc64-adi.exp
@@ -18,7 +18,7 @@
 # Basic tests of examining/assigning ADI version tags, and reporting 
 # precise mismatch.
 
-if ![istarget "sparc64*-*-linux*"] then {
+if {![istarget "sparc64*-*-linux*"]} {
     verbose "Skipping sparc64 ADI test."
     return 0
 }
@@ -30,7 +30,7 @@ if { [prepare_for_testing "failed to prepare" $testfile $srcfile \
     return -1
 }
 
-if ![runto_main] then {
+if {![runto_main]} {
     return -1
 }
 
diff --git a/gdb/testsuite/gdb.arch/sparc64-regs.exp b/gdb/testsuite/gdb.arch/sparc64-regs.exp
index a617254863a..3c786db7c60 100644
--- a/gdb/testsuite/gdb.arch/sparc64-regs.exp
+++ b/gdb/testsuite/gdb.arch/sparc64-regs.exp
@@ -18,7 +18,7 @@
 # Tests decoding of various sparc64 registers.
 # At the moment, only few registers are tested, but more can be added in future.
 
-if ![istarget "sparc64*-*-linux*"] then {
+if {![istarget "sparc64*-*-linux*"]} {
     verbose "Skipping sparc64 register tests."
     return 0
 }
@@ -29,7 +29,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
     return -1
 }
 
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 
diff --git a/gdb/testsuite/gdb.arch/thumb-bx-pc.exp b/gdb/testsuite/gdb.arch/thumb-bx-pc.exp
index ac62efa830c..ccc6fbfdca7 100644
--- a/gdb/testsuite/gdb.arch/thumb-bx-pc.exp
+++ b/gdb/testsuite/gdb.arch/thumb-bx-pc.exp
@@ -15,7 +15,7 @@
 
 # Test PC adjustment from Thumb-mode "bx pc" instruction.
 
-if {![is_aarch32_target]} then {
+if {![is_aarch32_target]} {
     verbose "Skipping ARM tests."
     return
 }
@@ -28,7 +28,7 @@ if [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} $opts] {
     return -1
 }
 
-if ![runto_main] then {
+if {![runto_main]} {
     return -1
 }
 
diff --git a/gdb/testsuite/gdb.arch/thumb-prologue.exp b/gdb/testsuite/gdb.arch/thumb-prologue.exp
index 0d3e6b01bd7..0cb14572345 100644
--- a/gdb/testsuite/gdb.arch/thumb-prologue.exp
+++ b/gdb/testsuite/gdb.arch/thumb-prologue.exp
@@ -15,7 +15,7 @@
 
 # Test ARM/Thumb prologue analyzer.
 
-if {![is_aarch32_target]} then {
+if {![is_aarch32_target]} {
     verbose "Skipping ARM prologue tests."
     return
 }
@@ -39,7 +39,7 @@ gdb_load ${binfile}
 # Run to `main' where we begin our tests.
 #
 
-if ![runto_main] then {
+if {![runto_main]} {
     return -1
 }
 
diff --git a/gdb/testsuite/gdb.arch/thumb-singlestep.exp b/gdb/testsuite/gdb.arch/thumb-singlestep.exp
index f31e428b421..289bdf52463 100644
--- a/gdb/testsuite/gdb.arch/thumb-singlestep.exp
+++ b/gdb/testsuite/gdb.arch/thumb-singlestep.exp
@@ -15,7 +15,7 @@
 
 # Test single-stepping into incorrectly marked Thumb routine
 
-if {![is_aarch32_target]} then {
+if {![is_aarch32_target]} {
     verbose "Skipping ARM tests."
     return
 }
@@ -28,7 +28,7 @@ if [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} [list debug $
     return -1
 }
 
-if ![runto_main] then {
+if {![runto_main]} {
     return -1
 }
 
diff --git a/gdb/testsuite/gdb.arch/thumb2-it.exp b/gdb/testsuite/gdb.arch/thumb2-it.exp
index 3892c90d8ea..0e1a2c2ea4e 100644
--- a/gdb/testsuite/gdb.arch/thumb2-it.exp
+++ b/gdb/testsuite/gdb.arch/thumb2-it.exp
@@ -15,7 +15,7 @@
 
 # Test single stepping over Thumb-2 IT blocks.
 
-if {![istarget arm*-*eabi*]} then {
+if {![istarget arm*-*eabi*]} {
     verbose "Skipping Thumb-2 tests."
     return
 }
@@ -32,7 +32,7 @@ gdb_start
 gdb_reinitialize_dir $srcdir/$subdir
 gdb_load ${binfile}
 
-if ![runto_main] then {
+if {![runto_main]} {
     return -1
 }
 
diff --git a/gdb/testsuite/gdb.arch/vsx-regs.exp b/gdb/testsuite/gdb.arch/vsx-regs.exp
index c288b2f7d6f..67890154f6a 100644
--- a/gdb/testsuite/gdb.arch/vsx-regs.exp
+++ b/gdb/testsuite/gdb.arch/vsx-regs.exp
@@ -19,7 +19,7 @@
 #
 
 
-if {![istarget "powerpc*"] || [skip_vsx_tests]} then {
+if {![istarget "powerpc*"] || [skip_vsx_tests]} {
     verbose "Skipping vsx register tests."
     return
 }
@@ -47,7 +47,7 @@ gdb_load ${binfile}
 
 # Run to `main' where we begin our tests.
 
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 
diff --git a/gdb/testsuite/gdb.arch/vsx-vsr-float28.exp b/gdb/testsuite/gdb.arch/vsx-vsr-float28.exp
index b5b2d584403..c2046977771 100644
--- a/gdb/testsuite/gdb.arch/vsx-vsr-float28.exp
+++ b/gdb/testsuite/gdb.arch/vsx-vsr-float28.exp
@@ -19,7 +19,7 @@
 #
 
 
-if {![istarget "powerpc*"] || [skip_vsx_tests]} then {
+if {![istarget "powerpc*"] || [skip_vsx_tests]} {
     verbose "Skipping vsr float128 field tests."
     return
 }
@@ -47,7 +47,7 @@ gdb_load ${binfile}
 
 # Run to `main' where we begin our tests.
 
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 
-- 
2.25.4


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH 05/14] gdb/testsuite: remove use of then keyword from gdb.cp/*.exp
  2022-11-15 10:42 [PATCH 00/14] Remove all uses of 'then' keyword from the testsuite Andrew Burgess
                   ` (3 preceding siblings ...)
  2022-11-15 10:42 ` [PATCH 04/14] gdb/testsuite: remove use of then keyword from gdb.arch/*.exp Andrew Burgess
@ 2022-11-15 10:42 ` Andrew Burgess
  2022-11-15 10:42 ` [PATCH 06/14] gdb/testsuite: remove use of then keyword from gdb.python/*.exp Andrew Burgess
                   ` (10 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: Andrew Burgess @ 2022-11-15 10:42 UTC (permalink / raw)
  To: gdb-patches; +Cc: Andrew Burgess

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

There should be no changes in what is tested after this commit.
---
 gdb/testsuite/gdb.cp/ambiguous.exp               |  2 +-
 gdb/testsuite/gdb.cp/anon-union.exp              |  2 +-
 gdb/testsuite/gdb.cp/breakpoint.exp              |  2 +-
 gdb/testsuite/gdb.cp/bs15503.exp                 |  2 +-
 gdb/testsuite/gdb.cp/casts.exp                   |  4 ++--
 gdb/testsuite/gdb.cp/class2.exp                  |  2 +-
 gdb/testsuite/gdb.cp/classes.exp                 |  2 +-
 gdb/testsuite/gdb.cp/converts.exp                |  2 +-
 gdb/testsuite/gdb.cp/ctti.exp                    |  4 ++--
 gdb/testsuite/gdb.cp/derivation.exp              |  2 +-
 gdb/testsuite/gdb.cp/disasm-func-name.exp        |  2 +-
 gdb/testsuite/gdb.cp/dispcxx.exp                 |  2 +-
 gdb/testsuite/gdb.cp/ena-dis-br-range.exp        |  2 +-
 gdb/testsuite/gdb.cp/filename.exp                |  2 +-
 gdb/testsuite/gdb.cp/fpointer.exp                |  2 +-
 gdb/testsuite/gdb.cp/gdb1355.exp                 |  2 +-
 gdb/testsuite/gdb.cp/gdb2384.exp                 |  2 +-
 gdb/testsuite/gdb.cp/gdb2495.exp                 |  4 ++--
 gdb/testsuite/gdb.cp/inherit.exp                 |  4 ++--
 gdb/testsuite/gdb.cp/koenig.exp                  |  2 +-
 gdb/testsuite/gdb.cp/local-static.exp            |  2 +-
 gdb/testsuite/gdb.cp/local.exp                   |  4 ++--
 gdb/testsuite/gdb.cp/m-data.exp                  |  2 +-
 gdb/testsuite/gdb.cp/m-static.exp                |  2 +-
 gdb/testsuite/gdb.cp/mb-ctor.exp                 |  2 +-
 gdb/testsuite/gdb.cp/member-name.exp             |  2 +-
 gdb/testsuite/gdb.cp/member-ptr.exp              |  2 +-
 gdb/testsuite/gdb.cp/method-call-in-c.exp        |  2 +-
 gdb/testsuite/gdb.cp/method.exp                  |  2 +-
 gdb/testsuite/gdb.cp/namespace-nested-import.exp |  2 +-
 gdb/testsuite/gdb.cp/namespace.exp               |  6 +++---
 gdb/testsuite/gdb.cp/nextoverthrow.exp           |  2 +-
 gdb/testsuite/gdb.cp/nsdecl.exp                  |  2 +-
 gdb/testsuite/gdb.cp/nsimport.exp                |  2 +-
 gdb/testsuite/gdb.cp/nsnested.exp                |  2 +-
 gdb/testsuite/gdb.cp/nsnoimports.exp             |  2 +-
 gdb/testsuite/gdb.cp/nsrecurs.exp                |  2 +-
 gdb/testsuite/gdb.cp/nsstress.exp                |  2 +-
 gdb/testsuite/gdb.cp/nsusing.exp                 |  4 ++--
 gdb/testsuite/gdb.cp/operator.exp                |  2 +-
 gdb/testsuite/gdb.cp/oranking.exp                |  2 +-
 gdb/testsuite/gdb.cp/overload.exp                |  4 ++--
 gdb/testsuite/gdb.cp/pr-1023.exp                 |  2 +-
 gdb/testsuite/gdb.cp/pr-1210.exp                 |  2 +-
 gdb/testsuite/gdb.cp/pr-574.exp                  |  2 +-
 gdb/testsuite/gdb.cp/pr10687.exp                 |  2 +-
 gdb/testsuite/gdb.cp/pr10728.exp                 |  2 +-
 gdb/testsuite/gdb.cp/pr12028.exp                 |  2 +-
 gdb/testsuite/gdb.cp/pr9067.exp                  |  2 +-
 gdb/testsuite/gdb.cp/pr9167.exp                  |  2 +-
 gdb/testsuite/gdb.cp/pr9631.exp                  |  2 +-
 gdb/testsuite/gdb.cp/printmethod.exp             |  2 +-
 gdb/testsuite/gdb.cp/ptype-flags.exp             |  2 +-
 gdb/testsuite/gdb.cp/ref-types.exp               | 10 +++++-----
 gdb/testsuite/gdb.cp/rtti.exp                    |  2 +-
 gdb/testsuite/gdb.cp/rvalue-ref-types.exp        |  2 +-
 gdb/testsuite/gdb.cp/shadow.exp                  |  2 +-
 gdb/testsuite/gdb.cp/smartp.exp                  |  2 +-
 gdb/testsuite/gdb.cp/try_catch.exp               |  2 +-
 gdb/testsuite/gdb.cp/userdef.exp                 |  2 +-
 gdb/testsuite/gdb.cp/virtbase.exp                |  2 +-
 gdb/testsuite/gdb.cp/virtbase2.exp               |  2 +-
 gdb/testsuite/gdb.cp/virtfunc.exp                |  2 +-
 gdb/testsuite/gdb.cp/virtfunc2.exp               |  2 +-
 gdb/testsuite/gdb.cp/watch-cp.exp                |  2 +-
 gdb/testsuite/gdb.cp/wide_char_types.exp         |  2 +-
 66 files changed, 79 insertions(+), 79 deletions(-)

diff --git a/gdb/testsuite/gdb.cp/ambiguous.exp b/gdb/testsuite/gdb.cp/ambiguous.exp
index c6bc9a6df9f..0f04668cbab 100644
--- a/gdb/testsuite/gdb.cp/ambiguous.exp
+++ b/gdb/testsuite/gdb.cp/ambiguous.exp
@@ -36,7 +36,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile \
     return -1
 }
 
-if ![runto_main] then {
+if {![runto_main]} {
     perror "couldn't run to breakpoint"
     return
 }
diff --git a/gdb/testsuite/gdb.cp/anon-union.exp b/gdb/testsuite/gdb.cp/anon-union.exp
index e086bfb0f7e..9f18545bbf8 100644
--- a/gdb/testsuite/gdb.cp/anon-union.exp
+++ b/gdb/testsuite/gdb.cp/anon-union.exp
@@ -31,7 +31,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
     return -1
 }
 
-if ![runto_main] then {
+if {![runto_main]} {
     perror "couldn't run to breakpoint"
     continue
 }
diff --git a/gdb/testsuite/gdb.cp/breakpoint.exp b/gdb/testsuite/gdb.cp/breakpoint.exp
index 1a0f946a481..e1f2d4c5dc5 100644
--- a/gdb/testsuite/gdb.cp/breakpoint.exp
+++ b/gdb/testsuite/gdb.cp/breakpoint.exp
@@ -32,7 +32,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
 proc test_breakpoint {name} {
     # Restart the program every time, so that a single failure doesn't
     # lead to a cascade.
-    if ![runto_main] then {
+    if {![runto_main]} {
 	perror "couldn't run to main when testing ${name}"
 	return -code continue
     } else {
diff --git a/gdb/testsuite/gdb.cp/bs15503.exp b/gdb/testsuite/gdb.cp/bs15503.exp
index bf5e660a54d..f00421a6702 100644
--- a/gdb/testsuite/gdb.cp/bs15503.exp
+++ b/gdb/testsuite/gdb.cp/bs15503.exp
@@ -25,7 +25,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
     return -1
 }
 
-if ![runto_main] then {
+if {![runto_main]} {
     perror "couldn't run to breakpoint"
     return
 }
diff --git a/gdb/testsuite/gdb.cp/casts.exp b/gdb/testsuite/gdb.cp/casts.exp
index 0f6460bd255..43851d43aeb 100644
--- a/gdb/testsuite/gdb.cp/casts.exp
+++ b/gdb/testsuite/gdb.cp/casts.exp
@@ -33,7 +33,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
     return -1
 }
 
-if ![runto_main] then {
+if {![runto_main]} {
     perror "couldn't run to breakpoint"
     return
 }
@@ -181,7 +181,7 @@ if {[prepare_for_testing "failed to prepare" ${testfile}03 $srcfile2 \
     return -1
 }
 
-if ![runto_main] then {
+if {![runto_main]} {
     perror "couldn't run to breakpoint"
    return
 }
diff --git a/gdb/testsuite/gdb.cp/class2.exp b/gdb/testsuite/gdb.cp/class2.exp
index cc192b6de64..9392e259be4 100644
--- a/gdb/testsuite/gdb.cp/class2.exp
+++ b/gdb/testsuite/gdb.cp/class2.exp
@@ -34,7 +34,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile $flags]} {
 gdb_test_no_output "set print object off"
 gdb_test_no_output "set print symbol off"
 
-if ![runto_main] then {
+if {![runto_main]} {
     perror "couldn't run to main"
     return
 }
diff --git a/gdb/testsuite/gdb.cp/classes.exp b/gdb/testsuite/gdb.cp/classes.exp
index 9a947754bb6..beac2681749 100644
--- a/gdb/testsuite/gdb.cp/classes.exp
+++ b/gdb/testsuite/gdb.cp/classes.exp
@@ -651,7 +651,7 @@ proc do_tests {} {
     gdb_test_no_output "set language c++" ""
     gdb_test_no_output "set width 0" ""
 
-    if ![runto_main ] then {
+    if {![runto_main]} {
 	perror "couldn't run to breakpoint"
 	return
     }
diff --git a/gdb/testsuite/gdb.cp/converts.exp b/gdb/testsuite/gdb.cp/converts.exp
index e4357fc924e..ea7a2f45d2f 100644
--- a/gdb/testsuite/gdb.cp/converts.exp
+++ b/gdb/testsuite/gdb.cp/converts.exp
@@ -21,7 +21,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {debug c++}
 
 ############################################
 
-if ![runto_main] then {
+if {![runto_main]} {
     perror "couldn't run to breakpoint main"
     return
 }
diff --git a/gdb/testsuite/gdb.cp/ctti.exp b/gdb/testsuite/gdb.cp/ctti.exp
index 36b7d34c48b..4a2012e4a05 100644
--- a/gdb/testsuite/gdb.cp/ctti.exp
+++ b/gdb/testsuite/gdb.cp/ctti.exp
@@ -30,7 +30,7 @@ if {[prepare_for_testing "failed to prepare" $testfile \
     return -1
 }
 
-if ![runto_main] then {
+if {![runto_main]} {
     perror "couldn't run to breakpoint"
     return
 }
@@ -45,7 +45,7 @@ gdb_test "print i" "\\$\[0-9\]+ = 4"
 # TODO: this needs more work before actually deploying it.
 # So bail out here.
 
-if { [ test_compiler_info gcc-*] } then { return }
+if {[test_compiler_info gcc-*]} { return }
 
 gdb_test_multiple "print add<int>(2,2)" "print add<int>(2,2)" {
     -re "\\$\[0-9\]+ = 4\r\n$gdb_prompt $" {
diff --git a/gdb/testsuite/gdb.cp/derivation.exp b/gdb/testsuite/gdb.cp/derivation.exp
index f49ab208ac9..f5d20a00a3f 100644
--- a/gdb/testsuite/gdb.cp/derivation.exp
+++ b/gdb/testsuite/gdb.cp/derivation.exp
@@ -55,7 +55,7 @@ with_test_prefix "before run" {
 
 # Set it up at a breakpoint so we can play with the variable values.
 
-if ![runto 'marker1'] then {
+if {![runto 'marker1']} {
     perror "couldn't run to marker1"
     return
 }
diff --git a/gdb/testsuite/gdb.cp/disasm-func-name.exp b/gdb/testsuite/gdb.cp/disasm-func-name.exp
index 7d325fe567f..45f18abb4e6 100644
--- a/gdb/testsuite/gdb.cp/disasm-func-name.exp
+++ b/gdb/testsuite/gdb.cp/disasm-func-name.exp
@@ -27,7 +27,7 @@ if {[prepare_for_testing "failed to prepare" $testfile \
     return -1
 }
 
-if ![runto_main] then {
+if {![runto_main]} {
     perror "couldn't run to breakpoint"
     return
 }
diff --git a/gdb/testsuite/gdb.cp/dispcxx.exp b/gdb/testsuite/gdb.cp/dispcxx.exp
index f82e5889321..9d2e340083f 100644
--- a/gdb/testsuite/gdb.cp/dispcxx.exp
+++ b/gdb/testsuite/gdb.cp/dispcxx.exp
@@ -21,7 +21,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
     return -1
 }
 
-if ![runto_main] then {
+if {![runto_main]} {
     perror "couldn't run to main"
     return
 } 
diff --git a/gdb/testsuite/gdb.cp/ena-dis-br-range.exp b/gdb/testsuite/gdb.cp/ena-dis-br-range.exp
index 83c9838aa42..967d6b41c62 100644
--- a/gdb/testsuite/gdb.cp/ena-dis-br-range.exp
+++ b/gdb/testsuite/gdb.cp/ena-dis-br-range.exp
@@ -29,7 +29,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
     return -1
 }
 
-if ![runto 'marker'] then {
+if {![runto 'marker']} {
     return -1
 }
 
diff --git a/gdb/testsuite/gdb.cp/filename.exp b/gdb/testsuite/gdb.cp/filename.exp
index 113c84d1905..6d97ee51257 100644
--- a/gdb/testsuite/gdb.cp/filename.exp
+++ b/gdb/testsuite/gdb.cp/filename.exp
@@ -21,7 +21,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
     return -1
 }
 
-if ![runto_main] then {
+if {![runto_main]} {
     perror "couldn't run to main"
     return
 }
diff --git a/gdb/testsuite/gdb.cp/fpointer.exp b/gdb/testsuite/gdb.cp/fpointer.exp
index f2af2b94aca..5fc99055a2c 100644
--- a/gdb/testsuite/gdb.cp/fpointer.exp
+++ b/gdb/testsuite/gdb.cp/fpointer.exp
@@ -22,7 +22,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {debug c++}
      return -1
 }
 
-if ![runto_main] then {
+if {![runto_main]} {
     perror "couldn't run to breakpoint main"
     return
 }
diff --git a/gdb/testsuite/gdb.cp/gdb1355.exp b/gdb/testsuite/gdb.cp/gdb1355.exp
index ecbf88f4bb9..e18bcc18f17 100644
--- a/gdb/testsuite/gdb.cp/gdb1355.exp
+++ b/gdb/testsuite/gdb.cp/gdb1355.exp
@@ -33,7 +33,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
     return -1
 }
 
-if ![runto_main] then {
+if {![runto_main]} {
     perror "couldn't run to main"
     return
 } 
diff --git a/gdb/testsuite/gdb.cp/gdb2384.exp b/gdb/testsuite/gdb.cp/gdb2384.exp
index 4181ab48119..7fc5a5ba0f8 100644
--- a/gdb/testsuite/gdb.cp/gdb2384.exp
+++ b/gdb/testsuite/gdb.cp/gdb2384.exp
@@ -38,7 +38,7 @@ clean_restart ${binfile}
 gdb_load_shlib ${sofile}
 
 
-if ![runto_main] then {
+if {![runto_main]} {
     perror "couldn't run to breakpoint"
     return -1
 }
diff --git a/gdb/testsuite/gdb.cp/gdb2495.exp b/gdb/testsuite/gdb.cp/gdb2495.exp
index 1babf5e3322..6ade5d91d4e 100644
--- a/gdb/testsuite/gdb.cp/gdb2495.exp
+++ b/gdb/testsuite/gdb.cp/gdb2495.exp
@@ -51,7 +51,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
     return -1
 }
 
-if ![runto_main] then {
+if {![runto_main]} {
     perror "couldn't run to main"
     return
 }
@@ -96,7 +96,7 @@ gdb_test "p exceptions.throw_function()" \
     "call a function that raises an exception with unwinding off.."
 
 # Restart the inferior back at main.
-if ![runto_main] then {
+if {![runto_main]} {
     perror "couldn't run to main"
     return
 }
diff --git a/gdb/testsuite/gdb.cp/inherit.exp b/gdb/testsuite/gdb.cp/inherit.exp
index 5f8cdd9639b..c3cfefc803c 100644
--- a/gdb/testsuite/gdb.cp/inherit.exp
+++ b/gdb/testsuite/gdb.cp/inherit.exp
@@ -677,7 +677,7 @@ proc test_print_mvi_classes { } {
 proc do_tests { } {
     gdb_test_no_output "set width 0"
 
-    if { ![runto_main] } then {
+    if {![runto_main]} {
 	perror "couldn't run to main"
 	return
     }
@@ -688,7 +688,7 @@ proc do_tests { } {
     test_ptype_vi
     test_ptype_mvi
 
-    if { ![runto 'inheritance2'] } then {
+    if {![runto 'inheritance2']} {
 	perror "couldn't run to inheritance2"
 	return
     }
diff --git a/gdb/testsuite/gdb.cp/koenig.exp b/gdb/testsuite/gdb.cp/koenig.exp
index 5a846c0b8c2..912a7eaadc7 100644
--- a/gdb/testsuite/gdb.cp/koenig.exp
+++ b/gdb/testsuite/gdb.cp/koenig.exp
@@ -22,7 +22,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} \
 
 ############################################
 
-if ![runto_main] then {
+if {![runto_main]} {
     perror "couldn't run to breakpoint main"
     return
 }
diff --git a/gdb/testsuite/gdb.cp/local-static.exp b/gdb/testsuite/gdb.cp/local-static.exp
index 577eaa1b4d0..4cad95b4b2e 100644
--- a/gdb/testsuite/gdb.cp/local-static.exp
+++ b/gdb/testsuite/gdb.cp/local-static.exp
@@ -149,7 +149,7 @@ proc do_test {lang} {
 	return -1
     }
 
-    if ![runto_main] then {
+    if {![runto_main]} {
 	return
     }
 
diff --git a/gdb/testsuite/gdb.cp/local.exp b/gdb/testsuite/gdb.cp/local.exp
index 140147ff723..351f39f6365 100644
--- a/gdb/testsuite/gdb.cp/local.exp
+++ b/gdb/testsuite/gdb.cp/local.exp
@@ -38,12 +38,12 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
 #
 # set it up at a breakpoint so we can play with the variable values
 #
-if ![runto_main] then {
+if {![runto_main]} {
     perror "couldn't run to breakpoint"
     return
 }
 
-if ![runto 'marker1'] then {
+if {![runto 'marker1']} {
     perror "couldn't run to marker1"
     return
 }
diff --git a/gdb/testsuite/gdb.cp/m-data.exp b/gdb/testsuite/gdb.cp/m-data.exp
index f86e5fd0867..aca98c7c4c7 100644
--- a/gdb/testsuite/gdb.cp/m-data.exp
+++ b/gdb/testsuite/gdb.cp/m-data.exp
@@ -30,7 +30,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
     return -1
 }
 
-if ![runto_main] then {
+if {![runto_main]} {
     perror "couldn't run to breakpoint"
     return
 }
diff --git a/gdb/testsuite/gdb.cp/m-static.exp b/gdb/testsuite/gdb.cp/m-static.exp
index 1239dbc0f1d..228c120fb7b 100644
--- a/gdb/testsuite/gdb.cp/m-static.exp
+++ b/gdb/testsuite/gdb.cp/m-static.exp
@@ -38,7 +38,7 @@ if {[prepare_for_testing "failed to prepare" $testfile \
     return -1
 }
 
-if ![runto_main] then {
+if {![runto_main]} {
     perror "couldn't run to breakpoint"
     return
 }
diff --git a/gdb/testsuite/gdb.cp/mb-ctor.exp b/gdb/testsuite/gdb.cp/mb-ctor.exp
index 05dbf507e90..3bf5ee3ebad 100644
--- a/gdb/testsuite/gdb.cp/mb-ctor.exp
+++ b/gdb/testsuite/gdb.cp/mb-ctor.exp
@@ -31,7 +31,7 @@ if {[test_compiler_info {clang-*-*} c++]} {
     set using_clang false
 }
 
-if ![runto_main] then {
+if {![runto_main]} {
     perror "couldn't run to breakpoint"
     return
 }
diff --git a/gdb/testsuite/gdb.cp/member-name.exp b/gdb/testsuite/gdb.cp/member-name.exp
index 2daf872124c..7e413cac6f4 100644
--- a/gdb/testsuite/gdb.cp/member-name.exp
+++ b/gdb/testsuite/gdb.cp/member-name.exp
@@ -21,7 +21,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
     return -1
 }
 
-if ![runto_main] then {
+if {![runto_main]} {
     perror "couldn't run to breakpoint"
     return
 }
diff --git a/gdb/testsuite/gdb.cp/member-ptr.exp b/gdb/testsuite/gdb.cp/member-ptr.exp
index 5b91bcb493a..8e20c018203 100644
--- a/gdb/testsuite/gdb.cp/member-ptr.exp
+++ b/gdb/testsuite/gdb.cp/member-ptr.exp
@@ -30,7 +30,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
     return -1
 }
 
-if ![runto_main] then {
+if {![runto_main]} {
     perror "couldn't run to breakpoint"
     return
 }
diff --git a/gdb/testsuite/gdb.cp/method-call-in-c.exp b/gdb/testsuite/gdb.cp/method-call-in-c.exp
index bf2032a7cc1..de54f213edb 100644
--- a/gdb/testsuite/gdb.cp/method-call-in-c.exp
+++ b/gdb/testsuite/gdb.cp/method-call-in-c.exp
@@ -24,7 +24,7 @@ if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } {
     return -1
 }
 
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 
diff --git a/gdb/testsuite/gdb.cp/method.exp b/gdb/testsuite/gdb.cp/method.exp
index 9e7ee51162e..07a17b013b6 100644
--- a/gdb/testsuite/gdb.cp/method.exp
+++ b/gdb/testsuite/gdb.cp/method.exp
@@ -43,7 +43,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
 #
 # set it up at a breakpoint so we can play with the variable values
 #
-if ![runto_main] then {
+if {![runto_main]} {
     perror "couldn't run to breakpoint"
     return
 }
diff --git a/gdb/testsuite/gdb.cp/namespace-nested-import.exp b/gdb/testsuite/gdb.cp/namespace-nested-import.exp
index 134276849cf..a08a4e008df 100644
--- a/gdb/testsuite/gdb.cp/namespace-nested-import.exp
+++ b/gdb/testsuite/gdb.cp/namespace-nested-import.exp
@@ -25,7 +25,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
 # in a namespace inner to the one which has
 # been imported.
 
-if ![runto_main] then {
+if {![runto_main]} {
     perror "couldn't run to breakpoint main"
     return
 }
diff --git a/gdb/testsuite/gdb.cp/namespace.exp b/gdb/testsuite/gdb.cp/namespace.exp
index 95a15aa12b7..2f3a766fd21 100644
--- a/gdb/testsuite/gdb.cp/namespace.exp
+++ b/gdb/testsuite/gdb.cp/namespace.exp
@@ -46,12 +46,12 @@ gdb_test "show lang" "auto; currently c\\+\\+.*"
 #
 # set it up at a breakpoint so we can play with the variable values
 #
-if ![runto_main] then {
+if {![runto_main]} {
     perror "couldn't run to breakpoint"
     return
 }
 
-if ![runto 'marker1'] then {
+if {![runto 'marker1']} {
     perror "couldn't run to marker1"
     return
 }
@@ -192,7 +192,7 @@ gdb_test_multiple $test $test {
 # to print out stuff from within a function defined within a
 # namespace.
 
-if ![runto "C::D::marker2"] then {
+if {![runto "C::D::marker2"]} {
     perror "couldn't run to marker2"
     return
 }
diff --git a/gdb/testsuite/gdb.cp/nextoverthrow.exp b/gdb/testsuite/gdb.cp/nextoverthrow.exp
index b74ef1296ed..58e54f849e0 100644
--- a/gdb/testsuite/gdb.cp/nextoverthrow.exp
+++ b/gdb/testsuite/gdb.cp/nextoverthrow.exp
@@ -22,7 +22,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
     return -1
 }
 
-if ![runto_main] then {
+if {![runto_main]} {
     perror "couldn't run to main"
     return
 } 
diff --git a/gdb/testsuite/gdb.cp/nsdecl.exp b/gdb/testsuite/gdb.cp/nsdecl.exp
index f35e38ea48e..d1859f874f1 100644
--- a/gdb/testsuite/gdb.cp/nsdecl.exp
+++ b/gdb/testsuite/gdb.cp/nsdecl.exp
@@ -22,7 +22,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
     return -1
 }
 
-if ![runto_main] then {
+if {![runto_main]} {
     perror "couldn't run to breakpoint main"
     return
 }
diff --git a/gdb/testsuite/gdb.cp/nsimport.exp b/gdb/testsuite/gdb.cp/nsimport.exp
index 161f5960479..56a74e73ff1 100644
--- a/gdb/testsuite/gdb.cp/nsimport.exp
+++ b/gdb/testsuite/gdb.cp/nsimport.exp
@@ -27,7 +27,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
 # test printing of namespace imported within
 # the function.
 
-if ![runto_main] then {
+if {![runto_main]} {
     perror "couldn't run to breakpoint main"
     return
 }
diff --git a/gdb/testsuite/gdb.cp/nsnested.exp b/gdb/testsuite/gdb.cp/nsnested.exp
index 0ac325c0f65..01aba767f7f 100644
--- a/gdb/testsuite/gdb.cp/nsnested.exp
+++ b/gdb/testsuite/gdb.cp/nsnested.exp
@@ -20,7 +20,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {debug c++}
 }
 
 ############################################
-if ![runto_main] then {
+if {![runto_main]} {
     perror "couldn't run to breakpoint main"
     return
 }
diff --git a/gdb/testsuite/gdb.cp/nsnoimports.exp b/gdb/testsuite/gdb.cp/nsnoimports.exp
index ec8cedbeef4..11bcdaed834 100644
--- a/gdb/testsuite/gdb.cp/nsnoimports.exp
+++ b/gdb/testsuite/gdb.cp/nsnoimports.exp
@@ -20,7 +20,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {debug c++}
 }
 
 ############################################
-if ![runto_main] then {
+if {![runto_main]} {
     perror "couldn't run to breakpoint main"
     return
 }
diff --git a/gdb/testsuite/gdb.cp/nsrecurs.exp b/gdb/testsuite/gdb.cp/nsrecurs.exp
index c658d36fc25..30eab175df3 100644
--- a/gdb/testsuite/gdb.cp/nsrecurs.exp
+++ b/gdb/testsuite/gdb.cp/nsrecurs.exp
@@ -20,7 +20,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
     return -1
 }
 
-if ![runto_main] then {
+if {![runto_main]} {
     perror "couldn't run to breakpoint main"
     return
 }
diff --git a/gdb/testsuite/gdb.cp/nsstress.exp b/gdb/testsuite/gdb.cp/nsstress.exp
index c255a3557f3..2ff88791180 100644
--- a/gdb/testsuite/gdb.cp/nsstress.exp
+++ b/gdb/testsuite/gdb.cp/nsstress.exp
@@ -22,7 +22,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
     return -1
 }
 
-if ![runto_main] then {
+if {![runto_main]} {
     perror "couldn't run to breakpoint main"
     continue
 }
diff --git a/gdb/testsuite/gdb.cp/nsusing.exp b/gdb/testsuite/gdb.cp/nsusing.exp
index 2835207a21e..f767b6b8c58 100644
--- a/gdb/testsuite/gdb.cp/nsusing.exp
+++ b/gdb/testsuite/gdb.cp/nsusing.exp
@@ -22,7 +22,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
 ############################################
 # Test printing of namespace imported within the function.
 
-if ![runto_main] then {
+if {![runto_main]} {
     perror "couldn't run to breakpoint main"
     continue
 }
@@ -62,7 +62,7 @@ gdb_continue_to_breakpoint "marker3"
 # the global scope instead of the corresponding
 # function scope. These wrong import statements throw
 # this test off. This is fixed in gcc-4-4.
-if [test_compiler_info gcc-4-3-*] then { setup_xfail *-*-* }
+if {[test_compiler_info gcc-4-3-*]} { setup_xfail *-*-* }
 
 gdb_test "print _a" "No symbol \"_a\" in current context." \
     "Print _a without import at marker3"
diff --git a/gdb/testsuite/gdb.cp/operator.exp b/gdb/testsuite/gdb.cp/operator.exp
index 7ce460f6e04..b5609ba687a 100644
--- a/gdb/testsuite/gdb.cp/operator.exp
+++ b/gdb/testsuite/gdb.cp/operator.exp
@@ -22,7 +22,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} \
 
 ############################################
 
-if ![runto_main] then {
+if {![runto_main]} {
     perror "couldn't run to breakpoint main"
     return
 }
diff --git a/gdb/testsuite/gdb.cp/oranking.exp b/gdb/testsuite/gdb.cp/oranking.exp
index 25ba55def29..b9aa27dee57 100644
--- a/gdb/testsuite/gdb.cp/oranking.exp
+++ b/gdb/testsuite/gdb.cp/oranking.exp
@@ -21,7 +21,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {debug c++}
 
 ############################################
 
-if ![runto_main] then {
+if {![runto_main]} {
     perror "couldn't run to breakpoint main"
     return
 }
diff --git a/gdb/testsuite/gdb.cp/overload.exp b/gdb/testsuite/gdb.cp/overload.exp
index 73ca0d2d55c..4dcd0efc171 100644
--- a/gdb/testsuite/gdb.cp/overload.exp
+++ b/gdb/testsuite/gdb.cp/overload.exp
@@ -34,7 +34,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
 
 # Set it up at a breakpoint so we can play with the variable values.
 
-if ![runto 'marker1'] then {
+if {![runto 'marker1']} {
     perror "couldn't run to marker1"
     continue
 }
@@ -359,7 +359,7 @@ with_test_prefix "list all overloads" {
     gdb_test "list bar" "${h1_re}${lines1}\r\n${h2_re}${lines2}"
 }
 
-if ![runto 'XXX::marker2'] then {
+if {![runto 'XXX::marker2']} {
     perror "couldn't run to XXX::marker2"
     continue
 }
diff --git a/gdb/testsuite/gdb.cp/pr-1023.exp b/gdb/testsuite/gdb.cp/pr-1023.exp
index 1bb244f116b..390459a0bac 100644
--- a/gdb/testsuite/gdb.cp/pr-1023.exp
+++ b/gdb/testsuite/gdb.cp/pr-1023.exp
@@ -30,7 +30,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
     return -1
 }
 
-if ![runto_main] then {
+if {![runto_main]} {
     perror "couldn't run to breakpoint"
     return
 }
diff --git a/gdb/testsuite/gdb.cp/pr-1210.exp b/gdb/testsuite/gdb.cp/pr-1210.exp
index a5e13e3dd0b..c74e7aa1dbc 100644
--- a/gdb/testsuite/gdb.cp/pr-1210.exp
+++ b/gdb/testsuite/gdb.cp/pr-1210.exp
@@ -29,7 +29,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
     return -1
 }
 
-if ![runto_main] then {
+if {![runto_main]} {
     perror "couldn't run to breakpoint"
     return
 }
diff --git a/gdb/testsuite/gdb.cp/pr-574.exp b/gdb/testsuite/gdb.cp/pr-574.exp
index a4d37f30fc0..32c7f634940 100644
--- a/gdb/testsuite/gdb.cp/pr-574.exp
+++ b/gdb/testsuite/gdb.cp/pr-574.exp
@@ -38,7 +38,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile $flags]} {
     return -1
 }
 
-if ![runto_main] then {
+if {![runto_main]} {
     perror "couldn't run to breakpoint"
     return
 }
diff --git a/gdb/testsuite/gdb.cp/pr10687.exp b/gdb/testsuite/gdb.cp/pr10687.exp
index 2ffd5607cac..d7db61a3ac5 100644
--- a/gdb/testsuite/gdb.cp/pr10687.exp
+++ b/gdb/testsuite/gdb.cp/pr10687.exp
@@ -19,7 +19,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
     return -1
 }
 
-if ![runto_main] then {
+if {![runto_main]} {
     return
 }
 
diff --git a/gdb/testsuite/gdb.cp/pr10728.exp b/gdb/testsuite/gdb.cp/pr10728.exp
index 3b0ecac6e8d..8051eae71da 100644
--- a/gdb/testsuite/gdb.cp/pr10728.exp
+++ b/gdb/testsuite/gdb.cp/pr10728.exp
@@ -42,7 +42,7 @@ if  { [gdb_compile "${tfx}.o ${tfy}.o" ${binfile} executable {debug c++}] != ""
 
 clean_restart $binfile
 
-if ![runto_main] then {
+if {![runto_main]} {
     perror "couldn't run to breakpoint"
     return
 }
diff --git a/gdb/testsuite/gdb.cp/pr12028.exp b/gdb/testsuite/gdb.cp/pr12028.exp
index 09e9a719b1e..c9583bd1731 100644
--- a/gdb/testsuite/gdb.cp/pr12028.exp
+++ b/gdb/testsuite/gdb.cp/pr12028.exp
@@ -21,7 +21,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {debug c++}
 
 ############################################
 
-if ![runto_main] then {
+if {![runto_main]} {
     perror "couldn't run to breakpoint main"
     continue
 }
diff --git a/gdb/testsuite/gdb.cp/pr9067.exp b/gdb/testsuite/gdb.cp/pr9067.exp
index 4b601dd8f6b..417abb19f07 100644
--- a/gdb/testsuite/gdb.cp/pr9067.exp
+++ b/gdb/testsuite/gdb.cp/pr9067.exp
@@ -25,7 +25,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
     return -1
 }
 
-if ![runto_main] then {
+if {![runto_main]} {
     perror "couldn't run to breakpoint"
     return
 }
diff --git a/gdb/testsuite/gdb.cp/pr9167.exp b/gdb/testsuite/gdb.cp/pr9167.exp
index 605d1df922a..b751423afbc 100644
--- a/gdb/testsuite/gdb.cp/pr9167.exp
+++ b/gdb/testsuite/gdb.cp/pr9167.exp
@@ -25,7 +25,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile $flags]} {
     return -1
 }
 
-if ![runto_main] then {
+if {![runto_main]} {
     return
 }
 
diff --git a/gdb/testsuite/gdb.cp/pr9631.exp b/gdb/testsuite/gdb.cp/pr9631.exp
index 6a010ed8179..c98e3e9bf3f 100644
--- a/gdb/testsuite/gdb.cp/pr9631.exp
+++ b/gdb/testsuite/gdb.cp/pr9631.exp
@@ -23,7 +23,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
     return -1
 }
 
-if ![runto_main] then {
+if {![runto_main]} {
     perror "couldn't run to breakpoint"
     return
 }
diff --git a/gdb/testsuite/gdb.cp/printmethod.exp b/gdb/testsuite/gdb.cp/printmethod.exp
index 2a8a3bc07a2..94aaba3f246 100644
--- a/gdb/testsuite/gdb.cp/printmethod.exp
+++ b/gdb/testsuite/gdb.cp/printmethod.exp
@@ -31,7 +31,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
     return -1
 }
 
-if ![runto_main] then {
+if {![runto_main]} {
     perror "couldn't run to breakpoint"
     return
 }
diff --git a/gdb/testsuite/gdb.cp/ptype-flags.exp b/gdb/testsuite/gdb.cp/ptype-flags.exp
index 371a2a5f128..b04a4a4b8c9 100644
--- a/gdb/testsuite/gdb.cp/ptype-flags.exp
+++ b/gdb/testsuite/gdb.cp/ptype-flags.exp
@@ -25,7 +25,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
     return -1
 }
 
-if ![runto_main] then {
+if {![runto_main]} {
     perror "couldn't run to breakpoint"
     return
 }
diff --git a/gdb/testsuite/gdb.cp/ref-types.exp b/gdb/testsuite/gdb.cp/ref-types.exp
index 3ca384ae391..8135a2845f8 100644
--- a/gdb/testsuite/gdb.cp/ref-types.exp
+++ b/gdb/testsuite/gdb.cp/ref-types.exp
@@ -31,12 +31,12 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
 #
 # set it up at a breakpoint so we can play with the variable values
 #
-if ![runto_main] then {
+if {![runto_main]} {
     perror "couldn't run to breakpoint"
     return
 }
 
-if ![runto 'marker1'] then {
+if {![runto 'marker1']} {
     perror "couldn't run to marker1"
     return
 }
@@ -57,12 +57,12 @@ proc gdb_start_again {} {
     #
     # set it up at a breakpoint so we can play with the variable values
     #
-    if ![runto_main] then {
+    if {![runto_main]} {
 	perror "couldn't run to breakpoint"
 	return
     }
 
-    if ![runto 'marker1'] then {
+    if {![runto 'marker1']} {
 	perror "couldn't run to marker1"
 	return
     }
@@ -128,7 +128,7 @@ gdb_test "print ras\[2\]" ".\[0-9\]* = 2" "print value of ras\[2\]"
 gdb_test "print ras\[3\]" ".\[0-9\]* = 3" "print value of ras\[3\]"
 
 
-if ![runto 'f'] then {
+if {![runto 'f']} {
     perror "couldn't run to f"
     return
 }
diff --git a/gdb/testsuite/gdb.cp/rtti.exp b/gdb/testsuite/gdb.cp/rtti.exp
index e69c0cf7611..77cc6b6c35e 100644
--- a/gdb/testsuite/gdb.cp/rtti.exp
+++ b/gdb/testsuite/gdb.cp/rtti.exp
@@ -39,7 +39,7 @@ if {[prepare_for_testing "failed to prepare" $testfile \
     return -1
 }
 
-if ![runto_main] then {
+if {![runto_main]} {
     perror "couldn't run to breakpoint"
     return
 }
diff --git a/gdb/testsuite/gdb.cp/rvalue-ref-types.exp b/gdb/testsuite/gdb.cp/rvalue-ref-types.exp
index a1e107838d1..6056af415cf 100644
--- a/gdb/testsuite/gdb.cp/rvalue-ref-types.exp
+++ b/gdb/testsuite/gdb.cp/rvalue-ref-types.exp
@@ -61,7 +61,7 @@ gdb_test "print rrat\[2\]" ".$decimal = 2" "print value of rrat\[2\]"
 gdb_test "print rrat\[3\]" ".$decimal = 3" "print value of rrat\[3\]"
 
 
-if {![runto 'f']} then {
+if {![runto 'f']} {
     perror "couldn't run to f"
     return
 }
diff --git a/gdb/testsuite/gdb.cp/shadow.exp b/gdb/testsuite/gdb.cp/shadow.exp
index f0bfb5b476d..641feed752c 100644
--- a/gdb/testsuite/gdb.cp/shadow.exp
+++ b/gdb/testsuite/gdb.cp/shadow.exp
@@ -23,7 +23,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
     return -1
 }
 
-if ![runto_main] then {
+if {![runto_main]} {
     perror "couldn't run to breakpoint main"
     return
 }
diff --git a/gdb/testsuite/gdb.cp/smartp.exp b/gdb/testsuite/gdb.cp/smartp.exp
index a40d54fa135..c94dfae4394 100644
--- a/gdb/testsuite/gdb.cp/smartp.exp
+++ b/gdb/testsuite/gdb.cp/smartp.exp
@@ -21,7 +21,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {debug c++}
 
 ############################################
 
-if ![runto_main] then {
+if {![runto_main]} {
     perror "couldn't run to breakpoint main"
     return
 }
diff --git a/gdb/testsuite/gdb.cp/try_catch.exp b/gdb/testsuite/gdb.cp/try_catch.exp
index 31fe298b10f..437309ada51 100644
--- a/gdb/testsuite/gdb.cp/try_catch.exp
+++ b/gdb/testsuite/gdb.cp/try_catch.exp
@@ -30,7 +30,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
     return -1
 }
 
-if ![runto_main] then {
+if {![runto_main]} {
     perror "couldn't run to breakpoint"
     return
 }
diff --git a/gdb/testsuite/gdb.cp/userdef.exp b/gdb/testsuite/gdb.cp/userdef.exp
index d67e42803fb..5eba7e2cd81 100644
--- a/gdb/testsuite/gdb.cp/userdef.exp
+++ b/gdb/testsuite/gdb.cp/userdef.exp
@@ -27,7 +27,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
     return -1
 }
 
-if ![runto_main] then {
+if {![runto_main]} {
     perror "couldn't run to breakpoint"
     return
 }
diff --git a/gdb/testsuite/gdb.cp/virtbase.exp b/gdb/testsuite/gdb.cp/virtbase.exp
index 828f8f576da..b026cfb4fba 100644
--- a/gdb/testsuite/gdb.cp/virtbase.exp
+++ b/gdb/testsuite/gdb.cp/virtbase.exp
@@ -23,7 +23,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
     return -1
 }
 
-if {![runto_main]} then {
+if {![runto_main]} {
     perror "couldn't run to breakpoint"
     return
 }
diff --git a/gdb/testsuite/gdb.cp/virtbase2.exp b/gdb/testsuite/gdb.cp/virtbase2.exp
index dc9149bf4a1..d58403b7fa0 100644
--- a/gdb/testsuite/gdb.cp/virtbase2.exp
+++ b/gdb/testsuite/gdb.cp/virtbase2.exp
@@ -23,7 +23,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
     return -1
 }
 
-if {![runto_main]} then {
+if {![runto_main]} {
     perror "couldn't run to main"
     return
 }
diff --git a/gdb/testsuite/gdb.cp/virtfunc.exp b/gdb/testsuite/gdb.cp/virtfunc.exp
index 0d354370a53..23088f75850 100644
--- a/gdb/testsuite/gdb.cp/virtfunc.exp
+++ b/gdb/testsuite/gdb.cp/virtfunc.exp
@@ -273,7 +273,7 @@ proc do_tests {} {
     gdb_test_no_output "set language c++" ""
     gdb_test_no_output "set width 0" ""
 
-    if ![runto_main] then {
+    if {![runto_main]} {
 	perror "couldn't run to breakpoint"
 	return
     }
diff --git a/gdb/testsuite/gdb.cp/virtfunc2.exp b/gdb/testsuite/gdb.cp/virtfunc2.exp
index 0a06d753474..3ec05301036 100644
--- a/gdb/testsuite/gdb.cp/virtfunc2.exp
+++ b/gdb/testsuite/gdb.cp/virtfunc2.exp
@@ -28,7 +28,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
     return -1
 }
 
-if ![runto_main] then {
+if {![runto_main]} {
     perror "couldn't run to breakpoint"
     return
 }
diff --git a/gdb/testsuite/gdb.cp/watch-cp.exp b/gdb/testsuite/gdb.cp/watch-cp.exp
index 30e804d3858..8ef64bb59b7 100644
--- a/gdb/testsuite/gdb.cp/watch-cp.exp
+++ b/gdb/testsuite/gdb.cp/watch-cp.exp
@@ -21,7 +21,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
     return -1
 }
 
-if ![runto_main] then {
+if {![runto_main]} {
     perror "couldn't run to main"
     return
 }
diff --git a/gdb/testsuite/gdb.cp/wide_char_types.exp b/gdb/testsuite/gdb.cp/wide_char_types.exp
index 9a086c88e0b..c37c7c189ec 100644
--- a/gdb/testsuite/gdb.cp/wide_char_types.exp
+++ b/gdb/testsuite/gdb.cp/wide_char_types.exp
@@ -47,7 +47,7 @@ proc wide_char_types_program {lang} {
 	return -1
     }
 
-    if ![runto_main] then {
+    if {![runto_main]} {
 	return 0
     }
     do_test_wide_char $lang "u16" "u32" "wchar"
-- 
2.25.4


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH 06/14] gdb/testsuite: remove use of then keyword from gdb.python/*.exp
  2022-11-15 10:42 [PATCH 00/14] Remove all uses of 'then' keyword from the testsuite Andrew Burgess
                   ` (4 preceding siblings ...)
  2022-11-15 10:42 ` [PATCH 05/14] gdb/testsuite: remove use of then keyword from gdb.cp/*.exp Andrew Burgess
@ 2022-11-15 10:42 ` Andrew Burgess
  2022-11-15 10:42 ` [PATCH 07/14] gdb/testsuite: remove use of then keyword from gdb.threads/*.exp Andrew Burgess
                   ` (9 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: Andrew Burgess @ 2022-11-15 10:42 UTC (permalink / raw)
  To: gdb-patches; +Cc: Andrew Burgess

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

There should be no changes in what is tested after this commit.
---
 gdb/testsuite/gdb.python/lib-types.exp        |  2 +-
 .../gdb.python/pretty-print-call-by-hand.exp  |  4 +--
 gdb/testsuite/gdb.python/py-bad-printers.exp  |  2 +-
 gdb/testsuite/gdb.python/py-block.exp         |  2 +-
 gdb/testsuite/gdb.python/py-breakpoint.exp    | 28 +++++++++----------
 gdb/testsuite/gdb.python/py-cmd.exp           |  2 +-
 gdb/testsuite/gdb.python/py-connection.exp    |  2 +-
 gdb/testsuite/gdb.python/py-disasm.exp        |  2 +-
 gdb/testsuite/gdb.python/py-events.exp        |  2 +-
 .../gdb.python/py-finish-breakpoint.exp       | 16 +++++------
 .../gdb.python/py-finish-breakpoint2.exp      |  2 +-
 gdb/testsuite/gdb.python/py-format-string.exp |  2 +-
 gdb/testsuite/gdb.python/py-frame-inline.exp  |  2 +-
 gdb/testsuite/gdb.python/py-frame.exp         |  2 +-
 .../gdb.python/py-framefilter-invalidarg.exp  |  2 +-
 gdb/testsuite/gdb.python/py-framefilter.exp   |  4 +--
 gdb/testsuite/gdb.python/py-inferior.exp      |  2 +-
 gdb/testsuite/gdb.python/py-infthread.exp     |  2 +-
 gdb/testsuite/gdb.python/py-nested-maps.exp   |  2 +-
 gdb/testsuite/gdb.python/py-objfile.exp       |  2 +-
 .../gdb.python/py-pending-frame-level.exp     |  2 +-
 gdb/testsuite/gdb.python/py-pp-maint.exp      |  2 +-
 gdb/testsuite/gdb.python/py-prettyprint.exp   |  4 +--
 gdb/testsuite/gdb.python/py-rbreak.exp        |  2 +-
 gdb/testsuite/gdb.python/py-record-btrace.exp |  2 +-
 gdb/testsuite/gdb.python/py-record-full.exp   |  2 +-
 .../gdb.python/py-recurse-unwind.exp          |  2 +-
 gdb/testsuite/gdb.python/py-shared.exp        |  2 +-
 gdb/testsuite/gdb.python/py-symbol.exp        |  6 ++--
 gdb/testsuite/gdb.python/py-symtab.exp        |  2 +-
 gdb/testsuite/gdb.python/py-template.exp      |  2 +-
 gdb/testsuite/gdb.python/py-type.exp          |  2 +-
 gdb/testsuite/gdb.python/py-unwind-inline.exp |  2 +-
 gdb/testsuite/gdb.python/py-unwind-maint.exp  |  2 +-
 .../gdb.python/py-unwind-user-regs.exp        |  2 +-
 gdb/testsuite/gdb.python/py-unwind.exp        |  2 +-
 gdb/testsuite/gdb.python/py-value.exp         |  4 +--
 gdb/testsuite/gdb.python/python.exp           |  6 ++--
 38 files changed, 66 insertions(+), 66 deletions(-)

diff --git a/gdb/testsuite/gdb.python/lib-types.exp b/gdb/testsuite/gdb.python/lib-types.exp
index a01e9d76219..35da9113621 100644
--- a/gdb/testsuite/gdb.python/lib-types.exp
+++ b/gdb/testsuite/gdb.python/lib-types.exp
@@ -27,7 +27,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
 # Skip all tests if Python scripting is not enabled.
 if { [skip_python_tests] } { continue }
 
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 
diff --git a/gdb/testsuite/gdb.python/pretty-print-call-by-hand.exp b/gdb/testsuite/gdb.python/pretty-print-call-by-hand.exp
index eb3fc9e35fa..76386bb6df1 100644
--- a/gdb/testsuite/gdb.python/pretty-print-call-by-hand.exp
+++ b/gdb/testsuite/gdb.python/pretty-print-call-by-hand.exp
@@ -47,7 +47,7 @@ proc start_test { breakpoint_comment } {
 
     clean_restart ${binfile}
 
-    if { ![runto_main] } then {
+    if {![runto_main]} {
 	untested "couldn't run to breakpoint"
 	return -1
     }
@@ -66,7 +66,7 @@ proc start_test { breakpoint_comment } {
 
 # Start by testing the "run" command, it can't leverage start_test
 with_test_prefix "run to frame" {
-    if { ![runto_main] } then {
+    if {![runto_main]} {
 	untested "couldn't run to main"
     }
 
diff --git a/gdb/testsuite/gdb.python/py-bad-printers.exp b/gdb/testsuite/gdb.python/py-bad-printers.exp
index 2ef7f487eda..01654ad024b 100644
--- a/gdb/testsuite/gdb.python/py-bad-printers.exp
+++ b/gdb/testsuite/gdb.python/py-bad-printers.exp
@@ -27,7 +27,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
 # Skip all tests if Python scripting is not enabled.
 if { [skip_python_tests] } { continue }
 
-if ![runto_main ] then {
+if {![runto_main]} {
     return -1
 }
 
diff --git a/gdb/testsuite/gdb.python/py-block.exp b/gdb/testsuite/gdb.python/py-block.exp
index 0bc020aee9e..0a88aec56a0 100644
--- a/gdb/testsuite/gdb.python/py-block.exp
+++ b/gdb/testsuite/gdb.python/py-block.exp
@@ -27,7 +27,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
 # Skip all tests if Python scripting is not enabled.
 if { [skip_python_tests] } { continue }
 
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 
diff --git a/gdb/testsuite/gdb.python/py-breakpoint.exp b/gdb/testsuite/gdb.python/py-breakpoint.exp
index c3215b13d5c..e36e87dc291 100644
--- a/gdb/testsuite/gdb.python/py-breakpoint.exp
+++ b/gdb/testsuite/gdb.python/py-breakpoint.exp
@@ -46,7 +46,7 @@ proc_with_prefix test_bkpt_basic { } {
     # We should start with no breakpoints.
     gdb_test "python print (gdb.breakpoints())" "\\(\\)"
 
-    if ![runto_main] then {
+    if {![runto_main]} {
 	return 0
     }
 
@@ -128,7 +128,7 @@ proc_with_prefix test_bkpt_deletion { } {
     # Start with a fresh gdb.
     clean_restart ${testfile}
 
-    if ![runto_main] then {
+    if {![runto_main]} {
 	return 0
     }
 
@@ -163,7 +163,7 @@ proc_with_prefix test_bkpt_cond_and_cmds { } {
     # Start with a fresh gdb.
     clean_restart ${testfile}
 
-    if ![runto_main] then {
+    if {![runto_main]} {
 	return 0
     }
 
@@ -220,7 +220,7 @@ proc_with_prefix test_bkpt_invisible { } {
     # Start with a fresh gdb.
     clean_restart ${testfile}
 
-    if ![runto_main] then {
+    if {![runto_main]} {
 	return 0
     }
 
@@ -265,7 +265,7 @@ proc_with_prefix test_hardware_breakpoints { } {
     # Start with a fresh gdb.
     clean_restart ${testfile}
 
-    if ![runto_main] then {
+    if {![runto_main]} {
 	return 0
     }
 
@@ -293,7 +293,7 @@ proc_with_prefix test_watchpoints { } {
 	gdb_test_no_output "set can-use-hw-watchpoints 0" ""
     }
 
-    if ![runto_main] then {
+    if {![runto_main]} {
 	return 0
     }
 
@@ -316,7 +316,7 @@ proc_with_prefix test_bkpt_internal { } {
     if {$skip_hw_watchpoint_tests_p} {
 	gdb_test_no_output "set can-use-hw-watchpoints 0" ""
     }
-    if ![runto_main] then {
+    if {![runto_main]} {
 	return 0
     }
     delete_breakpoints
@@ -364,7 +364,7 @@ proc_with_prefix test_bkpt_eval_funcs { } {
     if {$skip_hw_watchpoint_tests_p} {
 	gdb_test_no_output "set can-use-hw-watchpoints 0" ""
     }
-    if ![runto_main] then {
+    if {![runto_main]} {
 	return 0
     }
     delete_breakpoints
@@ -477,7 +477,7 @@ proc_with_prefix test_bkpt_temporary { } {
     # Start with a fresh gdb.
     clean_restart ${testfile}
 
-    if ![runto_main] then {
+    if {![runto_main]} {
 	return 0
     }
     delete_breakpoints
@@ -595,7 +595,7 @@ proc_with_prefix test_bkpt_explicit_loc {} {
     # Start with a fresh gdb.
     clean_restart ${testfile}
 
-    if ![runto_main] then {
+    if {![runto_main]} {
 	return 0
     }
 
@@ -680,7 +680,7 @@ proc_with_prefix test_bkpt_qualified {} {
     set one_location_re "Breakpoint $decimal at $hex:.*line $decimal."
     set two_location_re "Breakpoint $decimal at $hex:.*2 locations."
 
-    if ![runto_main] then {
+    if {![runto_main]} {
 	return 0
     }
 
@@ -749,7 +749,7 @@ proc_with_prefix test_bkpt_probe {} {
 	return -1
     }
 
-    if ![runto_main] then {
+    if {![runto_main]} {
 	return 0
     }
 
@@ -766,7 +766,7 @@ proc_with_prefix test_catchpoints {} {
     # Start with a fresh gdb.
     clean_restart ${testfile}
 
-    if ![runto_main] then {
+    if {![runto_main]} {
 	return 0
     }
 
@@ -825,7 +825,7 @@ proc_with_prefix test_bkpt_auto_disable { } {
     # Start with a fresh gdb.
     clean_restart ${testfile}
 
-    if ![runto_main] then {
+    if {![runto_main]} {
 	return 0
     }
     delete_breakpoints
diff --git a/gdb/testsuite/gdb.python/py-cmd.exp b/gdb/testsuite/gdb.python/py-cmd.exp
index 82f1c357518..aa95a459f46 100644
--- a/gdb/testsuite/gdb.python/py-cmd.exp
+++ b/gdb/testsuite/gdb.python/py-cmd.exp
@@ -27,7 +27,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
 # Skip all tests if Python scripting is not enabled.
 if { [skip_python_tests] } { continue }
 
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 
diff --git a/gdb/testsuite/gdb.python/py-connection.exp b/gdb/testsuite/gdb.python/py-connection.exp
index 91315eb1af4..fc212fc09c0 100644
--- a/gdb/testsuite/gdb.python/py-connection.exp
+++ b/gdb/testsuite/gdb.python/py-connection.exp
@@ -29,7 +29,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
 # Skip all tests if Python scripting is not enabled.
 if { [skip_python_tests] } { continue }
 
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 
diff --git a/gdb/testsuite/gdb.python/py-disasm.exp b/gdb/testsuite/gdb.python/py-disasm.exp
index 1f94d3e60f3..2fe20c39d83 100644
--- a/gdb/testsuite/gdb.python/py-disasm.exp
+++ b/gdb/testsuite/gdb.python/py-disasm.exp
@@ -27,7 +27,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} "debug"] }
 # Skip all tests if Python scripting is not enabled.
 if { [skip_python_tests] } { continue }
 
-if ![runto_main] then {
+if {![runto_main]} {
     fail "can't run to main"
     return 0
 }
diff --git a/gdb/testsuite/gdb.python/py-events.exp b/gdb/testsuite/gdb.python/py-events.exp
index 94762739cd4..ce9342afaff 100644
--- a/gdb/testsuite/gdb.python/py-events.exp
+++ b/gdb/testsuite/gdb.python/py-events.exp
@@ -317,7 +317,7 @@ with_test_prefix "gdb exiting: normal" {
 with_test_prefix "gdb exiting: error" {
     clean_restart ${testfile}
 
-    if ![runto_main] then {
+    if {![runto_main]} {
 	fail "cannot run to main."
 	return 0
     }
diff --git a/gdb/testsuite/gdb.python/py-finish-breakpoint.exp b/gdb/testsuite/gdb.python/py-finish-breakpoint.exp
index c525337990e..2f6c2f78e67 100644
--- a/gdb/testsuite/gdb.python/py-finish-breakpoint.exp
+++ b/gdb/testsuite/gdb.python/py-finish-breakpoint.exp
@@ -50,7 +50,7 @@ with_test_prefix "normal conditions" {
     clean_restart ${testfile}
     gdb_load_shlib ${lib_sl}
 
-    if ![runto_main] then {
+    if {![runto_main]} {
 	return 0
     }
 
@@ -102,7 +102,7 @@ with_test_prefix "no debug symbol" {
 	"import python scripts"
     set cond_line [gdb_get_line_number "Condition Break."]
 
-    if ![runto_main] then {
+    if {![runto_main]} {
 	return 0
     }
 
@@ -129,7 +129,7 @@ with_test_prefix "function returned by longjump" {
     gdb_test "source $python_file" "Python script imported.*" \
 	"import python scripts"
 
-    if ![runto call_longjmp_1] then {
+    if {![runto call_longjmp_1]} {
 	return
     }
 
@@ -157,7 +157,7 @@ with_test_prefix "finish in dummy frame" {
 	"import python scripts"
 
 
-    if ![runto_main] then {
+    if {![runto_main]} {
 	return 0
     }
 
@@ -184,7 +184,7 @@ with_test_prefix "finish in normal frame" {
     gdb_test "source $python_file" "Python script imported.*" \
 	"import python scripts"
 
-    if ![runto_main] then {
+    if {![runto_main]} {
 	return 0
     }
 
@@ -213,7 +213,7 @@ with_test_prefix "explicit inferior function call" {
     gdb_test "source $python_file" "Python script imported.*" \
 	"import python scripts"
 
-    if ![runto_main] then {
+    if {![runto_main]} {
 	return 0
     }
 
@@ -240,7 +240,7 @@ with_test_prefix "explicit inferior function call" {
 #
 
 with_test_prefix "inferior exit" {
-    if ![runto "test_exec_exit"] then {
+    if {![runto "test_exec_exit"]} {
 	return 0
     }
 
@@ -254,7 +254,7 @@ with_test_prefix "inferior exit" {
 #
 
 with_test_prefix "inferior exec" {
-    if ![runto "test_exec_exit"] then {
+    if {![runto "test_exec_exit"]} {
 	return 0
     }
 
diff --git a/gdb/testsuite/gdb.python/py-finish-breakpoint2.exp b/gdb/testsuite/gdb.python/py-finish-breakpoint2.exp
index 6ad0bef88ea..30758473d40 100644
--- a/gdb/testsuite/gdb.python/py-finish-breakpoint2.exp
+++ b/gdb/testsuite/gdb.python/py-finish-breakpoint2.exp
@@ -27,7 +27,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
 # Skip all tests if Python scripting is not enabled.
 if { [skip_python_tests] } { continue }
 
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 
diff --git a/gdb/testsuite/gdb.python/py-format-string.exp b/gdb/testsuite/gdb.python/py-format-string.exp
index 45b08512c0c..26b18ce1ab0 100644
--- a/gdb/testsuite/gdb.python/py-format-string.exp
+++ b/gdb/testsuite/gdb.python/py-format-string.exp
@@ -52,7 +52,7 @@ proc prepare_gdb {exefile} {
   gdb_reinitialize_dir $srcdir/$subdir
   gdb_load ${exefile}
 
-  if ![runto_main] then {
+  if {![runto_main]} {
       perror "couldn't run to breakpoint"
       return
   }
diff --git a/gdb/testsuite/gdb.python/py-frame-inline.exp b/gdb/testsuite/gdb.python/py-frame-inline.exp
index 44726cae0c4..791749c27c6 100644
--- a/gdb/testsuite/gdb.python/py-frame-inline.exp
+++ b/gdb/testsuite/gdb.python/py-frame-inline.exp
@@ -24,7 +24,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
 # Skip all tests if Python scripting is not enabled.
 if { [skip_python_tests] } { continue }
 
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 
diff --git a/gdb/testsuite/gdb.python/py-frame.exp b/gdb/testsuite/gdb.python/py-frame.exp
index 56e1ecdcedd..27130a95d79 100644
--- a/gdb/testsuite/gdb.python/py-frame.exp
+++ b/gdb/testsuite/gdb.python/py-frame.exp
@@ -29,7 +29,7 @@ if { [skip_python_tests] } { continue }
 
 # The following tests require execution.
 
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 
diff --git a/gdb/testsuite/gdb.python/py-framefilter-invalidarg.exp b/gdb/testsuite/gdb.python/py-framefilter-invalidarg.exp
index 5fbce55ef3a..81c434046a4 100644
--- a/gdb/testsuite/gdb.python/py-framefilter-invalidarg.exp
+++ b/gdb/testsuite/gdb.python/py-framefilter-invalidarg.exp
@@ -51,7 +51,7 @@ gdb_load ${binfile}
 gdb_test "info auto-load python-scripts" "Yes.*${testfile}-gdb.py.*" \
     "Test auto-load had loaded python scripts"
 
-if ![runto_main] then {
+if {![runto_main]} {
     perror "couldn't run to breakpoint"
     return
 }
diff --git a/gdb/testsuite/gdb.python/py-framefilter.exp b/gdb/testsuite/gdb.python/py-framefilter.exp
index 7a172e72d33..794d1c2944c 100644
--- a/gdb/testsuite/gdb.python/py-framefilter.exp
+++ b/gdb/testsuite/gdb.python/py-framefilter.exp
@@ -52,7 +52,7 @@ gdb_load ${binfile}
 gdb_test "info auto-load python-scripts" "Yes.*${testfile}-gdb.py.*" \
     "Test auto-load had loaded python scripts"
 
-if ![runto_main] then {
+if {![runto_main]} {
     perror "couldn't run to breakpoint"
     return
 }
@@ -310,7 +310,7 @@ gdb_load ${binfile}
 # Verify gdb loaded the script.
 gdb_test "info auto-load python-scripts" "Yes.*${testfile}-gdb.py.*" \
     "Set autoload path for no debug info tests"
-if ![runto_main] then {
+if {![runto_main]} {
     perror "couldn't run to breakpoint"
     return
 }
diff --git a/gdb/testsuite/gdb.python/py-inferior.exp b/gdb/testsuite/gdb.python/py-inferior.exp
index 552f9b17f4d..8fcd97a1b8d 100644
--- a/gdb/testsuite/gdb.python/py-inferior.exp
+++ b/gdb/testsuite/gdb.python/py-inferior.exp
@@ -37,7 +37,7 @@ switch [get_endianness] {
 
 # The following tests require execution.
 
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 
diff --git a/gdb/testsuite/gdb.python/py-infthread.exp b/gdb/testsuite/gdb.python/py-infthread.exp
index a7754198e60..4ca2b86a63c 100644
--- a/gdb/testsuite/gdb.python/py-infthread.exp
+++ b/gdb/testsuite/gdb.python/py-infthread.exp
@@ -40,7 +40,7 @@ gdb_test_multiline "install new_thread event handler" \
 
 # The following tests require execution.
 
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 
diff --git a/gdb/testsuite/gdb.python/py-nested-maps.exp b/gdb/testsuite/gdb.python/py-nested-maps.exp
index 70d4f771ec5..ea71a793aee 100644
--- a/gdb/testsuite/gdb.python/py-nested-maps.exp
+++ b/gdb/testsuite/gdb.python/py-nested-maps.exp
@@ -34,7 +34,7 @@ if { [prepare_for_testing "failed to prepare" $testfile $srcfile {debug}] } {
     return -1
 }
 
-if ![runto_main ] then {
+if {![runto_main]} {
     return -1
 }
 
diff --git a/gdb/testsuite/gdb.python/py-objfile.exp b/gdb/testsuite/gdb.python/py-objfile.exp
index 9565c16af96..80f2e794947 100644
--- a/gdb/testsuite/gdb.python/py-objfile.exp
+++ b/gdb/testsuite/gdb.python/py-objfile.exp
@@ -27,7 +27,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
 # Skip all tests if Python scripting is not enabled.
 if { [skip_python_tests] } { continue }
 
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 
diff --git a/gdb/testsuite/gdb.python/py-pending-frame-level.exp b/gdb/testsuite/gdb.python/py-pending-frame-level.exp
index 57ee6b634cc..3cf8d4d639e 100644
--- a/gdb/testsuite/gdb.python/py-pending-frame-level.exp
+++ b/gdb/testsuite/gdb.python/py-pending-frame-level.exp
@@ -26,7 +26,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
 # Skip all tests if Python scripting is not enabled.
 if { [skip_python_tests] } { continue }
 
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 
diff --git a/gdb/testsuite/gdb.python/py-pp-maint.exp b/gdb/testsuite/gdb.python/py-pp-maint.exp
index 8d8974c94c5..19cabe847f2 100644
--- a/gdb/testsuite/gdb.python/py-pp-maint.exp
+++ b/gdb/testsuite/gdb.python/py-pp-maint.exp
@@ -32,7 +32,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
 # Skip all tests if Python scripting is not enabled.
 if { [skip_python_tests] } { continue }
 
-if ![runto_main ] then {
+if {![runto_main]} {
     return -1
 }
 
diff --git a/gdb/testsuite/gdb.python/py-prettyprint.exp b/gdb/testsuite/gdb.python/py-prettyprint.exp
index c6040059cea..46a346c194b 100644
--- a/gdb/testsuite/gdb.python/py-prettyprint.exp
+++ b/gdb/testsuite/gdb.python/py-prettyprint.exp
@@ -42,7 +42,7 @@ proc run_lang_tests {exefile lang} {
     gdb_reinitialize_dir $srcdir/$subdir
     gdb_load ${exefile}
 
-    if ![runto_main ] then {
+    if {![runto_main]} {
 	perror "couldn't run to breakpoint"
 	return
     }
@@ -198,7 +198,7 @@ gdb_start
 gdb_reinitialize_dir $srcdir/$subdir
 gdb_load ${binfile}
 
-if ![runto_main ] then {
+if {![runto_main]} {
     perror "couldn't run to breakpoint"
     return
 }
diff --git a/gdb/testsuite/gdb.python/py-rbreak.exp b/gdb/testsuite/gdb.python/py-rbreak.exp
index 4c641c9cb96..f32cffc6e57 100644
--- a/gdb/testsuite/gdb.python/py-rbreak.exp
+++ b/gdb/testsuite/gdb.python/py-rbreak.exp
@@ -27,7 +27,7 @@ if {[prepare_for_testing "failed to prepare" ${testfile} [list $srcfile $srcfile
 # Skip all tests if Python scripting is not enabled.
 if { [skip_python_tests] } { continue }
 
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 
diff --git a/gdb/testsuite/gdb.python/py-record-btrace.exp b/gdb/testsuite/gdb.python/py-record-btrace.exp
index e9fdd06154e..bbaf268c86a 100644
--- a/gdb/testsuite/gdb.python/py-record-btrace.exp
+++ b/gdb/testsuite/gdb.python/py-record-btrace.exp
@@ -35,7 +35,7 @@ if { [skip_python_tests] } {
     return -1
 }
 
-if ![runto_main ] then {
+if {![runto_main]} {
     return -1
 }
 
diff --git a/gdb/testsuite/gdb.python/py-record-full.exp b/gdb/testsuite/gdb.python/py-record-full.exp
index f3ccefa275c..52d6dd3da0b 100644
--- a/gdb/testsuite/gdb.python/py-record-full.exp
+++ b/gdb/testsuite/gdb.python/py-record-full.exp
@@ -35,7 +35,7 @@ if { [skip_python_tests] } {
     return -1
 }
 
-if ![runto_main ] then {
+if {![runto_main]} {
     return -1
 }
 
diff --git a/gdb/testsuite/gdb.python/py-recurse-unwind.exp b/gdb/testsuite/gdb.python/py-recurse-unwind.exp
index 6361417ca9c..711b8b0995f 100644
--- a/gdb/testsuite/gdb.python/py-recurse-unwind.exp
+++ b/gdb/testsuite/gdb.python/py-recurse-unwind.exp
@@ -40,7 +40,7 @@ gdb_test "source ${pyfile}" "Python script imported" \
 
 # The following tests require execution.
 
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 
diff --git a/gdb/testsuite/gdb.python/py-shared.exp b/gdb/testsuite/gdb.python/py-shared.exp
index 7075bc5ee36..8dfd53acd26 100644
--- a/gdb/testsuite/gdb.python/py-shared.exp
+++ b/gdb/testsuite/gdb.python/py-shared.exp
@@ -48,7 +48,7 @@ if { [skip_python_tests] } { continue }
 
 # The following tests require execution.
 
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 
diff --git a/gdb/testsuite/gdb.python/py-symbol.exp b/gdb/testsuite/gdb.python/py-symbol.exp
index ef4f86d005d..ad06b07c2c6 100644
--- a/gdb/testsuite/gdb.python/py-symbol.exp
+++ b/gdb/testsuite/gdb.python/py-symbol.exp
@@ -104,7 +104,7 @@ gdb_test "python print (gdb.lookup_static_symbol ('nonexistent') is None)" \
 gdb_test "python print (gdb.lookup_static_symbol ('qq') is None)" \
     "True" "lookup_static_symbol for global var"
 
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 
@@ -212,7 +212,7 @@ gdb_test "python print (gdb.lookup_global_symbol ('(anonymous namespace)::anon')
 gdb_test "python print (gdb.lookup_static_symbol ('(anonymous namespace)::anon').value ())" \
     "10" "print value of anon"
 
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 
@@ -240,7 +240,7 @@ gdb_test "python print (cplusfunc.addr_class == gdb.SYMBOL_LOC_BLOCK)" "True" "t
 # test as it unloads the object file in GDB.
 # Start with a fresh gdb.
 clean_restart ${binfile}
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 
diff --git a/gdb/testsuite/gdb.python/py-symtab.exp b/gdb/testsuite/gdb.python/py-symtab.exp
index 90750669a83..470710872c1 100644
--- a/gdb/testsuite/gdb.python/py-symtab.exp
+++ b/gdb/testsuite/gdb.python/py-symtab.exp
@@ -27,7 +27,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
 # Skip all tests if Python scripting is not enabled.
 if { [skip_python_tests] } { continue }
 
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 
diff --git a/gdb/testsuite/gdb.python/py-template.exp b/gdb/testsuite/gdb.python/py-template.exp
index 729faef7966..25f3f52f4a3 100644
--- a/gdb/testsuite/gdb.python/py-template.exp
+++ b/gdb/testsuite/gdb.python/py-template.exp
@@ -43,7 +43,7 @@ proc test_template_arg {exefile type} {
 	return -1
     }
     gdb_load ${exefile}
-    if ![runto_main ] then {
+    if {![runto_main]} {
 	perror "couldn't run to breakpoint"
 	return
     }
diff --git a/gdb/testsuite/gdb.python/py-type.exp b/gdb/testsuite/gdb.python/py-type.exp
index 20f5084c332..fbe56f35b4b 100644
--- a/gdb/testsuite/gdb.python/py-type.exp
+++ b/gdb/testsuite/gdb.python/py-type.exp
@@ -41,7 +41,7 @@ proc restart_gdb {exefile} {
   gdb_reinitialize_dir $srcdir/$subdir
   gdb_load ${exefile}
 
-  if ![runto_main ] then {
+  if {![runto_main]} {
       perror "couldn't run to breakpoint"
       return
   }
diff --git a/gdb/testsuite/gdb.python/py-unwind-inline.exp b/gdb/testsuite/gdb.python/py-unwind-inline.exp
index 6667e29e446..b316ec0a3f4 100644
--- a/gdb/testsuite/gdb.python/py-unwind-inline.exp
+++ b/gdb/testsuite/gdb.python/py-unwind-inline.exp
@@ -29,7 +29,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} \
 if { [skip_python_tests] } { continue }
 
 # The following tests require execution.
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 
diff --git a/gdb/testsuite/gdb.python/py-unwind-maint.exp b/gdb/testsuite/gdb.python/py-unwind-maint.exp
index 7c88219089d..28121caf6bb 100644
--- a/gdb/testsuite/gdb.python/py-unwind-maint.exp
+++ b/gdb/testsuite/gdb.python/py-unwind-maint.exp
@@ -29,7 +29,7 @@ if { [skip_python_tests] } { continue }
 
 set pyfile [gdb_remote_download host ${srcdir}/${subdir}/${testfile}.py]
 
-if ![runto_main ] then {
+if {![runto_main]} {
     return -1
 }
 
diff --git a/gdb/testsuite/gdb.python/py-unwind-user-regs.exp b/gdb/testsuite/gdb.python/py-unwind-user-regs.exp
index 3430cbc3fbe..182a5481b56 100644
--- a/gdb/testsuite/gdb.python/py-unwind-user-regs.exp
+++ b/gdb/testsuite/gdb.python/py-unwind-user-regs.exp
@@ -47,7 +47,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
 # Skip all tests if Python scripting is not enabled.
 if { [skip_python_tests] } { continue }
 
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 
diff --git a/gdb/testsuite/gdb.python/py-unwind.exp b/gdb/testsuite/gdb.python/py-unwind.exp
index 798e76525db..515e1c07f21 100644
--- a/gdb/testsuite/gdb.python/py-unwind.exp
+++ b/gdb/testsuite/gdb.python/py-unwind.exp
@@ -37,7 +37,7 @@ if { ![istarget x86_64-*-* ] || ![is_lp64_target] } { continue }
 
 # The following tests require execution.
 
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 
diff --git a/gdb/testsuite/gdb.python/py-value.exp b/gdb/testsuite/gdb.python/py-value.exp
index b88c4515c8c..c04c98da162 100644
--- a/gdb/testsuite/gdb.python/py-value.exp
+++ b/gdb/testsuite/gdb.python/py-value.exp
@@ -415,7 +415,7 @@ proc test_subscript_regression {exefile lang} {
  # Start with a fresh gdb.
  clean_restart ${exefile}
 
- if ![runto_main ] then {
+ if {![runto_main]} {
      perror "couldn't run to breakpoint"
      return
  }
@@ -652,7 +652,7 @@ test_add_to_history
 
 # The following tests require execution.
 
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 
diff --git a/gdb/testsuite/gdb.python/python.exp b/gdb/testsuite/gdb.python/python.exp
index 48ff07e91e5..15ec5256f2c 100644
--- a/gdb/testsuite/gdb.python/python.exp
+++ b/gdb/testsuite/gdb.python/python.exp
@@ -217,7 +217,7 @@ clean_restart ${testfile}
 
 # The following tests require execution.
 
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 
@@ -431,7 +431,7 @@ clean_restart ${testfile}
 
 # The following tests require execution.
 
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 
@@ -486,7 +486,7 @@ clean_restart ${testfile}
 
 # The following tests require execution.
 
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 
-- 
2.25.4


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH 07/14] gdb/testsuite: remove use of then keyword from gdb.threads/*.exp
  2022-11-15 10:42 [PATCH 00/14] Remove all uses of 'then' keyword from the testsuite Andrew Burgess
                   ` (5 preceding siblings ...)
  2022-11-15 10:42 ` [PATCH 06/14] gdb/testsuite: remove use of then keyword from gdb.python/*.exp Andrew Burgess
@ 2022-11-15 10:42 ` Andrew Burgess
  2022-11-15 10:42 ` [PATCH 08/14] gdb/testsuite: remove use of then keyword from gdb.trace/*.exp Andrew Burgess
                   ` (8 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: Andrew Burgess @ 2022-11-15 10:42 UTC (permalink / raw)
  To: gdb-patches; +Cc: Andrew Burgess

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

There should be no changes in what is tested after this commit.
---
 .../gdb.threads/clone-new-thread-event.exp    |  2 +-
 .../gdb.threads/current-lwp-dead.exp          |  2 +-
 .../gdb.threads/detach-step-over.exp          |  2 +-
 .../gdb.threads/fork-child-threads.exp        |  2 +-
 .../gdb.threads/fork-plus-threads.exp         |  2 +-
 .../gdb.threads/fork-thread-pending.exp       |  4 ++--
 .../forking-threads-plus-breakpoint.exp       |  4 ++--
 .../gdb.threads/gcore-stale-thread.exp        |  2 +-
 gdb/testsuite/gdb.threads/gcore-thread.exp    |  4 ++--
 gdb/testsuite/gdb.threads/kill.exp            |  2 +-
 gdb/testsuite/gdb.threads/linux-dp.exp        |  2 +-
 .../gdb.threads/local-watch-wrong-thread.exp  |  2 +-
 .../multiple-successive-infcall.exp           |  2 +-
 .../next-while-other-thread-longjmps.exp      |  2 +-
 gdb/testsuite/gdb.threads/pending-step.exp    |  2 +-
 .../process-dies-while-handling-bp.exp        |  2 +-
 gdb/testsuite/gdb.threads/pthreads.exp        | 16 +++++++--------
 .../gdb.threads/reconnect-signal.exp          |  2 +-
 .../signal-command-handle-nopass.exp          |  2 +-
 ...ignal-command-multiple-signals-pending.exp |  2 +-
 .../signal-delivered-right-thread.exp         |  2 +-
 gdb/testsuite/gdb.threads/signal-sigtrap.exp  |  2 +-
 gdb/testsuite/gdb.threads/sigthread.exp       |  2 +-
 .../gdb.threads/stop-with-handle.exp          |  2 +-
 gdb/testsuite/gdb.threads/thread-find.exp     | 20 +++++++++----------
 gdb/testsuite/gdb.threads/thread_check.exp    |  2 +-
 gdb/testsuite/gdb.threads/thread_events.exp   |  4 ++--
 gdb/testsuite/gdb.threads/threadapply.exp     |  2 +-
 gdb/testsuite/gdb.threads/tls-nodebug-pie.exp |  2 +-
 gdb/testsuite/gdb.threads/tls-nodebug.exp     |  4 ++--
 gdb/testsuite/gdb.threads/tls-shared.exp      |  2 +-
 gdb/testsuite/gdb.threads/tls-so_extern.exp   |  2 +-
 gdb/testsuite/gdb.threads/tls.exp             |  4 ++--
 .../gdb.threads/vfork-follow-child-exec.exp   |  2 +-
 .../gdb.threads/vfork-follow-child-exit.exp   |  2 +-
 gdb/testsuite/gdb.threads/watchthreads.exp    |  2 +-
 gdb/testsuite/gdb.threads/watchthreads2.exp   |  2 +-
 gdb/testsuite/gdb.threads/wp-replication.exp  |  2 +-
 38 files changed, 60 insertions(+), 60 deletions(-)

diff --git a/gdb/testsuite/gdb.threads/clone-new-thread-event.exp b/gdb/testsuite/gdb.threads/clone-new-thread-event.exp
index db5ae39aded..abaad97ebcc 100644
--- a/gdb/testsuite/gdb.threads/clone-new-thread-event.exp
+++ b/gdb/testsuite/gdb.threads/clone-new-thread-event.exp
@@ -16,7 +16,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # This only works on targets with the Linux kernel.
-if ![istarget *-*-linux*] then {
+if {![istarget *-*-linux*]} {
     return
 }
 
diff --git a/gdb/testsuite/gdb.threads/current-lwp-dead.exp b/gdb/testsuite/gdb.threads/current-lwp-dead.exp
index 6728dbe87ab..51866b45b0b 100644
--- a/gdb/testsuite/gdb.threads/current-lwp-dead.exp
+++ b/gdb/testsuite/gdb.threads/current-lwp-dead.exp
@@ -25,7 +25,7 @@
 standard_testfile
 
 # This only works with on Linux targets.
-if ![istarget *-*-linux*] then {
+if {![istarget *-*-linux*]} {
     return
 }
 
diff --git a/gdb/testsuite/gdb.threads/detach-step-over.exp b/gdb/testsuite/gdb.threads/detach-step-over.exp
index 15af7e0e723..88b22e224ae 100644
--- a/gdb/testsuite/gdb.threads/detach-step-over.exp
+++ b/gdb/testsuite/gdb.threads/detach-step-over.exp
@@ -84,7 +84,7 @@ proc test {condition_eval target_non_stop non_stop displaced} {
     gdb_test "inferior 2" "Switching to .*"
 
     gdb_load $binfile
-    if ![runto setup_done] then {
+    if {![runto setup_done]} {
 	fail "can't run to setup_done"
 	kill_wait_spawned_process $test_spawn_id
 	return
diff --git a/gdb/testsuite/gdb.threads/fork-child-threads.exp b/gdb/testsuite/gdb.threads/fork-child-threads.exp
index f2718738cbf..4671c56e50e 100644
--- a/gdb/testsuite/gdb.threads/fork-child-threads.exp
+++ b/gdb/testsuite/gdb.threads/fork-child-threads.exp
@@ -26,7 +26,7 @@ if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executab
 
 clean_restart ${binfile}
 
-if ![runto_main] then {
+if {![runto_main]} {
    return 0
 }
 
diff --git a/gdb/testsuite/gdb.threads/fork-plus-threads.exp b/gdb/testsuite/gdb.threads/fork-plus-threads.exp
index 845d859f95a..55ba77c608f 100644
--- a/gdb/testsuite/gdb.threads/fork-plus-threads.exp
+++ b/gdb/testsuite/gdb.threads/fork-plus-threads.exp
@@ -45,7 +45,7 @@ proc do_test { detach-on-fork } {
 
     set GDBFLAGS $saved_gdbflags
 
-    if ![runto_main] then {
+    if {![runto_main]} {
 	return 0
     }
 
diff --git a/gdb/testsuite/gdb.threads/fork-thread-pending.exp b/gdb/testsuite/gdb.threads/fork-thread-pending.exp
index f83df4e8bc4..4ca2284d6e8 100644
--- a/gdb/testsuite/gdb.threads/fork-thread-pending.exp
+++ b/gdb/testsuite/gdb.threads/fork-thread-pending.exp
@@ -27,7 +27,7 @@ if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executab
 
 clean_restart ${binfile}
 
-if ![runto_main] then {
+if {![runto_main]} {
    return 0
 }
 
@@ -84,7 +84,7 @@ gdb_start
 gdb_reinitialize_dir $srcdir/$subdir
 
 gdb_load ${binfile}
-if ![runto_main] then {
+if {![runto_main]} {
    return 0
 }
 
diff --git a/gdb/testsuite/gdb.threads/forking-threads-plus-breakpoint.exp b/gdb/testsuite/gdb.threads/forking-threads-plus-breakpoint.exp
index a8b3b62f3b5..575761e69a1 100644
--- a/gdb/testsuite/gdb.threads/forking-threads-plus-breakpoint.exp
+++ b/gdb/testsuite/gdb.threads/forking-threads-plus-breakpoint.exp
@@ -38,7 +38,7 @@ proc probe_displaced_stepping_support {} {
 	clean_restart $binfile
 
 	gdb_test_no_output "set displaced on"
-	if ![runto_main] then {
+	if {![runto_main]} {
 	    return 0
 	}
 
@@ -77,7 +77,7 @@ proc do_test { cond_bp_target detach_on_fork displaced } {
     clean_restart $binfile
     set GDBFLAGS $saved_gdbflags
 
-    if ![runto_main] then {
+    if {![runto_main]} {
 	return 0
     }
 
diff --git a/gdb/testsuite/gdb.threads/gcore-stale-thread.exp b/gdb/testsuite/gdb.threads/gcore-stale-thread.exp
index 01a4dc2a753..0811ce8f06b 100644
--- a/gdb/testsuite/gdb.threads/gcore-stale-thread.exp
+++ b/gdb/testsuite/gdb.threads/gcore-stale-thread.exp
@@ -24,7 +24,7 @@ clean_restart ${testfile}
 
 gdb_test_no_output "set non-stop on"
 
-if { ! [ runto_main ] } then {
+if {![runto_main]} {
     return -1
 }
 
diff --git a/gdb/testsuite/gdb.threads/gcore-thread.exp b/gdb/testsuite/gdb.threads/gcore-thread.exp
index 748831ed28e..212920a8fbf 100644
--- a/gdb/testsuite/gdb.threads/gcore-thread.exp
+++ b/gdb/testsuite/gdb.threads/gcore-thread.exp
@@ -22,7 +22,7 @@ set objfile  $binfile.o
 set corefile $binfile.test
 set core0file ${binfile}0.test
 
-if [istarget "*-*-linux"] then {
+if {[istarget "*-*-linux"]} {
     set target_cflags "-D_MIT_POSIX_THREADS"
 } else {
     set target_cflags ""
@@ -55,7 +55,7 @@ set nl "\[\r\n\]+"
 
 set timeout 30
 
-if { ! [ runto_main ] } then {
+if {![runto_main]} {
     return -1
 }
 
diff --git a/gdb/testsuite/gdb.threads/kill.exp b/gdb/testsuite/gdb.threads/kill.exp
index a80c1239eff..992d18236ac 100644
--- a/gdb/testsuite/gdb.threads/kill.exp
+++ b/gdb/testsuite/gdb.threads/kill.exp
@@ -38,7 +38,7 @@ proc test {threaded} {
 	    return -1
 	}
 
-	if { ![runto_main] } then {
+	if {![runto_main]} {
 	    return
 	}
 
diff --git a/gdb/testsuite/gdb.threads/linux-dp.exp b/gdb/testsuite/gdb.threads/linux-dp.exp
index 953e6a9756b..84c68e7cace 100644
--- a/gdb/testsuite/gdb.threads/linux-dp.exp
+++ b/gdb/testsuite/gdb.threads/linux-dp.exp
@@ -35,7 +35,7 @@
 
 
 # This only works with Linux configurations.
-if ![istarget *-*-linux-gnu*] then {
+if {![istarget *-*-linux-gnu*]} {
     return
 }
 
diff --git a/gdb/testsuite/gdb.threads/local-watch-wrong-thread.exp b/gdb/testsuite/gdb.threads/local-watch-wrong-thread.exp
index e94c875f276..9ddcd589226 100644
--- a/gdb/testsuite/gdb.threads/local-watch-wrong-thread.exp
+++ b/gdb/testsuite/gdb.threads/local-watch-wrong-thread.exp
@@ -34,7 +34,7 @@ clean_restart ${binfile}
 
 gdb_test_no_output "set can-use-hw-watchpoints 1" ""
 
-if ![runto_main] then {
+if {![runto_main]} {
     return
 }
 
diff --git a/gdb/testsuite/gdb.threads/multiple-successive-infcall.exp b/gdb/testsuite/gdb.threads/multiple-successive-infcall.exp
index b950107f3d0..4e954129578 100644
--- a/gdb/testsuite/gdb.threads/multiple-successive-infcall.exp
+++ b/gdb/testsuite/gdb.threads/multiple-successive-infcall.exp
@@ -25,7 +25,7 @@ if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" \
 
 clean_restart "${binfile}"
 
-if ![runto_main] then {
+if {![runto_main]} {
    return 0
 }
 
diff --git a/gdb/testsuite/gdb.threads/next-while-other-thread-longjmps.exp b/gdb/testsuite/gdb.threads/next-while-other-thread-longjmps.exp
index a703e841769..e78ccced941 100644
--- a/gdb/testsuite/gdb.threads/next-while-other-thread-longjmps.exp
+++ b/gdb/testsuite/gdb.threads/next-while-other-thread-longjmps.exp
@@ -27,7 +27,7 @@ if {[prepare_for_testing "failed to prepare" \
     return -1
 }
 
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 
diff --git a/gdb/testsuite/gdb.threads/pending-step.exp b/gdb/testsuite/gdb.threads/pending-step.exp
index 89d1ecd853d..158cfed4057 100644
--- a/gdb/testsuite/gdb.threads/pending-step.exp
+++ b/gdb/testsuite/gdb.threads/pending-step.exp
@@ -56,7 +56,7 @@ if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executab
 
 clean_restart ${binfile}
 
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 
diff --git a/gdb/testsuite/gdb.threads/process-dies-while-handling-bp.exp b/gdb/testsuite/gdb.threads/process-dies-while-handling-bp.exp
index d6308059415..626143493c0 100644
--- a/gdb/testsuite/gdb.threads/process-dies-while-handling-bp.exp
+++ b/gdb/testsuite/gdb.threads/process-dies-while-handling-bp.exp
@@ -45,7 +45,7 @@ proc do_test { non_stop cond_bp_target } {
     clean_restart $binfile
     set GDBFLAGS $saved_gdbflags
 
-    if ![runto_main] then {
+    if {![runto_main]} {
 	return 0
     }
 
diff --git a/gdb/testsuite/gdb.threads/pthreads.exp b/gdb/testsuite/gdb.threads/pthreads.exp
index d2df4e07159..4cd104fb7b9 100644
--- a/gdb/testsuite/gdb.threads/pthreads.exp
+++ b/gdb/testsuite/gdb.threads/pthreads.exp
@@ -27,7 +27,7 @@ standard_testfile
 # carriage return)
 set horiz "\[^\n\r\]*"
 
-if [istarget "*-*-linux"] then {
+if {[istarget "*-*-linux"]} {
     set target_cflags "-D_MIT_POSIX_THREADS"
 } else {
     set target_cflags ""
@@ -79,7 +79,7 @@ proc all_threads_running {} {
 	}
     }
 
-    if { $return_me == 1 } then {
+    if {$return_me == 1} {
 	return 0
     }
 
@@ -139,7 +139,7 @@ proc test_startup {} {
 	}
     }
 
-    if { $return_me == 1 } then {
+    if {$return_me == 1} {
 	return 0
     }
 
@@ -189,7 +189,7 @@ proc check_control_c {} {
 
     # Verify that all threads are running.
     with_test_prefix "after startup" {
-	if [all_threads_running] then {
+	if {[all_threads_running]} {
 	    pass "all threads running after startup"
 	}
     }
@@ -219,7 +219,7 @@ proc check_control_c {} {
 
     # Verify that all threads can be run again after a ^C stop.
     with_test_prefix "after continue" {
-	if [all_threads_running] then {
+	if {[all_threads_running]} {
 	    pass "all threads running after continuing from ^C stop"
 	}
     }
@@ -345,9 +345,9 @@ proc check_qcs {} {
 
 }
 
-if [runto_main] then {
-    if [test_startup] then {
-	if [check_control_c] then {
+if {[runto_main]} {
+    if {[test_startup]} {
+	if {[check_control_c]} {
 	    warning "Could not stop child with ^C; skipping rest of tests.\n"
 	    return
 	}
diff --git a/gdb/testsuite/gdb.threads/reconnect-signal.exp b/gdb/testsuite/gdb.threads/reconnect-signal.exp
index 4b90c92ecbf..3edaa31b7d3 100644
--- a/gdb/testsuite/gdb.threads/reconnect-signal.exp
+++ b/gdb/testsuite/gdb.threads/reconnect-signal.exp
@@ -33,7 +33,7 @@ if { [gdb_compile_pthreads \
 
 clean_restart $executable
 
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 
diff --git a/gdb/testsuite/gdb.threads/signal-command-handle-nopass.exp b/gdb/testsuite/gdb.threads/signal-command-handle-nopass.exp
index e18d12d7394..47a6fc3d2c4 100644
--- a/gdb/testsuite/gdb.threads/signal-command-handle-nopass.exp
+++ b/gdb/testsuite/gdb.threads/signal-command-handle-nopass.exp
@@ -40,7 +40,7 @@ proc test { step_over } {
     with_test_prefix "step-over $step_over" {
 	clean_restart ${binfile}
 
-	if ![runto_main] then {
+	if {![runto_main]} {
 	    return 0
 	}
 
diff --git a/gdb/testsuite/gdb.threads/signal-command-multiple-signals-pending.exp b/gdb/testsuite/gdb.threads/signal-command-multiple-signals-pending.exp
index ba7bb26178c..6c56377c461 100644
--- a/gdb/testsuite/gdb.threads/signal-command-multiple-signals-pending.exp
+++ b/gdb/testsuite/gdb.threads/signal-command-multiple-signals-pending.exp
@@ -37,7 +37,7 @@ proc test { schedlock } {
     with_test_prefix "schedlock $schedlock" {
 	clean_restart ${binfile}
 
-	if ![runto_main] then {
+	if {![runto_main]} {
 	    return 0
 	}
 
diff --git a/gdb/testsuite/gdb.threads/signal-delivered-right-thread.exp b/gdb/testsuite/gdb.threads/signal-delivered-right-thread.exp
index 4e9d9ee6017..e041ffafa4c 100644
--- a/gdb/testsuite/gdb.threads/signal-delivered-right-thread.exp
+++ b/gdb/testsuite/gdb.threads/signal-delivered-right-thread.exp
@@ -34,7 +34,7 @@ proc test { command } {
     with_test_prefix "$command" {
 	clean_restart ${binfile}
 
-	if ![runto_main] then {
+	if {![runto_main]} {
 	    return 0
 	}
 
diff --git a/gdb/testsuite/gdb.threads/signal-sigtrap.exp b/gdb/testsuite/gdb.threads/signal-sigtrap.exp
index 1866ab9dd07..7aba001d4f6 100644
--- a/gdb/testsuite/gdb.threads/signal-sigtrap.exp
+++ b/gdb/testsuite/gdb.threads/signal-sigtrap.exp
@@ -37,7 +37,7 @@ proc test { sigtrap_thread } {
     with_test_prefix "sigtrap thread $sigtrap_thread" {
 	clean_restart ${binfile}
 
-	if ![runto "thread_function"] then {
+	if {![runto "thread_function"]} {
 	    return 0
 	}
 
diff --git a/gdb/testsuite/gdb.threads/sigthread.exp b/gdb/testsuite/gdb.threads/sigthread.exp
index 8e068cd9516..d650b872f2d 100644
--- a/gdb/testsuite/gdb.threads/sigthread.exp
+++ b/gdb/testsuite/gdb.threads/sigthread.exp
@@ -23,7 +23,7 @@ if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" \
 
 clean_restart ${binfile}
 
-if ![runto_main] then {
+if {![runto_main]} {
    return 0
 }
 
diff --git a/gdb/testsuite/gdb.threads/stop-with-handle.exp b/gdb/testsuite/gdb.threads/stop-with-handle.exp
index fccafd8acbf..b3336c2c609 100644
--- a/gdb/testsuite/gdb.threads/stop-with-handle.exp
+++ b/gdb/testsuite/gdb.threads/stop-with-handle.exp
@@ -28,7 +28,7 @@ if {[prepare_for_testing "failed to prepare" \
     return -1
 }
 
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 
diff --git a/gdb/testsuite/gdb.threads/thread-find.exp b/gdb/testsuite/gdb.threads/thread-find.exp
index fb23df10b88..f60caff74dd 100644
--- a/gdb/testsuite/gdb.threads/thread-find.exp
+++ b/gdb/testsuite/gdb.threads/thread-find.exp
@@ -67,7 +67,7 @@ gdb_test_multiple "info threads" "collect thread id" {
     }
 }
 
-if { [info exists thread6] } then {
+if {[info exists thread6]} {
     gdb_test "echo $thread6\\n" "$thread6" "got thread ids"
 }
 
@@ -84,7 +84,7 @@ gdb_test_multiple "info threads" "collect thread id" {
     }
 }
 
-if { [info exists process6] } then {
+if {[info exists process6]} {
     gdb_test "echo $process6\\n" "$process6" "got process ids"
 }
 
@@ -101,7 +101,7 @@ gdb_test_multiple "info threads" "collect thread id" {
     }
 }
 
-if { [info exists lwp6] } then {
+if {[info exists lwp6]} {
     gdb_test "echo $lwp6\\n" "$lwp6" "got lwp ids"
 }
 
@@ -126,7 +126,7 @@ gdb_test "thread find threadname_1" \
 # Test 'thread find' with thread ids, if any.
 #
 
-if { [info exists thread6] } then {
+if {[info exists thread6]} {
     gdb_test "thread find $thread6" \
 	"Thread 6 has .*$thread6.*" "find thread id 6"
     gdb_test "thread find $thread5" \
@@ -145,7 +145,7 @@ if { [info exists thread6] } then {
 # Test 'thread find' with process ids, if any.
 #
 
-if { [info exists process6] } then {
+if {[info exists process6]} {
     gdb_test "thread find $process6" \
 	"Thread 6 has .*$process6.*" "find process id 6"
     gdb_test "thread find $process5" \
@@ -164,7 +164,7 @@ if { [info exists process6] } then {
 # Test 'thread find' with lwp ids, if any.
 #
 
-if { [info exists lwp6] } then {
+if {[info exists lwp6]} {
     gdb_test "thread find $lwp6" \
 	"Thread 6 has .*$lwp6.*" "find lwp id 6"
     gdb_test "thread find $lwp5" \
@@ -197,7 +197,7 @@ gdb_test_multiple "thread find threadname_\[345\]" "test regular exp" {
 	exp_continue
     }
     -re ".*$gdb_prompt $" {
-	if { $see3 && $see4 && $see5 && !$see1 && !$see2 && !$see6 } then {
+	if {$see3 && $see4 && $see5 && !$see1 && !$see2 && !$see6} {
 	    pass "test regular exp"
 	} else {
 	    fail "test regular exp"
@@ -219,7 +219,7 @@ gdb_test_multiple "info threads 2 4 6" "info threads 2 4 6" {
 	exp_continue
     }
     -re "$gdb_prompt $" {
-	if { $see2 && $see4 && $see6 && !$see1 && !$see3 && !$see5 } then {
+	if {$see2 && $see4 && $see6 && !$see1 && !$see3 && !$see5} {
 	    pass "info threads 2 4 6"
 	} else {
 	    fail "info threads 2 4 6"
@@ -241,7 +241,7 @@ gdb_test_multiple "info threads 3-5" "info threads 3-5" {
 	exp_continue
     }
     -re "$gdb_prompt $" {
-	if { $see3 && $see4 && $see5 && !$see1 && !$see2 && !$see6 } then {
+	if {$see3 && $see4 && $see5 && !$see1 && !$see2 && !$see6} {
 	    pass "info threads 3-5"
 	} else {
 	    fail "info threads 3-5"
@@ -265,7 +265,7 @@ gdb_test_multiple "info threads 3-3" "info threads 3-3" {
 	exp_continue
     }
     -re ".*$gdb_prompt $" {
-	if { $see3 && !$see1 && !$see2 && !$see4 && !$see5 && !$see6 } then {
+	if {$see3 && !$see1 && !$see2 && !$see4 && !$see5 && !$see6} {
 	    pass "info threads 3-3"
 	} else {
 	    fail "info threads 3-3"
diff --git a/gdb/testsuite/gdb.threads/thread_check.exp b/gdb/testsuite/gdb.threads/thread_check.exp
index 61ec078a85a..03431fd56a4 100644
--- a/gdb/testsuite/gdb.threads/thread_check.exp
+++ b/gdb/testsuite/gdb.threads/thread_check.exp
@@ -41,7 +41,7 @@ if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executab
 
 clean_restart ${binfile}
 
-if ![runto_main] then {
+if {![runto_main]} {
       return 1
 }
 
diff --git a/gdb/testsuite/gdb.threads/thread_events.exp b/gdb/testsuite/gdb.threads/thread_events.exp
index a612d223396..6cd935a39a1 100644
--- a/gdb/testsuite/gdb.threads/thread_events.exp
+++ b/gdb/testsuite/gdb.threads/thread_events.exp
@@ -23,7 +23,7 @@
 
 # This test has only been verified with Linux targets, and would need
 # to be generalized to support other targets
-if ![istarget *-*-linux*] then {
+if {![istarget *-*-linux*]} {
     return
 }
 
@@ -112,7 +112,7 @@ proc test_thread_messages {enabled} {
 
   # The initial thread may log a 'New Thread' message, but we don't
   # check for it.
-  if ![runto_main] then {
+  if {![runto_main]} {
      return 1
   }
 
diff --git a/gdb/testsuite/gdb.threads/threadapply.exp b/gdb/testsuite/gdb.threads/threadapply.exp
index c8b73d13400..8302773ec13 100644
--- a/gdb/testsuite/gdb.threads/threadapply.exp
+++ b/gdb/testsuite/gdb.threads/threadapply.exp
@@ -31,7 +31,7 @@ clean_restart ${binfile}
 # Run to `main' where we begin our tests.
 #
 
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 
diff --git a/gdb/testsuite/gdb.threads/tls-nodebug-pie.exp b/gdb/testsuite/gdb.threads/tls-nodebug-pie.exp
index 88cabac71c8..5873796ad32 100644
--- a/gdb/testsuite/gdb.threads/tls-nodebug-pie.exp
+++ b/gdb/testsuite/gdb.threads/tls-nodebug-pie.exp
@@ -21,7 +21,7 @@ if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executab
 }
 
 clean_restart ${binfile}
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 
diff --git a/gdb/testsuite/gdb.threads/tls-nodebug.exp b/gdb/testsuite/gdb.threads/tls-nodebug.exp
index 6b8023a91b9..00e539b7d14 100644
--- a/gdb/testsuite/gdb.threads/tls-nodebug.exp
+++ b/gdb/testsuite/gdb.threads/tls-nodebug.exp
@@ -16,7 +16,7 @@
 
 standard_testfile
 
-if [istarget "*-*-linux"] then {
+if {[istarget "*-*-linux"]} {
     set target_cflags "-D_MIT_POSIX_THREADS"
 } else {
     set target_cflags ""
@@ -27,7 +27,7 @@ if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executab
 }
 
 clean_restart ${binfile}
-if ![runto_main] then {
+if {![runto_main]} {
    return 0
 }
 
diff --git a/gdb/testsuite/gdb.threads/tls-shared.exp b/gdb/testsuite/gdb.threads/tls-shared.exp
index cff80f86049..8f0f9ec62fd 100644
--- a/gdb/testsuite/gdb.threads/tls-shared.exp
+++ b/gdb/testsuite/gdb.threads/tls-shared.exp
@@ -32,7 +32,7 @@ if { [gdb_compile_shlib_pthreads ${srcdir}/${subdir}/${srcfile_lib} ${binfile_li
 clean_restart ${binfile}
 gdb_load_shlib ${binfile_lib}
 
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 
diff --git a/gdb/testsuite/gdb.threads/tls-so_extern.exp b/gdb/testsuite/gdb.threads/tls-so_extern.exp
index e6783175904..b885c0beaca 100644
--- a/gdb/testsuite/gdb.threads/tls-so_extern.exp
+++ b/gdb/testsuite/gdb.threads/tls-so_extern.exp
@@ -31,7 +31,7 @@ if { [gdb_compile_shlib_pthreads ${srcdir}/${subdir}/${srcfile_lib} ${binfile_li
 clean_restart ${binfile}
 gdb_load_shlib ${binfile_lib}
 
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 
diff --git a/gdb/testsuite/gdb.threads/tls.exp b/gdb/testsuite/gdb.threads/tls.exp
index 4f88c0ec987..f041571926d 100644
--- a/gdb/testsuite/gdb.threads/tls.exp
+++ b/gdb/testsuite/gdb.threads/tls.exp
@@ -18,7 +18,7 @@ load_lib gdb-python.exp
 
 standard_testfile tls.c tls2.c
 
-if [istarget "*-*-linux"] then {
+if {[istarget "*-*-linux"]} {
     set target_cflags "-D_MIT_POSIX_THREADS"
 } else {
     set target_cflags ""
@@ -167,7 +167,7 @@ gdb_test_multiple "print a_thread_local" "" {
     }
 }
 
-if ![runto_main] then {
+if {![runto_main]} {
    return 0
 }
 
diff --git a/gdb/testsuite/gdb.threads/vfork-follow-child-exec.exp b/gdb/testsuite/gdb.threads/vfork-follow-child-exec.exp
index c679857cb6b..0398e226641 100644
--- a/gdb/testsuite/gdb.threads/vfork-follow-child-exec.exp
+++ b/gdb/testsuite/gdb.threads/vfork-follow-child-exec.exp
@@ -30,7 +30,7 @@ proc test_vfork {detach} {
 
     clean_restart $binfile
 
-    if ![runto_main] then {
+    if {![runto_main]} {
 	return 0
     }
 
diff --git a/gdb/testsuite/gdb.threads/vfork-follow-child-exit.exp b/gdb/testsuite/gdb.threads/vfork-follow-child-exit.exp
index aff4ad241fa..0bff3aff697 100644
--- a/gdb/testsuite/gdb.threads/vfork-follow-child-exit.exp
+++ b/gdb/testsuite/gdb.threads/vfork-follow-child-exit.exp
@@ -30,7 +30,7 @@ proc test_vfork {detach} {
 
     clean_restart $binfile
 
-    if ![runto_main] then {
+    if {![runto_main]} {
 	return 0
     }
 
diff --git a/gdb/testsuite/gdb.threads/watchthreads.exp b/gdb/testsuite/gdb.threads/watchthreads.exp
index 7003044a177..7fac8a3df80 100644
--- a/gdb/testsuite/gdb.threads/watchthreads.exp
+++ b/gdb/testsuite/gdb.threads/watchthreads.exp
@@ -44,7 +44,7 @@ gdb_test_no_output "set can-use-hw-watchpoints 1" ""
 # Run to `main' where we begin our tests.
 #
 
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 
diff --git a/gdb/testsuite/gdb.threads/watchthreads2.exp b/gdb/testsuite/gdb.threads/watchthreads2.exp
index 2c18b20257c..8b887f2a944 100644
--- a/gdb/testsuite/gdb.threads/watchthreads2.exp
+++ b/gdb/testsuite/gdb.threads/watchthreads2.exp
@@ -41,7 +41,7 @@ gdb_test_no_output "set can-use-hw-watchpoints 1" ""
 # Run to `main' where we begin our tests.
 #
 
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 
diff --git a/gdb/testsuite/gdb.threads/wp-replication.exp b/gdb/testsuite/gdb.threads/wp-replication.exp
index d1c5b9df2d5..bec3d10fd67 100644
--- a/gdb/testsuite/gdb.threads/wp-replication.exp
+++ b/gdb/testsuite/gdb.threads/wp-replication.exp
@@ -42,7 +42,7 @@ clean_restart ${binfile}
 gdb_test_no_output "set can-use-hw-watchpoints 1" ""
 
 # Run to `main' where we begin our tests.
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 
-- 
2.25.4


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH 08/14] gdb/testsuite: remove use of then keyword from gdb.trace/*.exp
  2022-11-15 10:42 [PATCH 00/14] Remove all uses of 'then' keyword from the testsuite Andrew Burgess
                   ` (6 preceding siblings ...)
  2022-11-15 10:42 ` [PATCH 07/14] gdb/testsuite: remove use of then keyword from gdb.threads/*.exp Andrew Burgess
@ 2022-11-15 10:42 ` Andrew Burgess
  2022-11-15 10:42 ` [PATCH 09/14] gdb/testsuite: remove use of then keyword from gdb.reverse/*.exp Andrew Burgess
                   ` (7 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: Andrew Burgess @ 2022-11-15 10:42 UTC (permalink / raw)
  To: gdb-patches; +Cc: Andrew Burgess

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

There should be no changes in what is tested after this commit.
---
 gdb/testsuite/gdb.trace/actions.exp               |  4 ++--
 gdb/testsuite/gdb.trace/backtrace.exp             |  4 ++--
 gdb/testsuite/gdb.trace/change-loc.exp            |  2 +-
 gdb/testsuite/gdb.trace/collection.exp            |  2 +-
 gdb/testsuite/gdb.trace/deltrace.exp              |  6 +++---
 gdb/testsuite/gdb.trace/infotrace.exp             |  4 ++--
 gdb/testsuite/gdb.trace/mi-tracepoint-changed.exp |  2 +-
 gdb/testsuite/gdb.trace/mi-tsv-changed.exp        |  2 +-
 gdb/testsuite/gdb.trace/no-attach-trace.exp       |  2 +-
 gdb/testsuite/gdb.trace/packetlen.exp             |  2 +-
 gdb/testsuite/gdb.trace/passc-dyn.exp             |  6 +++---
 gdb/testsuite/gdb.trace/passcount.exp             |  4 ++--
 gdb/testsuite/gdb.trace/report.exp                |  4 ++--
 gdb/testsuite/gdb.trace/save-trace.exp            |  2 +-
 gdb/testsuite/gdb.trace/strace.exp                |  2 +-
 gdb/testsuite/gdb.trace/tfind.exp                 | 10 +++++-----
 gdb/testsuite/gdb.trace/tracecmd.exp              |  2 +-
 gdb/testsuite/gdb.trace/tspeed.exp                |  4 ++--
 gdb/testsuite/gdb.trace/tsv.exp                   |  6 +++---
 gdb/testsuite/gdb.trace/unavailable.exp           |  2 +-
 gdb/testsuite/gdb.trace/while-dyn.exp             |  2 +-
 gdb/testsuite/gdb.trace/while-stepping.exp        |  2 +-
 22 files changed, 38 insertions(+), 38 deletions(-)

diff --git a/gdb/testsuite/gdb.trace/actions.exp b/gdb/testsuite/gdb.trace/actions.exp
index c14fb27e3f6..397b30e484b 100644
--- a/gdb/testsuite/gdb.trace/actions.exp
+++ b/gdb/testsuite/gdb.trace/actions.exp
@@ -42,7 +42,7 @@ gdb_file_cmd $binfile
 # all subsequent line numbers are relative to this first one (baseline)
 
 set baseline  [gdb_find_recursion_test_baseline $srcfile]
-if { $baseline == -1 } then {
+if {$baseline == -1} {
     fail "could not find gdb_recursion_test function"
     return
 }
@@ -57,7 +57,7 @@ gdb_delete_tracepoints
 set trcpt1 [gdb_gettpnum gdb_c_test]
 set trcpt2 [gdb_gettpnum gdb_asm_test]
 set trcpt3 [gdb_gettpnum $testline1]
-if { $trcpt1 <= 0 || $trcpt2 <= 0 || $trcpt3 <= 0 } then {
+if {$trcpt1 <= 0 || $trcpt2 <= 0 || $trcpt3 <= 0} {
     fail "setting tracepoints"
     return
 }
diff --git a/gdb/testsuite/gdb.trace/backtrace.exp b/gdb/testsuite/gdb.trace/backtrace.exp
index ec068b20d4a..20f0a388afc 100644
--- a/gdb/testsuite/gdb.trace/backtrace.exp
+++ b/gdb/testsuite/gdb.trace/backtrace.exp
@@ -35,7 +35,7 @@ if ![runto_main] {
     return -1
 }
 
-if { ![gdb_target_supports_trace] } then {
+if {![gdb_target_supports_trace]} {
     unsupported "current target does not support trace"
     return 1
 
@@ -106,7 +106,7 @@ all tests in this module will fail."
     }
 }
 
-if { $return_me == 1 } then {
+if {$return_me == 1} {
     return -1
 }
 
diff --git a/gdb/testsuite/gdb.trace/change-loc.exp b/gdb/testsuite/gdb.trace/change-loc.exp
index 5e31d0c77f6..4710b8d0952 100644
--- a/gdb/testsuite/gdb.trace/change-loc.exp
+++ b/gdb/testsuite/gdb.trace/change-loc.exp
@@ -53,7 +53,7 @@ if ![runto_main] {
     return -1
 }
 
-if { ![gdb_target_supports_trace] } then {
+if {![gdb_target_supports_trace]} {
     unsupported "current target does not support trace"
     return -1
 }
diff --git a/gdb/testsuite/gdb.trace/collection.exp b/gdb/testsuite/gdb.trace/collection.exp
index c261b3c824d..c290684e0d8 100644
--- a/gdb/testsuite/gdb.trace/collection.exp
+++ b/gdb/testsuite/gdb.trace/collection.exp
@@ -796,7 +796,7 @@ proc gdb_trace_collection_test {} {
 
 runto_main
 
-if { ![gdb_target_supports_trace] } then {
+if {![gdb_target_supports_trace]} {
     unsupported "current target does not support trace"
     return 1
 }
diff --git a/gdb/testsuite/gdb.trace/deltrace.exp b/gdb/testsuite/gdb.trace/deltrace.exp
index 1e2f10f7636..605223aa3db 100644
--- a/gdb/testsuite/gdb.trace/deltrace.exp
+++ b/gdb/testsuite/gdb.trace/deltrace.exp
@@ -43,7 +43,7 @@ gdb_file_cmd $binfile
 # define relative source line numbers:
 # all subsequent line numbers are relative to this first one (baseline)
 set baseline [gdb_find_recursion_test_baseline $srcfile]
-if { $baseline == -1 } then {
+if {$baseline == -1} {
     fail "could not find gdb_recursion_test function"
     return
 }
@@ -81,7 +81,7 @@ gdb_delete_tracepoints
 set trcpt1 [gdb_gettpnum gdb_c_test]
 set trcpt2 [gdb_gettpnum gdb_asm_test]
 set trcpt3 [gdb_gettpnum $testline1]
-if { $trcpt1 <= 0 || $trcpt2 <= 0 || $trcpt3 <= 0 } then {
+if {$trcpt1 <= 0 || $trcpt2 <= 0 || $trcpt3 <= 0} {
     fail "setting tracepoints"
     return
 }
@@ -159,7 +159,7 @@ gdb_delete_tracepoints
 set trcpt1 [gdb_gettpnum gdb_c_test]
 set trcpt2 [gdb_gettpnum gdb_asm_test]
 set trcpt3 [gdb_gettpnum $testline1]
-if { $trcpt1 <= 0 || $trcpt2 <= 0 || $trcpt3 <= 0 } then {
+if {$trcpt1 <= 0 || $trcpt2 <= 0 || $trcpt3 <= 0} {
     fail "setting tracepoints"
     return
 }
diff --git a/gdb/testsuite/gdb.trace/infotrace.exp b/gdb/testsuite/gdb.trace/infotrace.exp
index 1504fb36508..912e29123d3 100644
--- a/gdb/testsuite/gdb.trace/infotrace.exp
+++ b/gdb/testsuite/gdb.trace/infotrace.exp
@@ -47,7 +47,7 @@ gdb_file_cmd $binfile
 gdb_delete_tracepoints
 set c_test_num [gdb_gettpnum gdb_c_test]
 set asm_test_num [gdb_gettpnum gdb_asm_test]
-if { $c_test_num <= 0 || $asm_test_num <= 0 } then {
+if {$c_test_num <= 0 || $asm_test_num <= 0} {
     fail "setting tracepoints"
     return
 }
@@ -111,7 +111,7 @@ if {[gdb_test "" "Breakpoint ${decimal}, main.*" "run to main"] != 0} {
     return -1
 }
 
-if { ![gdb_target_supports_trace] } then {
+if {![gdb_target_supports_trace]} {
     unsupported "current target does not support trace"
     return 1
 }
diff --git a/gdb/testsuite/gdb.trace/mi-tracepoint-changed.exp b/gdb/testsuite/gdb.trace/mi-tracepoint-changed.exp
index 517e0394e06..abf5fec1ba2 100644
--- a/gdb/testsuite/gdb.trace/mi-tracepoint-changed.exp
+++ b/gdb/testsuite/gdb.trace/mi-tracepoint-changed.exp
@@ -69,7 +69,7 @@ proc test_reconnect { } {
 	clean_restart $executable
 	gdb_load_shlib $lib_sl1
 	gdb_load_shlib $lib_sl2
-	if ![runto_main] then {
+	if {![runto_main]} {
 	    return 0
 	}
 	# Create tracepoints on marker and main, and leave them in the
diff --git a/gdb/testsuite/gdb.trace/mi-tsv-changed.exp b/gdb/testsuite/gdb.trace/mi-tsv-changed.exp
index 96251c900e7..a2cfa70b8f3 100644
--- a/gdb/testsuite/gdb.trace/mi-tsv-changed.exp
+++ b/gdb/testsuite/gdb.trace/mi-tsv-changed.exp
@@ -151,7 +151,7 @@ proc test_upload_tsv { } {
 	}
 
 	clean_restart $testfile
-	if ![runto_main] then {
+	if {![runto_main]} {
 	    return 0
 	}
 
diff --git a/gdb/testsuite/gdb.trace/no-attach-trace.exp b/gdb/testsuite/gdb.trace/no-attach-trace.exp
index b16ca83afa6..67a908de575 100644
--- a/gdb/testsuite/gdb.trace/no-attach-trace.exp
+++ b/gdb/testsuite/gdb.trace/no-attach-trace.exp
@@ -30,7 +30,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
 # can start programs ("run"), such as e.g., extended-remote gdbserver.
 clean_restart $testfile
 
-if { ![gdb_target_supports_trace] } then {
+if {![gdb_target_supports_trace]} {
     unsupported "current target does not support trace"
     return 1
 }
diff --git a/gdb/testsuite/gdb.trace/packetlen.exp b/gdb/testsuite/gdb.trace/packetlen.exp
index 9f019acaa00..0330e82c1a0 100644
--- a/gdb/testsuite/gdb.trace/packetlen.exp
+++ b/gdb/testsuite/gdb.trace/packetlen.exp
@@ -37,7 +37,7 @@ gdb_test "tfind none"  ".*" ""
 runto_main
 gdb_reinitialize_dir $srcdir/$subdir
 
-if { ![gdb_target_supports_trace] } then {
+if {![gdb_target_supports_trace]} {
     unsupported "current target does not support trace"
     return 1
 
diff --git a/gdb/testsuite/gdb.trace/passc-dyn.exp b/gdb/testsuite/gdb.trace/passc-dyn.exp
index 747e4207dd0..63f4788d07b 100644
--- a/gdb/testsuite/gdb.trace/passc-dyn.exp
+++ b/gdb/testsuite/gdb.trace/passc-dyn.exp
@@ -34,7 +34,7 @@ gdb_load $binfile
 runto_main
 gdb_reinitialize_dir $srcdir/$subdir
 
-if { ![gdb_target_supports_trace] } then {
+if {![gdb_target_supports_trace]} {
     unsupported "current target does not support trace"
     return 1
 
@@ -50,7 +50,7 @@ if { ![gdb_target_supports_trace] } then {
 
 set baseline [gdb_find_recursion_test_baseline $srcfile]
 
-if { $baseline == -1 } then {
+if {$baseline == -1} {
     fail "could not find gdb_recursion_test function"
     return
 }
@@ -74,7 +74,7 @@ gdb_delete_tracepoints
 set tdp2 [gdb_gettpnum "$testline2"]
 set tdp3 [gdb_gettpnum "$testline3"]
 set tdp4 [gdb_gettpnum "$testline4"]
-if { $tdp2 <= 0 || $tdp3 <= 0 || $tdp4 <= 0 } then {
+if {$tdp2 <= 0 || $tdp3 <= 0 || $tdp4 <= 0} {
     fail "setting tracepoints"
     return
 }
diff --git a/gdb/testsuite/gdb.trace/passcount.exp b/gdb/testsuite/gdb.trace/passcount.exp
index 52c95c53367..bbb3be7d583 100644
--- a/gdb/testsuite/gdb.trace/passcount.exp
+++ b/gdb/testsuite/gdb.trace/passcount.exp
@@ -40,7 +40,7 @@ gdb_file_cmd $binfile
 # define relative source line numbers:
 # all subsequent line numbers are relative to this first one (baseline)
 set baseline  [gdb_find_recursion_test_baseline $srcfile]
-if { $baseline == -1 } then {
+if {$baseline == -1} {
     fail "could not find gdb_recursion_test function"
     return
 }
@@ -55,7 +55,7 @@ gdb_delete_tracepoints
 set trcpt1 [gdb_gettpnum gdb_c_test]
 set trcpt2 [gdb_gettpnum gdb_asm_test]
 set trcpt3 [gdb_gettpnum $testline1]
-if { $trcpt1 <= 0 || $trcpt2 <= 0 || $trcpt3 <= 0 } then {
+if {$trcpt1 <= 0 || $trcpt2 <= 0 || $trcpt3 <= 0} {
     fail "setting tracepoints"
     return
 }
diff --git a/gdb/testsuite/gdb.trace/report.exp b/gdb/testsuite/gdb.trace/report.exp
index 7b3678d29f3..33e803bd4fe 100644
--- a/gdb/testsuite/gdb.trace/report.exp
+++ b/gdb/testsuite/gdb.trace/report.exp
@@ -35,7 +35,7 @@ gdb_load $binfile
 runto_main
 gdb_reinitialize_dir $srcdir/$subdir
 
-if { ![gdb_target_supports_trace] } then {
+if {![gdb_target_supports_trace]} {
     unsupported "current target does not support trace"
     return 1
 
@@ -111,7 +111,7 @@ all tests in this module will fail."
     } 
 }
 
-if { $return_me == 1 } then {
+if {$return_me == 1} {
     return -1
 }
 
diff --git a/gdb/testsuite/gdb.trace/save-trace.exp b/gdb/testsuite/gdb.trace/save-trace.exp
index 0eac0b5503c..ddeb20360aa 100644
--- a/gdb/testsuite/gdb.trace/save-trace.exp
+++ b/gdb/testsuite/gdb.trace/save-trace.exp
@@ -41,7 +41,7 @@ gdb_file_cmd $binfile
 # define relative source line numbers:
 # all subsequent line numbers are relative to this first one (baseline)
 set baseline  [gdb_find_recursion_test_baseline $srcfile]
-if { $baseline == -1 } then {
+if {$baseline == -1} {
     fail "could not find gdb_recursion_test function"
     return
 }
diff --git a/gdb/testsuite/gdb.trace/strace.exp b/gdb/testsuite/gdb.trace/strace.exp
index d015381899b..2e754891903 100644
--- a/gdb/testsuite/gdb.trace/strace.exp
+++ b/gdb/testsuite/gdb.trace/strace.exp
@@ -370,7 +370,7 @@ gdb_load_shlib $libipa
 if ![runto_main] {
     return -1
 }
-if { ![gdb_target_supports_trace] } then {
+if {![gdb_target_supports_trace]} {
     # At this point, the socket file has been created.  We must make sure it is
     # removed when we return here.  GDB detaches inferior so that the socket
     # file can be removed.  Note that GDB simply kill inferior doesn't remove
diff --git a/gdb/testsuite/gdb.trace/tfind.exp b/gdb/testsuite/gdb.trace/tfind.exp
index 57b7b2fad70..66b744fc11b 100644
--- a/gdb/testsuite/gdb.trace/tfind.exp
+++ b/gdb/testsuite/gdb.trace/tfind.exp
@@ -65,7 +65,7 @@ gdb_test "help tfind trace" "Select a trace frame by tracepoint number.*" \
 runto_main
 gdb_reinitialize_dir $srcdir/$subdir
 
-if { ![gdb_target_supports_trace] } then {
+if {![gdb_target_supports_trace]} {
     unsupported "current target does not support trace"
     return 1
 
@@ -77,7 +77,7 @@ if { ![gdb_target_supports_trace] } then {
 # define relative source line numbers:
 # all subsequent line numbers are relative to this first one (baseline)
 set baseline  [gdb_find_recursion_test_baseline $srcfile]
-if { $baseline == -1 } then {
+if {$baseline == -1} {
     fail "could not find gdb_recursion_test function"
     return
 }
@@ -123,7 +123,7 @@ gdb_test_multiple "tstart" "6.1: tstart" {
     }
 }
 
-if { $return_me == 1 } then {
+if {$return_me == 1} {
     return -1
 }
 
@@ -154,7 +154,7 @@ gdb_test_multiple "tstop" "7.1: tstop" {
     }
 }
 
-if { $return_me == 1 } then {
+if {$return_me == 1} {
     return -1
 }
 
@@ -164,7 +164,7 @@ gdb_test "tstatus" "Trace stopped by a tstop command.*" \
 
 ## record starting PC
 set save_pc [gdb_readexpr "(unsigned long) \$pc"]
-if { $save_pc == -1 } then {
+if {$save_pc == -1} {
     fail "could not read PC"
     return
 }
diff --git a/gdb/testsuite/gdb.trace/tracecmd.exp b/gdb/testsuite/gdb.trace/tracecmd.exp
index c2ec95a7a4e..4bc16b1d344 100644
--- a/gdb/testsuite/gdb.trace/tracecmd.exp
+++ b/gdb/testsuite/gdb.trace/tracecmd.exp
@@ -40,7 +40,7 @@ gdb_file_cmd $binfile
 # define relative source line numbers:
 # all subsequent line numbers are relative to this first one (baseline)
 set baseline  [gdb_find_recursion_test_baseline $srcfile]
-if { $baseline == -1 } then {
+if {$baseline == -1} {
     fail "could not find gdb_recursion_test function"
     return
 }
diff --git a/gdb/testsuite/gdb.trace/tspeed.exp b/gdb/testsuite/gdb.trace/tspeed.exp
index ba64176596b..80ec962c042 100644
--- a/gdb/testsuite/gdb.trace/tspeed.exp
+++ b/gdb/testsuite/gdb.trace/tspeed.exp
@@ -139,7 +139,7 @@ proc_with_prefix gdb_fast_trace_speed_test { } {
 	}
 
     # If the fast tracepoint couldn't be set, don't bother with the run.
-    if { $run_ftrace == 1 } then {
+    if {$run_ftrace == 1} {
 
 	# Begin the test.
 	run_trace_experiment
@@ -160,7 +160,7 @@ gdb_load_shlib $ipalib
 
 runto_main
 
-if { ![gdb_target_supports_trace] } then {
+if {![gdb_target_supports_trace]} {
     unsupported "current target does not support trace"
     return 1
 }
diff --git a/gdb/testsuite/gdb.trace/tsv.exp b/gdb/testsuite/gdb.trace/tsv.exp
index abf858963de..e51e7d654b1 100644
--- a/gdb/testsuite/gdb.trace/tsv.exp
+++ b/gdb/testsuite/gdb.trace/tsv.exp
@@ -113,7 +113,7 @@ runto_main
 gdb_reinitialize_dir $srcdir/$subdir
 
 # The rest of the testing needs actual tracing to work.
-if { ![gdb_target_supports_trace] } then {
+if {![gdb_target_supports_trace]} {
     unsupported "current target does not support trace"
     return 1
 }
@@ -121,7 +121,7 @@ if { ![gdb_target_supports_trace] } then {
 gdb_delete_tracepoints
 set trcpt1 [gdb_gettpnum gdb_c_test]
 
-if { $trcpt1 <= 0 } then {
+if {$trcpt1 <= 0} {
     fail "setting tracepoints"
     return
 }
@@ -200,7 +200,7 @@ gdb_test_multiple "target ctf ${tracefile}.ctf" "" {
 # Restart.
 clean_restart ${binfile}
 
-if ![runto_main] then {
+if {![runto_main]} {
     return
 }
 
diff --git a/gdb/testsuite/gdb.trace/unavailable.exp b/gdb/testsuite/gdb.trace/unavailable.exp
index 9e1124edc6e..82a6014c1bc 100644
--- a/gdb/testsuite/gdb.trace/unavailable.exp
+++ b/gdb/testsuite/gdb.trace/unavailable.exp
@@ -731,7 +731,7 @@ proc gdb_trace_collection_test {} {
 
 runto_main
 
-if { ![gdb_target_supports_trace] } then {
+if {![gdb_target_supports_trace]} {
     unsupported "current target does not support trace"
     return 1
 }
diff --git a/gdb/testsuite/gdb.trace/while-dyn.exp b/gdb/testsuite/gdb.trace/while-dyn.exp
index c77bad73c2d..0085e0aad48 100644
--- a/gdb/testsuite/gdb.trace/while-dyn.exp
+++ b/gdb/testsuite/gdb.trace/while-dyn.exp
@@ -36,7 +36,7 @@ gdb_load $binfile
 runto_main
 gdb_reinitialize_dir $srcdir/$subdir
 
-if { ![gdb_target_supports_trace] } then {
+if {![gdb_target_supports_trace]} {
     unsupported "current target does not support trace"
     return 1
 }
diff --git a/gdb/testsuite/gdb.trace/while-stepping.exp b/gdb/testsuite/gdb.trace/while-stepping.exp
index 77641b8a130..3d1b29bab02 100644
--- a/gdb/testsuite/gdb.trace/while-stepping.exp
+++ b/gdb/testsuite/gdb.trace/while-stepping.exp
@@ -44,7 +44,7 @@ gdb_file_cmd $binfile
 
 gdb_delete_tracepoints
 set trcpt1 [gdb_gettpnum gdb_c_test]
-if { $trcpt1 <= 0 } then {
+if {$trcpt1 <= 0} {
     fail "could not find gdb_c_test function"
     return
 }
-- 
2.25.4


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH 09/14] gdb/testsuite: remove use of then keyword from gdb.reverse/*.exp
  2022-11-15 10:42 [PATCH 00/14] Remove all uses of 'then' keyword from the testsuite Andrew Burgess
                   ` (7 preceding siblings ...)
  2022-11-15 10:42 ` [PATCH 08/14] gdb/testsuite: remove use of then keyword from gdb.trace/*.exp Andrew Burgess
@ 2022-11-15 10:42 ` Andrew Burgess
  2022-11-15 10:42 ` [PATCH 10/14] gdb/testsuite: remove use of then keyword from gdb.disasm/*.exp Andrew Burgess
                   ` (6 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: Andrew Burgess @ 2022-11-15 10:42 UTC (permalink / raw)
  To: gdb-patches; +Cc: Andrew Burgess

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

There should be no changes in what is tested after this commit.
---
 gdb/testsuite/gdb.reverse/consecutive-precsave.exp     |  6 +++---
 gdb/testsuite/gdb.reverse/consecutive-reverse.exp      |  6 +++---
 gdb/testsuite/gdb.reverse/finish-reverse-bkpt.exp      |  2 +-
 gdb/testsuite/gdb.reverse/i386-precsave.exp            |  2 +-
 gdb/testsuite/gdb.reverse/i386-reverse.exp             |  2 +-
 gdb/testsuite/gdb.reverse/i386-sse-reverse.exp         |  2 +-
 gdb/testsuite/gdb.reverse/i387-env-reverse.exp         |  2 +-
 gdb/testsuite/gdb.reverse/i387-stack-reverse.exp       |  2 +-
 gdb/testsuite/gdb.reverse/insn-reverse.exp             |  2 +-
 .../gdb.reverse/next-reverse-bkpt-over-sr.exp          |  2 +-
 gdb/testsuite/gdb.reverse/ppc_record_test_isa_2_06.exp |  6 +++---
 gdb/testsuite/gdb.reverse/ppc_record_test_isa_3_1.exp  |  6 +++---
 gdb/testsuite/gdb.reverse/sigall-precsave.exp          | 10 +++++-----
 gdb/testsuite/gdb.reverse/sigall-reverse.exp           | 10 +++++-----
 gdb/testsuite/gdb.reverse/test_ioctl_TCSETSW.exp       |  2 +-
 15 files changed, 31 insertions(+), 31 deletions(-)

diff --git a/gdb/testsuite/gdb.reverse/consecutive-precsave.exp b/gdb/testsuite/gdb.reverse/consecutive-precsave.exp
index 5d2c8105a1f..d1d1aa2b061 100644
--- a/gdb/testsuite/gdb.reverse/consecutive-precsave.exp
+++ b/gdb/testsuite/gdb.reverse/consecutive-precsave.exp
@@ -83,7 +83,7 @@ set testmsg "stopped at bp, 2nd instr"
 gdb_test_multiple "step" $testmsg {
     -re -wrap "Breakpoint $decimal, ($hex) in foo.*" {
 	set stop_addr $expect_out(1,string)
-	if [eval expr "$foo2_addr == $stop_addr"] then {
+	if {[eval expr "$foo2_addr == $stop_addr"]} {
 	    pass "stopped at bp, 2nd instr"
 	} else {
 	    fail "stopped at bp, 2nd instr (wrong address)"
@@ -94,7 +94,7 @@ gdb_test_multiple "step" $testmsg {
        set stop_addr_is_stmt [hex_in_list $stop_addr $is_stmt]
        if { ! $stop_addr_is_stmt } {
            fail "stopped at bp, 2nd instr (missing hex prefix)"
-       } elseif [eval expr "$foo2_addr == $stop_addr"] then {
+       } elseif {[eval expr "$foo2_addr == $stop_addr"]} {
            pass "stopped at bp, 2nd instr"
        } else {
            fail "stopped at bp, 2nd instr (wrong address)"
@@ -116,7 +116,7 @@ set test_msg "stopped at bp in reverse, 1st instr"
 gdb_test_multiple "step" "$test_msg" {
     -re "Breakpoint $decimal, ($hex) in foo.*$gdb_prompt $" {
 	set stop_addr $expect_out(1,string)
-	if [eval expr "$foo1_addr == $stop_addr"] then {
+	if {[eval expr "$foo1_addr == $stop_addr"]} {
 	    pass "$test_msg"
 	} else {
 	    fail "$test_msg (wrong address)"
diff --git a/gdb/testsuite/gdb.reverse/consecutive-reverse.exp b/gdb/testsuite/gdb.reverse/consecutive-reverse.exp
index 955cb4903e0..99d83328feb 100644
--- a/gdb/testsuite/gdb.reverse/consecutive-reverse.exp
+++ b/gdb/testsuite/gdb.reverse/consecutive-reverse.exp
@@ -63,7 +63,7 @@ set testmsg "stopped at bp, 2nd instr"
 gdb_test_multiple "step" $testmsg {
     -re -wrap "Breakpoint $decimal, ($hex) in foo.*" {
 	set stop_addr $expect_out(1,string)
-	if [eval expr "$foo2_addr == $stop_addr"] then {
+	if {[eval expr "$foo2_addr == $stop_addr"]} {
 	    pass "stopped at bp, 2nd instr"
 	} else {
 	    fail "stopped at bp, 2nd instr (wrong address)"
@@ -74,7 +74,7 @@ gdb_test_multiple "step" $testmsg {
        set stop_addr_is_stmt [hex_in_list $stop_addr $is_stmt]
        if { ! $stop_addr_is_stmt } {
            fail "stopped at bp, 2nd instr (missing hex prefix)"
-       } elseif [eval expr "$foo2_addr == $stop_addr"] then {
+       } elseif {[eval expr "$foo2_addr == $stop_addr"]} {
            pass "stopped at bp, 2nd instr"
        } else {
            fail "stopped at bp, 2nd instr (wrong address)"
@@ -96,7 +96,7 @@ set test_msg "stopped at bp in reverse, 1st instr"
 gdb_test_multiple "step" "$test_msg" {
     -re "Breakpoint $decimal, ($hex) in foo.*$gdb_prompt $" {
 	set stop_addr $expect_out(1,string)
-	if [eval expr "$foo1_addr == $stop_addr"] then {
+	if {[eval expr "$foo1_addr == $stop_addr"]} {
 	    pass "$test_msg"
 	} else {
 	    fail "$test_msg (wrong address)"
diff --git a/gdb/testsuite/gdb.reverse/finish-reverse-bkpt.exp b/gdb/testsuite/gdb.reverse/finish-reverse-bkpt.exp
index 2a204748d98..5bfe14788c6 100644
--- a/gdb/testsuite/gdb.reverse/finish-reverse-bkpt.exp
+++ b/gdb/testsuite/gdb.reverse/finish-reverse-bkpt.exp
@@ -29,7 +29,7 @@ if { [prepare_for_testing "failed to prepare" "$testfile" $srcfile] } {
     return -1
 }
 
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 
diff --git a/gdb/testsuite/gdb.reverse/i386-precsave.exp b/gdb/testsuite/gdb.reverse/i386-precsave.exp
index 54580474430..fbf80b89c05 100644
--- a/gdb/testsuite/gdb.reverse/i386-precsave.exp
+++ b/gdb/testsuite/gdb.reverse/i386-precsave.exp
@@ -25,7 +25,7 @@ if ![supports_process_record] {
 }
 
 
-if ![is_x86_like_target] then {
+if {![is_x86_like_target]} {
     verbose "Skipping i386 reverse tests."
     return
 }
diff --git a/gdb/testsuite/gdb.reverse/i386-reverse.exp b/gdb/testsuite/gdb.reverse/i386-reverse.exp
index 15c18dad205..6f6458c776e 100644
--- a/gdb/testsuite/gdb.reverse/i386-reverse.exp
+++ b/gdb/testsuite/gdb.reverse/i386-reverse.exp
@@ -24,7 +24,7 @@ if ![supports_reverse] {
 }
 
 
-if ![is_x86_like_target] then {
+if {![is_x86_like_target]} {
     verbose "Skipping i386 reverse tests."
     return
 }
diff --git a/gdb/testsuite/gdb.reverse/i386-sse-reverse.exp b/gdb/testsuite/gdb.reverse/i386-sse-reverse.exp
index 9713e896f59..ac56cd4e50d 100644
--- a/gdb/testsuite/gdb.reverse/i386-sse-reverse.exp
+++ b/gdb/testsuite/gdb.reverse/i386-sse-reverse.exp
@@ -24,7 +24,7 @@ if ![supports_reverse] {
 }
 
 
-if ![istarget "*86*-*linux*"] then {
+if {![istarget "*86*-*linux*"]} {
     verbose "Skipping i386 reverse tests."
     return
 }
diff --git a/gdb/testsuite/gdb.reverse/i387-env-reverse.exp b/gdb/testsuite/gdb.reverse/i387-env-reverse.exp
index 53fee0986df..efc7c847d59 100644
--- a/gdb/testsuite/gdb.reverse/i387-env-reverse.exp
+++ b/gdb/testsuite/gdb.reverse/i387-env-reverse.exp
@@ -16,7 +16,7 @@
 # This file is part of the gdb testsuite.
 
 
-if ![is_x86_like_target] then {
+if {![is_x86_like_target]} {
     verbose "Skipping i387 reverse float tests."
     return
 }
diff --git a/gdb/testsuite/gdb.reverse/i387-stack-reverse.exp b/gdb/testsuite/gdb.reverse/i387-stack-reverse.exp
index cadd4f76035..f88c1dc0b86 100644
--- a/gdb/testsuite/gdb.reverse/i387-stack-reverse.exp
+++ b/gdb/testsuite/gdb.reverse/i387-stack-reverse.exp
@@ -16,7 +16,7 @@
 # This file is part of the gdb testsuite.
 
 
-if ![is_x86_like_target] then {
+if {![is_x86_like_target]} {
     verbose "Skipping i387 reverse float tests."
     return
 }
diff --git a/gdb/testsuite/gdb.reverse/insn-reverse.exp b/gdb/testsuite/gdb.reverse/insn-reverse.exp
index c5437ecef6f..82ae39f9cd9 100644
--- a/gdb/testsuite/gdb.reverse/insn-reverse.exp
+++ b/gdb/testsuite/gdb.reverse/insn-reverse.exp
@@ -26,7 +26,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile \
 	 [list debug]]} {
     return -1
 }
-if { ![runto_main] } then {
+if {![runto_main]} {
     return
 }
 
diff --git a/gdb/testsuite/gdb.reverse/next-reverse-bkpt-over-sr.exp b/gdb/testsuite/gdb.reverse/next-reverse-bkpt-over-sr.exp
index 6ef56d30e7b..71d915d20a9 100644
--- a/gdb/testsuite/gdb.reverse/next-reverse-bkpt-over-sr.exp
+++ b/gdb/testsuite/gdb.reverse/next-reverse-bkpt-over-sr.exp
@@ -33,7 +33,7 @@ if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } {
     return -1
 }
 
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 
diff --git a/gdb/testsuite/gdb.reverse/ppc_record_test_isa_2_06.exp b/gdb/testsuite/gdb.reverse/ppc_record_test_isa_2_06.exp
index 066d307fbcd..bca7399bcdf 100644
--- a/gdb/testsuite/gdb.reverse/ppc_record_test_isa_2_06.exp
+++ b/gdb/testsuite/gdb.reverse/ppc_record_test_isa_2_06.exp
@@ -37,18 +37,18 @@ set gen_src record_test_isa_2_06.c
 set executable record_test_isa_2_06
 set options [list debug]
 
-if {![istarget "powerpc*"]} then {
+if {![istarget "powerpc*"]} {
     verbose "Skipping PowerPC ISA 2.06 instruction record_test_2_06."
     return
 }
 
-if {[build_executable "failed to prepare" $executable $srcfile $options] == -1} then {
+if {[build_executable "failed to prepare" $executable $srcfile $options] == -1} {
     return -1
 }
 
 clean_restart $executable
 
-if ![runto_main] then {
+if {![runto_main]} {
     untested "could not run to main"
     return
 }
diff --git a/gdb/testsuite/gdb.reverse/ppc_record_test_isa_3_1.exp b/gdb/testsuite/gdb.reverse/ppc_record_test_isa_3_1.exp
index 79f04f65b64..b4cddfac8fe 100644
--- a/gdb/testsuite/gdb.reverse/ppc_record_test_isa_3_1.exp
+++ b/gdb/testsuite/gdb.reverse/ppc_record_test_isa_3_1.exp
@@ -37,19 +37,19 @@ standard_testfile
 set gen_src record_test_isa_3_1.c
 set executable record_test_isa_3_1
 
-if {![istarget "powerpc*"] || [skip_power_isa_3_1_tests] } then  {
+if {![istarget "powerpc*"] || [skip_power_isa_3_1_tests]}  {
     verbose "Skipping PowerPC ISA 3.1 instruction record_test."
     return
 }
 
 set options [list additional_flags=-mcpu=power10 debug]
-if {[build_executable "failed to prepare" $executable $srcfile $options] == -1} then {
+if {[build_executable "failed to prepare" $executable $srcfile $options] == -1} {
     return -1
 }
 
 clean_restart $executable
 
-if ![runto_main] then {
+if {![runto_main]} {
     untested "could not run to main"
     return
 }
diff --git a/gdb/testsuite/gdb.reverse/sigall-precsave.exp b/gdb/testsuite/gdb.reverse/sigall-precsave.exp
index 991a6b0656a..d8761753971 100644
--- a/gdb/testsuite/gdb.reverse/sigall-precsave.exp
+++ b/gdb/testsuite/gdb.reverse/sigall-precsave.exp
@@ -47,7 +47,7 @@ proc test_one_sig {nextsig} {
 
     set need_another_continue 1
     set missed_handler 0
-    if $this_sig_supported then {
+    if {$this_sig_supported} {
 	if { $thissig == "IO" } {
 	    setup_xfail "i*86-pc-linuxoldld-gnu" "i*86-pc-linuxaout-gnu"
 	}
@@ -66,7 +66,7 @@ proc test_one_sig {nextsig} {
 	}
     }
 
-    if $need_another_continue then {
+    if {$need_another_continue} {
 	if { $thissig == "URG" } {
 	    setup_xfail "i*86-pc-linuxoldld-gnu" "i*86-pc-linuxaout-gnu"
 	}
@@ -86,7 +86,7 @@ proc test_one_sig {nextsig} {
 	}
     }
 
-    if { $missed_handler == "0" } then {
+    if {$missed_handler == "0"} {
 	set testmsg "advance to $nextsig"
         gdb_test_multiple "signal 0" $testmsg {
 	    -re "Breakpoint.*gen_$nextsig.*kill.*$gdb_prompt $" {
@@ -132,14 +132,14 @@ proc test_one_sig_reverse {prevsig} {
 	    exp_continue
 	}
 	-re "Breakpoint.*kill.*$gdb_prompt " {
-	    if { $saw_signal } then {
+	    if {$saw_signal} {
 		pass "$testmsg (handled)"
 	    } else {
 		xfail "$testmsg (handled)"
 	    }
 	}
 	-re "No more reverse-execution history.*kill.*$gdb_prompt " {
-	    if { $saw_signal } then {
+	    if {$saw_signal} {
 		pass "$testmsg (handled)"
 	    } else {
 		xfail "$testmsg (handled)"
diff --git a/gdb/testsuite/gdb.reverse/sigall-reverse.exp b/gdb/testsuite/gdb.reverse/sigall-reverse.exp
index 36fdb74a66f..7078067a71e 100644
--- a/gdb/testsuite/gdb.reverse/sigall-reverse.exp
+++ b/gdb/testsuite/gdb.reverse/sigall-reverse.exp
@@ -47,7 +47,7 @@ proc test_one_sig {nextsig} {
 
     set need_another_continue 1
     set missed_handler 0
-    if $this_sig_supported then {
+    if {$this_sig_supported} {
 	if { $thissig == "IO" } {
 	    setup_xfail "i*86-pc-linuxoldld-gnu" "i*86-pc-linuxaout-gnu"
 	}
@@ -72,7 +72,7 @@ proc test_one_sig {nextsig} {
 	}
     }
 
-    if $need_another_continue then {
+    if {$need_another_continue} {
 	if { $thissig == "URG" } {
 	    setup_xfail "i*86-pc-linuxoldld-gnu" "i*86-pc-linuxaout-gnu"
 	}
@@ -92,7 +92,7 @@ proc test_one_sig {nextsig} {
 	}
     }
 
-    if { $missed_handler == "0" } then {
+    if {$missed_handler == "0"} {
 	set testmsg "advance to $nextsig"
         gdb_test_multiple "signal 0" $testmsg {
 	    -re "Breakpoint.*gen_$nextsig.*kill.*$gdb_prompt $" {
@@ -138,14 +138,14 @@ proc test_one_sig_reverse {prevsig} {
 	    exp_continue
 	}
 	-re "Breakpoint.*kill.*$gdb_prompt " {
-	    if { $saw_signal } then {
+	    if {$saw_signal} {
 		pass "$testmsg (handled)"
 	    } else {
 		xfail "$testmsg (handled)"
 	    }
 	}
 	-re "No more reverse-execution history.*kill.*$gdb_prompt " {
-	    if { $saw_signal } then {
+	    if {$saw_signal} {
 		pass "$testmsg (handled)"
 	    } else {
 		xfail "$testmsg (handled)"
diff --git a/gdb/testsuite/gdb.reverse/test_ioctl_TCSETSW.exp b/gdb/testsuite/gdb.reverse/test_ioctl_TCSETSW.exp
index 4a81a618efc..21844e54d01 100644
--- a/gdb/testsuite/gdb.reverse/test_ioctl_TCSETSW.exp
+++ b/gdb/testsuite/gdb.reverse/test_ioctl_TCSETSW.exp
@@ -22,7 +22,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
     return -1
 }
 
-if ![runto_main] then {
+if {![runto_main]} {
     untested "could not run to main"
     continue
 }
-- 
2.25.4


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH 10/14] gdb/testsuite: remove use of then keyword from gdb.disasm/*.exp
  2022-11-15 10:42 [PATCH 00/14] Remove all uses of 'then' keyword from the testsuite Andrew Burgess
                   ` (8 preceding siblings ...)
  2022-11-15 10:42 ` [PATCH 09/14] gdb/testsuite: remove use of then keyword from gdb.reverse/*.exp Andrew Burgess
@ 2022-11-15 10:42 ` Andrew Burgess
  2022-11-15 10:42 ` [PATCH 11/14] gdb/testsuite: remove use of then keyword from gdb.fortran/*.exp Andrew Burgess
                   ` (5 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: Andrew Burgess @ 2022-11-15 10:42 UTC (permalink / raw)
  To: gdb-patches; +Cc: Andrew Burgess

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

There should be no changes in what is tested after this commit.
---
 gdb/testsuite/gdb.disasm/t01_mov.exp  | 4 ++--
 gdb/testsuite/gdb.disasm/t02_mova.exp | 4 ++--
 gdb/testsuite/gdb.disasm/t03_add.exp  | 4 ++--
 gdb/testsuite/gdb.disasm/t04_sub.exp  | 4 ++--
 gdb/testsuite/gdb.disasm/t05_cmp.exp  | 4 ++--
 gdb/testsuite/gdb.disasm/t06_ari2.exp | 4 ++--
 gdb/testsuite/gdb.disasm/t07_ari3.exp | 4 ++--
 gdb/testsuite/gdb.disasm/t08_or.exp   | 4 ++--
 gdb/testsuite/gdb.disasm/t09_xor.exp  | 4 ++--
 gdb/testsuite/gdb.disasm/t10_and.exp  | 4 ++--
 gdb/testsuite/gdb.disasm/t11_logs.exp | 4 ++--
 gdb/testsuite/gdb.disasm/t12_bit.exp  | 4 ++--
 gdb/testsuite/gdb.disasm/t13_otr.exp  | 4 ++--
 13 files changed, 26 insertions(+), 26 deletions(-)

diff --git a/gdb/testsuite/gdb.disasm/t01_mov.exp b/gdb/testsuite/gdb.disasm/t01_mov.exp
index c9efa34f7c6..2e29baccc18 100644
--- a/gdb/testsuite/gdb.disasm/t01_mov.exp
+++ b/gdb/testsuite/gdb.disasm/t01_mov.exp
@@ -30,12 +30,12 @@ set asm-flags ""
 set link-flags "-m h8300sxelf"
 
 
-if {[target_assemble $srcfile $objfile "${asm-flags}"] != ""} then {
+if {[target_assemble $srcfile $objfile "${asm-flags}"] != ""} {
      untested "failed to assemble"
      return -1
 }
 
-if {[target_link $objfile $binfile "${link-flags}"] != ""} then {
+if {[target_link $objfile $binfile "${link-flags}"] != ""} {
      untested "failed to link"
      return -1
 }
diff --git a/gdb/testsuite/gdb.disasm/t02_mova.exp b/gdb/testsuite/gdb.disasm/t02_mova.exp
index 3fcb0be5e2b..67d3d5f11c6 100644
--- a/gdb/testsuite/gdb.disasm/t02_mova.exp
+++ b/gdb/testsuite/gdb.disasm/t02_mova.exp
@@ -30,12 +30,12 @@ set asm-flags ""
 set link-flags "-m h8300sxelf"
 
 
-if {[target_assemble $srcfile $objfile "${asm-flags}"] != ""} then {
+if {[target_assemble $srcfile $objfile "${asm-flags}"] != ""} {
      untested "failed to assemble"
      return -1
 }
 
-if {[target_link $objfile $binfile "${link-flags}"] != ""} then {
+if {[target_link $objfile $binfile "${link-flags}"] != ""} {
      untested "failed to link"
      return -1
 }
diff --git a/gdb/testsuite/gdb.disasm/t03_add.exp b/gdb/testsuite/gdb.disasm/t03_add.exp
index 0a5a914e0c8..b2f2289f585 100644
--- a/gdb/testsuite/gdb.disasm/t03_add.exp
+++ b/gdb/testsuite/gdb.disasm/t03_add.exp
@@ -30,12 +30,12 @@ set asm-flags ""
 set link-flags "-m h8300sxelf"
 
 
-if {[target_assemble $srcfile $objfile "${asm-flags}"] != ""} then {
+if {[target_assemble $srcfile $objfile "${asm-flags}"] != ""} {
      untested "failed to assemble"
      return -1
 }
 
-if {[target_link $objfile $binfile "${link-flags}"] != ""} then {
+if {[target_link $objfile $binfile "${link-flags}"] != ""} {
      untested "failed to link"
      return -1
 }
diff --git a/gdb/testsuite/gdb.disasm/t04_sub.exp b/gdb/testsuite/gdb.disasm/t04_sub.exp
index 4f4353e0df6..5ac5829d60f 100644
--- a/gdb/testsuite/gdb.disasm/t04_sub.exp
+++ b/gdb/testsuite/gdb.disasm/t04_sub.exp
@@ -30,12 +30,12 @@ set asm-flags ""
 set link-flags "-m h8300sxelf"
 
 
-if {[target_assemble $srcfile $objfile "${asm-flags}"] != ""} then {
+if {[target_assemble $srcfile $objfile "${asm-flags}"] != ""} {
      untested "failed to assemble"
      return -1
 }
 
-if {[target_link $objfile $binfile "${link-flags}"] != ""} then {
+if {[target_link $objfile $binfile "${link-flags}"] != ""} {
      untested "failed to link"
      return -1
 }
diff --git a/gdb/testsuite/gdb.disasm/t05_cmp.exp b/gdb/testsuite/gdb.disasm/t05_cmp.exp
index 534f81650db..a1c704151c9 100644
--- a/gdb/testsuite/gdb.disasm/t05_cmp.exp
+++ b/gdb/testsuite/gdb.disasm/t05_cmp.exp
@@ -30,12 +30,12 @@ set asm-flags ""
 set link-flags "-m h8300sxelf"
 
 
-if {[target_assemble $srcfile $objfile "${asm-flags}"] != ""} then {
+if {[target_assemble $srcfile $objfile "${asm-flags}"] != ""} {
      untested "failed to assemble"
      return -1
 }
 
-if {[target_link $objfile $binfile "${link-flags}"] != ""} then {
+if {[target_link $objfile $binfile "${link-flags}"] != ""} {
      untested "failed to link"
      return -1
 }
diff --git a/gdb/testsuite/gdb.disasm/t06_ari2.exp b/gdb/testsuite/gdb.disasm/t06_ari2.exp
index ab5ffdd5fa0..c7de7336217 100644
--- a/gdb/testsuite/gdb.disasm/t06_ari2.exp
+++ b/gdb/testsuite/gdb.disasm/t06_ari2.exp
@@ -30,12 +30,12 @@ set asm-flags ""
 set link-flags "-m h8300sxelf"
 
 
-if {[target_assemble $srcfile $objfile "${asm-flags}"] != ""} then {
+if {[target_assemble $srcfile $objfile "${asm-flags}"] != ""} {
      untested "failed to assemble"
      return -1
 }
 
-if {[target_link $objfile $binfile "${link-flags}"] != ""} then {
+if {[target_link $objfile $binfile "${link-flags}"] != ""} {
      untested "failed to link"
      return -1
 }
diff --git a/gdb/testsuite/gdb.disasm/t07_ari3.exp b/gdb/testsuite/gdb.disasm/t07_ari3.exp
index 810dc0e2311..7937925e70a 100644
--- a/gdb/testsuite/gdb.disasm/t07_ari3.exp
+++ b/gdb/testsuite/gdb.disasm/t07_ari3.exp
@@ -30,12 +30,12 @@ set asm-flags ""
 set link-flags "-m h8300sxelf"
 
 
-if {[target_assemble $srcfile $objfile "${asm-flags}"] != ""} then {
+if {[target_assemble $srcfile $objfile "${asm-flags}"] != ""} {
      untested "failed to assemble"
      return -1
 }
 
-if {[target_link $objfile $binfile "${link-flags}"] != ""} then {
+if {[target_link $objfile $binfile "${link-flags}"] != ""} {
      untested "failed to link"
      return -1
 }
diff --git a/gdb/testsuite/gdb.disasm/t08_or.exp b/gdb/testsuite/gdb.disasm/t08_or.exp
index 5ade4eb770e..fdfa0a1b301 100644
--- a/gdb/testsuite/gdb.disasm/t08_or.exp
+++ b/gdb/testsuite/gdb.disasm/t08_or.exp
@@ -30,12 +30,12 @@ set asm-flags ""
 set link-flags "-m h8300sxelf"
 
 
-if {[target_assemble $srcfile $objfile "${asm-flags}"] != ""} then {
+if {[target_assemble $srcfile $objfile "${asm-flags}"] != ""} {
      untested "failed to assemble"
      return -1
 }
 
-if {[target_link $objfile $binfile "${link-flags}"] != ""} then {
+if {[target_link $objfile $binfile "${link-flags}"] != ""} {
      untested "failed to link"
      return -1
 }
diff --git a/gdb/testsuite/gdb.disasm/t09_xor.exp b/gdb/testsuite/gdb.disasm/t09_xor.exp
index 8c8f584e136..7e246753367 100644
--- a/gdb/testsuite/gdb.disasm/t09_xor.exp
+++ b/gdb/testsuite/gdb.disasm/t09_xor.exp
@@ -30,12 +30,12 @@ set asm-flags ""
 set link-flags "-m h8300sxelf"
 
 
-if {[target_assemble $srcfile $objfile "${asm-flags}"] != ""} then {
+if {[target_assemble $srcfile $objfile "${asm-flags}"] != ""} {
      untested "failed to assemble"
      return -1
 }
 
-if {[target_link $objfile $binfile "${link-flags}"] != ""} then {
+if {[target_link $objfile $binfile "${link-flags}"] != ""} {
      untested "failed to link"
      return -1
 }
diff --git a/gdb/testsuite/gdb.disasm/t10_and.exp b/gdb/testsuite/gdb.disasm/t10_and.exp
index c096737019f..5650aebba1c 100644
--- a/gdb/testsuite/gdb.disasm/t10_and.exp
+++ b/gdb/testsuite/gdb.disasm/t10_and.exp
@@ -30,12 +30,12 @@ set asm-flags ""
 set link-flags "-m h8300sxelf"
 
 
-if {[target_assemble $srcfile $objfile "${asm-flags}"] != ""} then {
+if {[target_assemble $srcfile $objfile "${asm-flags}"] != ""} {
      untested "failed to assemble"
      return -1
 }
 
-if {[target_link $objfile $binfile "${link-flags}"] != ""} then {
+if {[target_link $objfile $binfile "${link-flags}"] != ""} {
      untested "failed to link"
      return -1
 }
diff --git a/gdb/testsuite/gdb.disasm/t11_logs.exp b/gdb/testsuite/gdb.disasm/t11_logs.exp
index 7511b84c28d..2b58273c307 100644
--- a/gdb/testsuite/gdb.disasm/t11_logs.exp
+++ b/gdb/testsuite/gdb.disasm/t11_logs.exp
@@ -30,12 +30,12 @@ set asm-flags ""
 set link-flags "-m h8300sxelf"
 
 
-if {[target_assemble $srcfile $objfile "${asm-flags}"] != ""} then {
+if {[target_assemble $srcfile $objfile "${asm-flags}"] != ""} {
      untested "failed to assemble"
      return -1
 }
 
-if {[target_link $objfile $binfile "${link-flags}"] != ""} then {
+if {[target_link $objfile $binfile "${link-flags}"] != ""} {
      untested "failed to link"
      return -1
 }
diff --git a/gdb/testsuite/gdb.disasm/t12_bit.exp b/gdb/testsuite/gdb.disasm/t12_bit.exp
index 1020986f331..e58412128f3 100644
--- a/gdb/testsuite/gdb.disasm/t12_bit.exp
+++ b/gdb/testsuite/gdb.disasm/t12_bit.exp
@@ -30,12 +30,12 @@ set asm-flags ""
 set link-flags "-m h8300sxelf"
 
 
-if {[target_assemble $srcfile $objfile "${asm-flags}"] != ""} then {
+if {[target_assemble $srcfile $objfile "${asm-flags}"] != ""} {
      untested "failed to assemble"
      return -1
 }
 
-if {[target_link $objfile $binfile "${link-flags}"] != ""} then {
+if {[target_link $objfile $binfile "${link-flags}"] != ""} {
      untested "failed to link"
      return -1
 }
diff --git a/gdb/testsuite/gdb.disasm/t13_otr.exp b/gdb/testsuite/gdb.disasm/t13_otr.exp
index 70fbd1310e1..61b300f511f 100644
--- a/gdb/testsuite/gdb.disasm/t13_otr.exp
+++ b/gdb/testsuite/gdb.disasm/t13_otr.exp
@@ -30,12 +30,12 @@ set asm-flags ""
 set link-flags "-m h8300sxelf"
 
 
-if {[target_assemble $srcfile $objfile "${asm-flags}"] != ""} then {
+if {[target_assemble $srcfile $objfile "${asm-flags}"] != ""} {
      untested "failed to assemble"
      return -1
 }
 
-if {[target_link $objfile $binfile "${link-flags}"] != ""} then {
+if {[target_link $objfile $binfile "${link-flags}"] != ""} {
      untested "failed to link"
      return -1
 }
-- 
2.25.4


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH 11/14] gdb/testsuite: remove use of then keyword from gdb.fortran/*.exp
  2022-11-15 10:42 [PATCH 00/14] Remove all uses of 'then' keyword from the testsuite Andrew Burgess
                   ` (9 preceding siblings ...)
  2022-11-15 10:42 ` [PATCH 10/14] gdb/testsuite: remove use of then keyword from gdb.disasm/*.exp Andrew Burgess
@ 2022-11-15 10:42 ` Andrew Burgess
  2022-11-15 10:42 ` [PATCH 12/14] gdb/testsuite: remove use of then keyword from gdb.multi/*.exp Andrew Burgess
                   ` (4 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: Andrew Burgess @ 2022-11-15 10:42 UTC (permalink / raw)
  To: gdb-patches; +Cc: Andrew Burgess

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.
---
 gdb/testsuite/gdb.fortran/array-element.exp               | 2 +-
 gdb/testsuite/gdb.fortran/block-data.exp                  | 2 +-
 gdb/testsuite/gdb.fortran/common-block.exp                | 2 +-
 gdb/testsuite/gdb.fortran/complex.exp                     | 2 +-
 gdb/testsuite/gdb.fortran/derived-type-function.exp       | 2 +-
 gdb/testsuite/gdb.fortran/derived-type-striding.exp       | 2 +-
 gdb/testsuite/gdb.fortran/derived-type.exp                | 2 +-
 gdb/testsuite/gdb.fortran/dot-ops.exp                     | 2 +-
 gdb/testsuite/gdb.fortran/exprs.exp                       | 2 +-
 gdb/testsuite/gdb.fortran/function-calls.exp              | 2 +-
 gdb/testsuite/gdb.fortran/library-module.exp              | 2 +-
 gdb/testsuite/gdb.fortran/module.exp                      | 2 +-
 gdb/testsuite/gdb.fortran/namelist.exp                    | 2 +-
 gdb/testsuite/gdb.fortran/nested-funcs-2.exp              | 2 +-
 gdb/testsuite/gdb.fortran/nested-funcs.exp                | 2 +-
 gdb/testsuite/gdb.fortran/printing-types.exp              | 2 +-
 gdb/testsuite/gdb.fortran/ptr-indentation.exp             | 2 +-
 gdb/testsuite/gdb.fortran/ptype-on-functions.exp          | 2 +-
 gdb/testsuite/gdb.fortran/short-circuit-argument-list.exp | 2 +-
 gdb/testsuite/gdb.fortran/subarray.exp                    | 2 +-
 gdb/testsuite/gdb.fortran/type-kinds.exp                  | 2 +-
 gdb/testsuite/gdb.fortran/types.exp                       | 2 +-
 gdb/testsuite/gdb.fortran/vla-value.exp                   | 2 +-
 23 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/gdb/testsuite/gdb.fortran/array-element.exp b/gdb/testsuite/gdb.fortran/array-element.exp
index 22b72e2974b..f5d313cdf1a 100644
--- a/gdb/testsuite/gdb.fortran/array-element.exp
+++ b/gdb/testsuite/gdb.fortran/array-element.exp
@@ -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
 }
diff --git a/gdb/testsuite/gdb.fortran/block-data.exp b/gdb/testsuite/gdb.fortran/block-data.exp
index 482dcc296b2..ab064910108 100644
--- a/gdb/testsuite/gdb.fortran/block-data.exp
+++ b/gdb/testsuite/gdb.fortran/block-data.exp
@@ -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
 }
 
diff --git a/gdb/testsuite/gdb.fortran/common-block.exp b/gdb/testsuite/gdb.fortran/common-block.exp
index e8d7c222134..b8cbfb895c5 100644
--- a/gdb/testsuite/gdb.fortran/common-block.exp
+++ b/gdb/testsuite/gdb.fortran/common-block.exp
@@ -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
 }
diff --git a/gdb/testsuite/gdb.fortran/complex.exp b/gdb/testsuite/gdb.fortran/complex.exp
index 9298b3be56c..896e01cb932 100644
--- a/gdb/testsuite/gdb.fortran/complex.exp
+++ b/gdb/testsuite/gdb.fortran/complex.exp
@@ -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
 }
diff --git a/gdb/testsuite/gdb.fortran/derived-type-function.exp b/gdb/testsuite/gdb.fortran/derived-type-function.exp
index 573444a5808..3adabd63d36 100644
--- a/gdb/testsuite/gdb.fortran/derived-type-function.exp
+++ b/gdb/testsuite/gdb.fortran/derived-type-function.exp
@@ -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
 }
diff --git a/gdb/testsuite/gdb.fortran/derived-type-striding.exp b/gdb/testsuite/gdb.fortran/derived-type-striding.exp
index 1edc489bcfb..bf868f57284 100644
--- a/gdb/testsuite/gdb.fortran/derived-type-striding.exp
+++ b/gdb/testsuite/gdb.fortran/derived-type-striding.exp
@@ -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
 }
diff --git a/gdb/testsuite/gdb.fortran/derived-type.exp b/gdb/testsuite/gdb.fortran/derived-type.exp
index b3be8e57056..63ec0c8d0ba 100644
--- a/gdb/testsuite/gdb.fortran/derived-type.exp
+++ b/gdb/testsuite/gdb.fortran/derived-type.exp
@@ -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
 }
diff --git a/gdb/testsuite/gdb.fortran/dot-ops.exp b/gdb/testsuite/gdb.fortran/dot-ops.exp
index fefa27b87db..2bad2bc7c8f 100644
--- a/gdb/testsuite/gdb.fortran/dot-ops.exp
+++ b/gdb/testsuite/gdb.fortran/dot-ops.exp
@@ -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
diff --git a/gdb/testsuite/gdb.fortran/exprs.exp b/gdb/testsuite/gdb.fortran/exprs.exp
index 28c0a86f239..c14cdad4ff5 100644
--- a/gdb/testsuite/gdb.fortran/exprs.exp
+++ b/gdb/testsuite/gdb.fortran/exprs.exp
@@ -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
diff --git a/gdb/testsuite/gdb.fortran/function-calls.exp b/gdb/testsuite/gdb.fortran/function-calls.exp
index bc0192be064..ea58e6249c9 100644
--- a/gdb/testsuite/gdb.fortran/function-calls.exp
+++ b/gdb/testsuite/gdb.fortran/function-calls.exp
@@ -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
 }
diff --git a/gdb/testsuite/gdb.fortran/library-module.exp b/gdb/testsuite/gdb.fortran/library-module.exp
index 1745360d80c..a6ed67d404f 100644
--- a/gdb/testsuite/gdb.fortran/library-module.exp
+++ b/gdb/testsuite/gdb.fortran/library-module.exp
@@ -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
 }
diff --git a/gdb/testsuite/gdb.fortran/module.exp b/gdb/testsuite/gdb.fortran/module.exp
index fe539fbc6d3..b9c9d6b44f3 100644
--- a/gdb/testsuite/gdb.fortran/module.exp
+++ b/gdb/testsuite/gdb.fortran/module.exp
@@ -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
 }
diff --git a/gdb/testsuite/gdb.fortran/namelist.exp b/gdb/testsuite/gdb.fortran/namelist.exp
index 39cf0e17654..46f24f47970 100644
--- a/gdb/testsuite/gdb.fortran/namelist.exp
+++ b/gdb/testsuite/gdb.fortran/namelist.exp
@@ -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
 }
diff --git a/gdb/testsuite/gdb.fortran/nested-funcs-2.exp b/gdb/testsuite/gdb.fortran/nested-funcs-2.exp
index bf679447c03..2a83144b648 100644
--- a/gdb/testsuite/gdb.fortran/nested-funcs-2.exp
+++ b/gdb/testsuite/gdb.fortran/nested-funcs-2.exp
@@ -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
     }
diff --git a/gdb/testsuite/gdb.fortran/nested-funcs.exp b/gdb/testsuite/gdb.fortran/nested-funcs.exp
index ea3d66685be..237e09ed009 100755
--- a/gdb/testsuite/gdb.fortran/nested-funcs.exp
+++ b/gdb/testsuite/gdb.fortran/nested-funcs.exp
@@ -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
 }
diff --git a/gdb/testsuite/gdb.fortran/printing-types.exp b/gdb/testsuite/gdb.fortran/printing-types.exp
index 3a8e02fea12..0ba07f6c1ff 100644
--- a/gdb/testsuite/gdb.fortran/printing-types.exp
+++ b/gdb/testsuite/gdb.fortran/printing-types.exp
@@ -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
 }
 
diff --git a/gdb/testsuite/gdb.fortran/ptr-indentation.exp b/gdb/testsuite/gdb.fortran/ptr-indentation.exp
index 98378342957..daf5bd53550 100644
--- a/gdb/testsuite/gdb.fortran/ptr-indentation.exp
+++ b/gdb/testsuite/gdb.fortran/ptr-indentation.exp
@@ -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
 }
 
diff --git a/gdb/testsuite/gdb.fortran/ptype-on-functions.exp b/gdb/testsuite/gdb.fortran/ptype-on-functions.exp
index cc2454858a0..6751b50a43d 100644
--- a/gdb/testsuite/gdb.fortran/ptype-on-functions.exp
+++ b/gdb/testsuite/gdb.fortran/ptype-on-functions.exp
@@ -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
 }
diff --git a/gdb/testsuite/gdb.fortran/short-circuit-argument-list.exp b/gdb/testsuite/gdb.fortran/short-circuit-argument-list.exp
index aa7f5d1ebde..d458e1adfc4 100644
--- a/gdb/testsuite/gdb.fortran/short-circuit-argument-list.exp
+++ b/gdb/testsuite/gdb.fortran/short-circuit-argument-list.exp
@@ -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
 }
diff --git a/gdb/testsuite/gdb.fortran/subarray.exp b/gdb/testsuite/gdb.fortran/subarray.exp
index b282c5dd7c9..88d47f91e77 100644
--- a/gdb/testsuite/gdb.fortran/subarray.exp
+++ b/gdb/testsuite/gdb.fortran/subarray.exp
@@ -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
 }
diff --git a/gdb/testsuite/gdb.fortran/type-kinds.exp b/gdb/testsuite/gdb.fortran/type-kinds.exp
index 47b788bf134..e481ad3b38d 100644
--- a/gdb/testsuite/gdb.fortran/type-kinds.exp
+++ b/gdb/testsuite/gdb.fortran/type-kinds.exp
@@ -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
diff --git a/gdb/testsuite/gdb.fortran/types.exp b/gdb/testsuite/gdb.fortran/types.exp
index 594276f3a7b..eac667646ac 100644
--- a/gdb/testsuite/gdb.fortran/types.exp
+++ b/gdb/testsuite/gdb.fortran/types.exp
@@ -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
diff --git a/gdb/testsuite/gdb.fortran/vla-value.exp b/gdb/testsuite/gdb.fortran/vla-value.exp
index 5b3a680c9f7..36ba0b405e3 100644
--- a/gdb/testsuite/gdb.fortran/vla-value.exp
+++ b/gdb/testsuite/gdb.fortran/vla-value.exp
@@ -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
 }
-- 
2.25.4


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH 12/14] gdb/testsuite: remove use of then keyword from gdb.multi/*.exp
  2022-11-15 10:42 [PATCH 00/14] Remove all uses of 'then' keyword from the testsuite Andrew Burgess
                   ` (10 preceding siblings ...)
  2022-11-15 10:42 ` [PATCH 11/14] gdb/testsuite: remove use of then keyword from gdb.fortran/*.exp Andrew Burgess
@ 2022-11-15 10:42 ` Andrew Burgess
  2022-11-15 10:42 ` [PATCH 13/14] gdb/testsuite: remove use of then keyword from gdb.*/*.exp scripts Andrew Burgess
                   ` (3 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: Andrew Burgess @ 2022-11-15 10:42 UTC (permalink / raw)
  To: gdb-patches; +Cc: Andrew Burgess

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(-)

diff --git a/gdb/testsuite/gdb.multi/base.exp b/gdb/testsuite/gdb.multi/base.exp
index 7f291996ef4..6c5042eb404 100644
--- a/gdb/testsuite/gdb.multi/base.exp
+++ b/gdb/testsuite/gdb.multi/base.exp
@@ -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"
diff --git a/gdb/testsuite/gdb.multi/bkpt-multi-exec.exp b/gdb/testsuite/gdb.multi/bkpt-multi-exec.exp
index cf7101bd5f4..43700016b4e 100644
--- a/gdb/testsuite/gdb.multi/bkpt-multi-exec.exp
+++ b/gdb/testsuite/gdb.multi/bkpt-multi-exec.exp
@@ -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
 }
 
diff --git a/gdb/testsuite/gdb.multi/dummy-frame-restore.exp b/gdb/testsuite/gdb.multi/dummy-frame-restore.exp
index 5accd7d4bd7..0cd1cf5a414 100644
--- a/gdb/testsuite/gdb.multi/dummy-frame-restore.exp
+++ b/gdb/testsuite/gdb.multi/dummy-frame-restore.exp
@@ -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
 }
 
diff --git a/gdb/testsuite/gdb.multi/info-threads.exp b/gdb/testsuite/gdb.multi/info-threads.exp
index 5a4d611d628..650e7c6194f 100644
--- a/gdb/testsuite/gdb.multi/info-threads.exp
+++ b/gdb/testsuite/gdb.multi/info-threads.exp
@@ -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
 }
 
diff --git a/gdb/testsuite/gdb.multi/multi-arch-exec.exp b/gdb/testsuite/gdb.multi/multi-arch-exec.exp
index a8e81e29ee9..fa31cbb6db6 100644
--- a/gdb/testsuite/gdb.multi/multi-arch-exec.exp
+++ b/gdb/testsuite/gdb.multi/multi-arch-exec.exp
@@ -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
 	}
 
diff --git a/gdb/testsuite/gdb.multi/multi-arch.exp b/gdb/testsuite/gdb.multi/multi-arch.exp
index b564e6caf25..a15b0217a9e 100644
--- a/gdb/testsuite/gdb.multi/multi-arch.exp
+++ b/gdb/testsuite/gdb.multi/multi-arch.exp
@@ -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
 }
 
diff --git a/gdb/testsuite/gdb.multi/multi-re-run.exp b/gdb/testsuite/gdb.multi/multi-re-run.exp
index 5af4fde4baf..04073c94545 100644
--- a/gdb/testsuite/gdb.multi/multi-re-run.exp
+++ b/gdb/testsuite/gdb.multi/multi-re-run.exp
@@ -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
     }
 
diff --git a/gdb/testsuite/gdb.multi/tids-gid-reset.exp b/gdb/testsuite/gdb.multi/tids-gid-reset.exp
index 6cab573a1f8..27474b19e36 100644
--- a/gdb/testsuite/gdb.multi/tids-gid-reset.exp
+++ b/gdb/testsuite/gdb.multi/tids-gid-reset.exp
@@ -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
 	}
     }
diff --git a/gdb/testsuite/gdb.multi/tids.exp b/gdb/testsuite/gdb.multi/tids.exp
index fb7c2a29a71..6f2f81c109b 100644
--- a/gdb/testsuite/gdb.multi/tids.exp
+++ b/gdb/testsuite/gdb.multi/tids.exp
@@ -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
 }
 
-- 
2.25.4


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH 13/14] gdb/testsuite: remove use of then keyword from gdb.*/*.exp scripts
  2022-11-15 10:42 [PATCH 00/14] Remove all uses of 'then' keyword from the testsuite Andrew Burgess
                   ` (11 preceding siblings ...)
  2022-11-15 10:42 ` [PATCH 12/14] gdb/testsuite: remove use of then keyword from gdb.multi/*.exp Andrew Burgess
@ 2022-11-15 10:42 ` Andrew Burgess
  2022-11-15 10:42 ` [PATCH 14/14] gdb/testsuite: remove use of then keyword from library files Andrew Burgess
                   ` (2 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: Andrew Burgess @ 2022-11-15 10:42 UTC (permalink / raw)
  To: gdb-patches; +Cc: Andrew Burgess

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.asm/asm-source.exp               | 14 +++++++-------
 gdb/testsuite/gdb.compile/compile-tls.exp          |  2 +-
 gdb/testsuite/gdb.ctf/funcreturn.exp               |  4 ++--
 gdb/testsuite/gdb.dwarf2/dw2-common-block.exp      |  2 +-
 .../gdb.dwarf2/dw2-cp-infcall-ref-static.exp       |  2 +-
 .../gdb.dwarf2/dw2-linkage-name-trust.exp          |  2 +-
 .../gdb.dwarf2/dw2-single-line-discriminators.exp  |  2 +-
 .../gdb.dwarf2/locexpr-data-member-location.exp    |  4 ++--
 gdb/testsuite/gdb.guile/scm-breakpoint.exp         |  2 +-
 .../gdb.mi/list-thread-groups-available.exp        |  2 +-
 gdb/testsuite/gdb.mi/mi-async.exp                  |  2 +-
 gdb/testsuite/gdb.mi/mi-corefile.exp               |  2 +-
 gdb/testsuite/gdb.mi/mi-frame-regs.exp             |  4 ++--
 gdb/testsuite/gdb.mi/mi-info-os.exp                |  4 ++--
 gdb/testsuite/gdb.mi/mi-regs.exp                   |  2 +-
 gdb/testsuite/gdb.modula2/max-depth.exp            |  2 +-
 gdb/testsuite/gdb.modula2/multidim.exp             |  2 +-
 gdb/testsuite/gdb.modula2/unbounded-array.exp      |  2 +-
 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 ++--
 gdb/testsuite/gdb.pascal/types.exp                 |  2 +-
 .../gdb.server/connect-with-no-symbol-file.exp     |  2 +-
 gdb/testsuite/gdb.server/ext-attach.exp            |  2 +-
 .../gdb.server/extended-remote-restart.exp         |  4 ++--
 gdb/testsuite/gdb.stabs/exclfwd.exp                |  6 +++---
 gdb/testsuite/gdb.tui/tui-layout.exp               |  2 +-
 gdb/testsuite/gdb.xml/tdesc-reload.exp             |  4 ++--
 29 files changed, 44 insertions(+), 44 deletions(-)

diff --git a/gdb/testsuite/gdb.asm/asm-source.exp b/gdb/testsuite/gdb.asm/asm-source.exp
index d56a5076b44..45c83305216 100644
--- a/gdb/testsuite/gdb.asm/asm-source.exp
+++ b/gdb/testsuite/gdb.asm/asm-source.exp
@@ -166,14 +166,14 @@ if { "${asm-arch}" == "" } {
 }
 
 # On NetBSD/ELF we need a special NetBSD-identifying note section.
-if { [istarget "*-*-netbsd*"] && ![istarget "*-*-netbsdaout*"] } then {
+if {[istarget "*-*-netbsd*"] && ![istarget "*-*-netbsdaout*"]} {
     set asm-note "netbsd"
 }
 
 # On OpenBSD/ELF we need a similar note section.  We make no attempt
 # of handing a.out here since most OpenBSD/a.out systems use a rather
 # outdated assembler that doesn't assemble this test's code anyway.
-if { [istarget "*-*-openbsd*"] } then {
+if {[istarget "*-*-openbsd*"]} {
     set asm-note "openbsd"
 }
 
@@ -212,7 +212,7 @@ if { [string equal ${debug-flags} ""] } {
 }
 
 # Allow the target board to override the debug flags.
-if { [board_info $dest exists debug_flags] } then {
+if {[board_info $dest exists debug_flags]} {
     set debug-flags "[board_info $dest debug_flags]"
 }
 
@@ -239,11 +239,11 @@ regsub "--" "-g\[0-9\]" "${debug-flags}" "" debug-flags
 set asm1obj [standard_output_file asmrc1.o]
 set asm2obj [standard_output_file asmrc2.o]
 
-if {[target_assemble ${srcdir}/${subdir}/${srcfile} $asm1obj "${asm-flags} ${debug-flags}"] != ""} then {
+if {[target_assemble ${srcdir}/${subdir}/${srcfile} $asm1obj "${asm-flags} ${debug-flags}"] != ""} {
      untested "failed to assemble"
      return -1
 }
-if {[target_assemble ${srcdir}/${subdir}/${srcfile2} $asm2obj "${asm-flags} ${debug-flags}"] != ""} then {
+if {[target_assemble ${srcdir}/${subdir}/${srcfile2} $asm2obj "${asm-flags} ${debug-flags}"] != ""} {
      untested "failed to assemble"
      return -1
 }
@@ -254,7 +254,7 @@ if {[target_assemble ${srcdir}/${subdir}/${srcfile2} $asm2obj "${asm-flags} ${de
 # code here that provides its own startup code.  Using target_link
 # also avoids a lot of problems on many systems, most notably on
 # *-*-*bsd* and *-*-solaris2*.
-if {[target_link [list $asm1obj $asm2obj] "${binfile}" ${link-flags}] != "" } then {
+if {[target_link [list $asm1obj $asm2obj] "${binfile}" ${link-flags}] != ""} {
      untested "failed to link"
      return -1
 }
@@ -284,7 +284,7 @@ gdb_load ${binfile}
 # Run to `main' where we begin our tests.
 #
 
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 
diff --git a/gdb/testsuite/gdb.compile/compile-tls.exp b/gdb/testsuite/gdb.compile/compile-tls.exp
index bb6a60bd2e9..f9c9ee5e2f7 100644
--- a/gdb/testsuite/gdb.compile/compile-tls.exp
+++ b/gdb/testsuite/gdb.compile/compile-tls.exp
@@ -21,7 +21,7 @@ if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" \
 }
 
 clean_restart ${binfile}
-if ![runto_main] then {
+if {![runto_main]} {
    return 0
 }
 
diff --git a/gdb/testsuite/gdb.ctf/funcreturn.exp b/gdb/testsuite/gdb.ctf/funcreturn.exp
index 1267cab2b75..ab4aa21fa32 100644
--- a/gdb/testsuite/gdb.ctf/funcreturn.exp
+++ b/gdb/testsuite/gdb.ctf/funcreturn.exp
@@ -106,7 +106,7 @@ if ![target_info exists no_long_long] {
 }
 
 # Sun /bin/cc calls this a function returning double.
-if {!$gcc_compiled} then {setup_xfail "*-sun-sunos4*"}
+if {!$gcc_compiled} {setup_xfail "*-sun-sunos4*"}
 gdb_test "print v_float_func" \
     "$decimal = \{float \\(\\)\} 0x\[0-9a-z\]+.*" \
     "print float function"
@@ -179,7 +179,7 @@ if ![target_info exists no_long_long] {
 }
 
 # Sun /bin/cc calls this a function returning double.
-if {!$gcc_compiled} then {setup_xfail "*-sun-sunos4*"}
+if {!$gcc_compiled} {setup_xfail "*-sun-sunos4*"}
 gdb_test "whatis v_float_func" \
     "type = float \\($void\\)" \
     "whatis float function"
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-common-block.exp b/gdb/testsuite/gdb.dwarf2/dw2-common-block.exp
index f7c9e9597a7..12c2f4cce82 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-common-block.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-common-block.exp
@@ -37,7 +37,7 @@ if { [prepare_for_testing "failed to prepare" "${testfile}" $srcfile \
     return -1
 }
 
-if ![runto MAIN__] then {
+if {![runto MAIN__]} {
     perror "couldn't run to breakpoint MAIN__"
     return
 }
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-cp-infcall-ref-static.exp b/gdb/testsuite/gdb.dwarf2/dw2-cp-infcall-ref-static.exp
index 262f36a7afb..92f0e1350ec 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-cp-infcall-ref-static.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-cp-infcall-ref-static.exp
@@ -32,7 +32,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} \
     return -1
 }
 
-if ![runto_main] then {
+if {![runto_main]} {
     return -1
 }
 
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-linkage-name-trust.exp b/gdb/testsuite/gdb.dwarf2/dw2-linkage-name-trust.exp
index 99c69f00348..288c5a00176 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-linkage-name-trust.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-linkage-name-trust.exp
@@ -34,7 +34,7 @@ if {[prepare_for_testing_full "failed to prepare" \
     return -1
 }
 
-if ![runto_main] then {
+if {![runto_main]} {
     return -1
 }
 
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-single-line-discriminators.exp b/gdb/testsuite/gdb.dwarf2/dw2-single-line-discriminators.exp
index 63fc723956e..5824d8b3426 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-single-line-discriminators.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-single-line-discriminators.exp
@@ -35,7 +35,7 @@ if { [prepare_for_testing "failed to prepare" "${testfile}" $srcfile {nodebug no
     return -1
 }
 
-if ![runto_main] then {
+if {![runto_main]} {
     return
 }
 
diff --git a/gdb/testsuite/gdb.dwarf2/locexpr-data-member-location.exp b/gdb/testsuite/gdb.dwarf2/locexpr-data-member-location.exp
index bd20272637c..368f63c1a63 100644
--- a/gdb/testsuite/gdb.dwarf2/locexpr-data-member-location.exp
+++ b/gdb/testsuite/gdb.dwarf2/locexpr-data-member-location.exp
@@ -105,7 +105,7 @@ with_test_prefix "first session" {
     gdb_load_shlib ${lib_so}
 
     # Run to foo to make sure foo refers to the function, and not foo@PLT.
-    if ![runto foo qualified] then {
+    if {![runto foo qualified]} {
 	return
     }
 
@@ -334,7 +334,7 @@ with_test_prefix "second session" {
     # loaded for remote targets.
     gdb_load_shlib ${lib_so}
 
-    if ![runto_main] then {
+    if {![runto_main]} {
 	return
     }
 
diff --git a/gdb/testsuite/gdb.guile/scm-breakpoint.exp b/gdb/testsuite/gdb.guile/scm-breakpoint.exp
index 37607b7f4ff..256416d8e9e 100644
--- a/gdb/testsuite/gdb.guile/scm-breakpoint.exp
+++ b/gdb/testsuite/gdb.guile/scm-breakpoint.exp
@@ -536,7 +536,7 @@ proc_with_prefix test_bkpt_probe {} {
 	return -1
     }
 
-    if ![gdb_guile_runto_main] then {
+    if {![gdb_guile_runto_main]} {
 	return
     }
 
diff --git a/gdb/testsuite/gdb.mi/list-thread-groups-available.exp b/gdb/testsuite/gdb.mi/list-thread-groups-available.exp
index c4cad2075ac..4b3c6d7a18e 100644
--- a/gdb/testsuite/gdb.mi/list-thread-groups-available.exp
+++ b/gdb/testsuite/gdb.mi/list-thread-groups-available.exp
@@ -21,7 +21,7 @@ set MIFLAGS "-i=mi"
 standard_testfile
 
 # Support for XML is needed to run this test.
-if [gdb_skip_xml_test] then {
+if {[gdb_skip_xml_test]} {
     unsupported "list-thread-groups-available.exp"
     return -1
 }
diff --git a/gdb/testsuite/gdb.mi/mi-async.exp b/gdb/testsuite/gdb.mi/mi-async.exp
index af16b4a243d..756ca112820 100644
--- a/gdb/testsuite/gdb.mi/mi-async.exp
+++ b/gdb/testsuite/gdb.mi/mi-async.exp
@@ -21,7 +21,7 @@
 # mi_run_cmd, it ignores whatever target the rest of GDB testsuite is
 # using, and always tries to run natively.  So, don't do anything unless
 # we're actually testing native.
-if { !([isnative] && [istarget *-linux*]) } then {
+if {!([isnative] && [istarget *-linux*])} {
   return
 }
 
diff --git a/gdb/testsuite/gdb.mi/mi-corefile.exp b/gdb/testsuite/gdb.mi/mi-corefile.exp
index d8ca6b3b34f..61aec326bcb 100644
--- a/gdb/testsuite/gdb.mi/mi-corefile.exp
+++ b/gdb/testsuite/gdb.mi/mi-corefile.exp
@@ -18,7 +18,7 @@
 load_lib mi-support.exp
 set MIFLAGS "-i=mi"
 
-if ![isnative] then {
+if {![isnative]} {
     return
 }
 
diff --git a/gdb/testsuite/gdb.mi/mi-frame-regs.exp b/gdb/testsuite/gdb.mi/mi-frame-regs.exp
index 94a02dd2c0f..df15c59887c 100644
--- a/gdb/testsuite/gdb.mi/mi-frame-regs.exp
+++ b/gdb/testsuite/gdb.mi/mi-frame-regs.exp
@@ -98,7 +98,7 @@ proc_with_prefix do_floating_varobj_test {} {
 
 	# Get the address of the current breakpoint.
 	set bpaddr [breakpoint_address $bpnum]
-	if {$bpaddr == ""} then { return }
+	if {$bpaddr == ""} { return }
 
 	# Check that the addresses are the same.
 	gdb_assert [expr $bpaddr == $pcval] "\$pc equals address of breakpoint in callee$i"
@@ -145,7 +145,7 @@ proc_with_prefix do_fixed_varobj_test {} {
 
     for {set i 0} {$i < 4} {incr i} {
 
-	if { $i == 1 } then { set first_unchanging_varnum $varnum }
+	if {$i == 1} { set first_unchanging_varnum $varnum }
 
 	mi_gdb_test "-var-create --thread 1 --frame $i - \* \$pc" \
 	    "\\^done,.*value=\"$hex.*" \
diff --git a/gdb/testsuite/gdb.mi/mi-info-os.exp b/gdb/testsuite/gdb.mi/mi-info-os.exp
index ea4acf9e3eb..fde70bb1ea8 100644
--- a/gdb/testsuite/gdb.mi/mi-info-os.exp
+++ b/gdb/testsuite/gdb.mi/mi-info-os.exp
@@ -17,13 +17,13 @@ load_lib mi-support.exp
 set MIFLAGS "-i=mi"
 
 # This test is Linux-only.
-if ![istarget *-*-linux*] then {
+if {![istarget *-*-linux*]} {
     unsupported "mi-info-os.exp"
     return -1
 }
 
 # Support for XML-output is needed to run this test.
-if [gdb_skip_xml_test] then {
+if {[gdb_skip_xml_test]} {
     unsupported "mi-info-os.exp"
     return -1
 }
diff --git a/gdb/testsuite/gdb.mi/mi-regs.exp b/gdb/testsuite/gdb.mi/mi-regs.exp
index da253e644ca..983e1079a38 100644
--- a/gdb/testsuite/gdb.mi/mi-regs.exp
+++ b/gdb/testsuite/gdb.mi/mi-regs.exp
@@ -104,7 +104,7 @@ proc sparc_register_tests { } {
 	    "list changed registers"
 }
 
-if [istarget "sparc-*-*"] then {
+if {[istarget "sparc-*-*"]} {
     mi_clean_restart
     sparc_register_tests_no_exec
     mi_clean_restart $binfile
diff --git a/gdb/testsuite/gdb.modula2/max-depth.exp b/gdb/testsuite/gdb.modula2/max-depth.exp
index 2ffcba4ba93..5f5b19a5a77 100644
--- a/gdb/testsuite/gdb.modula2/max-depth.exp
+++ b/gdb/testsuite/gdb.modula2/max-depth.exp
@@ -21,7 +21,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug quiet}]}
     return -1
 }
 
-if { ![runto_main] } then {
+if {![runto_main]} {
     return -1
 }
 
diff --git a/gdb/testsuite/gdb.modula2/multidim.exp b/gdb/testsuite/gdb.modula2/multidim.exp
index 1e4354d8822..06a74d462f5 100644
--- a/gdb/testsuite/gdb.modula2/multidim.exp
+++ b/gdb/testsuite/gdb.modula2/multidim.exp
@@ -24,7 +24,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile \
     return -1
 }
 
-if ![runto here] then {
+if {![runto here]} {
     perror "couldn't run to breakpoint 'here'"
     return
 }
diff --git a/gdb/testsuite/gdb.modula2/unbounded-array.exp b/gdb/testsuite/gdb.modula2/unbounded-array.exp
index ae3032d349f..e75f1993787 100644
--- a/gdb/testsuite/gdb.modula2/unbounded-array.exp
+++ b/gdb/testsuite/gdb.modula2/unbounded-array.exp
@@ -23,7 +23,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug quiet}]}
     return -1
 }
 
-if ![runto foo] then {
+if {![runto foo]} {
     perror "couldn't run to breakpoint foo"
     return
 }
diff --git a/gdb/testsuite/gdb.opt/break-on-_exit.exp b/gdb/testsuite/gdb.opt/break-on-_exit.exp
index d94cc7e48df..7c2fda6af69 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 66ec5c85d21..617ebff7ab4 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 8d4018e9b8b..5798ad0fcb5 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 0acda6594c5..f8868a0e179 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
 }
 
@@ -73,7 +73,7 @@ gdb_test_multiple "step" $test {
     }
 }
 
-if ![runto_main] then {
+if {![runto_main]} {
   return 0
 }
 
diff --git a/gdb/testsuite/gdb.pascal/types.exp b/gdb/testsuite/gdb.pascal/types.exp
index a761e25a0f0..a19d65ab17f 100644
--- a/gdb/testsuite/gdb.pascal/types.exp
+++ b/gdb/testsuite/gdb.pascal/types.exp
@@ -74,7 +74,7 @@ gdb_exit
 gdb_start
 gdb_reinitialize_dir $srcdir/$subdir
 
-if [set_lang_pascal] then {
+if {[set_lang_pascal]} {
     test_integer_literal_types_accepted
     test_logical_literal_types_accepted
     test_character_literal_types_accepted
diff --git a/gdb/testsuite/gdb.server/connect-with-no-symbol-file.exp b/gdb/testsuite/gdb.server/connect-with-no-symbol-file.exp
index 0ada144a803..9b47f21106f 100644
--- a/gdb/testsuite/gdb.server/connect-with-no-symbol-file.exp
+++ b/gdb/testsuite/gdb.server/connect-with-no-symbol-file.exp
@@ -63,7 +63,7 @@ proc connect_no_symbol_file { sysroot action } {
 	set gdbserver_gdbport [lindex $res 1]
 
 	# Perform test actions to the symbol file on the target.
-	if { $action == "delete" } then {
+	if {$action == "delete"} {
 	  remote_file target delete $target_exec
 	} elseif { $action == "permission" } {
 	  remote_exec target "chmod 000 $target_exec"
diff --git a/gdb/testsuite/gdb.server/ext-attach.exp b/gdb/testsuite/gdb.server/ext-attach.exp
index 7514faf6b3d..a67a536809c 100644
--- a/gdb/testsuite/gdb.server/ext-attach.exp
+++ b/gdb/testsuite/gdb.server/ext-attach.exp
@@ -56,7 +56,7 @@ proc run_test { target_async target_non_stop to_disable } {
     # extended-remote board, therefore already connected.
     gdb_test "disconnect" ".*"
 
-    if { [gdb_target_supports_trace] } then {
+    if {[gdb_target_supports_trace]} {
 	# Test predefined TSVs are uploaded.
 	gdb_test_sequence "info tvariables" "check uploaded tsv" {
 	    "\[\r\n\]+Name\[\t \]+Initial\[\t \]+Current"
diff --git a/gdb/testsuite/gdb.server/extended-remote-restart.exp b/gdb/testsuite/gdb.server/extended-remote-restart.exp
index db25a6ef075..41e55439950 100644
--- a/gdb/testsuite/gdb.server/extended-remote-restart.exp
+++ b/gdb/testsuite/gdb.server/extended-remote-restart.exp
@@ -35,7 +35,7 @@ if {[target_info gdb_protocol] != "extended-remote"} {
 
 # This test also makes use of 'detach-on-fork' which is not supported
 # on all platforms.
-if { ![istarget "*-*-linux*"] && ![istarget "*-*-openbsd*"] } then {
+if {![istarget "*-*-linux*"] && ![istarget "*-*-openbsd*"]} {
     return
 }
 
@@ -60,7 +60,7 @@ proc test_reload { do_kill_p follow_child_p } {
 
     clean_restart ${binfile}
 
-    if ![runto_main] then {
+    if {![runto_main]} {
 	return 0
     }
 
diff --git a/gdb/testsuite/gdb.stabs/exclfwd.exp b/gdb/testsuite/gdb.stabs/exclfwd.exp
index 5337ac8e376..201c13dd59a 100644
--- a/gdb/testsuite/gdb.stabs/exclfwd.exp
+++ b/gdb/testsuite/gdb.stabs/exclfwd.exp
@@ -27,7 +27,7 @@ if {[prepare_for_testing "failed to prepare" $testfile \
     return -1
 }
 
-if ![runto_main] then {
+if {![runto_main]} {
     perror "couldn't run to breakpoint"
     return
 }
@@ -41,14 +41,14 @@ gdb_test "ptype v1" "type = struct a {$eol
     int y;$eol
 }$eol"
 
-if { [test_debug_format "stabs"] } then {
+if {[test_debug_format "stabs"]} {
     setup_kfail "gdb/1602" *-*-*
 }
 gdb_test "ptype v2" "type = struct a {$eol
     const char .c;$eol
 }$eol"
 
-if { [test_debug_format "stabs"] } then {
+if {[test_debug_format "stabs"]} {
     setup_kfail "gdb/1603" *-*-*
 }
 gdb_test "ptype v3" "type = const char ."
diff --git a/gdb/testsuite/gdb.tui/tui-layout.exp b/gdb/testsuite/gdb.tui/tui-layout.exp
index 5e44b9cf38a..26259e337f9 100644
--- a/gdb/testsuite/gdb.tui/tui-layout.exp
+++ b/gdb/testsuite/gdb.tui/tui-layout.exp
@@ -35,7 +35,7 @@ proc test_layout {layout execution} {
     clean_restart $binfile
 
     if {$execution} {
-	if ![runto_main] then {
+	if {![runto_main]} {
 	    return 0
 	}
     }
diff --git a/gdb/testsuite/gdb.xml/tdesc-reload.exp b/gdb/testsuite/gdb.xml/tdesc-reload.exp
index 6e3fe2f5304..5c3f702ea18 100644
--- a/gdb/testsuite/gdb.xml/tdesc-reload.exp
+++ b/gdb/testsuite/gdb.xml/tdesc-reload.exp
@@ -27,7 +27,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
     return -1
 }
 
-if ![runto_main] then {
+if {![runto_main]} {
     return 0
 }
 
@@ -62,7 +62,7 @@ gdb_test_no_output "set tdesc filename $xml_file_1" \
 gdb_load ${binfile}
 
 # Run to `main' where we begin our tests.
-if ![runto_main] then {
+if {![runto_main]} {
     return -1
 }
 
-- 
2.25.4


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH 14/14] gdb/testsuite: remove use of then keyword from library files
  2022-11-15 10:42 [PATCH 00/14] Remove all uses of 'then' keyword from the testsuite Andrew Burgess
                   ` (12 preceding siblings ...)
  2022-11-15 10:42 ` [PATCH 13/14] gdb/testsuite: remove use of then keyword from gdb.*/*.exp scripts Andrew Burgess
@ 2022-11-15 10:42 ` Andrew Burgess
  2022-11-15 15:01 ` [PATCH 00/14] Remove all uses of 'then' keyword from the testsuite Simon Marchi
  2022-11-16 17:20 ` Tom Tromey
  15 siblings, 0 replies; 17+ messages in thread
From: Andrew Burgess @ 2022-11-15 10:42 UTC (permalink / raw)
  To: gdb-patches; +Cc: Andrew Burgess

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 testsuite
library files (in boards/, config/, and lib/).  Previous commits have
removed all uses of the 'then' keyword from the test script files,
this commit just cleans up the library files.

There should be no changes in what is tested after this commit.
---
 .../boards/native-extended-gdbserver.exp      |  4 +-
 gdb/testsuite/config/sid.exp                  | 16 ++---
 gdb/testsuite/config/sim.exp                  | 10 +--
 gdb/testsuite/config/slite.exp                |  8 +--
 gdb/testsuite/lib/cp-support.exp              | 64 +++++++++----------
 gdb/testsuite/lib/dwarf.exp                   | 10 +--
 gdb/testsuite/lib/gdb.exp                     | 62 +++++++++---------
 gdb/testsuite/lib/mi-support.exp              | 24 +++----
 gdb/testsuite/lib/prompt.exp                  |  2 +-
 gdb/testsuite/lib/selftest-support.exp        | 12 ++--
 gdb/testsuite/lib/trace-support.exp           |  6 +-
 11 files changed, 109 insertions(+), 109 deletions(-)

diff --git a/gdb/testsuite/boards/native-extended-gdbserver.exp b/gdb/testsuite/boards/native-extended-gdbserver.exp
index 67acc6fea7c..88857d6a905 100644
--- a/gdb/testsuite/boards/native-extended-gdbserver.exp
+++ b/gdb/testsuite/boards/native-extended-gdbserver.exp
@@ -113,7 +113,7 @@ proc gdb_reload { {inferior_args {}} } {
 # to a separate non-dbx testcase, we should be able to remove this.
 proc gdb_load { arg } {
     if { $arg != "" } {
-	if [gdb_file_cmd $arg] then { return -1 }
+	if {[gdb_file_cmd $arg]} { return -1 }
     }
 
     return [extended_gdbserver_load_last_file]
@@ -129,7 +129,7 @@ proc mi_gdb_load { arg } {
     global mi_gdb_prompt
 
     set res [extended_gdbserver_mi_gdb_load $arg]
-    if { $res } then { return -1 }
+    if {$res} { return -1 }
 
     send_gdb "100-gdb-set remote exec-file $arg\n"
     gdb_expect 10 {
diff --git a/gdb/testsuite/config/sid.exp b/gdb/testsuite/config/sid.exp
index e78317725a6..592663082c0 100644
--- a/gdb/testsuite/config/sid.exp
+++ b/gdb/testsuite/config/sid.exp
@@ -22,7 +22,7 @@ proc sid_start {} {
 	{ *big-endian* *-EB* *-meb* } { set sidendian "-EB" }
 	{ *little-endian* *-EL* *-mel* } { set sidendian "-EL" }
 	default { 
-	    if {[target_info exists sim,defaultendian]} then {
+	    if {[target_info exists sim,defaultendian]} {
 		set sidendian [target_info sim,defaultendian] 
 	    } else { 
                 # rely on endianness settings in sid configuration defaults
@@ -39,12 +39,12 @@ proc sid_start {} {
     # test to see whether to use use sid in build or install tree
     set use_build_tree [file exists ../../sid]
 
-    if {$use_build_tree} then {
+    if {$use_build_tree} {
 	set pre_spawn {
 	    global env
 	    set env(SID_LIBRARY_PATH) [join [glob "../../sid/component/*"] ":"]
 	    set env(SID) "../../sid/main/dynamic/sid"
-	    if {! [file exists $env(SID)]} then { error "Cannot find sid in build tree" }
+	    if {![file exists $env(SID)]} { error "Cannot find sid in build tree" }
 	}
 	if { [board_info target sim,protocol] == "sid" } {
 	    set spawncmd "[target_info sim] [target_info sim,options] $sidendian2 -e \"set cpu-gdb-socket sockaddr-local 0.0.0.0:$port\""
@@ -169,7 +169,7 @@ proc gdb_load { arg } {
     global retval
 
     if { $arg != "" } {
-	if [gdb_file_cmd $arg] then { return -1 }
+	if {[gdb_file_cmd $arg]} { return -1 }
     }
 
     gdb_target_sid
@@ -181,25 +181,25 @@ proc gdb_load { arg } {
     verbose "Timeout is now $timeout seconds" 2
     gdb_expect {
 	-re ".*\[Ee\]rror.*$gdb_prompt $" {
-	    if $verbose>1 then {
+	    if {$verbose > 1} {
 		perror "Error during download."
 	    }
 	    set retval -1
 	}
 	-re ".*$gdb_prompt $" {
-	    if $verbose>1 then {
+	    if {$verbose > 1} {
 		send_user "Loaded $arg into $GDB\n"
 	    }
 	    set retval 0
 	}
 	-re "$gdb_prompt $"     {
-	    if $verbose>1 then {
+	    if {$verbose > 1} {
 		perror "GDB couldn't load."
 	    }
 	    set retval -1
 	}
 	timeout {
-	    if $verbose>1 then {
+	    if {$verbose > 1} {
 		perror "Timed out trying to load $arg."
 	    }
 	    set retval -1
diff --git a/gdb/testsuite/config/sim.exp b/gdb/testsuite/config/sim.exp
index 862958510ea..57c54589e80 100644
--- a/gdb/testsuite/config/sim.exp
+++ b/gdb/testsuite/config/sim.exp
@@ -48,26 +48,26 @@ proc gdb_load { arg } {
     global gdb_prompt
 
     if { $arg != "" } {
-	if [gdb_file_cmd $arg] then { return -1 }
+	if {[gdb_file_cmd $arg]} { return -1 }
     }
 
-    if [gdb_target_sim] then { return -1 }
+    if {[gdb_target_sim]} { return -1 }
 
     send_gdb "load\n"
     gdb_expect 2400 {
 	-re ".*$gdb_prompt $" {
-	    if $verbose>1 then {
+	    if {$verbose > 1} {
 		send_user "Loaded $arg into $GDB\n"
 	    }
 	    return 0
 	}
 	-re "$gdb_prompt $"     {
-	    if $verbose>1 then {
+	    if {$verbose > 1} {
 		perror "GDB couldn't load."
 	    }
 	}
 	timeout {
-	    if $verbose>1 then {
+	    if {$verbose > 1} {
 		perror "Timed out trying to load $arg."
 	    }
 	}
diff --git a/gdb/testsuite/config/slite.exp b/gdb/testsuite/config/slite.exp
index 34679a82190..d81aaa29f94 100644
--- a/gdb/testsuite/config/slite.exp
+++ b/gdb/testsuite/config/slite.exp
@@ -83,7 +83,7 @@ proc gdb_load { arg } {
 	}
 	 -re "Remote target.*$gdb_prompt $" { }
 	 -re ".*SPARClite appears to be alive.*$gdb_prompt $"	{
-	    if $verbose>1 then {
+	    if {$verbose > 1} {
 		send_user "Set target to $targetname\n"
 	    }
 	}
@@ -119,12 +119,12 @@ proc gdb_load { arg } {
 		verbose "Timeout is now $timeout seconds" 2
 	    }
 	     -re "$gdb_prompt $"     {
-		if $verbose>1 then {
+		if {$verbose > 1} {
 		    perror "GDB couldn't load."
 		}
 	    }
 	     timeout {
-		if $verbose>1 then {
+		if {$verbose > 1} {
 		    perror "Timed out trying to load $arg."
 		}
 	    }
@@ -172,7 +172,7 @@ proc gdb_load { arg } {
 	}
     }
 
-    if [info exists expect_out(buffer)] then {
+    if {[info exists expect_out(buffer)]} {
 	send_log $expect_out(buffer)
     }
     return 0
diff --git a/gdb/testsuite/lib/cp-support.exp b/gdb/testsuite/lib/cp-support.exp
index 87bbf9104a1..82ad59d9905 100644
--- a/gdb/testsuite/lib/cp-support.exp
+++ b/gdb/testsuite/lib/cp-support.exp
@@ -251,7 +251,7 @@ proc cp_test_ptype_class { in_exp in_testname in_key in_tag in_class_table
 	# The test name defaults to the command, but without the
 	# arguments, for historical reasons.
 
-	if { "$in_testname" == "" } then { set in_testname "ptype $in_exp" }
+	if {"$in_testname" == ""} { set in_testname "ptype $in_exp" }
 
 	set in_command "ptype${in_ptype_arg} $in_exp"
     }
@@ -259,8 +259,8 @@ proc cp_test_ptype_class { in_exp in_testname in_key in_tag in_class_table
     # Save class tables in a history array for reuse.
 
     global cp_class_table_history
-    if { $in_class_table == "ibid" } then {
-	if { ! [info exists cp_class_table_history("$in_key,$in_tag") ] } then {
+    if {$in_class_table == "ibid"} {
+	if {![info exists cp_class_table_history("$in_key,$in_tag")]} {
 	    fail "$in_testname // bad ibid"
 	    return false
 	}
@@ -385,7 +385,7 @@ proc cp_test_ptype_class { in_exp in_testname in_key in_tag in_class_table
 
     # Check the actual tag.
 
-    if { "$actual_tag" != "$in_tag" } then {
+    if {"$actual_tag" != "$in_tag"} {
 	cp_check_errata "$in_tag" "$actual_tag" $in_errata_table
 	fail "$in_testname // wrong tag: $actual_tag"
 	return false
@@ -395,18 +395,18 @@ proc cp_test_ptype_class { in_exp in_testname in_key in_tag in_class_table
     # First parse them into a list.
 
     set list_actual_bases { }
-    if { "$actual_base_string" != "" } then {
+    if {"$actual_base_string" != ""} {
 	regsub "^:${wsopt}" $actual_base_string "" actual_base_string
 	set list_actual_bases [split $actual_base_string ","]
     }
 
     # Check the base count.
 
-    if { [llength $list_actual_bases] < [llength $list_bases] } then {
+    if {[llength $list_actual_bases] < [llength $list_bases]} {
 	fail "$in_testname // too few bases"
 	return false
     }
-    if { [llength $list_actual_bases] > [llength $list_bases] } then {
+    if {[llength $list_actual_bases] > [llength $list_bases]} {
 	fail "$in_testname // too many bases"
 	return false
     }
@@ -416,7 +416,7 @@ proc cp_test_ptype_class { in_exp in_testname in_key in_tag in_class_table
     foreach actual_base $list_actual_bases {
 	set actual_base [string trim $actual_base]
 	set base [lindex $list_bases 0]
-	if { "$actual_base" != "$base" } then {
+	if {"$actual_base" != "$base"} {
 	    cp_check_errata "$base" "$actual_base" $in_errata_table
 	    fail "$in_testname // wrong base: $actual_base"
 	    return false
@@ -449,13 +449,13 @@ proc cp_test_ptype_class { in_exp in_testname in_key in_tag in_class_table
 	# Get the next line.
 
 	set actual_line [cp_support_internal::next_line $line_queue]
-	if { "$actual_line" == "" } then { continue }
+	if {"$actual_line" == ""} { continue }
 
 	# Access specifiers.
 
-	if { [regexp "^(public|protected|private)${wsopt}:\$" "$actual_line" s0 s1] } then {
+	if {[regexp "^(public|protected|private)${wsopt}:\$" "$actual_line" s0 s1]} {
 	    set access "$s1"
-	    if { $last_was_access } then {
+	    if {$last_was_access} {
 		fail "$in_testname // redundant access specifier"
 		queue delete $line_queue
 		return false
@@ -468,10 +468,10 @@ proc cp_test_ptype_class { in_exp in_testname in_key in_tag in_class_table
 
 	# Optional virtual base pointer.
 
-	if { [ llength $list_vbases ] > 0 } then {
+	if {[llength $list_vbases] > 0} {
 	    set vbase [lindex $list_vbases 0]
-	    if { [ regexp "$vbase \\*(_vb.|_vb\\\$|__vb_)\[0-9\]*$vbase;" $actual_line ] } then {
-		if { "$access" != "private" } then {
+	    if {[regexp "$vbase \\*(_vb.|_vb\\\$|__vb_)\[0-9\]*$vbase;" $actual_line]} {
+		if {"$access" != "private"} {
 		    cp_check_errata "private" "$access" $in_errata_table
 		    fail "$in_testname // wrong access specifier for virtual base: $access"
 		    queue delete $line_queue
@@ -485,7 +485,7 @@ proc cp_test_ptype_class { in_exp in_testname in_key in_tag in_class_table
 
 	# Data field.
 
-	if { [llength $list_fields] > 0 } then {
+	if {[llength $list_fields] > 0} {
 	    set field_access [lindex [lindex $list_fields 0] 0]
 	    set field_decl   [lindex [lindex $list_fields 0] 1]
 	    if {$recursive_qid > 0} {
@@ -494,8 +494,8 @@ proc cp_test_ptype_class { in_exp in_testname in_key in_tag in_class_table
 		cp_ptype_class_verbose "\tfield_decl=$field_decl"
 		cp_ptype_class_verbose "\taccess=$access"
 	    }
-	    if { "$actual_line" == "$field_decl" } then {
-		if { "$access" != "$field_access" } then {
+	    if {"$actual_line" == "$field_decl"} {
+		if {"$access" != "$field_access"} {
 		    cp_check_errata "$field_access" "$access" $in_errata_table
 		    fail "$in_testname // wrong access specifier for field: $access"
 		    queue delete $line_queue
@@ -514,11 +514,11 @@ proc cp_test_ptype_class { in_exp in_testname in_key in_tag in_class_table
 
 	# Method function.
 
-	if { [llength $list_methods] > 0 } then {
+	if {[llength $list_methods] > 0} {
 	    set method_access [lindex [lindex $list_methods 0] 0]
 	    set method_decl   [lindex [lindex $list_methods 0] 1]
-	    if { "$actual_line" == "$method_decl" } then {
-		if { "$access" != "$method_access" } then {
+	    if {"$actual_line" == "$method_decl"} {
+		if {"$access" != "$method_access"} {
 		    cp_check_errata "$method_access" "$access" $in_errata_table
 		    fail "$in_testname // wrong access specifier for method: $access"
 		    queue delete $line_queue
@@ -530,8 +530,8 @@ proc cp_test_ptype_class { in_exp in_testname in_key in_tag in_class_table
 
 	    # gcc 2.95.3 shows "foo()" as "foo(void)".
 	    regsub -all "\\(\\)" $method_decl "(void)" method_decl
-	    if { "$actual_line" == "$method_decl" } then {
-		if { "$access" != "$method_access" } then {
+	    if {"$actual_line" == "$method_decl"} {
+		if {"$access" != "$method_access"} {
 		    cp_check_errata "$method_access" "$access" $in_errata_table
 		    fail "$in_testname // wrong access specifier for method: $access"
 		    queue delete $line_queue
@@ -689,16 +689,16 @@ proc cp_test_ptype_class { in_exp in_testname in_key in_tag in_class_table
 	    set synth_access  [lindex $synth 1]
 	    set synth_re      [lindex $synth 2]
 
-	    if { [ regexp "$synth_re" "$actual_line" ] } then {
+	    if {[regexp "$synth_re" "$actual_line"]} {
 
-		if { "$access" != "$synth_access" } then {
+		if {"$access" != "$synth_access"} {
 		    cp_check_errata "$synth_access" "$access" $in_errata_table
 		    fail "$in_testname // wrong access specifier for synthetic operator: $access"
 		    queue delete $line_queue
 		    return false
 		}
 
-		if { $synth_count > 0 } then {
+		if {$synth_count > 0} {
 		    cp_check_errata "$actual_line" "$actual_line" $in_errata_table
 		    fail "$in_testname // duplicate synthetic operator: $actual_line"
 		}
@@ -715,7 +715,7 @@ proc cp_test_ptype_class { in_exp in_testname in_key in_tag in_class_table
 		break
 	    }
 	}
-	if { $synth_match } then { continue }
+	if {$synth_match} { continue }
 
 	# If checking a nested type/recursively and we see a closing curly
 	# brace, we're done.
@@ -725,7 +725,7 @@ proc cp_test_ptype_class { in_exp in_testname in_key in_tag in_class_table
 
 	# Unrecognized line.
 
-	if { [llength $list_methods] > 0 } then {
+	if {[llength $list_methods] > 0} {
 	    set method_decl [lindex [lindex $list_methods 0] 1]
 	    cp_check_errata "$method_decl" "$actual_line" $in_errata_table
 	}
@@ -742,19 +742,19 @@ proc cp_test_ptype_class { in_exp in_testname in_key in_tag in_class_table
 
     # Check for missing elements.
 
-    if { $vbase_match } then {
-	if { [llength $list_vbases] > 0 } then {
+    if {$vbase_match} {
+	if {[llength $list_vbases] > 0} {
 	    fail "$in_testname // missing virtual base pointers"
 	    return false
 	}
     }
 
-    if { [llength $list_fields] > 0 } then {
+    if {[llength $list_fields] > 0} {
 	fail "$in_testname // missing fields"
 	return false
     }
 
-    if { [llength $list_methods] > 0 } then {
+    if {[llength $list_methods] > 0} {
 	fail "$in_testname // missing methods"
 	return false
     }
@@ -767,7 +767,7 @@ proc cp_test_ptype_class { in_exp in_testname in_key in_tag in_class_table
     # Check the tail.
 
     set actual_tail [string trim $actual_tail]
-    if { "$actual_tail" != "$in_tail" } then {
+    if {"$actual_tail" != "$in_tail"} {
 	cp_check_errata "$in_tail" "$actual_tail" $in_errata_table
 	fail "$in_testname // wrong tail: $actual_tail"
 	return false
diff --git a/gdb/testsuite/lib/dwarf.exp b/gdb/testsuite/lib/dwarf.exp
index 9df8e7f9bdc..35f4e957c58 100644
--- a/gdb/testsuite/lib/dwarf.exp
+++ b/gdb/testsuite/lib/dwarf.exp
@@ -104,7 +104,7 @@ proc build_executable_and_dwo_files { testname executable options args } {
     global subdir
     global srcdir
 
-    if { ! [regexp "^/" "$executable"] } then {
+    if {![regexp "^/" "$executable"]} {
 	set binfile [standard_output_file $executable]
     } else {
 	set binfile $executable
@@ -143,7 +143,7 @@ proc build_executable_and_dwo_files { testname executable options args } {
 	set s [lindex $spec 0]
 	set local_options [lindex $spec 1]
 
-	if { ! [regexp "^/" "$s"] } then {
+	if {![regexp "^/" "$s"]} {
 	    set s "$srcdir/$subdir/$s"
 	}
 
@@ -1685,7 +1685,7 @@ namespace eval Dwarf {
 	    proc base { addr } {
 		variable _debug_ranges_64_bit
 
-		if { $_debug_ranges_64_bit } then {
+		if {$_debug_ranges_64_bit} {
 		    _op .8byte 0xffffffffffffffff "Base Marker"
 		    _op .8byte $addr "Base Address"
 		} else {
@@ -1697,7 +1697,7 @@ namespace eval Dwarf {
 	    proc range { start end } {
 		variable _debug_ranges_64_bit
 
-		if { $_debug_ranges_64_bit } then {
+		if {$_debug_ranges_64_bit} {
 		    _op .8byte $start "Start Address"
 		    _op .8byte $end "End Address"
 		} else {
@@ -1709,7 +1709,7 @@ namespace eval Dwarf {
 	    uplevel $body
 
 	    # End of the sequence.
-	    if { $_debug_ranges_64_bit } then {
+	    if {$_debug_ranges_64_bit} {
 		_op .8byte 0x0 "End of Sequence Marker (Part 1)"
 		_op .8byte 0x0 "End of Sequence Marker (Part 2)"
 	    } else {
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index 3e0a46445ca..b3a36d10f9d 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -227,7 +227,7 @@ if ![info exists INTERNAL_GDBFLAGS] {
 # but it's not clear what removing one of them will break.
 # See with_gdb_prompt for more details on prompt handling.
 global gdb_prompt
-if ![info exists gdb_prompt] then {
+if {![info exists gdb_prompt]} {
     set gdb_prompt "\\(gdb\\)"
 }
 
@@ -1135,7 +1135,7 @@ proc gdb_test_multiple { command message args } {
     regsub -all {\r} $patterns {\\r} patterns
     regsub -all {\n} $patterns {\\n} patterns
 
-    if $verbose>2 then {
+    if {$verbose > 2} {
 	send_user "Sending \"$command\" to gdb\n"
 	send_user "Looking to match \"$patterns\"\n"
 	send_user "Message is \"$message\"\n"
@@ -1206,7 +1206,7 @@ proc gdb_test_multiple { command message args } {
 
     append code {
 	-re "Ending remote debugging.*$prompt_regexp" {
-	    if ![isnative] then {
+	    if {![isnative]} {
 		warning "Can`t communicate to remote target."
 	    }
 	    gdb_exit
@@ -1224,7 +1224,7 @@ proc gdb_test_multiple { command message args } {
 	    set result 1
 	}
 	-re "$inferior_exited_re with code \[0-9\]+.*$prompt_regexp" {
-	    if ![string match "" $message] then {
+	    if {![string match "" $message]} {
 		set errmsg "$message (the program exited)"
 	    } else {
 		set errmsg "$command (the program exited)"
@@ -1233,7 +1233,7 @@ proc gdb_test_multiple { command message args } {
 	    set result -1
 	}
 	-re "$inferior_exited_re normally.*$prompt_regexp" {
-	    if ![string match "" $message] then {
+	    if {![string match "" $message]} {
 		set errmsg "$message (the program exited)"
 	    } else {
 		set errmsg "$command (the program exited)"
@@ -1242,7 +1242,7 @@ proc gdb_test_multiple { command message args } {
 	    set result -1
 	}
 	-re "The program is not being run.*$prompt_regexp" {
-	    if ![string match "" $message] then {
+	    if {![string match "" $message]} {
 		set errmsg "$message (the program is no longer running)"
 	    } else {
 		set errmsg "$command (the program is no longer running)"
@@ -1251,7 +1251,7 @@ proc gdb_test_multiple { command message args } {
 	    set result -1
 	}
 	-re "\r\n$prompt_regexp" {
-	    if ![string match "" $message] then {
+	    if {![string match "" $message]} {
 		fail "$message"
 	    }
 	    set result 1
@@ -1311,7 +1311,7 @@ proc gdb_test_multiple { command message args } {
 	    set result -1
 	}
 	timeout	{
-	    if ![string match "" $message] then {
+	    if {![string match "" $message]} {
 		fail "$message (timeout)"
 	    }
 	    set result 1
@@ -1669,13 +1669,13 @@ proc test_print_reject { args } {
     global gdb_prompt
     global verbose
 
-    if [llength $args]==2 then {
+    if {[llength $args] == 2} {
 	set expectthis [lindex $args 1]
     } else {
 	set expectthis "should never match this bogus string"
     }
     set sendthis [lindex $args 0]
-    if $verbose>2 then {
+    if {$verbose > 2} {
 	send_user "Sending \"$sendthis\" to gdb\n"
 	send_user "Looking to match \"$expectthis\"\n"
     }
@@ -1762,7 +1762,7 @@ proc gdb_test_exact { args } {
     # case some users of gdb_test_exact already do the right thing.
     regsub -all "\r\n" $pattern "\n" pattern
     regsub -all "\n" $pattern "\r\n" pattern
-    if [llength $args]==3 then {
+    if {[llength $args] == 3} {
 	set message [lindex $args 2]
 	return [gdb_test $command $pattern $message]
     }
@@ -2240,7 +2240,7 @@ proc default_gdb_spawn { } {
     }
 
     if ![is_remote host] {
-	if { [which $GDB] == 0 } then {
+	if {[which $GDB] == 0} {
 	    perror "$GDB does not exist."
 	    exit 1
 	}
@@ -4587,7 +4587,7 @@ gdb_caching_proc universal_compile_options {
     # such an option is specified.
     set opt "additional_flags=-fdiagnostics-color=never"
     set lines [target_compile $src $obj object [list "quiet" $opt]]
-    if [string match "" $lines] then {
+    if {[string match "" $lines]} {
 	# Seems to have worked; use the option.
 	lappend options $opt
     }
@@ -4638,7 +4638,7 @@ proc gdb_simple_compile {name code {type object} {compile_flags {}} {object obj}
 
     file delete $src
 
-    if ![string match "" $lines] then {
+    if {![string match "" $lines]} {
         verbose "$name:  compilation failed, returning 0" 2
         return 0
     }
@@ -5505,7 +5505,7 @@ proc can_spawn_for_attach { } {
     # We use exp_pid to get the inferior's pid, assuming that gives
     # back the pid of the program.  On remote boards, that would give
     # us instead the PID of e.g., the ssh client, etc.
-    if [is_remote target] then {
+    if {[is_remote target]} {
 	verbose -log "can't spawn for attach (target is remote)"
 	return 0
     }
@@ -6530,7 +6530,7 @@ proc test_debug_format {format} {
 proc setup_xfail_format { format } {
     set ret [test_debug_format $format]
 
-    if {$ret} then {
+    if {$ret} {
 	setup_xfail "*-*-*"
     }
     return $ret
@@ -6604,32 +6604,32 @@ proc gdb_get_line_number { text { file "" } } {
     global subdir
     global srcfile
 
-    if { "$file" == "" } then {
+    if {"$file" == ""} {
 	set file "$srcfile"
     }
-    if { ! [regexp "^/" "$file"] } then {
+    if {![regexp "^/" "$file"]} {
 	set file "$srcdir/$subdir/$file"
     }
 
-    if { [ catch { set fd [open "$file"] } message ] } then {
+    if {[catch { set fd [open "$file"] } message]} {
 	error "$message"
     }
 
     set found -1
     for { set line 1 } { 1 } { incr line } {
-	if { [ catch { set nchar [gets "$fd" body] } message ] } then {
+	if {[catch { set nchar [gets "$fd" body] } message]} {
 	    error "$message"
 	}
-	if { $nchar < 0 } then {
+	if {$nchar < 0} {
 	    break
 	}
-	if { [string first "$text" "$body"] >= 0 } then {
+	if {[string first "$text" "$body"] >= 0} {
 	    set found $line
 	    break
 	}
     }
 
-    if { [ catch { close "$fd" } message ] } then {
+    if {[catch { close "$fd" } message]} {
 	error "$message"
     }
 
@@ -6841,7 +6841,7 @@ gdb_caching_proc gdb_skip_float_test {
 	set lines [gdb_compile $src $exe executable $compile_flags]
 	file delete $src
 
-	if ![string match "" $lines] then {
+	if {![string match "" $lines]} {
 	    verbose "testfile compilation failed, returning 1" 2
 	    return 0
 	}
@@ -7085,7 +7085,7 @@ proc get_build_id { filename } {
 	set data [read $fi]
 	close $fi
 	file delete $tmp
-	if ![string compare $data ""] then {
+	if {![string compare $data ""]} {
 	    return ""
 	}
 	# Convert it to hex.
@@ -7301,7 +7301,7 @@ proc build_executable_from_specs {testname executable options args} {
     if [string match gdb_compile_shlib* $func] {
 	set sources_path {}
 	foreach {s local_options} $args {
-	    if { [regexp "^/" "$s"] } then {
+	    if {[regexp "^/" "$s"]} {
 		lappend sources_path "$s"
 	    } else {
 		lappend sources_path "$srcdir/$subdir/$s"
@@ -7311,7 +7311,7 @@ proc build_executable_from_specs {testname executable options args} {
     } elseif {[lsearch -exact $options rust] != -1} {
 	set sources_path {}
 	foreach {s local_options} $args {
-	    if { [regexp "^/" "$s"] } then {
+	    if {[regexp "^/" "$s"]} {
 		lappend sources_path "$s"
 	    } else {
 		lappend sources_path "$srcdir/$subdir/$s"
@@ -7322,7 +7322,7 @@ proc build_executable_from_specs {testname executable options args} {
 	set objects {}
 	set i 0
 	foreach {s local_options} $args {
-	    if { ! [regexp "^/" "$s"] } then {
+	    if {![regexp "^/" "$s"]} {
 		set s "$srcdir/$subdir/$s"
 	    }
 	    if  { [$func "${s}" "${binfile}${i}.o" object $local_options] != "" } {
@@ -8076,7 +8076,7 @@ proc parse_list { level listname argset prefix eval } {
 	    set pattern "$prefix$argument"
 	    set result [lsearch -exact $args $pattern]
 
-	    if {$result != -1} then {
+	    if {$result != -1} {
 		set value 1
 		set args [lreplace $args $result $result]
 	    } else {
@@ -8092,7 +8092,7 @@ proc parse_list { level listname argset prefix eval } {
 	    set pattern "$prefix[lindex $arg 0]"
 	    set result [lsearch -exact $args $pattern]
 
-	    if {$result != -1} then {
+	    if {$result != -1} {
 		set value [lindex $args [expr $result+1]]
 		if { $eval } {
 		    set value [uplevel [expr $level + 1] [list subst $value]]
@@ -8417,7 +8417,7 @@ proc cmp_file_string { file str msg } {
 	set file_contents [read $fp]
 	close $fp
     } error_message]
-    if { $caught_error } then {
+    if {$caught_error} {
 	error "$error_message"
 	fail "$msg"
 	return
diff --git a/gdb/testsuite/lib/mi-support.exp b/gdb/testsuite/lib/mi-support.exp
index b11457693be..ab81c07f664 100644
--- a/gdb/testsuite/lib/mi-support.exp
+++ b/gdb/testsuite/lib/mi-support.exp
@@ -22,7 +22,7 @@ load_lib gdb-utils.exp
 # The variable mi_gdb_prompt is a regexp which matches the gdb mi prompt.
 # Set it if it is not already set.
 global mi_gdb_prompt
-if ![info exists mi_gdb_prompt] then {
+if {![info exists mi_gdb_prompt]} {
     set mi_gdb_prompt "\[(\]gdb\[)\] \r\n"
 }
 
@@ -727,19 +727,19 @@ proc mi_gdb_test { args } {
     global inferior_exited_re async
     upvar timeout timeout
 
-    if { [llength $args] >= 1 } then {
+    if {[llength $args] >= 1} {
 	set command [lindex $args 0]
     } else {
 	error "Not enough arguments in mi_gdb_test"
     }
 
-    if { [llength $args] >= 2 } then {
+    if {[llength $args] >= 2} {
 	set pattern [lindex $args 1]
     } else {
 	set pattern ".*"
     }
 
-    if { [llength $args] >= 3 } then {
+    if {[llength $args] >= 3} {
 	set message [lindex $args 2]
     } else {
 	set message $command
@@ -760,7 +760,7 @@ proc mi_gdb_test { args } {
 	error "Too many arguments in mi_gdb_test"
     }
 
-    if $verbose>2 then {
+    if {$verbose > 2} {
 	send_user "Sending \"$command\" to gdb\n"
 	send_user "Looking to match \"$pattern\"\n"
 	send_user "Message is \"$message\"\n"
@@ -819,7 +819,7 @@ proc mi_gdb_test { args } {
 	     return -1
 	 }
 	 -re "Ending remote debugging.*$mi_gdb_prompt\[ \]*$" {
-	    if ![isnative] then {
+	    if {![isnative]} {
 		warning "Can`t communicate to remote target."
 	    }
 	    gdb_exit
@@ -839,7 +839,7 @@ proc mi_gdb_test { args } {
 	    # match a single mi output command.  If a second GDB/MI output 
 	    # response is sent, it will be in the buffer for the next 
 	    # time mi_gdb_test is called.
-	    if ![string match "" $message] then {
+	    if {![string match "" $message]} {
 		pass "$message"
 	    }
 	    set result 0
@@ -859,7 +859,7 @@ proc mi_gdb_test { args } {
 	    set result 1
 	}
 	 -re "$inferior_exited_re with code \[0-9\]+.*$mi_gdb_prompt\[ \]*$" {
-	    if ![string match "" $message] then {
+	    if {![string match "" $message]} {
 		set errmsg "$message (the program exited)"
 	    } else {
 		set errmsg "$command (the program exited)"
@@ -868,7 +868,7 @@ proc mi_gdb_test { args } {
 	    return -1
 	}
 	 -re "The program is not being run.*$mi_gdb_prompt\[ \]*$" {
-	    if ![string match "" $message] then {
+	    if {![string match "" $message]} {
 		set errmsg "$message (the program is no longer running)"
 	    } else {
 		set errmsg "$command (the program is no longer running)"
@@ -877,7 +877,7 @@ proc mi_gdb_test { args } {
 	    return -1
 	}
 	 -re ".*$mi_gdb_prompt\[ \]*$" {
-	    if ![string match "" $message] then {
+	    if {![string match "" $message]} {
 		fail "$message (unexpected output)"
 	    }
 	    set result 1
@@ -899,7 +899,7 @@ proc mi_gdb_test { args } {
 	     fail "$message"
 	}
 	timeout	{
-	    if ![string match "" $message] then {
+	    if {![string match "" $message]} {
 		fail "$message (timeout)"
 	    }
 	    set result 1
@@ -1742,7 +1742,7 @@ proc mi_prepare_inline_tests { filename } {
 
     set mi_autotest_source $filename
 
-    if { ! [regexp "^/" "$filename"] } then {
+    if {![regexp "^/" "$filename"]} {
 	set filename "$srcdir/$subdir/$filename"
     }
 
diff --git a/gdb/testsuite/lib/prompt.exp b/gdb/testsuite/lib/prompt.exp
index d648130b611..1bd34ab72d2 100644
--- a/gdb/testsuite/lib/prompt.exp
+++ b/gdb/testsuite/lib/prompt.exp
@@ -38,7 +38,7 @@ proc default_prompt_gdb_start { } {
     }
 
     if ![is_remote host] {
-	if { [which $GDB] == 0 } then {
+	if {[which $GDB] == 0} {
 	    perror "$GDB does not exist."
 	    exit 1
 	}
diff --git a/gdb/testsuite/lib/selftest-support.exp b/gdb/testsuite/lib/selftest-support.exp
index 2b17c539a96..3c270d88527 100644
--- a/gdb/testsuite/lib/selftest-support.exp
+++ b/gdb/testsuite/lib/selftest-support.exp
@@ -21,12 +21,12 @@ proc find_gdb { arg } {
     # If the arg directly specifies an existing executable file, then
     # simply use it.
 
-    if [file executable $arg] then {
+    if {[file executable $arg]} {
 	return $arg
     }
 
     set result [which $arg]
-    if [string match "/" [ string range $result 0 0 ]] then {
+    if {[string match "/" [ string range $result 0 0 ]]} {
 	return $result
     }
 
@@ -54,11 +54,11 @@ proc selftest_setup { executable function } {
 
     set result [gdb_load $executable]
 
-    if { $result != 0 } then {
+    if {$result != 0} {
 	return -1
     }
 
-    if { $gdb_file_cmd_debug_info != "debug" } then {
+    if {$gdb_file_cmd_debug_info != "debug"} {
 	untested "no debug information, skipping testcase."
 	return -2
     }
@@ -139,7 +139,7 @@ proc do_self_tests {function body} {
     # duration of the test.
     with_timeout_factor 10 {
 	set result [selftest_setup $file $function]
-	if {$result == 0} then {
+	if {$result == 0} {
 	    set result [uplevel $body]
 	}
     }
@@ -147,7 +147,7 @@ proc do_self_tests {function body} {
     gdb_exit
     catch "remote_file host delete $file"
 
-    if {$result == -1} then {
+    if {$result == -1} {
 	warning "Couldn't test self"
     }
 }
diff --git a/gdb/testsuite/lib/trace-support.exp b/gdb/testsuite/lib/trace-support.exp
index ccad22ecd99..49bf9bd9653 100644
--- a/gdb/testsuite/lib/trace-support.exp
+++ b/gdb/testsuite/lib/trace-support.exp
@@ -208,7 +208,7 @@ proc gdb_trace_setactions_command { actions_command testname tracepoint args } {
     if { $testname != "" } {
 	$passfail $testname
     }
-    if { $passfail == "pass" } then { 
+    if {$passfail == "pass"} {
 	return 0
     } else {
 	return 1
@@ -265,7 +265,7 @@ proc gdb_tfind_test { testname tfind_arg exp_res args } {
 	-re "$gdb_prompt $" { }
     }
     $passfail "$testname"
-    if { $passfail == "pass" } then { 
+    if {$passfail == "pass"} {
 	return 0
     } else {
 	return 1
@@ -395,7 +395,7 @@ proc generate_tracefile { binfile } {
 
 	clean_restart $binfile
 
-	if ![runto_main] then {
+	if {![runto_main]} {
 	    return 0
 	}
 	gdb_continue_to_end "" continue 1
-- 
2.25.4


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 00/14] Remove all uses of 'then' keyword from the testsuite
  2022-11-15 10:42 [PATCH 00/14] Remove all uses of 'then' keyword from the testsuite Andrew Burgess
                   ` (13 preceding siblings ...)
  2022-11-15 10:42 ` [PATCH 14/14] gdb/testsuite: remove use of then keyword from library files Andrew Burgess
@ 2022-11-15 15:01 ` Simon Marchi
  2022-11-16 17:20 ` Tom Tromey
  15 siblings, 0 replies; 17+ messages in thread
From: Simon Marchi @ 2022-11-15 15:01 UTC (permalink / raw)
  To: Andrew Burgess, gdb-patches

On 11/15/22 05:42, Andrew Burgess via Gdb-patches wrote:
> It was pointed out to me (off-list) that in this patch:
> 
>   https://sourceware.org/pipermail/gdb-patches/2022-November/193744.html
> 
> I had made use of TCL's 'then' keyword, which apparently is not the
> preferred way to write if statements these days, at least, not for
> single line conditions.  And it certainly seems that NOT using 'then'
> is more common in the GDB testsuite.
> 
> As my use of 'then' was due to copy&paste from another test, this
> series aims to prevent the same mistake happening again by removing
> all uses of 'then' for if statements where the condition fits on a
> single line.
> 
> The change was generated with sed, I sanity checked them all by eye,
> and didn't see any obvious mistakes.  Tested on x86-64 GNU/Linux and
> didn't see any test regressions.
> 
> Thoughts?

Hi Andrew,

I'm totally fine with that.

Simon

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 00/14] Remove all uses of 'then' keyword from the testsuite
  2022-11-15 10:42 [PATCH 00/14] Remove all uses of 'then' keyword from the testsuite Andrew Burgess
                   ` (14 preceding siblings ...)
  2022-11-15 15:01 ` [PATCH 00/14] Remove all uses of 'then' keyword from the testsuite Simon Marchi
@ 2022-11-16 17:20 ` Tom Tromey
  15 siblings, 0 replies; 17+ messages in thread
From: Tom Tromey @ 2022-11-16 17:20 UTC (permalink / raw)
  To: Andrew Burgess via Gdb-patches; +Cc: Andrew Burgess

>>>>> "Andrew" == Andrew Burgess via Gdb-patches <gdb-patches@sourceware.org> writes:

Andrew> It was pointed out to me (off-list) that in this patch:
Andrew>   https://sourceware.org/pipermail/gdb-patches/2022-November/193744.html

Andrew> I had made use of TCL's 'then' keyword, which apparently is not the
Andrew> preferred way to write if statements these days, at least, not for
Andrew> single line conditions.  And it certainly seems that NOT using 'then'
Andrew> is more common in the GDB testsuite.

I always liked the "noise" keywords in Tcl, but I think it's fine to
remove the "then"s.  I'd prefer we keep "else", though, even though it
isn't strictly required.  Especially for long "if"s I think the "else"
adds some clarity.

So, ok from me.  Thank you.

Tom

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2022-11-16 17:20 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-15 10:42 [PATCH 00/14] Remove all uses of 'then' keyword from the testsuite Andrew Burgess
2022-11-15 10:42 ` [PATCH 01/14] gdb/testsuite: remove DOS line endings from a test script Andrew Burgess
2022-11-15 10:42 ` [PATCH 02/14] gdb/testsuite: remove use of then keyword from gdb.ada/*.exp Andrew Burgess
2022-11-15 10:42 ` [PATCH 03/14] gdb/testsuite: remove use of then keyword from gdb.base/*.exp Andrew Burgess
2022-11-15 10:42 ` [PATCH 04/14] gdb/testsuite: remove use of then keyword from gdb.arch/*.exp Andrew Burgess
2022-11-15 10:42 ` [PATCH 05/14] gdb/testsuite: remove use of then keyword from gdb.cp/*.exp Andrew Burgess
2022-11-15 10:42 ` [PATCH 06/14] gdb/testsuite: remove use of then keyword from gdb.python/*.exp Andrew Burgess
2022-11-15 10:42 ` [PATCH 07/14] gdb/testsuite: remove use of then keyword from gdb.threads/*.exp Andrew Burgess
2022-11-15 10:42 ` [PATCH 08/14] gdb/testsuite: remove use of then keyword from gdb.trace/*.exp Andrew Burgess
2022-11-15 10:42 ` [PATCH 09/14] gdb/testsuite: remove use of then keyword from gdb.reverse/*.exp Andrew Burgess
2022-11-15 10:42 ` [PATCH 10/14] gdb/testsuite: remove use of then keyword from gdb.disasm/*.exp Andrew Burgess
2022-11-15 10:42 ` [PATCH 11/14] gdb/testsuite: remove use of then keyword from gdb.fortran/*.exp Andrew Burgess
2022-11-15 10:42 ` [PATCH 12/14] gdb/testsuite: remove use of then keyword from gdb.multi/*.exp Andrew Burgess
2022-11-15 10:42 ` [PATCH 13/14] gdb/testsuite: remove use of then keyword from gdb.*/*.exp scripts Andrew Burgess
2022-11-15 10:42 ` [PATCH 14/14] gdb/testsuite: remove use of then keyword from library files Andrew Burgess
2022-11-15 15:01 ` [PATCH 00/14] Remove all uses of 'then' keyword from the testsuite Simon Marchi
2022-11-16 17:20 ` Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).