Commit | Line | Data |
---|---|---|
252b5132 RH |
1 | # |
2 | # Some generic MIPS tests | |
3 | # | |
d9e138e2 | 4 | |
5915a74a CD |
5 | # When adding a new test to this file, try to do the following things: |
6 | # | |
7 | # * If testing assembly and disassembly of code, don't forget to test | |
8 | # the actual bit encodings of the instructions (using the | |
9 | # --show-raw-insn flag to objdump). | |
10 | # | |
11 | # * Try to run the test for as many architectures as appropriate, | |
12 | # using the "run_dump_test_arches" or "run_list_test_arches" functions, | |
13 | # along with the output from a call to "mips_arch_list_matching." | |
14 | # | |
15 | # * Be sure to compare the test output before and after your testsuite | |
16 | # changes, to verify that existing and new tests were run as expected. | |
17 | # Look for expect ERROR messages in the testsuite .log file to make sure | |
18 | # the new expect code did not contain errors. | |
19 | ||
20 | # To add support for a new CPU to this file, add an appropriate entry | |
21 | # to the sequence of "mips_arch_create" function calls below, and test | |
22 | # the result. The new CPU should automatically be used when running | |
23 | # various tests. If the new CPU is the default CPU for any tool | |
24 | # targets, make sure the call to "mips_arch_create" reflects that fact. | |
25 | ||
26 | ||
51124b6c CD |
27 | # "LOSE" marks information about tests which fail at a particular point |
28 | # in time, but which are not XFAILed. Either they used to pass | |
29 | # and indicate either regressions or the need to tweak the tests to keep | |
30 | # up the with code, or they are new tests and it is unknown whether or not | |
31 | # they should pass as-is for the given object formats. | |
32 | ||
5915a74a CD |
33 | |
34 | # The functions below create and manipulate an "architecture data | |
35 | # array" which contains entries for each MIPS architecture (or CPU) | |
36 | # known to these tests. The array contains the following information | |
37 | # for each architecture, indexed by the name of the architecture | |
38 | # described by the entry: | |
39 | # | |
40 | # displayname: The name of the entry to be used for pretty-printing. | |
41 | # | |
42 | # gprsize: The size in bits of General Purpose Registers provided by | |
43 | # the architecture (must be 32 or 64). | |
44 | # | |
45 | # props: A list of text strings which are associated with the | |
46 | # architecture. These include the architecture name as well as | |
47 | # information about what instructions the CPU supports. When matching | |
48 | # based on properties, an additional property is added to the normal | |
49 | # property list, "gpr<gprsize>" so that tests can match CPUs which | |
50 | # have GPRs of a specific size. The following properties are most | |
51 | # useful when matching properties for generic (i.e., not CPU-specific) | |
52 | # tests: | |
53 | # | |
54 | # mips1, mips2, mips3, mips4, mips5, mips32, mips64 | |
55 | # The architecture includes the instructions defined | |
56 | # by that MIPS ISA. | |
57 | # | |
58 | # mips3d The architecture includes the MIPS-3D ASE. | |
59 | # | |
60 | # ror The architecture includes hardware rotate instructions. | |
61 | # | |
62 | # gpr32, gpr64 | |
63 | # The architecture provides 32- or 64-bit General Purpose | |
64 | # Registers. | |
65 | # | |
66 | # as_flags: The assembler flags used when assembling tests for this | |
67 | # architecture. | |
68 | # | |
69 | # objdump_flags: The objdump flags used when disassembling tests for | |
70 | # this architecture. | |
71 | # | |
72 | # Most entries in the architecture array will have values in all of | |
73 | # the fields above. One entry, "default" represents the default CPU | |
74 | # based on the target of the assembler being built. If always has | |
75 | # empty "as_flags" and "objdump_flags." | |
76 | ||
77 | # mips_arch_create ARCH GPRSIZE EXTENDS PROPS AS_FLAGS OBJDUMP_FLAGS \ | |
78 | # (optional:) DEFAULT_FOR_TARGETS | |
79 | # | |
80 | # This function creates a new entry in the architecture data array, | |
81 | # for the architecture or CPU named ARCH, and fills in the entry | |
82 | # according to the rest of the arguments. | |
83 | # | |
84 | # The new entry's property list is initialized to contain ARCH, any | |
85 | # properties specified by PROPS, and the properties associated with | |
86 | # the entry specified by EXTENDS. (The new architecture is considered | |
87 | # to extend the capabilities provided by that architecture.) | |
88 | # | |
89 | # If DEFAULT_FOR_TARGETS is specified, it is a list of targets for which | |
90 | # this architecture is the default architecture. If "istarget" returns | |
91 | # true for any of the targets in the list, a "default" entry will be | |
92 | # added to the architecture array which indicates that ARCH is the default | |
93 | # architecture. | |
94 | proc mips_arch_create {arch gprsize extends props as_flags objdump_flags | |
95 | {default_for_targets {}}} { | |
96 | global mips_arches | |
97 | ||
98 | if { [info exists mips_arches($arch)] } { | |
99 | error "mips_arch_create: arch \"$arch\" already exists" | |
100 | } | |
101 | if { $gprsize != 32 && $gprsize != 64 } { | |
102 | error "mips_arch_create: invalid GPR size $gprsize" | |
103 | } | |
104 | ||
105 | set archdata(displayname) $arch | |
106 | set archdata(gprsize) $gprsize | |
107 | set archdata(as_flags) $as_flags | |
108 | set archdata(objdump_flags) $objdump_flags | |
109 | set archdata(props) $arch | |
110 | eval lappend archdata(props) $props | |
111 | if { [string length $extends] != 0 } { | |
112 | eval lappend archdata(props) [mips_arch_properties $extends 0] | |
113 | } | |
114 | ||
115 | set mips_arches($arch) [array get archdata] | |
116 | ||
117 | # Set as default if appropriate. | |
118 | foreach target $default_for_targets { | |
119 | if { [istarget $target] } { | |
120 | if { [info exists mips_arches(default)] } { | |
121 | error "mips_arch_create: default arch already exists" | |
122 | } | |
123 | ||
124 | set archdata(displayname) "default = $arch" | |
125 | set archdata(as_flags) "" | |
126 | set archdata(objdump_flags) "" | |
127 | ||
128 | set mips_arches(default) [array get archdata] | |
129 | break | |
130 | } | |
131 | } | |
132 | } | |
133 | ||
134 | # mips_arch_list_all | |
135 | # | |
136 | # This function returns the list of all names of entries in the | |
137 | # architecture data array (including the default entry, if a default | |
138 | # is known). | |
139 | proc mips_arch_list_all {} { | |
140 | global mips_arches | |
141 | return [lsort -dictionary [array names mips_arches]] | |
142 | } | |
143 | ||
144 | # mips_arch_data ARCH | |
145 | # | |
146 | # This function returns the information associated with ARCH | |
147 | # in the architecture data array, in "array get" form. | |
148 | proc mips_arch_data {arch} { | |
149 | global mips_arches | |
150 | ||
151 | if { ! [info exists mips_arches($arch)] } { | |
152 | error "mips_arch_data: unknown arch \"$arch\"" | |
153 | } | |
154 | return $mips_arches($arch) | |
155 | } | |
156 | ||
157 | # mips_arch_displayname ARCH | |
158 | # | |
159 | # This function returns the printable name associated with ARCH in | |
160 | # the architecture data array. | |
161 | proc mips_arch_displayname {arch} { | |
162 | array set archdata [mips_arch_data $arch] | |
163 | return $archdata(displayname) | |
164 | } | |
165 | ||
166 | # mips_arch_properties ARCH (optional:) INCLUDE_GPRSIZE | |
167 | # | |
168 | # This function returns the property list associated with ARCH in the | |
169 | # architecture data array. If INCLUDE_GPRSIZE is non-zero, an additional | |
170 | # "gpr32" or "gpr64" property will be returned as part of the list based | |
171 | # on the architecture's GPR size. | |
172 | proc mips_arch_properties {arch {include_gprsize 1}} { | |
173 | array set archdata [mips_arch_data $arch] | |
174 | set props $archdata(props) | |
175 | if { $include_gprsize } { | |
176 | lappend props gpr$archdata(gprsize) | |
177 | } | |
178 | return $props | |
179 | } | |
180 | ||
181 | # mips_arch_as_flags ARCH | |
182 | # | |
183 | # This function returns the assembler flags associated with ARCH in | |
184 | # the architecture data array. | |
185 | proc mips_arch_as_flags {arch} { | |
186 | array set archdata [mips_arch_data $arch] | |
187 | return $archdata(as_flags) | |
188 | } | |
189 | ||
190 | # mips_arch_objdump_flags ARCH | |
191 | # | |
192 | # This function returns the objdump disassembly flags associated with | |
193 | # ARCH in the architecture data array. | |
194 | proc mips_arch_objdump_flags {arch} { | |
195 | array set archdata [mips_arch_data $arch] | |
196 | return $archdata(objdump_flags) | |
197 | } | |
198 | ||
199 | # mips_arch_matches ARCH PROPMATCHLIST | |
200 | # | |
201 | # This function returns non-zero if ARCH matches the set of properties | |
202 | # described by PROPMATCHLIST. Each entry in PROPMATCHLIST can either | |
203 | # be the name of a property which must be matched, or "!" followed by | |
204 | # the name of a property which must not be matched. ARCH matches | |
205 | # PROPMATCHLIST if and only if all of the conditions specified by | |
206 | # PROPMATCHLIST are satisfied. | |
207 | proc mips_arch_matches {arch propmatchlist} { | |
208 | foreach pm $propmatchlist { | |
209 | if { [string match {!*} $pm] } { | |
210 | # fail if present. | |
211 | set inverted 1 | |
212 | set p [string range $pm 1 end] | |
213 | } { | |
214 | # fail if not present. | |
215 | set inverted 0 | |
216 | set p $pm | |
217 | } | |
218 | ||
219 | set loc [lsearch -exact [mips_arch_properties $arch] $p] | |
220 | ||
221 | # required-absent and found, or required-present and not found: fail. | |
222 | if { ($inverted && $loc != -1) || (! $inverted && $loc == -1) } { | |
223 | return 0 | |
224 | } | |
225 | } | |
226 | return 1 | |
227 | } | |
228 | ||
229 | # mips_arch_list_matching ARGS | |
230 | # | |
231 | # This function returns a list of all architectures which match | |
232 | # the conditions described by its arguments. Its arguments are | |
233 | # taken as a list and used as the PROPMATCHLIST in a call to | |
234 | # "mips_arch_matches" for each known architecture. | |
235 | proc mips_arch_list_matching {args} { | |
236 | set l "" | |
237 | foreach arch [mips_arch_list_all] { | |
238 | # For now, don't match default arch until we know what its | |
239 | # properties actually are. | |
240 | if { [string compare $arch default] == 0 | |
241 | && [string length [mips_arch_properties default]] == 0} { | |
242 | continue; | |
243 | } | |
244 | if { [mips_arch_matches $arch $args] } { | |
245 | lappend l $arch | |
246 | } | |
247 | } | |
248 | return $l | |
249 | } | |
250 | ||
251 | ||
252 | # The functions below facilitate running various types of tests. | |
253 | ||
254 | # run_dump_test_arch NAME ARCH | |
255 | # | |
256 | # Invoke "run_dump_test" for test NAME, with extra assembler and | |
257 | # disassembler flags to test architecture ARCH. | |
258 | proc run_dump_test_arch { name arch } { | |
259 | global subdir | |
260 | ||
261 | if [catch {run_dump_test $name \ | |
262 | "{name {([mips_arch_displayname $arch])}} | |
263 | {objdump {[mips_arch_objdump_flags $arch]}} | |
264 | {as {[mips_arch_as_flags $arch]}}"} rv] { | |
265 | perror "$rv" | |
266 | untested "$subdir/$name ($arch)" | |
267 | } | |
268 | } | |
269 | ||
270 | # run_dump_test_arches NAME ARCH_LIST | |
271 | # | |
272 | # Invoke "run_dump_test_arch" for test NAME, for each architecture | |
273 | # listed in ARCH_LIST. | |
274 | proc run_dump_test_arches { name arch_list } { | |
275 | foreach arch $arch_list { | |
276 | run_dump_test_arch "$name" "$arch" | |
277 | } | |
278 | } | |
279 | ||
280 | # run_list_test NAME OPTS (optional): TESTNAME | |
281 | # | |
282 | # Assemble the file "NAME.d" and compare the assembler standard error | |
283 | # output against the regular expressions given in the file "NAME.l". | |
284 | # The assembler is passed the flags given in OPTS. If TESTNAME is | |
285 | # provided, it will be used as the name of the test. | |
286 | proc run_list_test { name opts {testname {}} } { | |
d9e138e2 | 287 | global srcdir subdir |
5915a74a CD |
288 | if { [string length $testname] == 0 } then { |
289 | set testname "MIPS $name" | |
290 | } | |
d9e138e2 L |
291 | set file $srcdir/$subdir/$name |
292 | gas_run ${name}.s $opts ">&dump.out" | |
293 | if { [regexp_diff "dump.out" "${file}.l"] } then { | |
294 | fail $testname | |
295 | verbose "output is [file_contents "dump.out"]" 2 | |
296 | return | |
297 | } | |
298 | pass $testname | |
299 | } | |
300 | ||
5915a74a CD |
301 | # run_list_test_arch NAME OPTS ARCH |
302 | # | |
303 | # Invoke "run_list_test" for test NAME with options OPTS, with extra | |
304 | # assembler flags to test architecture ARCH. | |
305 | proc run_list_test_arch { name opts arch } { | |
306 | global subdir | |
307 | ||
308 | set testname "MIPS $name ([mips_arch_displayname $arch])" | |
309 | if [catch {run_list_test "$name" "$opts [mips_arch_as_flags $arch]" \ | |
310 | "$testname"} rv] { | |
311 | perror "$rv" | |
312 | untested "$testname" | |
313 | } | |
314 | } | |
315 | ||
316 | # run_list_test_arches NAME OPTS ARCH_LIST | |
317 | # | |
318 | # Invoke "run_list_test_arch" for test NAME with options OPTS, for each | |
319 | # architecture listed in ARCH_LIST. | |
320 | proc run_list_test_arches { name opts arch_list } { | |
321 | foreach arch $arch_list { | |
322 | run_list_test_arch "$name" "$opts" "$arch" | |
323 | } | |
324 | } | |
325 | ||
326 | ||
327 | # Create the architecture data array by providing data for all | |
328 | # known architectures. | |
329 | # | |
330 | # Note that several targets pick default CPU based on ABI. We | |
331 | # can't easily handle that; do NOT list those targets as defaulting | |
332 | # to any architecture. | |
333 | mips_arch_create mips1 32 {} {} \ | |
334 | { -march=mips1 -mtune=mips1 } { -mmips:3000 } | |
335 | mips_arch_create mips2 32 mips1 {} \ | |
336 | { -march=mips2 -mtune=mips2 } { -mmips:6000 } | |
337 | mips_arch_create mips3 64 mips2 {} \ | |
338 | { -march=mips3 -mtune=mips3 } { -mmips:4000 } | |
339 | mips_arch_create mips4 64 mips3 {} \ | |
340 | { -march=mips4 -mtune=mips4 } { -mmips:8000 } | |
341 | mips_arch_create mips5 64 mips4 {} \ | |
342 | { -march=mips5 -mtune=mips5 } { -mmips:mips5 } | |
343 | mips_arch_create mips32 32 mips2 {} \ | |
344 | { -march=mips32 -mtune=mips32 } { -mmips:isa32 } \ | |
345 | { mipsisa32-*-* mipsisa32el-*-* } | |
346 | mips_arch_create mips64 64 mips5 { mips32 } \ | |
347 | { -march=mips64 -mtune=mips64 } { -mmips:isa64 } \ | |
348 | { mipsisa64-*-* mipsisa64el-*-* } | |
349 | mips_arch_create r3000 32 mips1 {} \ | |
350 | { -march=r3000 -mtune=r3000 } { -mmips:3000 } | |
351 | mips_arch_create r3900 32 mips1 {} \ | |
352 | { -march=r3900 -mtune=r3900 } { -mmips:3900 } \ | |
353 | { mipstx39-*-* mipstx39el-*-* } | |
354 | mips_arch_create r4000 64 mips3 {} \ | |
355 | { -march=r4000 -mtune=r4000 } { -mmips:4000 } | |
356 | mips_arch_create vr5400 64 mips4 { ror } \ | |
357 | { -march=vr5400 -mtune=vr5400 } { -mmips:5400 } | |
358 | mips_arch_create sb1 64 mips64 { mips3d } \ | |
359 | { -march=sb1 -mtune=sb1 } { -mmips:sb1 } \ | |
360 | { mipsisa64sb1-*-* mipsisa64sb1el-*-* } | |
361 | ||
362 | ||
363 | # | |
364 | # And now begin the actual tests! | |
365 | # | |
366 | ||
0285c67d | 367 | if { [istarget mips*-*-*] } then { |
252b5132 | 368 | set no_mips16 0 |
ae948b86 TS |
369 | set elf [expr [istarget *-*-elf*] || [istarget *-*-irix5*] || [istarget *-*-irix6* ] || [istarget *-*-linux*] || [istarget *-*-netbsd*] ] |
370 | set ecoff [expr [istarget *-*-ecoff*] || [istarget *-*-ultrix*] || [istarget *-*-irix\[1-4\]*] ] | |
9fb9af6e | 371 | set aout [expr [istarget *-*-bsd*] || [istarget *-*-openbsd*] ] |
252b5132 RH |
372 | set ilocks [istarget mipstx39*-*-*] |
373 | set gpr_ilocks [expr [istarget mipstx39*-*-*]] | |
374 | set addr32 [expr [istarget mipstx39*-*-*]] | |
375 | ||
dda688fc | 376 | if { [istarget "mips*-*-*linux*"] } then { |
ff8715d0 L |
377 | set tmips "t" |
378 | } else { | |
379 | set tmips "" | |
380 | } | |
0c4ec151 RS |
381 | if [istarget mips*el-*-*] { |
382 | set el el | |
383 | } { | |
384 | set el "" | |
385 | } | |
252b5132 | 386 | |
5915a74a CD |
387 | run_dump_test_arches "abs" [mips_arch_list_matching mips1] |
388 | run_dump_test_arches "add" [mips_arch_list_matching mips1] | |
389 | run_dump_test_arches "and" [mips_arch_list_matching mips1] | |
252b5132 RH |
390 | run_dump_test "break20" |
391 | run_dump_test "trap20" | |
51124b6c CD |
392 | |
393 | # LOSE: As of 2002-02-08, "beq" through "bltu" fail for target mips-ecoff. | |
394 | # See http://sources.redhat.com/ml/binutils/2001-10/msg00418.html for | |
395 | # more information. Not sure if the fixes there are correct; should | |
396 | # branches to external labels be allowed for ECOFF? | |
5915a74a CD |
397 | # XXX FIXME: the following tests require -mips2 disasm for |
398 | # branch-likely instructions. They should be split. | |
399 | run_dump_test_arches "beq" [mips_arch_list_matching mips2] | |
400 | run_dump_test_arches "bge" [mips_arch_list_matching mips2] | |
401 | run_dump_test_arches "bgeu" [mips_arch_list_matching mips2] | |
402 | run_dump_test_arches "blt" [mips_arch_list_matching mips2] | |
403 | run_dump_test_arches "bltu" [mips_arch_list_matching mips2] | |
404 | run_dump_test_arches "branch-misc-1" [mips_arch_list_matching mips1] | |
405 | run_list_test_arches "branch-misc-2" "" [mips_arch_list_matching mips1] | |
51124b6c | 406 | |
f22ba854 NC |
407 | if $ilocks { |
408 | run_dump_test "div-ilocks" | |
409 | } else { | |
410 | run_dump_test "div" | |
411 | } | |
5915a74a | 412 | run_dump_test_arches "dli" [mips_arch_list_matching mips3] |
ae948b86 | 413 | if $elf { |
5915a74a | 414 | run_dump_test_arches "elf-jal" [mips_arch_list_matching mips1] |
7388e440 L |
415 | } else { |
416 | run_dump_test "jal" | |
417 | } | |
ae948b86 TS |
418 | if $elf { run_dump_test "jal-svr4pic" } |
419 | if $elf { run_dump_test "jal-xgot" } | |
51124b6c CD |
420 | # LOSE: As of 2002-02-08, the jal-empic test fails for target mips-ecoff. |
421 | # It appears that it broke between 2000-03-11 00:00UTC and | |
422 | # 2000-03-12 00:00 UTC. | |
ae948b86 | 423 | if $ecoff { run_dump_test "jal-empic" } |
5915a74a CD |
424 | if $elf { |
425 | run_dump_test_arches "jal-empic-elf" [mips_arch_list_matching mips1] | |
426 | run_dump_test_arches "jal-empic-elf-2" [mips_arch_list_matching mips1] | |
427 | run_dump_test_arches "jal-empic-elf-3" [mips_arch_list_matching mips1] | |
428 | } | |
429 | run_list_test_arches "jal-range" "" [mips_arch_list_matching mips1] | |
252b5132 | 430 | if !$aout { run_dump_test "la" } |
ae948b86 TS |
431 | if $elf { run_dump_test "la-svr4pic" } |
432 | if $elf { run_dump_test "la-xgot" } | |
51124b6c CD |
433 | # LOSE: As of 2002-02-08, the la-empic test fails for target mips-ecoff. |
434 | # Not sure when it first cropped up, but may be related to addition of | |
435 | # "la" -> "addiu" pattern in MIPS opcode table long ago. | |
ae948b86 | 436 | if $ecoff { run_dump_test "la-empic" } |
5915a74a CD |
437 | if !$aout { |
438 | # XXX FIXME: Has mips2 and later insns with mips1 disassemblies. | |
439 | # (Should split and then use appropriate arch lists.) | |
440 | run_dump_test_arches "lb" [mips_arch_list_matching !mips2] | |
441 | } | |
442 | if $elf { | |
443 | run_dump_test_arches "lb-svr4pic" [mips_arch_list_matching mips1] | |
444 | } | |
ae948b86 | 445 | if $elf { |
252b5132 RH |
446 | # Both versions specify the cpu, so we can run both regardless of |
447 | # the interlocking in the configured default cpu. | |
448 | run_dump_test "lb-xgot" | |
449 | run_dump_test "lb-xgot-ilocks" | |
450 | } | |
ae948b86 | 451 | if $ecoff { run_dump_test "lb-empic" } |
f22ba854 NC |
452 | if !$aout { |
453 | if !$gpr_ilocks { | |
454 | run_dump_test "ld" | |
252b5132 RH |
455 | } else { |
456 | if !$addr32 { | |
457 | run_dump_test "ld-ilocks" | |
458 | } else { | |
459 | run_dump_test "ld-ilocks-addr32" | |
460 | } | |
461 | } | |
462 | } | |
ae948b86 TS |
463 | if $elf { run_dump_test "ld-svr4pic" } |
464 | if $elf { run_dump_test "ld-xgot" } | |
465 | if $ecoff { run_dump_test "ld-empic" } | |
5915a74a | 466 | run_dump_test_arches "li" [mips_arch_list_matching mips1] |
252b5132 | 467 | if !$aout { run_dump_test "lifloat" } |
ae948b86 TS |
468 | if $elf { run_dump_test "lif-svr4pic" } |
469 | if $elf { run_dump_test "lif-xgot" } | |
51124b6c CD |
470 | # LOSE: As of 2002-02-08, the lif-empic test fails for target mips-ecoff. |
471 | # It appears that it broke between 2000-03-11 00:00UTC and | |
472 | # 2000-03-12 00:00 UTC. | |
ae948b86 | 473 | if $ecoff { run_dump_test "lif-empic" } |
5915a74a | 474 | run_dump_test_arches "mips4" [mips_arch_list_matching mips4] |
f22ba854 NC |
475 | if $ilocks { |
476 | run_dump_test "mul-ilocks" | |
477 | } else { | |
478 | run_dump_test "mul" | |
479 | } | |
5915a74a CD |
480 | |
481 | run_dump_test_arches "rol" [mips_arch_list_matching !ror] | |
482 | run_dump_test_arches "rol-hw" [mips_arch_list_matching ror] | |
483 | ||
484 | run_dump_test_arches "rol64" [mips_arch_list_matching gpr64 !ror] | |
485 | run_dump_test_arches "rol64-hw" [mips_arch_list_matching gpr64 ror] | |
486 | ||
252b5132 RH |
487 | if !$aout { run_dump_test "sb" } |
488 | run_dump_test "trunc" | |
489 | if !$aout { run_dump_test "ulh" } | |
ae948b86 TS |
490 | if $elf { run_dump_test "ulh-svr4pic" } |
491 | if $elf { run_dump_test "ulh-xgot" } | |
492 | if $ecoff { run_dump_test "ulh-empic" } | |
252b5132 RH |
493 | if !$aout { |
494 | run_dump_test "ulw" | |
495 | run_dump_test "uld" | |
496 | run_dump_test "ush" | |
497 | run_dump_test "usw" | |
498 | run_dump_test "usd" | |
499 | } | |
500 | # The mips16 test can only be run on ELF, because only ELF | |
501 | # supports the necessary mips16 reloc. | |
3396de36 TS |
502 | if { $elf && !$no_mips16 } { |
503 | run_dump_test "mips16" | |
504 | # Check jalx handling | |
505 | run_dump_test "mips16-jalx" | |
506 | run_dump_test "mips-jalx" | |
507 | } | |
508 | run_list_test "mips-no-jalx" "" | |
252b5132 RH |
509 | run_dump_test "delay" |
510 | run_dump_test "nodelay" | |
511 | run_dump_test "mips4010" | |
512 | run_dump_test "mips4650" | |
513 | run_dump_test "mips4100" | |
60b63b72 RS |
514 | run_dump_test "vr4111" |
515 | run_dump_test "vr4120" | |
516 | run_dump_test "vr4122" | |
517 | run_dump_test "vr5400" | |
518 | run_dump_test "vr5500" | |
99c14723 | 519 | run_dump_test "perfcount" |
252b5132 RH |
520 | run_dump_test "lineno" |
521 | run_dump_test "sync" | |
5915a74a CD |
522 | |
523 | run_dump_test_arches "mips32" [mips_arch_list_matching mips32] | |
524 | ||
525 | run_dump_test_arches "mips64" [mips_arch_list_matching mips64] | |
526 | ||
1f25f5d3 | 527 | run_dump_test "mips64-mips3d" |
5915a74a CD |
528 | run_dump_test_arches "mips64-mips3d-incl" [mips_arch_list_matching mips3d] |
529 | ||
deec1734 | 530 | run_dump_test "mips64-mdmx" |
107c6e1a | 531 | run_dump_test "sb1-ext-mdmx" |
2228315b | 532 | run_dump_test "sb1-ext-ps" |
252b5132 | 533 | |
594e740f L |
534 | run_dump_test "relax" |
535 | ||
d9e138e2 | 536 | run_list_test "illegal" "" |
e8dcafb0 | 537 | run_list_test "baddata1" "" |
d9e138e2 | 538 | |
51124b6c CD |
539 | # LOSE: As of 2002-02-08, the next 4 tests fail for target mips-ecoff. |
540 | # It's unknown whether they _should_ pass as-is, or whether different | |
541 | # variants are needed for ELF and ECOFF. | |
dc462216 RS |
542 | run_dump_test "mips-gp32-fp32" |
543 | run_dump_test "mips-gp32-fp64" | |
544 | run_dump_test "mips-gp64-fp32" | |
545 | run_dump_test "mips-gp64-fp64" | |
dc462216 | 546 | |
ae948b86 | 547 | if $elf { |
2cd5676f CD |
548 | # Make sure that -mcpu=FOO and -mFOO are equivalent. Assemble a file |
549 | # containing 4650-specific instructions with -m4650 and -mcpu=4650, | |
550 | # and verify that they're the same. Specifically, we're checking | |
551 | # that the EF_MIPS_MACH field is set, and that the 4650 'mul' | |
f22ba854 | 552 | # instruction does get used. In previous versions of GAS, |
2cd5676f CD |
553 | # only -mcpu=4650 would set the EF_MIPS_MACH field; -m4650 wouldn't. |
554 | run_dump_test "elf_e_flags1" | |
555 | run_dump_test "elf_e_flags2" | |
556 | run_dump_test "elf_e_flags3" | |
557 | run_dump_test "elf_e_flags4" | |
f22ba854 | 558 | |
70a31400 CD |
559 | # Verify that ASE markings are handled properly. |
560 | if { !$no_mips16 } { run_dump_test "elf_ase_mips16" } | |
561 | ||
dc462216 RS |
562 | run_dump_test "mips-gp32-fp32-pic" |
563 | run_dump_test "mips-gp32-fp64-pic" | |
564 | run_dump_test "mips-gp64-fp32-pic" | |
565 | run_dump_test "mips-gp64-fp64-pic" | |
ae948b86 TS |
566 | |
567 | run_dump_test "mips-abi32" | |
568 | run_dump_test "mips-abi32-pic" | |
885add95 | 569 | run_dump_test "mips-abi32-pic2" |
ff8715d0 | 570 | |
0c4ec151 | 571 | run_dump_test "elf${el}-rel" |
b4dc22a8 CD |
572 | if {[istarget mips64*-*-*] || [istarget mipsisa32*-*-*] |
573 | || [istarget mipsisa64*-*-*]} { | |
15ba8cc1 | 574 | run_dump_test "elf${el}-rel2" |
7ad8fb54 | 575 | } else { |
15ba8cc1 | 576 | run_dump_test "e32${el}-rel2" |
a90335ee | 577 | } |
0c4ec151 | 578 | run_dump_test "elf${el}-rel3" |
7ad8fb54 CD |
579 | if {[istarget mips64*-*-*]} { |
580 | run_dump_test "elf-rel4" | |
581 | } else { | |
582 | run_dump_test "e32-rel4" | |
583 | } | |
5f266a81 | 584 | run_dump_test "elf-rel5" |
98605598 | 585 | run_dump_test "elf-rel6" |
631cb423 | 586 | run_dump_test "elf-rel7" |
0c4ec151 | 587 | run_dump_test "${tmips}${el}empic" |
afdbd6d0 | 588 | run_dump_test "empic2" |
a657e7c1 CD |
589 | run_dump_test "empic3_e" |
590 | run_dump_test "empic3_g1" | |
591 | run_dump_test "empic3_g2" | |
f22ba854 NC |
592 | if { !$no_mips16 } { |
593 | run_dump_test "${tmips}mips${el}16-e" | |
594 | run_dump_test "${tmips}mips${el}16-f" | |
bb2d6cd7 | 595 | } |
fdb987ee | 596 | run_dump_test "elf-consthilo" |
07147777 | 597 | } |
640c0ccd CD |
598 | |
599 | # tests of objdump's ability to disassemble using different | |
600 | # register names. | |
601 | run_dump_test "gpr-names-numeric" | |
602 | run_dump_test "gpr-names-32" | |
603 | run_dump_test "gpr-names-n32" | |
604 | run_dump_test "gpr-names-64" | |
605 | ||
606 | run_dump_test "fpr-names-numeric" | |
607 | run_dump_test "fpr-names-32" | |
608 | run_dump_test "fpr-names-n32" | |
609 | run_dump_test "fpr-names-64" | |
610 | ||
611 | run_dump_test "cp0-names-numeric" | |
612 | run_dump_test "cp0-names-mips32" | |
613 | run_dump_test "cp0-names-mips64" | |
614 | run_dump_test "cp0-names-sb1" | |
252b5132 | 615 | } |