2 # Some generic MIPS tests
5 proc run_list_test { name opts } {
7 set testname "MIPS $name"
8 set file $srcdir/$subdir/$name
9 gas_run ${name}.s $opts ">&dump.out"
10 if { [regexp_diff "dump.out" "${file}.l"] } then {
12 verbose "output is [file_contents "dump.out"]" 2
18 if { [istarget mips*-*-*] } then {
20 set svr4pic [expr [istarget *-*-elf*] || [istarget *-*-irix5*] || [istarget *-*-irix6* ] || [istarget *-*-linux*] ]
21 set empic [expr [istarget *-*-ecoff*] || [istarget *-*-ultrix*] || [istarget *-*-irix\[1-4\]*] ]
22 set aout [expr [istarget *-*-bsd*] || [istarget *-*-netbsd*] || [istarget *-*-openbsd*] ]
23 set ilocks [istarget mipstx39*-*-*]
24 set gpr_ilocks [expr [istarget mipstx39*-*-*]]
25 set addr32 [expr [istarget mipstx39*-*-*]]
27 if { [istarget mips*el-*-*] || [istarget "mips*-*-*linux*"] } then {
32 if [istarget mips*el-*-*] {
41 run_dump_test "break20"
42 run_dump_test "trap20"
48 if !$ilocks { run_dump_test "div" } else { run_dump_test "div-ilocks" }
51 run_dump_test "elf-jal"
55 if $svr4pic { run_dump_test "jal-svr4pic" }
56 if $svr4pic { run_dump_test "jal-xgot" }
57 if $empic { run_dump_test "jal-empic" }
58 if !$aout { run_dump_test "la" }
59 if $svr4pic { run_dump_test "la-svr4pic" }
60 if $svr4pic { run_dump_test "la-xgot" }
61 if $empic { run_dump_test "la-empic" }
62 if !$aout { run_dump_test "lb" }
63 if $svr4pic { run_dump_test "lb-svr4pic" }
65 # Both versions specify the cpu, so we can run both regardless of
66 # the interlocking in the configured default cpu.
67 run_dump_test "lb-xgot"
68 run_dump_test "lb-xgot-ilocks"
70 if $empic { run_dump_test "lb-empic" }
76 run_dump_test "ld-ilocks"
78 run_dump_test "ld-ilocks-addr32"
82 if $svr4pic { run_dump_test "ld-svr4pic" }
83 if $svr4pic { run_dump_test "ld-xgot" }
84 if $empic { run_dump_test "ld-empic" }
86 if !$aout { run_dump_test "lifloat" }
87 if $svr4pic { run_dump_test "lif-svr4pic" }
88 if $svr4pic { run_dump_test "lif-xgot" }
89 if $empic { run_dump_test "lif-empic" }
91 if !$ilocks { run_dump_test "mul" } else { run_dump_test "mul-ilocks" }
93 if !$aout { run_dump_test "sb" }
95 if !$aout { run_dump_test "ulh" }
96 if $svr4pic { run_dump_test "ulh-svr4pic" }
97 if $svr4pic { run_dump_test "ulh-xgot" }
98 if $empic { run_dump_test "ulh-empic" }
106 # The mips16 test can only be run on ELF, because only ELF
107 # supports the necessary mips16 reloc.
108 if { $svr4pic && !$no_mips16 } { run_dump_test "mips16" }
109 run_dump_test "delay"
110 run_dump_test "nodelay"
111 run_dump_test "mips4010"
112 run_dump_test "mips4650"
113 run_dump_test "mips4100"
114 # Linux uses ELF stabs, which doesn't support line number.
115 setup_xfail "mips*-*-*linux*"
116 run_dump_test "lineno"
118 run_dump_test "mips32"
119 run_dump_test "mips64"
121 # It will always fail until someone fixes it.
122 setup_xfail "mips*-*-*"
123 run_dump_test "relax"
125 run_list_test "illegal" ""
127 run_dump_test "mips-gp32-fp32"
128 run_dump_test "mips-gp32-fp64"
129 run_dump_test "mips-gp64-fp32"
130 run_dump_test "mips-gp64-fp64"
131 run_dump_test "mips-abi32"
134 # Make sure that -mcpu=FOO and -mFOO are equivalent. Assemble a file
135 # containing 4650-specific instructions with -m4650 and -mcpu=4650,
136 # and verify that they're the same. Specifically, we're checking
137 # that the EF_MIPS_MACH field is set, and that the 4650 'mul'
138 # instruction does get used. In previous versions of GAS,
139 # only -mcpu=4650 would set the EF_MIPS_MACH field; -m4650 wouldn't.
140 run_dump_test "elf_e_flags1"
141 run_dump_test "elf_e_flags2"
142 run_dump_test "elf_e_flags3"
143 run_dump_test "elf_e_flags4"
145 run_dump_test "mips-gp32-fp32-pic"
146 run_dump_test "mips-gp32-fp64-pic"
147 run_dump_test "mips-gp64-fp32-pic"
148 run_dump_test "mips-gp64-fp64-pic"
149 run_dump_test "mips-abi32-pic"
151 run_dump_test "elf${el}-rel"
152 if [istarget mips64*-*-*] {
153 run_dump_test "elf${el}-rel2"
154 run_dump_test "elf-rel4"
156 run_dump_test "e32${el}-rel2"
157 run_dump_test "e32-rel4"
159 run_dump_test "elf${el}-rel3"
160 run_dump_test "${tmips}${el}empic"
162 run_dump_test "${tmips}mips${el}16-e"
163 run_dump_test "mips${el}16-f"