* gas/mips/mips.exp (run_dump_test_arch): Get the name of the
[binutils-gdb.git] / gas / testsuite / gas / mips / mips.exp
1 #
2 # Some generic MIPS tests
3 #
4
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
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
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 # gpr_ilocks
59 # The architecture interlocks GPRs accesses. (That is,
60 # there are no load delay slots.)
61 #
62 # mips3d The architecture includes the MIPS-3D ASE.
63 #
64 # ror The architecture includes hardware rotate instructions.
65 #
66 # gpr32, gpr64
67 # The architecture provides 32- or 64-bit General Purpose
68 # Registers.
69 #
70 # as_flags: The assembler flags used when assembling tests for this
71 # architecture.
72 #
73 # objdump_flags: The objdump flags used when disassembling tests for
74 # this architecture.
75 #
76 # Most entries in the architecture array will have values in all of
77 # the fields above. One entry, "default" represents the default CPU
78 # based on the target of the assembler being built. If always has
79 # empty "as_flags" and "objdump_flags."
80
81 # mips_arch_init
82 #
83 # This function initializes the architecture data array ("mips_arches")
84 # to be empty.
85 proc mips_arch_init {} {
86 global mips_arches
87
88 # Catch because the variable won't be set the first time through.
89 catch {unset mips_arches}
90 }
91
92 # mips_arch_create ARCH GPRSIZE EXTENDS PROPS AS_FLAGS OBJDUMP_FLAGS \
93 # (optional:) DEFAULT_FOR_TARGETS
94 #
95 # This function creates a new entry in the architecture data array,
96 # for the architecture or CPU named ARCH, and fills in the entry
97 # according to the rest of the arguments.
98 #
99 # The new entry's property list is initialized to contain ARCH, any
100 # properties specified by PROPS, and the properties associated with
101 # the entry specified by EXTENDS. (The new architecture is considered
102 # to extend the capabilities provided by that architecture.)
103 #
104 # If DEFAULT_FOR_TARGETS is specified, it is a list of targets for which
105 # this architecture is the default architecture. If "istarget" returns
106 # true for any of the targets in the list, a "default" entry will be
107 # added to the architecture array which indicates that ARCH is the default
108 # architecture.
109 proc mips_arch_create {arch gprsize extends props as_flags objdump_flags
110 {default_for_targets {}}} {
111 global mips_arches
112
113 if { [info exists mips_arches($arch)] } {
114 error "mips_arch_create: arch \"$arch\" already exists"
115 }
116 if { $gprsize != 32 && $gprsize != 64 } {
117 error "mips_arch_create: invalid GPR size $gprsize"
118 }
119
120 set archdata(displayname) $arch
121 set archdata(gprsize) $gprsize
122 set archdata(as_flags) $as_flags
123 set archdata(objdump_flags) $objdump_flags
124 set archdata(props) $arch
125 eval lappend archdata(props) $props
126 if { [string length $extends] != 0 } {
127 eval lappend archdata(props) [mips_arch_properties $extends 0]
128 }
129
130 set mips_arches($arch) [array get archdata]
131
132 # Set as default if appropriate.
133 foreach target $default_for_targets {
134 if { [istarget $target] } {
135 if { [info exists mips_arches(default)] } {
136 error "mips_arch_create: default arch already exists"
137 }
138
139 set archdata(displayname) "default = $arch"
140 set archdata(as_flags) ""
141 set archdata(objdump_flags) ""
142
143 set mips_arches(default) [array get archdata]
144 break
145 }
146 }
147 }
148
149 # mips_arch_destroy ARCH
150 #
151 # The opposite of the above. This function removes an entry from
152 # the architecture data array, for the architecture or CPU named ARCH.
153
154 proc mips_arch_destroy {arch} {
155 global mips_arches
156
157 if { [info exists mips_arches($arch)] } {
158 unset mips_arches($arch)
159 }
160 }
161
162 # mips_arch_list_all
163 #
164 # This function returns the list of all names of entries in the
165 # architecture data array (including the default entry, if a default
166 # is known).
167 proc mips_arch_list_all {} {
168 global mips_arches
169 return [lsort -dictionary [array names mips_arches]]
170 }
171
172 # mips_arch_data ARCH
173 #
174 # This function returns the information associated with ARCH
175 # in the architecture data array, in "array get" form.
176 proc mips_arch_data {arch} {
177 global mips_arches
178
179 if { ! [info exists mips_arches($arch)] } {
180 error "mips_arch_data: unknown arch \"$arch\""
181 }
182 return $mips_arches($arch)
183 }
184
185 # mips_arch_displayname ARCH
186 #
187 # This function returns the printable name associated with ARCH in
188 # the architecture data array.
189 proc mips_arch_displayname {arch} {
190 array set archdata [mips_arch_data $arch]
191 return $archdata(displayname)
192 }
193
194 # mips_arch_properties ARCH (optional:) INCLUDE_GPRSIZE
195 #
196 # This function returns the property list associated with ARCH in the
197 # architecture data array, including the "canonical" target name as the
198 # first element.
199 #
200 # If INCLUDE_GPRSIZE is non-zero, an additional "gpr32" or "gpr64"
201 # property will be returned as part of the list based on the
202 # architecture's GPR size.
203 proc mips_arch_properties {arch {include_gprsize 1}} {
204 array set archdata [mips_arch_data $arch]
205 set props $archdata(props)
206 if { $include_gprsize } {
207 lappend props gpr$archdata(gprsize)
208 }
209 return $props
210 }
211
212 # mips_arch_as_flags ARCH
213 #
214 # This function returns the assembler flags associated with ARCH in
215 # the architecture data array.
216 proc mips_arch_as_flags {arch} {
217 array set archdata [mips_arch_data $arch]
218 return $archdata(as_flags)
219 }
220
221 # mips_arch_objdump_flags ARCH
222 #
223 # This function returns the objdump disassembly flags associated with
224 # ARCH in the architecture data array.
225 proc mips_arch_objdump_flags {arch} {
226 array set archdata [mips_arch_data $arch]
227 return $archdata(objdump_flags)
228 }
229
230 # mips_arch_matches ARCH PROPMATCHLIST
231 #
232 # This function returns non-zero if ARCH matches the set of properties
233 # described by PROPMATCHLIST. Each entry in PROPMATCHLIST can either
234 # be the name of a property which must be matched, or "!" followed by
235 # the name of a property which must not be matched. ARCH matches
236 # PROPMATCHLIST if and only if all of the conditions specified by
237 # PROPMATCHLIST are satisfied.
238 proc mips_arch_matches {arch propmatchlist} {
239 foreach pm $propmatchlist {
240 if { [string match {!*} $pm] } {
241 # fail if present.
242 set inverted 1
243 set p [string range $pm 1 end]
244 } {
245 # fail if not present.
246 set inverted 0
247 set p $pm
248 }
249
250 set loc [lsearch -exact [mips_arch_properties $arch] $p]
251
252 # required-absent and found, or required-present and not found: fail.
253 if { ($inverted && $loc != -1) || (! $inverted && $loc == -1) } {
254 return 0
255 }
256 }
257 return 1
258 }
259
260 # mips_arch_list_matching ARGS
261 #
262 # This function returns a list of all architectures which match
263 # the conditions described by its arguments. Its arguments are
264 # taken as a list and used as the PROPMATCHLIST in a call to
265 # "mips_arch_matches" for each known architecture.
266 proc mips_arch_list_matching {args} {
267 set l ""
268 foreach arch [mips_arch_list_all] {
269 # For now, don't match default arch until we know what its
270 # properties actually are.
271 if { [string compare $arch default] == 0
272 && [string length [mips_arch_properties default]] == 0} {
273 continue
274 }
275 if { [mips_arch_matches $arch $args] } {
276 lappend l $arch
277 }
278 }
279 return $l
280 }
281
282
283 # The functions below facilitate running various types of tests.
284
285 # run_dump_test_arch NAME ARCH
286 #
287 # Invoke "run_dump_test" for test NAME, with extra assembler and
288 # disassembler flags to test architecture ARCH.
289 proc run_dump_test_arch { name arch } {
290 global subdir srcdir
291
292 set proparch [lindex [mips_arch_properties $arch 0] 0]
293 set archname "${proparch}@${name}"
294 if { [file exists "$srcdir/$subdir/${archname}.d"] } {
295 set name $archname
296 }
297
298 if [catch {run_dump_test $name \
299 "{name {([mips_arch_displayname $arch])}}
300 {objdump {[mips_arch_objdump_flags $arch]}}
301 {as {[mips_arch_as_flags $arch]}}"} rv] {
302 perror "$rv"
303 untested "$subdir/$name ($arch)"
304 }
305 }
306
307 # run_dump_test_arches NAME ARCH_LIST
308 #
309 # Invoke "run_dump_test_arch" for test NAME, for each architecture
310 # listed in ARCH_LIST.
311 proc run_dump_test_arches { name arch_list } {
312 foreach arch $arch_list {
313 run_dump_test_arch "$name" "$arch"
314 }
315 }
316
317 # run_list_test_arch NAME OPTS ARCH
318 #
319 # Invoke "run_list_test" for test NAME with options OPTS, with extra
320 # assembler flags to test architecture ARCH.
321 proc run_list_test_arch { name opts arch } {
322 global subdir
323
324 set testname "MIPS $name ([mips_arch_displayname $arch])"
325 if [catch {run_list_test "$name" "$opts [mips_arch_as_flags $arch]" \
326 "$testname"} rv] {
327 perror "$rv"
328 untested "$testname"
329 }
330 }
331
332 # run_list_test_arches NAME OPTS ARCH_LIST
333 #
334 # Invoke "run_list_test_arch" for test NAME with options OPTS, for each
335 # architecture listed in ARCH_LIST.
336 proc run_list_test_arches { name opts arch_list } {
337 foreach arch $arch_list {
338 run_list_test_arch "$name" "$opts" "$arch"
339 }
340 }
341
342
343 # Create the architecture data array by providing data for all
344 # known architectures.
345 #
346 # Note that several targets pick default CPU based on ABI. We
347 # can't easily handle that; do NOT list those targets as defaulting
348 # to any architecture.
349 mips_arch_init
350 mips_arch_create mips1 32 {} {} \
351 { -march=mips1 -mtune=mips1 } { -mmips:3000 }
352 mips_arch_create mips2 32 mips1 { gpr_ilocks } \
353 { -march=mips2 -mtune=mips2 } { -mmips:6000 }
354 mips_arch_create mips3 64 mips2 {} \
355 { -march=mips3 -mtune=mips3 } { -mmips:4000 }
356 mips_arch_create mips4 64 mips3 {} \
357 { -march=mips4 -mtune=mips4 } { -mmips:8000 }
358 mips_arch_create mips5 64 mips4 {} \
359 { -march=mips5 -mtune=mips5 } { -mmips:mips5 }
360 mips_arch_create mips32 32 mips2 {} \
361 { -march=mips32 -mtune=mips32 } { -mmips:isa32 } \
362 { mipsisa32-*-* mipsisa32el-*-* }
363 mips_arch_create mips32r2 32 mips32 { ror } \
364 { -march=mips32r2 -mtune=mips32r2 } \
365 { -mmips:isa32r2 } \
366 { mipsisa32r2-*-* mipsisa32r2el-*-* }
367 mips_arch_create mips64 64 mips5 { mips32 } \
368 { -march=mips64 -mtune=mips64 } { -mmips:isa64 } \
369 { mipsisa64-*-* mipsisa64el-*-* }
370 mips_arch_create mips64r2 64 mips64 { mips32r2 ror } \
371 { -march=mips64r2 -mtune=mips64r2 } \
372 { -mmips:isa64r2 } \
373 { mipsisa64r2-*-* mipsisa64r2el-*-* }
374 mips_arch_create mips16 32 {} {} \
375 { -march=mips1 -mips16 } { -mmips:16 }
376 mips_arch_create r3000 32 mips1 {} \
377 { -march=r3000 -mtune=r3000 } { -mmips:3000 }
378 mips_arch_create r3900 32 mips1 { gpr_ilocks } \
379 { -march=r3900 -mtune=r3900 } { -mmips:3900 } \
380 { mipstx39-*-* mipstx39el-*-* }
381 mips_arch_create r4000 64 mips3 {} \
382 { -march=r4000 -mtune=r4000 } { -mmips:4000 }
383 mips_arch_create vr5400 64 mips4 { ror } \
384 { -march=vr5400 -mtune=vr5400 } { -mmips:5400 }
385 mips_arch_create sb1 64 mips64 { mips3d } \
386 { -march=sb1 -mtune=sb1 } { -mmips:sb1 } \
387 { mipsisa64sb1-*-* mipsisa64sb1el-*-* }
388 mips_arch_create octeon 64 mips64r2 {} \
389 { -march=octeon -mtune=octeon } { -mmips:octeon } \
390 { mips64octeon*-*-* }
391 mips_arch_create xlr 64 mips64 {} \
392 { -march=xlr -mtune=xlr } { -mmips:xlr }
393
394 #
395 # And now begin the actual tests! VxWorks uses RELA rather than REL
396 # relocations, so most of the generic dump tests will not work there.
397 #
398 if { [istarget mips*-*-vxworks*] } {
399 run_dump_test "vxworks1"
400 run_dump_test "vxworks1-xgot"
401 run_dump_test "vxworks1-el"
402 run_dump_test "vxworks1-xgot-el"
403 } elseif { [istarget mips*-*-*] } {
404 set no_mips16 0
405 set elf [expr [istarget *-*-elf*] || [istarget *-*-irix5*] || [istarget *-*-irix6* ] || [istarget *-*-linux*] || [istarget *-*-netbsd*] ]
406 set ecoff [expr [istarget *-*-ecoff*] || [istarget *-*-ultrix*] || [istarget *-*-irix\[1-4\]*] ]
407 set aout [expr [istarget *-*-bsd*] || [istarget *-*-openbsd*] ]
408 set gpr_ilocks [expr [istarget mipstx39*-*-*]]
409 set addr32 [expr [istarget mipstx39*-*-*] || [istarget mips-*-linux*] || [istarget mipsel-*-linux*] || [istarget mips*-*-ecoff]]
410 set has_newabi [expr [istarget *-*-irix6*] || [istarget mips64*-*-linux*]]
411
412 if { [istarget "mips*-*-*linux*"] || [istarget "mips*-sde-elf*"] } then {
413 set tmips "t"
414 } else {
415 set tmips ""
416 }
417 if [istarget mips*el-*-*] {
418 set el "el"
419 } {
420 set el ""
421 }
422 if { $ecoff } {
423 set no_mips16 1
424 }
425 if { $no_mips16 } {
426 mips_arch_destroy mips16
427 }
428
429 run_dump_test_arches "abs" [mips_arch_list_matching mips1]
430 run_dump_test_arches "add" [mips_arch_list_matching mips1]
431 run_dump_test_arches "and" [mips_arch_list_matching mips1]
432 run_dump_test_arches "mips1-fp" [mips_arch_list_matching mips1]
433 run_list_test_arches "mips1-fp" "-32 -msoft-float" \
434 [mips_arch_list_matching mips1]
435 run_dump_test "break20"
436 run_dump_test "trap20"
437
438 # LOSE: As of 2002-02-08, "beq" through "bltu" fail for target mips-ecoff.
439 # See http://sources.redhat.com/ml/binutils/2001-10/msg00418.html for
440 # more information. Not sure if the fixes there are correct; should
441 # branches to external labels be allowed for ECOFF?
442 run_dump_test_arches "beq" [mips_arch_list_matching mips1]
443 run_dump_test_arches "bge" [mips_arch_list_matching mips1]
444 run_dump_test_arches "bgeu" [mips_arch_list_matching mips1]
445 run_dump_test_arches "blt" [mips_arch_list_matching mips1]
446 run_dump_test_arches "bltu" [mips_arch_list_matching mips1]
447 run_dump_test_arches "branch-likely" [mips_arch_list_matching mips2]
448 run_dump_test_arches "branch-misc-1" [mips_arch_list_matching mips1]
449 run_dump_test_arches "branch-misc-2" [mips_arch_list_matching mips1]
450 run_dump_test_arches "branch-misc-2pic" [mips_arch_list_matching mips1]
451 run_dump_test_arches "branch-misc-2-64" [mips_arch_list_matching mips3]
452 run_dump_test_arches "branch-misc-2pic-64" [mips_arch_list_matching mips3]
453 run_dump_test "branch-misc-3"
454 run_dump_test "branch-swap"
455 run_dump_test "div"
456
457 if { !$addr32 } {
458 run_dump_test_arches "dli" [mips_arch_list_matching mips3]
459 }
460 if $elf {
461 run_dump_test_arches "elf-jal" [mips_arch_list_matching mips1]
462 } else {
463 run_dump_test "jal"
464 }
465 run_dump_test "eret-1"
466 run_dump_test "eret-2"
467 run_dump_test "eret-3"
468
469 if $elf {
470 run_dump_test_arches "jal-svr4pic" \
471 [mips_arch_list_matching mips1]
472 run_dump_test_arches "jal-svr4pic-noreorder" \
473 [mips_arch_list_matching mips1]
474 }
475 if $elf { run_dump_test "jal-xgot" }
476 run_list_test_arches "jal-range" "-32" [mips_arch_list_matching mips1]
477 if $has_newabi { run_dump_test "jal-newabi" }
478 if !$aout { run_dump_test "la" }
479 if $elf { run_dump_test "la-svr4pic" }
480 if $elf { run_dump_test "la-xgot" }
481 if $elf { run_dump_test "lca-svr4pic" }
482 if $elf { run_dump_test "lca-xgot" }
483 if !$aout {
484 # XXX FIXME: Has mips2 and later insns with mips1 disassemblies.
485 # (Should split and then use appropriate arch lists.)
486 run_dump_test_arches "lb" [mips_arch_list_matching mips1 !mips2]
487 }
488 if $elf {
489 run_dump_test_arches "lb-svr4pic" \
490 [mips_arch_list_matching mips1 !gpr_ilocks]
491 run_dump_test_arches "lb-svr4pic-ilocks" [mips_arch_list_matching gpr_ilocks]
492 }
493 if $elf {
494 # Both versions specify the cpu, so we can run both regardless of
495 # the interlocking in the configured default cpu.
496 run_dump_test "lb-xgot"
497 run_dump_test "lb-xgot-ilocks"
498 }
499 if !$aout {
500 if !$gpr_ilocks {
501 run_dump_test "ld"
502 } else {
503 if !$addr32 {
504 run_dump_test "ld-ilocks"
505 } else {
506 run_dump_test "ld-ilocks-addr32"
507 }
508 }
509 }
510 if $elf { run_dump_test "ld-svr4pic" }
511 if $elf { run_dump_test "ld-xgot" }
512 run_dump_test_arches "li" [mips_arch_list_matching mips1]
513 if !$aout { run_dump_test "lifloat" }
514 if $elf { run_dump_test "lif-svr4pic" }
515 if $elf { run_dump_test "lif-xgot" }
516 run_dump_test_arches "mips4" [mips_arch_list_matching mips4]
517 run_dump_test_arches "mips4-fp" [mips_arch_list_matching mips4]
518 run_list_test_arches "mips4-fp" "-32 -msoft-float" \
519 [mips_arch_list_matching mips4]
520 run_dump_test_arches "mips4-branch-likely" \
521 [mips_arch_list_matching mips4]
522 run_list_test_arches "mips4-branch-likely" "-32 -msoft-float" \
523 [mips_arch_list_matching mips4]
524 run_dump_test_arches "mips5" [mips_arch_list_matching mips5]
525 run_dump_test "mul"
526
527 run_dump_test_arches "rol" [mips_arch_list_matching mips1 !ror]
528 run_dump_test_arches "rol-hw" [mips_arch_list_matching ror]
529
530 run_dump_test_arches "rol64" [mips_arch_list_matching gpr64 !ror]
531 run_dump_test_arches "rol64-hw" [mips_arch_list_matching gpr64 ror]
532
533 if !$aout { run_dump_test "sb" }
534 run_dump_test "trunc"
535 if !$aout { run_dump_test "ulh" }
536 run_dump_test_arches "ulh2-eb" [mips_arch_list_matching mips1]
537 run_dump_test_arches "ulh2-el" [mips_arch_list_matching mips1]
538 if $elf { run_dump_test "ulh-svr4pic" }
539 if $elf { run_dump_test "ulh-xgot" }
540 if !$aout {
541 run_dump_test "ulw"
542 run_dump_test "uld"
543 run_dump_test "ush"
544 run_dump_test "usw"
545 run_dump_test "usd"
546 }
547 run_dump_test_arches "ulw2-eb" \
548 [mips_arch_list_matching mips1 !gpr_ilocks]
549 run_dump_test_arches "ulw2-eb-ilocks" [mips_arch_list_matching gpr_ilocks]
550 run_dump_test_arches "ulw2-el" \
551 [mips_arch_list_matching mips1 !gpr_ilocks]
552 run_dump_test_arches "ulw2-el-ilocks" [mips_arch_list_matching gpr_ilocks]
553
554 run_dump_test_arches "uld2-eb" [mips_arch_list_matching mips3]
555 run_dump_test_arches "uld2-el" [mips_arch_list_matching mips3]
556
557 # The mips16 test can only be run on ELF, because only ELF
558 # supports the necessary mips16 reloc.
559 if { $elf && !$no_mips16 } {
560 run_dump_test "mips16"
561 run_dump_test "mips16-64"
562 # Check MIPS16e extensions
563 run_dump_test_arches "mips16e" [mips_arch_list_matching mips32]
564 # Check jalx handling
565 run_dump_test "mips16-jalx"
566 run_dump_test "mips-jalx"
567 run_dump_test "mips-jalx-2"
568 # Check MIPS16 HI16/LO16 relocations
569 run_dump_test "mips16-hilo"
570 if $has_newabi {
571 run_dump_test "mips16-hilo-n32"
572 }
573 run_dump_test "mips16-hilo-match"
574 }
575 run_dump_test "delay"
576 run_dump_test "nodelay"
577 run_dump_test "mips4010"
578 run_dump_test "mips4650"
579 run_dump_test "mips4100"
580 run_dump_test "vr4111"
581 run_dump_test "vr4120"
582 run_dump_test "vr4120-2"
583 run_dump_test "vr4130"
584 run_dump_test "vr5400"
585 run_dump_test "vr5500"
586 run_dump_test "rm7000"
587 run_dump_test "perfcount"
588 run_dump_test "lineno"
589 run_dump_test "sync"
590
591 run_dump_test_arches "mips32" [mips_arch_list_matching mips32]
592
593 run_dump_test_arches "mips32-sf32" [mips_arch_list_matching mips32]
594 run_list_test_arches "mips32-sf32" "-32 -msoft-float" \
595 [mips_arch_list_matching mips32]
596 run_dump_test_arches "mips32-cp2" [mips_arch_list_matching mips32 \
597 !octeon]
598
599 run_dump_test_arches "mips32r2" [mips_arch_list_matching mips32r2]
600 run_dump_test_arches "mips32r2-cp2" [mips_arch_list_matching mips32r2 \
601 !octeon]
602 run_dump_test_arches "mips32r2-fp32" \
603 [mips_arch_list_matching mips32r2]
604 run_list_test_arches "mips32r2-fp32" "-32 -msoft-float" \
605 [mips_arch_list_matching mips32r2]
606 run_list_test_arches "mips32r2-ill" "-32" \
607 [mips_arch_list_matching mips32r2 gpr32]
608 run_list_test_arches "mips32r2-ill-fp64" "-mabi=o64" \
609 [mips_arch_list_matching mips32r2 gpr64]
610 run_list_test_arches "mips32r2-ill-nofp" "-32 -msoft-float" \
611 [mips_arch_list_matching mips32r2]
612
613 run_dump_test_arches "mips64" [mips_arch_list_matching mips64]
614 run_dump_test_arches "mips64-cp2" [mips_arch_list_matching mips64 \
615 !octeon]
616
617 run_dump_test_arches "mips64r2" [mips_arch_list_matching mips64r2]
618 run_list_test_arches "mips64r2-ill" "" [mips_arch_list_matching mips64r2]
619
620 run_dump_test "set-arch"
621
622 if { !$addr32 } {
623 run_dump_test "mips64-mips3d"
624 run_dump_test_arches "mips64-mips3d-incl" [mips_arch_list_matching mips3d]
625
626 run_dump_test "mips64-mdmx"
627 run_dump_test "sb1-ext-mdmx"
628 run_dump_test "sb1-ext-ps"
629 run_dump_test "xlr-ext"
630 }
631
632 run_dump_test "relax"
633 run_dump_test "relax-swap1-mips1"
634 run_dump_test "relax-swap1-mips2"
635 run_dump_test "relax-swap2"
636
637 run_list_test "illegal" "-32"
638 run_list_test "baddata1" "-32"
639 run_list_test "jalr" ""
640
641 # LOSE: As of 2002-02-08, the next 4 tests fail for target mips-ecoff.
642 # It's unknown whether they _should_ pass as-is, or whether different
643 # variants are needed for ELF and ECOFF.
644 run_dump_test "mips-gp32-fp32"
645 run_dump_test "mips-gp32-fp64"
646 run_dump_test "mips-gp64-fp32"
647 run_dump_test "mips-gp64-fp64"
648
649 if $elf {
650 # Make sure that -mcpu=FOO and -mFOO are equivalent. Assemble a file
651 # containing 4650-specific instructions with -m4650 and -mcpu=4650,
652 # and verify that they're the same. Specifically, we're checking
653 # that the EF_MIPS_MACH field is set, and that the 4650 'mul'
654 # instruction does get used. In previous versions of GAS,
655 # only -mcpu=4650 would set the EF_MIPS_MACH field; -m4650 wouldn't.
656 run_dump_test "elf_e_flags1"
657 run_dump_test "elf_e_flags2"
658 run_dump_test "elf_e_flags3"
659 run_dump_test "elf_e_flags4"
660
661 # Check EF_MIPS_ARCH markings for each supported architecture.
662 run_dump_test "elf_arch_mips1"
663 run_dump_test "elf_arch_mips2"
664 run_dump_test "elf_arch_mips3"
665 run_dump_test "elf_arch_mips4"
666 run_dump_test "elf_arch_mips5"
667 run_dump_test "elf_arch_mips32"
668 run_dump_test "elf_arch_mips32r2"
669 run_dump_test "elf_arch_mips64"
670 run_dump_test "elf_arch_mips64r2"
671
672 # Verify that ASE markings are handled properly.
673 if { !$no_mips16 } { run_dump_test "elf_ase_mips16" }
674
675 run_dump_test "mips-gp32-fp32-pic"
676 run_dump_test "mips-gp32-fp64-pic"
677 run_dump_test "mips-gp64-fp32-pic"
678 run_dump_test "mips-gp64-fp64-pic"
679
680 run_dump_test "mips-abi32"
681 run_dump_test "mips-abi32-pic"
682 run_dump_test "mips-abi32-pic2"
683
684 run_dump_test "elf${el}-rel"
685 run_dump_test_arches "elf${el}-rel2" [mips_arch_list_matching gpr64]
686 run_dump_test "e32${el}-rel2"
687 run_dump_test "elf${el}-rel3"
688 run_dump_test_arches "elf-rel4" [mips_arch_list_matching gpr64]
689 run_dump_test "e32-rel4"
690 run_dump_test "elf-rel5"
691 run_dump_test "elf-rel6"
692 if $has_newabi {
693 run_dump_test "elf-rel6-n32"
694 run_dump_test "elf-rel6-n64"
695 }
696 run_dump_test "elf-rel7"
697 run_dump_test "elf-rel8"
698 run_dump_test "elf-rel8-mips16"
699 run_dump_test "elf-rel9"
700 run_dump_test "elf-rel9-mips16"
701 if $has_newabi {
702 run_dump_test "elf-rel10"
703 run_dump_test "elf-rel11"
704 }
705 run_dump_test "elf-rel12"
706 run_dump_test "elf-rel13"
707 run_dump_test "elf-rel13-mips16"
708 run_dump_test "elf-rel14"
709
710 if $has_newabi {
711 run_dump_test "elf-rel15"
712 run_dump_test "elf-rel16"
713
714 run_dump_test "elf-rel-got-n32"
715 run_dump_test "elf-rel-xgot-n32"
716 run_dump_test "elf-rel-got-n64"
717 run_dump_test "elf-rel-xgot-n64"
718 }
719 run_dump_test "elf-rel17"
720 if $has_newabi {
721 run_dump_test "elf-rel18"
722 }
723 run_dump_test "elf-rel19"
724 run_dump_test "elf-rel20"
725 if $has_newabi {
726 run_dump_test "elf-rel21"
727 run_dump_test "elf-rel22"
728 run_dump_test "elf-rel23"
729 run_dump_test "elf-rel23a"
730 run_dump_test "elf-rel23b"
731 run_dump_test "elf-rel24"
732 }
733
734 run_dump_test "elf-rel25"
735 run_dump_test "elf-rel25a"
736 run_dump_test "elf-rel26"
737
738 run_dump_test_arches "elf-rel27" [mips_arch_list_all]
739
740 if { !$no_mips16 } {
741 run_dump_test "${tmips}mips${el}16-e"
742 run_dump_test "${tmips}mips${el}16-f"
743 }
744 run_dump_test "elf-consthilo"
745 run_dump_test "expr1"
746
747 run_list_test "tls-ill" "-32"
748 run_dump_test "tls-o32"
749 run_dump_test "jalr2"
750 }
751
752 if $has_newabi {
753 run_dump_test "n32-consec"
754 }
755
756 # tests of objdump's ability to disassemble using different
757 # register names.
758 run_dump_test "gpr-names-numeric"
759 run_dump_test "gpr-names-32"
760 run_dump_test "gpr-names-n32"
761 run_dump_test "gpr-names-64"
762
763 run_dump_test "fpr-names-numeric"
764 run_dump_test "fpr-names-32"
765 run_dump_test "fpr-names-n32"
766 run_dump_test "fpr-names-64"
767
768 run_dump_test "cp0-names-numeric"
769 run_dump_test "cp0-names-r3000"
770 run_dump_test "cp0-names-r4000" \
771 { { {name} {(r4000)} } { {objdump} {-M cp0-names=r4000} } }
772 run_dump_test "cp0-names-r4000" \
773 { { {name} {(r4400)} } { {objdump} {-M cp0-names=r4400} } }
774 run_dump_test "cp0-names-mips32"
775 run_dump_test "cp0-names-mips32r2"
776 run_dump_test "cp0-names-mips64"
777 run_dump_test "cp0-names-mips64r2"
778 run_dump_test "cp0-names-sb1"
779
780 run_dump_test "cp0sel-names-numeric"
781 run_dump_test "cp0sel-names-mips32"
782 run_dump_test "cp0sel-names-mips32r2"
783 run_dump_test "cp0sel-names-mips64"
784 run_dump_test "cp0sel-names-mips64r2"
785 run_dump_test "cp0sel-names-sb1"
786
787 run_dump_test "hwr-names-numeric"
788 run_dump_test "hwr-names-mips32r2"
789 run_dump_test "hwr-names-mips64r2"
790
791 run_dump_test "ldstla-32"
792 run_dump_test "ldstla-32-mips3"
793 run_dump_test "ldstla-32-shared"
794 run_dump_test "ldstla-32-mips3-shared"
795 run_list_test "ldstla-32-1" "-mabi=32" \
796 "MIPS ld-st-la bad constants (ABI o32)"
797 run_list_test "ldstla-32-mips3-1" "-mabi=32" \
798 "MIPS ld-st-la bad constants (ABI o32, mips3)"
799 run_list_test "ldstla-32-1" "-KPIC -mabi=32" \
800 "MIPS ld-st-la bad constants (ABI o32, shared)"
801 run_list_test "ldstla-32-mips3-1" "-KPIC -mabi=32" \
802 "MIPS ld-st-la bad constants (ABI o32, mips3, shared)"
803 run_dump_test "ldstla-eabi64"
804 if $has_newabi {
805 run_dump_test "ldstla-n64"
806 run_dump_test "ldstla-n64-shared"
807 run_dump_test "ldstla-n64-sym32"
808 }
809
810 run_dump_test "macro-warn-1"
811 run_dump_test "macro-warn-2"
812 run_dump_test "macro-warn-3"
813 run_dump_test "macro-warn-4"
814 if $has_newabi {
815 run_dump_test "macro-warn-1-n32"
816 run_dump_test "macro-warn-2-n32"
817 }
818
819 run_dump_test "noat-1"
820 run_list_test "noat-2" ""
821 run_list_test "noat-3" ""
822 run_list_test "noat-4" ""
823 run_list_test "noat-5" ""
824 run_list_test "noat-6" ""
825 run_list_test "noat-7" ""
826
827 run_dump_test "at-1"
828 run_list_test "at-2" "-32 -mips1" "MIPS at-2"
829
830 run_dump_test "loongson-2e"
831 run_dump_test "loongson-2f"
832 run_dump_test "loongson-2f-2"
833 run_dump_test "loongson-2f-3"
834
835 run_dump_test_arches "octeon" [mips_arch_list_matching octeon]
836 run_list_test_arches "octeon-ill" "" \
837 [mips_arch_list_matching octeon]
838 run_dump_test_arches "octeon-pref" [mips_arch_list_matching octeon]
839
840 run_dump_test "smartmips"
841 run_dump_test "mips32-dsp"
842 run_dump_test "mips32-dspr2"
843 run_dump_test "mips64-dsp"
844 run_dump_test "mips32-mt"
845
846 if { $elf && !$no_mips16 } {
847 run_dump_test "mips16-dwarf2"
848 if $has_newabi {
849 run_dump_test "mips16-dwarf2-n32"
850 }
851 }
852 if { !$no_mips16 } {
853 run_dump_test "mips16e-jrc"
854 run_dump_test "mips16e-save"
855 run_dump_test "mips16e-64"
856 run_list_test "mips16e-64" "-march=mips32 -32"
857 run_dump_test "mips16-intermix"
858 }
859 run_dump_test "vxworks1"
860 run_dump_test "vxworks1-xgot"
861 run_dump_test "vxworks1-el"
862 run_dump_test "vxworks1-xgot-el"
863
864 run_dump_test "noreorder"
865 run_dump_test "align"
866 run_dump_test "align2"
867 run_dump_test "align2-el"
868 run_dump_test "odd-float"
869
870 run_list_test_arches "mips-macro-ill-sfp" "-32 -msingle-float" \
871 [mips_arch_list_matching mips2]
872 run_list_test_arches "mips-macro-ill-nofp" "-32 -msoft-float" \
873 [mips_arch_list_matching mips2]
874
875 run_list_test_arches "mips-hard-float-flag" \
876 "-32 -msoft-float -mhard-float" \
877 [mips_arch_list_matching mips1]
878 run_list_test_arches "mips-double-float-flag" \
879 "-32 -msingle-float -mdouble-float" \
880 [mips_arch_list_matching mips1]
881
882 run_dump_test "mips16-vis-1"
883 run_dump_test "call-nonpic-1"
884 run_dump_test "mips32-sync"
885 run_dump_test_arches "mips32r2-sync" \
886 [mips_arch_list_matching mips32r2]
887
888 if $has_newabi { run_dump_test "cfi-n64-1" }
889
890 run_dump_test_arches "aent" [mips_arch_list_matching mips1]
891 }