[ binutils/ChangeLog ]
[deliverable/binutils-gdb.git] / gas / testsuite / gas / mips / mips.exp
CommitLineData
252b5132
RH
1#
2# Some generic MIPS tests
3#
d9e138e2 4
51124b6c
CD
5# "LOSE" marks information about tests which fail at a particular point
6# in time, but which are not XFAILed. Either they used to pass
7# and indicate either regressions or the need to tweak the tests to keep
8# up the with code, or they are new tests and it is unknown whether or not
9# they should pass as-is for the given object formats.
10
d9e138e2
L
11proc run_list_test { name opts } {
12 global srcdir subdir
13 set testname "MIPS $name"
14 set file $srcdir/$subdir/$name
15 gas_run ${name}.s $opts ">&dump.out"
16 if { [regexp_diff "dump.out" "${file}.l"] } then {
17 fail $testname
18 verbose "output is [file_contents "dump.out"]" 2
19 return
20 }
21 pass $testname
22}
23
0285c67d 24if { [istarget mips*-*-*] } then {
252b5132 25 set no_mips16 0
ae948b86
TS
26 set elf [expr [istarget *-*-elf*] || [istarget *-*-irix5*] || [istarget *-*-irix6* ] || [istarget *-*-linux*] || [istarget *-*-netbsd*] ]
27 set ecoff [expr [istarget *-*-ecoff*] || [istarget *-*-ultrix*] || [istarget *-*-irix\[1-4\]*] ]
9fb9af6e 28 set aout [expr [istarget *-*-bsd*] || [istarget *-*-openbsd*] ]
252b5132
RH
29 set ilocks [istarget mipstx39*-*-*]
30 set gpr_ilocks [expr [istarget mipstx39*-*-*]]
31 set addr32 [expr [istarget mipstx39*-*-*]]
32
dda688fc 33 if { [istarget "mips*-*-*linux*"] } then {
ff8715d0
L
34 set tmips "t"
35 } else {
36 set tmips ""
37 }
0c4ec151
RS
38 if [istarget mips*el-*-*] {
39 set el el
40 } {
41 set el ""
42 }
252b5132
RH
43
44 run_dump_test "abs"
45 run_dump_test "add"
46 run_dump_test "and"
47 run_dump_test "break20"
48 run_dump_test "trap20"
51124b6c
CD
49
50 # LOSE: As of 2002-02-08, "beq" through "bltu" fail for target mips-ecoff.
51 # See http://sources.redhat.com/ml/binutils/2001-10/msg00418.html for
52 # more information. Not sure if the fixes there are correct; should
53 # branches to external labels be allowed for ECOFF?
252b5132
RH
54 run_dump_test "beq"
55 run_dump_test "bge"
56 run_dump_test "bgeu"
57 run_dump_test "blt"
58 run_dump_test "bltu"
2dc83527 59 run_dump_test "branch-misc-1"
6f171daa 60 run_list_test "branch-misc-2" ""
51124b6c 61
f22ba854
NC
62 if $ilocks {
63 run_dump_test "div-ilocks"
64 } else {
65 run_dump_test "div"
66 }
252b5132 67 run_dump_test "dli"
ae948b86 68 if $elf {
7388e440
L
69 run_dump_test "elf-jal"
70 } else {
71 run_dump_test "jal"
72 }
ae948b86
TS
73 if $elf { run_dump_test "jal-svr4pic" }
74 if $elf { run_dump_test "jal-xgot" }
51124b6c
CD
75 # LOSE: As of 2002-02-08, the jal-empic test fails for target mips-ecoff.
76 # It appears that it broke between 2000-03-11 00:00UTC and
77 # 2000-03-12 00:00 UTC.
ae948b86 78 if $ecoff { run_dump_test "jal-empic" }
d65d31a6
CD
79 if $elf { run_dump_test "jal-empic-elf" }
80 if $elf { run_dump_test "jal-empic-elf-2" }
81 if $elf { run_dump_test "jal-empic-elf-3" }
f697dfed 82 run_list_test "jal-range" ""
252b5132 83 if !$aout { run_dump_test "la" }
ae948b86
TS
84 if $elf { run_dump_test "la-svr4pic" }
85 if $elf { run_dump_test "la-xgot" }
51124b6c
CD
86 # LOSE: As of 2002-02-08, the la-empic test fails for target mips-ecoff.
87 # Not sure when it first cropped up, but may be related to addition of
88 # "la" -> "addiu" pattern in MIPS opcode table long ago.
ae948b86 89 if $ecoff { run_dump_test "la-empic" }
252b5132 90 if !$aout { run_dump_test "lb" }
ae948b86
TS
91 if $elf { run_dump_test "lb-svr4pic" }
92 if $elf {
252b5132
RH
93 # Both versions specify the cpu, so we can run both regardless of
94 # the interlocking in the configured default cpu.
95 run_dump_test "lb-xgot"
96 run_dump_test "lb-xgot-ilocks"
97 }
ae948b86 98 if $ecoff { run_dump_test "lb-empic" }
f22ba854
NC
99 if !$aout {
100 if !$gpr_ilocks {
101 run_dump_test "ld"
252b5132
RH
102 } else {
103 if !$addr32 {
104 run_dump_test "ld-ilocks"
105 } else {
106 run_dump_test "ld-ilocks-addr32"
107 }
108 }
109 }
ae948b86
TS
110 if $elf { run_dump_test "ld-svr4pic" }
111 if $elf { run_dump_test "ld-xgot" }
112 if $ecoff { run_dump_test "ld-empic" }
252b5132
RH
113 run_dump_test "li"
114 if !$aout { run_dump_test "lifloat" }
ae948b86
TS
115 if $elf { run_dump_test "lif-svr4pic" }
116 if $elf { run_dump_test "lif-xgot" }
51124b6c
CD
117 # LOSE: As of 2002-02-08, the lif-empic test fails for target mips-ecoff.
118 # It appears that it broke between 2000-03-11 00:00UTC and
119 # 2000-03-12 00:00 UTC.
ae948b86 120 if $ecoff { run_dump_test "lif-empic" }
252b5132 121 run_dump_test "mips4"
f22ba854
NC
122 if $ilocks {
123 run_dump_test "mul-ilocks"
124 } else {
125 run_dump_test "mul"
126 }
252b5132 127 run_dump_test "rol"
82dd0097 128 run_dump_test "rol-hw"
771c7ce4 129 run_dump_test "rol64"
82dd0097 130 run_dump_test "rol64-hw"
252b5132
RH
131 if !$aout { run_dump_test "sb" }
132 run_dump_test "trunc"
133 if !$aout { run_dump_test "ulh" }
ae948b86
TS
134 if $elf { run_dump_test "ulh-svr4pic" }
135 if $elf { run_dump_test "ulh-xgot" }
136 if $ecoff { run_dump_test "ulh-empic" }
252b5132
RH
137 if !$aout {
138 run_dump_test "ulw"
139 run_dump_test "uld"
140 run_dump_test "ush"
141 run_dump_test "usw"
142 run_dump_test "usd"
143 }
144 # The mips16 test can only be run on ELF, because only ELF
145 # supports the necessary mips16 reloc.
3396de36
TS
146 if { $elf && !$no_mips16 } {
147 run_dump_test "mips16"
148 # Check jalx handling
149 run_dump_test "mips16-jalx"
150 run_dump_test "mips-jalx"
151 }
152 run_list_test "mips-no-jalx" ""
252b5132
RH
153 run_dump_test "delay"
154 run_dump_test "nodelay"
155 run_dump_test "mips4010"
156 run_dump_test "mips4650"
157 run_dump_test "mips4100"
60b63b72
RS
158 run_dump_test "vr4111"
159 run_dump_test "vr4120"
160 run_dump_test "vr4122"
161 run_dump_test "vr5400"
162 run_dump_test "vr5500"
99c14723 163 run_dump_test "perfcount"
252b5132
RH
164 run_dump_test "lineno"
165 run_dump_test "sync"
e7af610e 166 run_dump_test "mips32"
0808b8a9 167 run_dump_test "mips64"
1f25f5d3 168 run_dump_test "mips64-mips3d"
deec1734 169 run_dump_test "mips64-mdmx"
107c6e1a 170 run_dump_test "sb1-ext-mdmx"
2228315b 171 run_dump_test "sb1-ext-ps"
252b5132 172
594e740f
L
173 run_dump_test "relax"
174
d9e138e2 175 run_list_test "illegal" ""
e8dcafb0 176 run_list_test "baddata1" ""
d9e138e2 177
51124b6c
CD
178 # LOSE: As of 2002-02-08, the next 4 tests fail for target mips-ecoff.
179 # It's unknown whether they _should_ pass as-is, or whether different
180 # variants are needed for ELF and ECOFF.
dc462216
RS
181 run_dump_test "mips-gp32-fp32"
182 run_dump_test "mips-gp32-fp64"
183 run_dump_test "mips-gp64-fp32"
184 run_dump_test "mips-gp64-fp64"
dc462216 185
ae948b86 186 if $elf {
2cd5676f
CD
187 # Make sure that -mcpu=FOO and -mFOO are equivalent. Assemble a file
188 # containing 4650-specific instructions with -m4650 and -mcpu=4650,
189 # and verify that they're the same. Specifically, we're checking
190 # that the EF_MIPS_MACH field is set, and that the 4650 'mul'
f22ba854 191 # instruction does get used. In previous versions of GAS,
2cd5676f
CD
192 # only -mcpu=4650 would set the EF_MIPS_MACH field; -m4650 wouldn't.
193 run_dump_test "elf_e_flags1"
194 run_dump_test "elf_e_flags2"
195 run_dump_test "elf_e_flags3"
196 run_dump_test "elf_e_flags4"
f22ba854 197
70a31400
CD
198 # Verify that ASE markings are handled properly.
199 if { !$no_mips16 } { run_dump_test "elf_ase_mips16" }
200
dc462216
RS
201 run_dump_test "mips-gp32-fp32-pic"
202 run_dump_test "mips-gp32-fp64-pic"
203 run_dump_test "mips-gp64-fp32-pic"
204 run_dump_test "mips-gp64-fp64-pic"
ae948b86
TS
205
206 run_dump_test "mips-abi32"
207 run_dump_test "mips-abi32-pic"
885add95 208 run_dump_test "mips-abi32-pic2"
ff8715d0 209
0c4ec151 210 run_dump_test "elf${el}-rel"
b4dc22a8
CD
211 if {[istarget mips64*-*-*] || [istarget mipsisa32*-*-*]
212 || [istarget mipsisa64*-*-*]} {
15ba8cc1 213 run_dump_test "elf${el}-rel2"
7ad8fb54 214 } else {
15ba8cc1 215 run_dump_test "e32${el}-rel2"
a90335ee 216 }
0c4ec151 217 run_dump_test "elf${el}-rel3"
7ad8fb54
CD
218 if {[istarget mips64*-*-*]} {
219 run_dump_test "elf-rel4"
220 } else {
221 run_dump_test "e32-rel4"
222 }
5f266a81 223 run_dump_test "elf-rel5"
98605598 224 run_dump_test "elf-rel6"
631cb423 225 run_dump_test "elf-rel7"
0c4ec151 226 run_dump_test "${tmips}${el}empic"
afdbd6d0 227 run_dump_test "empic2"
a657e7c1
CD
228 run_dump_test "empic3_e"
229 run_dump_test "empic3_g1"
230 run_dump_test "empic3_g2"
f22ba854
NC
231 if { !$no_mips16 } {
232 run_dump_test "${tmips}mips${el}16-e"
233 run_dump_test "${tmips}mips${el}16-f"
bb2d6cd7 234 }
fdb987ee 235 run_dump_test "elf-consthilo"
07147777 236 }
640c0ccd
CD
237
238 # tests of objdump's ability to disassemble using different
239 # register names.
240 run_dump_test "gpr-names-numeric"
241 run_dump_test "gpr-names-32"
242 run_dump_test "gpr-names-n32"
243 run_dump_test "gpr-names-64"
244
245 run_dump_test "fpr-names-numeric"
246 run_dump_test "fpr-names-32"
247 run_dump_test "fpr-names-n32"
248 run_dump_test "fpr-names-64"
249
250 run_dump_test "cp0-names-numeric"
251 run_dump_test "cp0-names-mips32"
252 run_dump_test "cp0-names-mips64"
253 run_dump_test "cp0-names-sb1"
252b5132 254}
This page took 0.18984 seconds and 4 git commands to generate.