diff options
Diffstat (limited to 'gas')
-rw-r--r-- | gas/ChangeLog | 8 | ||||
-rw-r--r-- | gas/testsuite/gas/all/gas.exp | 122 | ||||
-rw-r--r-- | gas/testsuite/gas/elf/elf.exp | 62 | ||||
-rw-r--r-- | gas/testsuite/gas/macros/macros.exp | 24 | ||||
-rw-r--r-- | gas/testsuite/lib/gas-defs.exp | 2 |
5 files changed, 114 insertions, 104 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog index 5d149df..6c182f5 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,11 @@ +2020-01-27 Alan Modra <amodra@gmail.com> + + * testsuite/gas/all/gas.exp: Replace case statements with switch + statements. + * testsuite/gas/elf/elf.exp: Likewise. + * testsuite/gas/macros/macros.exp: Likewise. + * testsuite/lib/gas-defs.exp: Likewise. + 2020-01-27 Tamar Christina <tamar.christina@arm.com> PR 25403 diff --git a/gas/testsuite/gas/all/gas.exp b/gas/testsuite/gas/all/gas.exp index 78cd3eb..d414053 100644 --- a/gas/testsuite/gas/all/gas.exp +++ b/gas/testsuite/gas/all/gas.exp @@ -80,9 +80,9 @@ if { ![ishost "*-*-mingw*"] } then { } # .equ works differently on some targets. -case $target_triplet in { - { hppa*-*-* } { } - { *c54x*-*-* } { } +switch -glob $target_triplet { + hppa*-*-* { } + *c54x*-*-* { } default { gas_test "equ-ok.s" "" "" ".equ for symbol already set" gas_test_error "equ-bad.s" "" ".equ for symbol already set through .eqv" @@ -106,19 +106,19 @@ run_dump_test forward # mmix doesn't like .L1: # ti addresses aren't octets. if { ![is_aout_format] } { - case $target_triplet in { - { hppa*64*-*-* } { + switch -glob $target_triplet { + hppa*64*-*-* { run_dump_test fwdexp } - { alpha-*-*linux*ecoff } { } - { alpha-*-osf* } { } - { hppa*-*-hpux* } { } - { mep-*-* } { } - { mmix-*-* } { } - { nds32*-*-* } { } - { tic30*-*-* } { } - { tic4x*-*-* } { } - { tic54x*-*-* } { } + alpha-*-*linux*ecoff { } + alpha-*-osf* { } + hppa*-*-hpux* { } + mep-*-* { } + mmix-*-* { } + nds32*-*-* { } + tic30*-*-* { } + tic4x*-*-* { } + tic54x*-*-* { } default { run_dump_test fwdexp } @@ -129,23 +129,23 @@ if { ![is_aout_format] } { # most of the tests won't work on targets that set linkrelax. # 4 octet bytes confuse address matching on ti targets. # pdp11 gets unexpected reloc types. -case $target_triplet in { - { alpha*-*-* } { } - { am3*-*-* } { } - { cr16*-*-* } { } - { crx*-*-* } { } - { h8300-*-* } { } - { mips*-*-* } { } - { mn10200-*-* } { } - { mn10300-*-* } { } - { msp430*-*-* } { } - { nds32*-*-* } { } - { pdp11-*-* } { } - { tic30*-*-* } { } - { tic4x*-*-* } { } - { tic54x*-*-* } { } - { xtensa*-*-* } { } - { z80-*-* } { } +switch -glob $target_triplet { + alpha*-*-* { } + am3*-*-* { } + cr16*-*-* { } + crx*-*-* { } + h8300-*-* { } + mips*-*-* { } + mn10200-*-* { } + mn10300-*-* { } + msp430*-*-* { } + nds32*-*-* { } + pdp11-*-* { } + tic30*-*-* { } + tic4x*-*-* { } + tic54x*-*-* { } + xtensa*-*-* { } + z80-*-* { } default { run_dump_test redef # These targets fail redef2 because they disallow redefined @@ -269,10 +269,10 @@ if { ![istarget *c30*-*-*] # ".struct" and ".align" have different meanings on c54x # These directives are done in the c54x-specific tests instead -case $target_triplet in { - { hppa*-*-* } { } - { *c4x*-*-* } { } - { *c54x*-*-* } { } +switch -glob $target_triplet { + hppa*-*-* { } + *c4x*-*-* { } + *c54x*-*-* { } default { run_dump_test struct run_dump_test align @@ -281,14 +281,14 @@ case $target_triplet in { } # '<' and '>' appear to have special meanings on the excluded targets -case $target_triplet in { - { frv-*-* } { } - { hppa*-*-* } { } - { m32r-*-* } { } - { mmix-*-* } { } - { *c4x*-*-* } { } - { *c54x*-*-* } { } - { bfin-*-* } { } +switch -glob $target_triplet { + frv-*-* { } + hppa*-*-* { } + m32r-*-* { } + mmix-*-* { } + *c4x*-*-* { } + *c54x*-*-* { } + bfin-*-* { } default { run_dump_test altmacro # The second test is valid only when '!' is not a comment @@ -342,14 +342,14 @@ proc test_cond {} { # not limited to the fact that it depends on specific section # names appearing in the output file. # Again, p2align doesn't work on c54x and related targets. -case $target_triplet in { - { alpha-*-linux*ecoff} { } - { alpha-*-osf*} { } - { hppa*-*-* } { } - { *c4x*-*-* } { } - { *c54x*-*-* } { } - { rl78-*-* } { } - { rx-*-* } { } +switch -glob $target_triplet { + alpha-*-linux*ecoff { } + alpha-*-osf* { } + hppa*-*-* { } + *c4x*-*-* { } + *c54x*-*-* { } + rl78-*-* { } + rx-*-* { } default { test_cond remote_download host "$srcdir/$subdir/incbin.dat" @@ -394,11 +394,11 @@ run_dump_test quad run_dump_test octa # .set works differently on some targets. -case $target_triplet in { - { alpha*-*-* } { } - { mips*-*-* } { } - { *c54x*-*-* } { } - { z80-*-* } { } +switch -glob $target_triplet { + alpha*-*-* { } + mips*-*-* { } + *c54x*-*-* { } + z80-*-* { } default { run_dump_test weakref1 run_dump_test weakref1g @@ -426,17 +426,17 @@ dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/err-*.s $srcdir/$subdir/warn dg-finish # Set $nop_type appropriately to indicate the NOP instruction mnemonic. -case $target_triplet in { - { "bpf-*-*" } { +switch -glob $target_triplet { + bpf-*-* { set nop_type 6 } - { "mmix-*-*" } { + mmix-*-* { set nop_type 5 } - { "or1k*-*-*" } { + or1k*-*-* { set nop_type 2 } - { "ia64-*-*" } { + ia64-*-* { set nop_type 1 } default { diff --git a/gas/testsuite/gas/elf/elf.exp b/gas/testsuite/gas/elf/elf.exp index 746ff7e..5a298fe 100644 --- a/gas/testsuite/gas/elf/elf.exp +++ b/gas/testsuite/gas/elf/elf.exp @@ -112,14 +112,15 @@ if { [is_elf_format] } then { && ![istarget "am3*-*-*"]} then { run_dump_test "ehopt0" } - case $target_triplet in { - { m68k-*-* m68[03]??-*-* } { + switch -glob $target_triplet { + m68k-*-* - + m68[03]??-*-* { run_dump_test "file" { { as "--defsym m68k=1" } } } - { mmix-*-* } { + mmix-*-* { run_dump_test "file" { { as "--defsym mmix=1" } } } - { xtensa*-*-* } { + xtensa*-*-* { run_dump_test "file" { { as "--rename-section file.s=file.c" } } } default { @@ -135,37 +136,37 @@ if { [is_elf_format] } then { run_dump_test "group1b" run_dump_test "group2" run_dump_test "group3" - case $target_triplet in { - { hppa64*-*-hpux* } { } - { riscv*-*-* } { } + switch -glob $target_triplet { + hppa64*-*-hpux* { } + riscv*-*-* { } default { run_dump_test "groupautoa" } } - case $target_triplet in { - { hppa64*-*-hpux* } { } - { riscv*-*-* } { } - { xtensa*-*-* } { } + switch -glob $target_triplet { + hppa64*-*-hpux* { } + riscv*-*-* { } + xtensa*-*-* { } default { run_dump_test "groupautob" } } - case $target_triplet in { - { alpha*-*-* } { } - { am3*-*-* } { } - { *c54x*-*-* } { } - { cr16*-*-* } { } - { crx*-*-* } { } - { h8300-*-* } { } - { hppa*-*-* } { } - { iq2000*-*-* } { } - { mips*-*-* } { } - { mn10200-*-* } { } - { mn10300-*-* } { } - { msp43*-*-* } { } - { rl78-*-* } { } - { riscv*-*-* } { } - { rx-*-* } { } + switch -glob $target_triplet { + alpha*-*-* { } + am3*-*-* { } + *c54x*-*-* { } + cr16*-*-* { } + crx*-*-* { } + h8300-*-* { } + hppa*-*-* { } + iq2000*-*-* { } + mips*-*-* { } + mn10200-*-* { } + mn10300-*-* { } + msp43*-*-* { } + rl78-*-* { } + riscv*-*-* { } + rx-*-* { } default { # The next test can fail if the target does not convert fixups # against ordinary symbols into relocations against section symbols. @@ -183,11 +184,12 @@ if { [is_elf_format] } then { # new sections created without atrributes. if {! [istarget "h8300-*-*"]} then { set as_flags "-al --generate-missing-build-notes=no" - case $target_triplet in { - { i*86-*-* x86_64-*-* } { + switch -glob $target_triplet { + i*86-*-* - + x86_64-*-* { set as_flags "$as_flags -mx86-used-note=no" } - { riscv*-*-* } { + riscv*-*-* { set as_flags "$as_flags -march-attr" } } diff --git a/gas/testsuite/gas/macros/macros.exp b/gas/testsuite/gas/macros/macros.exp index a5df0d3..7beaf48 100644 --- a/gas/testsuite/gas/macros/macros.exp +++ b/gas/testsuite/gas/macros/macros.exp @@ -42,10 +42,10 @@ gas_test_error "err.s" "" "macro infinite recursion" setup_xfail "tic4x*-*" gas_test "and.s" "" "" "logical and in macro definition" -case $target_triplet in { - { hppa*-*-* } { if [istarget *-*-linux*] { run_dump_test semi } } - { *c4x*-*-* } { } - { *c54x*-*-* } { } +switch -glob $target_triplet { + hppa*-*-* { if [istarget *-*-linux*] { run_dump_test semi } } + *c4x*-*-* { } + *c54x*-*-* { } default { run_dump_test semi } @@ -74,14 +74,14 @@ run_dump_test app4 run_list_test badarg "" -case $target_triplet in { - { *c54x*-*-* } { } - { *c4x*-*-* } { } - { mmix-* } { } - { ns32k-*-* } { } - { rl78-*-* } { } - { rx-*-* } { } - { vax-*-* } { } +switch -glob $target_triplet { + *c54x*-*-* { } + *c4x*-*-* { } + mmix-* { } + ns32k-*-* { } + rl78-*-* { } + rx-*-* { } + vax-*-* { } default { run_list_test dot "-alm" } } run_list_test end "" diff --git a/gas/testsuite/lib/gas-defs.exp b/gas/testsuite/lib/gas-defs.exp index c17262c..6649eaa 100644 --- a/gas/testsuite/lib/gas-defs.exp +++ b/gas/testsuite/lib/gas-defs.exp @@ -267,7 +267,7 @@ proc gas_init { args } { global target_os global stdoptlist - case "$target_cpu" in { + switch -glob "$target_cpu" { "m68???" { set target_cpu_family m68k } "i[3-7]86" { set target_cpu_family i386 } default { set target_cpu_family $target_cpu } |