#
# Some generic MIPS tests
#
if [istarget mips*-*-*] then {
    set svr4pic [expr [istarget *-*-elf*] || [istarget *-*-irix5*] ]
    set empic [expr [istarget *-*-ecoff*] || [istarget *-*-ultrix*] || [istarget *-*-irix\[1-4\]*] ]
    set aout [expr [istarget *-*-bsd*] || [istarget *-*-netbsd*] || {istarget *-*-openbsd*]]
    set ilocks [expr [istarget mips64vr4300*-*-*] || [istarget mips64vr4100*-*-*]]

    run_dump_test "abs"
    run_dump_test "add"
    run_dump_test "and"
    run_dump_test "beq"
    run_dump_test "bge"
    run_dump_test "bgeu"
    run_dump_test "blt"
    run_dump_test "bltu"
    if !$ilocks { run_dump_test "div" } else { run_dump_test "div-ilocks" }
    run_dump_test "dli"
    run_dump_test "jal"
    if $svr4pic { run_dump_test "jal-svr4pic" }
    if $svr4pic { run_dump_test "jal-xgot" }
    if $empic { run_dump_test "jal-empic" }
    if !$aout { run_dump_test "la" }
    if $svr4pic { run_dump_test "la-svr4pic" }
    if $svr4pic { run_dump_test "la-xgot" }
    if $empic { run_dump_test "la-empic" }
    if !$aout { run_dump_test "lb" }
    if $svr4pic { run_dump_test "lb-svr4pic" }
    if $svr4pic { run_dump_test "lb-xgot" }
    if $empic { run_dump_test "lb-empic" }
    if !$aout { run_dump_test "ld" }
    if $svr4pic { run_dump_test "ld-svr4pic" }
    if $svr4pic { run_dump_test "ld-xgot" }
    if $empic { run_dump_test "ld-empic" }
    run_dump_test "li"
    if !$aout { run_dump_test "lifloat" }
    if $svr4pic { run_dump_test "lif-svr4pic" }
    if $svr4pic { run_dump_test "lif-xgot" }
    if $empic { run_dump_test "lif-empic" }
    run_dump_test "mips4"
    if !$ilocks { run_dump_test "mul" } else { run_dump_test "mul-ilocks" }
    run_dump_test "rol"
    if !$aout { run_dump_test "sb" }
    run_dump_test "trunc"
    if !$aout { run_dump_test "ulh" }
    if $svr4pic { run_dump_test "ulh-svr4pic" }
    if $svr4pic { run_dump_test "ulh-xgot" }
    if $empic { run_dump_test "ulh-empic" }
    if !$aout {
	run_dump_test "ulw"
	run_dump_test "uld"
	run_dump_test "ush"
	run_dump_test "usw"
	run_dump_test "usd"
    }
    # The mips16 test can only be run on ELF, because only ELF
    # supports the necessary mips16 reloc.
    if $svr4pic { run_dump_test "mips16" }
    run_dump_test "delay"
    run_dump_test "nodelay"
}
