diff options
author | YunQiang Su <yunqiang.su@cipunited.com> | 2023-05-10 15:50:19 +0800 |
---|---|---|
committer | YunQiang Su <yunqiang.su@cipunited.com> | 2023-06-05 11:00:14 +0800 |
commit | ffc528aed56b9e2c171137da28690a9bb6861b0b (patch) | |
tree | 8e6247b2959f909c50551bbd3ec0777ebe32781b /binutils/testsuite | |
parent | be0d391f22fe6009c3be907753975a984cbbcc23 (diff) | |
download | gdb-ffc528aed56b9e2c171137da28690a9bb6861b0b.zip gdb-ffc528aed56b9e2c171137da28690a9bb6861b0b.tar.gz gdb-ffc528aed56b9e2c171137da28690a9bb6861b0b.tar.bz2 |
MIPS: fix r6 testsuites
Introduce
run_dump_test_o32l
run_dump_test_n32l
run_dump_test_n64l
Which use `-march=from-abi` for pre-R6 testcases,
like micromips/mips16e etc.
For cases doesn't use run_dump_test_*, we use
-mips32r2 for micromips32
-mips1 for mips16-32
-march=from-abi for testcases to o32/n32/n64 both/all.
Replace `addi` with `addiu` for some cases for both r6 and pre-R6.
Introduce some new testcases for r6 with FPXX/FP64.
Introduce new testcase: comdat-reloc-r6.
Skip `default` in mips_arch_list_matching if triple is mipsisa*, due to:
1)it will cannot match mipsr6@*.d: since mips32rN/mips64rN
will always be used, it won't be a problem.
2)some test think -march=mips64rN will alway true for mipsisa64rN,
which is not true now.
This patch fix testsuite for all r6-default gnu triples:
mipsisa32r6-linux-gnu
mipsisa32r6el-linux-gnu
mips-img-linux-gnu
mipsel-img-linux-gnu
mipsisa64r6-linux-gnu
mipsisa64r6el-linux-gnu
Diffstat (limited to 'binutils/testsuite')
-rw-r--r-- | binutils/testsuite/binutils-all/mips/mips.exp | 75 |
1 files changed, 59 insertions, 16 deletions
diff --git a/binutils/testsuite/binutils-all/mips/mips.exp b/binutils/testsuite/binutils-all/mips/mips.exp index 91bf327..3b7bc29 100644 --- a/binutils/testsuite/binutils-all/mips/mips.exp +++ b/binutils/testsuite/binutils-all/mips/mips.exp @@ -52,7 +52,8 @@ proc run_dump_test_abi { abi name args } { set ldflags $abi_ldflags($abi) set args [lreplace $args 0 0] } - if !$has_abi($abi) { + set abi_r [regsub "l$" $abi {}] + if !$has_abi($abi_r) { lappend args {notarget *-*-*} } @@ -74,6 +75,13 @@ proc run_dump_test_abi { abi name args } { proc run_dump_test_o32 { name args } { run_dump_test_abi o32 $name [lindex $args 0] } +proc run_dump_test_o32l { name args } { + if {[istarget *-linux*] || [istarget *-img-elf]} { + run_dump_test_abi o32l $name [lindex $args 0] + } else { + run_dump_test_abi o32 $name [lindex $args 0] + } +} # run_dump_test_n32 NAME ARGS # @@ -82,6 +90,13 @@ proc run_dump_test_o32 { name args } { proc run_dump_test_n32 { name args } { run_dump_test_abi n32 $name [lindex $args 0] } +proc run_dump_test_n32l { name args } { + if {[istarget *-linux*] || [istarget *-img-elf]} { + run_dump_test_abi n32l $name [lindex $args 0] + } else { + run_dump_test_abi n32 $name [lindex $args 0] + } +} # run_dump_test_n64 NAME ARGS # @@ -90,6 +105,13 @@ proc run_dump_test_n32 { name args } { proc run_dump_test_n64 { name args } { run_dump_test_abi n64 $name [lindex $args 0] } +proc run_dump_test_n64l { name args } { + if {[istarget *-linux*] || [istarget *-img-elf]} { + run_dump_test_abi n64l $name [lindex $args 0] + } else { + run_dump_test_abi n64 $name [lindex $args 0] + } +} set has_abi(o32) [expr ![istarget *-*-openbsd*] \ && ![istarget mips64*el-ps2-elf*]] @@ -109,49 +131,68 @@ set has_abi(n64) [expr [istarget *-*-freebsd*] \ || [istarget *-*-openbsd*]] # Set defaults. +# ABI with l tail means legacy, aka pre-R6. +# Please use them, if the test only suite for pre-R6, +# such as mips16/micromips tests. set abi_asflags(o32) "" +set abi_asflags(o32l) "" set abi_asflags(n32) "" +set abi_asflags(n32l) "" set abi_asflags(n64) "" +set abi_asflags(n64l) "" set abi_asflags(eabi) "" set abi_ldflags(o32) "" +set abi_ldflags(o32l) "" set abi_ldflags(n32) "" +set abi_ldflags(n32l) "" set abi_ldflags(n64) "" +set abi_ldflags(n64l) "" set abi_ldflags(eabi) "" # Override as needed. if {[istarget *-*-openbsd*] } { set irixemul 0 -} elseif { [istarget mips64*-*-linux*] } { +} elseif { [istarget mips*64*-*-linux*] } { + set abi_asflags(o32) -32 + set abi_asflags(o32l) "-32 -march=from-abi" + set abi_asflags(n32) "" + set abi_asflags(n32l) "-n32 -march=from-abi" + set abi_asflags(n64) "-64" + set abi_asflags(n64l) "-march=from-abi -64" if [istarget *el-*-*] { - set abi_asflags(o32) -32 set abi_ldflags(o32) -melf32ltsmip - set abi_asflags(n64) "-march=from-abi -64" + set abi_ldflags(o32l) -melf32ltsmip set abi_ldflags(n64) -melf64ltsmip + set abi_ldflags(n64l) -melf64ltsmip } else { - set abi_asflags(o32) -32 set abi_ldflags(o32) -melf32btsmip - set abi_asflags(n64) "-march=from-abi -64" + set abi_ldflags(o32l) -melf32btsmip set abi_ldflags(n64) -melf64btsmip + set abi_ldflags(n64l) -melf64btsmip } set irixemul 0 -} elseif {[istarget *-*-linux*] } { +} elseif {[istarget *-*-linux*] || [istarget *-img-elf] } { + set abi_asflags(o32) "" + set abi_asflags(o32l) "-march=from-abi" + set abi_asflags(n32) "-n32" + set abi_asflags(n32l) "-n32 -march=from-abi" + set abi_asflags(n64) "-64" + set abi_asflags(n64l) "-64 -march=from-abi" if [istarget *el-*-*] { - set abi_asflags(n32) "-march=from-abi -n32" set abi_ldflags(n32) -melf32ltsmipn32 - set abi_asflags(n64) "-march=from-abi -64" + set abi_ldflags(n32l) -melf32ltsmipn32 set abi_ldflags(n64) -melf64ltsmip + set abi_ldflags(n64l) -melf64ltsmip } else { - set abi_asflags(n32) "-march=from-abi -n32" set abi_ldflags(n32) -melf32btsmipn32 - set abi_asflags(n64) "-march=from-abi -64" + set abi_ldflags(n32l) -melf32btsmipn32 set abi_ldflags(n64) -melf64btsmip + set abi_ldflags(n64l) -melf64btsmip } set irixemul 0 -} elseif {[istarget *-img-elf*] \ - || [istarget *-mti-elf*] \ +} elseif {[istarget *-mti-elf*] \ || [istarget *-sde-elf*] \ || [istarget *-*-netbsd*] \ - || [istarget *-*-linux*] \ || [istarget *-*-sysv4*] } { if [istarget *el-*-*] { set abi_asflags(o32) -32 @@ -229,11 +270,13 @@ run_dump_test "mips-xpa-virt-3" run_dump_test "mips-xpa-virt-4" run_dump_test_o32 "mixed-mips16" noarch run_dump_test_o32 "mixed-micromips" noarch -run_dump_test "mixed-mips16-micromips" +run_dump_test_o32l "mixed-mips16-micromips" +run_dump_test_n32l "mixed-mips16-micromips" +run_dump_test_n64l "mixed-mips16-micromips" run_dump_test_o32 "mips16-undecoded" noarch run_dump_test_o32 "mips16e2-undecoded" noarch run_dump_test_o32 "mips16-pcrel" -run_dump_test_o32 "mips16-extend-noinsn" +run_dump_test_o32l "mips16-extend-noinsn" run_dump_test_o32 "mips16-extend-insn" noarch run_dump_test_o32 "mips16e2-extend-insn" noarch run_dump_test_o32 "mips16-alias" noarch |