2 # Some generic MIPS tests
5 # When adding a new test to this file, try to do the following things:
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).
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."
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.
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.
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.
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:
40 # displayname: The name of the entry to be used for pretty-printing.
42 # gprsize: The size in bits of General Purpose Registers provided by
43 # the architecture (must be 32 or 64).
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)
54 # mips1, mips2, mips3, mips4, mips5, mips32, mips64
55 # The architecture includes the instructions defined
58 # fpisa3, fpisa4, fpisa5
59 # The architecture includes the floating-point
60 # instructions defined by that MIPS ISA.
63 # The architecture interlocks GPRs accesses. (That is,
64 # there are no load delay slots.)
66 # mips3d The architecture includes the MIPS-3D ASE.
68 # ror The architecture includes hardware rotate instructions.
71 # The architecture provides 32- or 64-bit General Purpose
74 # as_flags: The assembler flags used when assembling tests for this
77 # objdump_flags: The objdump flags used when disassembling tests for
80 # Most entries in the architecture array will have values in all of
81 # the fields above. One entry, "default" represents the default CPU
82 # based on the target of the assembler being built. If always has
83 # empty "as_flags" and "objdump_flags."
87 # This function initializes the architecture data array ("mips_arches")
89 proc mips_arch_init {} {
92 # Catch because the variable won't be set the first time through.
93 catch {unset mips_arches}
96 # mips_arch_create ARCH GPRSIZE EXTENDS PROPS AS_FLAGS OBJDUMP_FLAGS \
97 # (optional:) DEFAULT_FOR_TARGETS
99 # This function creates a new entry in the architecture data array,
100 # for the architecture or CPU named ARCH, and fills in the entry
101 # according to the rest of the arguments.
103 # The new entry's property list is initialized to contain ARCH, any
104 # properties specified by PROPS, and the properties associated with
105 # the entry specified by EXTENDS. (The new architecture is considered
106 # to extend the capabilities provided by that architecture.)
108 # If DEFAULT_FOR_TARGETS is specified, it is a list of targets for which
109 # this architecture is the default architecture. If "istarget" returns
110 # true for any of the targets in the list, a "default" entry will be
111 # added to the architecture array which indicates that ARCH is the default
113 proc mips_arch_create {arch gprsize extends props as_flags objdump_flags
114 {default_for_targets {}}} {
117 if { [info exists mips_arches($arch)] } {
118 error "mips_arch_create: arch \"$arch\" already exists"
120 if { $gprsize != 32 && $gprsize != 64 } {
121 error "mips_arch_create: invalid GPR size $gprsize"
124 set archdata(displayname) $arch
125 set archdata(gprsize) $gprsize
126 set archdata(as_flags) $as_flags
127 set archdata(objdump_flags) $objdump_flags
128 set archdata(props) $arch
129 eval lappend archdata(props) $props
130 if { [string length $extends] != 0 } {
131 eval lappend archdata(props) [mips_arch_properties $extends 0]
134 set mips_arches($arch) [array get archdata]
136 # Set as default if appropriate.
137 foreach target $default_for_targets {
138 if { [istarget $target] } {
139 if { [info exists mips_arches(default)] } {
140 error "mips_arch_create: default arch already exists"
143 set archdata(displayname) "default = $arch"
144 set archdata(as_flags) ""
145 set archdata(objdump_flags) ""
147 set mips_arches(default) [array get archdata]
153 # mips_arch_destroy ARCH
155 # The opposite of the above. This function removes an entry from
156 # the architecture data array, for the architecture or CPU named ARCH.
158 proc mips_arch_destroy {arch} {
161 if { [info exists mips_arches($arch)] } {
162 unset mips_arches($arch)
168 # This function returns the list of all names of entries in the
169 # architecture data array (including the default entry, if a default
171 proc mips_arch_list_all {} {
173 return [lsort -dictionary [array names mips_arches]]
176 # mips_arch_data ARCH
178 # This function returns the information associated with ARCH
179 # in the architecture data array, in "array get" form.
180 proc mips_arch_data {arch} {
183 if { ! [info exists mips_arches($arch)] } {
184 error "mips_arch_data: unknown arch \"$arch\""
186 return $mips_arches($arch)
189 # mips_arch_displayname ARCH
191 # This function returns the printable name associated with ARCH in
192 # the architecture data array.
193 proc mips_arch_displayname {arch} {
194 array set archdata [mips_arch_data $arch]
195 return $archdata(displayname)
198 # mips_arch_properties ARCH (optional:) INCLUDE_GPRSIZE
200 # This function returns the property list associated with ARCH in the
201 # architecture data array, including the "canonical" target name as the
204 # If INCLUDE_GPRSIZE is non-zero, an additional "gpr32" or "gpr64"
205 # property will be returned as part of the list based on the
206 # architecture's GPR size.
207 proc mips_arch_properties {arch {include_gprsize 1}} {
208 array set archdata [mips_arch_data $arch]
209 set props $archdata(props)
210 if { $include_gprsize } {
211 lappend props gpr$archdata(gprsize)
216 # mips_arch_as_flags ARCH
218 # This function returns the assembler flags associated with ARCH in
219 # the architecture data array.
220 proc mips_arch_as_flags {arch} {
221 array set archdata [mips_arch_data $arch]
222 return $archdata(as_flags)
225 # mips_arch_objdump_flags ARCH
227 # This function returns the objdump disassembly flags associated with
228 # ARCH in the architecture data array.
229 proc mips_arch_objdump_flags {arch} {
230 array set archdata [mips_arch_data $arch]
231 return $archdata(objdump_flags)
234 # mips_arch_matches ARCH PROPMATCHLIST
236 # This function returns non-zero if ARCH matches the set of properties
237 # described by PROPMATCHLIST. Each entry in PROPMATCHLIST can either
238 # be the name of a property which must be matched, or "!" followed by
239 # the name of a property which must not be matched. ARCH matches
240 # PROPMATCHLIST if and only if all of the conditions specified by
241 # PROPMATCHLIST are satisfied.
242 proc mips_arch_matches {arch propmatchlist} {
243 foreach pm $propmatchlist {
244 if { [string match {!*} $pm] } {
247 set p [string range $pm 1 end]
249 # fail if not present.
254 set loc [lsearch -exact [mips_arch_properties $arch] $p]
256 # required-absent and found, or required-present and not found: fail.
257 if { ($inverted && $loc != -1) || (! $inverted && $loc == -1) } {
264 # mips_arch_list_matching ARGS
266 # This function returns a list of all architectures which match
267 # the conditions described by its arguments. Its arguments are
268 # taken as a list and used as the PROPMATCHLIST in a call to
269 # "mips_arch_matches" for each known architecture.
270 proc mips_arch_list_matching {args} {
272 foreach arch [mips_arch_list_all] {
273 # For now, don't match default arch until we know what its
274 # properties actually are.
275 if { [string compare $arch default] == 0
276 && [string length [mips_arch_properties default]] == 0} {
279 if { [mips_arch_matches $arch $args] } {
287 # The functions below facilitate running various types of tests.
289 # run_dump_test_arch NAME OPTS ARCH
291 # Invoke "run_dump_test" for test NAME with additional assembler options OPTS.
292 # Add the assembler and disassembler flags that are associated with
295 # You can override the expected output for particular architectures
296 # and file formats. The possible test names are, in order of preference:
298 # 1. CARCH@FORMAT@NAME.d
303 # where CARCH is the "canonical" name of architecture ARCH as recorded
304 # in its associated property list, and where FORMAT is the target's
305 # file format (one of "elf", "ecoff" or "aout").
306 proc run_dump_test_arch { name opts arch } {
307 upvar elf elf ecoff ecoff aout aout
310 set format [expr { $elf ? "elf" : $ecoff ? "ecoff" : "aout" }]
311 set proparch [lindex [mips_arch_properties $arch 0] 0]
312 set prefixes [list ${proparch}@${format}@ ${proparch}@ ]
313 if { [ string match "octeon*" $proparch ] && $proparch != "octeon" } {
314 lappend prefixes octeon@
315 lappend prefixes octeon@${format}@
317 lappend prefixes ${format}@
318 foreach prefix ${prefixes} {
319 set archname ${prefix}${name}
320 if { [file exists "$srcdir/$subdir/${archname}.d"] } {
326 if [catch {run_dump_test $name \
327 "{name {([concat $opts [mips_arch_displayname $arch]])}}
328 {objdump {[mips_arch_objdump_flags $arch]}}
329 {as {[concat $opts [mips_arch_as_flags $arch]]}}"} rv] {
331 untested "$subdir/$name ($arch)"
335 # run_dump_test_arches NAME [OPTS] ARCH_LIST
337 # Invoke "run_dump_test_arch" for test NAME, for each architecture
338 # listed in ARCH_LIST. OPTS, if specified, is a list of additional
339 # assembler options that should be used for all architectures.
340 proc run_dump_test_arches { name args } {
341 upvar elf elf ecoff ecoff aout aout
343 if { [llength $args] > 1 } {
344 set opts [lindex $args 0]
345 set args [lrange $args 1 end]
347 set arch_list [lindex $args 0]
348 foreach arch $arch_list {
349 run_dump_test_arch $name $opts $arch
353 # run_list_test_arch NAME OPTS ARCH
355 # Invoke "run_list_test" for test NAME with additional assembler options OPTS.
356 # Add the assembler flags that are associated with architecture ARCH.
357 proc run_list_test_arch { name opts arch } {
360 set testname "MIPS $name ([concat $opts [mips_arch_displayname $arch]])"
361 if [catch {run_list_test \
363 [concat $opts [mips_arch_as_flags $arch]] \
370 # run_list_test_arches NAME [OPTS] ARCH_LIST
372 # Invoke "run_list_test_arch" for test NAME, for each architecture listed
373 # in ARCH_LIST. OPTS, if specified, is a list of additional assembler
374 # options that should be used for all architectures.
375 proc run_list_test_arches { name args } {
377 if { [llength $args] > 1 } {
378 set opts [lindex $args 0]
379 set args [lrange $args 1 end]
381 set arch_list [lindex $args 0]
382 foreach arch $arch_list {
383 run_list_test_arch "$name" "$opts" "$arch"
388 # Create the architecture data array by providing data for all
389 # known architectures.
391 # Note that several targets pick default CPU based on ABI. We
392 # can't easily handle that; do NOT list those targets as defaulting
393 # to any architecture.
395 mips_arch_create mips1 32 {} {} \
396 { -march=mips1 -mtune=mips1 } { -mmips:3000 }
397 mips_arch_create mips2 32 mips1 { gpr_ilocks } \
398 { -march=mips2 -mtune=mips2 } { -mmips:6000 }
399 mips_arch_create mips3 64 mips2 { fpisa3 } \
400 { -march=mips3 -mtune=mips3 } { -mmips:4000 }
401 mips_arch_create mips4 64 mips3 { fpisa4 } \
402 { -march=mips4 -mtune=mips4 } { -mmips:8000 }
403 mips_arch_create mips5 64 mips4 { fpisa5 } \
404 { -march=mips5 -mtune=mips5 } { -mmips:mips5 }
405 mips_arch_create mips32 32 mips2 {} \
406 { -march=mips32 -mtune=mips32 } { -mmips:isa32 } \
407 { mipsisa32-*-* mipsisa32el-*-* }
408 mips_arch_create mips32r2 32 mips32 { fpisa3 fpisa4 fpisa5 ror } \
409 { -march=mips32r2 -mtune=mips32r2 } \
411 { mipsisa32r2-*-* mipsisa32r2el-*-* }
412 mips_arch_create mips64 64 mips5 { mips32 } \
413 { -march=mips64 -mtune=mips64 } { -mmips:isa64 } \
414 { mipsisa64-*-* mipsisa64el-*-* }
415 mips_arch_create mips64r2 64 mips64 { mips32r2 ror } \
416 { -march=mips64r2 -mtune=mips64r2 } \
418 { mipsisa64r2-*-* mipsisa64r2el-*-* }
419 mips_arch_create mips16 32 {} {} \
420 { -march=mips1 -mips16 } { -mmips:16 }
421 mips_arch_create micromips 64 mips64r2 {} \
422 { -march=mips64 -mmicromips } {}
423 mips_arch_create r3000 32 mips1 {} \
424 { -march=r3000 -mtune=r3000 } { -mmips:3000 }
425 mips_arch_create r3900 32 mips1 { gpr_ilocks } \
426 { -march=r3900 -mtune=r3900 } { -mmips:3900 } \
427 { mipstx39-*-* mipstx39el-*-* }
428 mips_arch_create r4000 64 mips3 {} \
429 { -march=r4000 -mtune=r4000 } { -mmips:4000 }
430 mips_arch_create vr5400 64 mips4 { ror } \
431 { -march=vr5400 -mtune=vr5400 } { -mmips:5400 }
432 mips_arch_create sb1 64 mips64 { mips3d } \
433 { -march=sb1 -mtune=sb1 } { -mmips:sb1 } \
434 { mipsisa64sb1-*-* mipsisa64sb1el-*-* }
435 mips_arch_create octeon 64 mips64r2 {} \
436 { -march=octeon -mtune=octeon } { -mmips:octeon } \
437 { mips64octeon*-*-* }
438 mips_arch_create octeonp 64 octeon {} \
439 { -march=octeon+ -mtune=octeon+ } { -mmips:octeon+ } \
441 mips_arch_create xlr 64 mips64 {} \
442 { -march=xlr -mtune=xlr } { -mmips:xlr }
445 # And now begin the actual tests! VxWorks uses RELA rather than REL
446 # relocations, so most of the generic dump tests will not work there.
448 if { [istarget mips*-*-vxworks*] } {
449 run_dump_test "vxworks1"
450 run_dump_test "vxworks1-xgot"
451 run_dump_test "vxworks1-el"
452 run_dump_test "vxworks1-xgot-el"
453 } elseif { [istarget mips*-*-*] } {
454 set elf [expr [istarget *-*-elf*] || [istarget *-*-irix5*] || [istarget *-*-irix6* ] || [istarget *-*-linux*] || [istarget *-*-netbsd*] ]
455 set ecoff [expr [istarget *-*-ecoff*] || [istarget *-*-ultrix*] || [istarget *-*-irix\[1-4\]*] ]
456 set aout [expr [istarget *-*-bsd*] || [istarget *-*-openbsd*] ]
457 set addr32 [expr [istarget mipstx39*-*-*] || [istarget mips-*-linux*] || [istarget mipsel-*-linux*] || [istarget mips*-*-ecoff]]
458 set has_newabi [expr [istarget *-*-irix6*] || [istarget mips64*-*-linux*]]
459 set no_mips16 [expr !$elf]
460 set no_micromips [expr !$elf]
462 if { [istarget "mips*-*-*linux*"] || [istarget "mips*-sde-elf*"] } then {
467 if [istarget mips*el-*-*] {
473 mips_arch_destroy mips16
475 if { $no_micromips } {
476 mips_arch_destroy micromips
479 run_dump_test_arches "abs" [mips_arch_list_matching mips1]
480 run_dump_test_arches "add" [mips_arch_list_matching mips1]
481 run_dump_test_arches "and" [mips_arch_list_matching mips1]
482 run_dump_test_arches "mips1-fp" [mips_arch_list_matching mips1]
483 run_list_test_arches "mips1-fp" "-32 -msoft-float" \
484 [mips_arch_list_matching mips1]
485 run_dump_test "break20"
486 run_dump_test "trap20"
488 # LOSE: As of 2002-02-08, "beq" through "bltu" fail for target mips-ecoff.
489 # See http://sources.redhat.com/ml/binutils/2001-10/msg00418.html for
490 # more information. Not sure if the fixes there are correct; should
491 # branches to external labels be allowed for ECOFF?
492 run_dump_test_arches "beq" [mips_arch_list_matching mips1]
493 run_dump_test_arches "bge" [mips_arch_list_matching mips1]
494 run_dump_test_arches "bgeu" [mips_arch_list_matching mips1]
495 run_dump_test_arches "blt" [mips_arch_list_matching mips1]
496 run_dump_test_arches "bltu" [mips_arch_list_matching mips1]
497 run_dump_test_arches "branch-likely" [mips_arch_list_matching mips2]
498 run_dump_test_arches "branch-misc-1" [mips_arch_list_matching mips1]
499 run_dump_test_arches "branch-misc-2" [mips_arch_list_matching mips1]
500 run_dump_test_arches "branch-misc-2pic" [mips_arch_list_matching mips1]
501 run_dump_test_arches "branch-misc-2-64" [mips_arch_list_matching mips3]
502 run_dump_test_arches "branch-misc-2pic-64" [mips_arch_list_matching mips3]
503 run_dump_test "branch-misc-3"
504 run_dump_test "branch-swap"
508 run_dump_test_arches "dli" [mips_arch_list_matching mips3]
511 run_dump_test_arches "elf-jal" [mips_arch_list_matching mips1]
515 run_dump_test_arches "jal-mask-11" [mips_arch_list_matching mips1]
516 run_dump_test_arches "jal-mask-12" [mips_arch_list_matching mips1]
517 run_dump_test_arches "jal-mask-21" [mips_arch_list_matching micromips]
518 run_dump_test_arches "jal-mask-22" [mips_arch_list_matching micromips]
519 run_dump_test "eret-1"
520 run_dump_test "eret-2"
521 run_dump_test "eret-3"
522 run_dump_test_arches "24k-branch-delay-1" \
523 [mips_arch_list_matching mips1]
524 run_dump_test_arches "24k-triple-stores-1" \
525 [mips_arch_list_matching fpisa5 !octeon]
526 run_dump_test_arches "24k-triple-stores-2" \
527 [mips_arch_list_matching mips2]
528 run_dump_test_arches "24k-triple-stores-3" \
529 [mips_arch_list_matching mips2]
530 run_dump_test_arches "24k-triple-stores-4" \
531 [mips_arch_list_matching mips2]
532 run_dump_test_arches "24k-triple-stores-5" \
533 [mips_arch_list_matching mips1]
534 run_dump_test_arches "24k-triple-stores-6" \
535 [mips_arch_list_matching mips2]
536 run_dump_test_arches "24k-triple-stores-7" \
537 [mips_arch_list_matching mips2]
538 run_dump_test_arches "24k-triple-stores-8" \
539 [mips_arch_list_matching mips1]
540 run_dump_test_arches "24k-triple-stores-9" \
541 [mips_arch_list_matching mips1]
542 run_dump_test_arches "24k-triple-stores-10" \
543 [mips_arch_list_matching mips1]
545 run_dump_test_arches "24k-triple-stores-11" \
546 [mips_arch_list_matching mips1]
550 run_dump_test_arches "jal-svr4pic" \
551 [mips_arch_list_matching mips1]
552 run_dump_test_arches "jal-svr4pic-noreorder" \
553 [mips_arch_list_matching mips1]
555 if $elf { run_dump_test "jal-xgot" }
556 run_list_test_arches "jal-range" "-32" [mips_arch_list_matching mips1]
557 if $has_newabi { run_dump_test "jal-newabi" }
558 if !$aout { run_dump_test "la" }
559 if $elf { run_dump_test "la-svr4pic" }
560 if $elf { run_dump_test "la-xgot" }
561 if $elf { run_dump_test "lca-svr4pic" }
562 if $elf { run_dump_test "lca-xgot" }
564 # XXX FIXME: Has mips2 and later insns with mips1 disassemblies.
565 # (Should split and then use appropriate arch lists.)
566 run_dump_test_arches "lb" [mips_arch_list_matching mips1 !mips2]
569 run_dump_test_arches "lb-svr4pic" \
570 [mips_arch_list_matching mips1 !gpr_ilocks]
571 run_dump_test_arches "lb-svr4pic-ilocks" [mips_arch_list_matching gpr_ilocks]
574 # Both versions specify the cpu, so we can run both regardless of
575 # the interlocking in the configured default cpu.
576 run_dump_test "lb-xgot"
577 run_dump_test "lb-xgot-ilocks"
580 run_dump_test_arches "ld" [mips_arch_list_matching mips1]
581 run_dump_test_arches "ld-forward" \
582 [mips_arch_list_matching mips1]
583 run_dump_test_arches "sd" [mips_arch_list_matching mips1]
584 run_dump_test_arches "sd-forward" \
585 [mips_arch_list_matching mips1]
586 run_dump_test_arches "l_d" [mips_arch_list_matching mips1]
587 run_dump_test_arches "l_d-forward" \
588 [mips_arch_list_matching mips1]
589 run_dump_test_arches "s_d" [mips_arch_list_matching mips1]
590 run_dump_test_arches "s_d-forward" \
591 [mips_arch_list_matching mips1]
592 run_dump_test_arches "ldc1" [mips_arch_list_matching mips2]
593 run_dump_test_arches "ldc1-forward" \
594 [mips_arch_list_matching mips2]
595 run_dump_test_arches "sdc1" [mips_arch_list_matching mips2]
596 run_dump_test_arches "sdc1-forward" \
597 [mips_arch_list_matching mips2]
599 run_dump_test_arches "ld-n32" \
600 [mips_arch_list_matching mips3]
601 run_dump_test_arches "ld-forward-n32" \
602 [mips_arch_list_matching mips3]
603 run_dump_test_arches "sd-n32" \
604 [mips_arch_list_matching mips3]
605 run_dump_test_arches "sd-forward-n32" \
606 [mips_arch_list_matching mips3]
607 run_dump_test_arches "l_d-n32" \
608 [mips_arch_list_matching mips3]
609 run_dump_test_arches "l_d-forward-n32" \
610 [mips_arch_list_matching mips3]
611 run_dump_test_arches "s_d-n32" \
612 [mips_arch_list_matching mips3]
613 run_dump_test_arches "s_d-forward-n32" \
614 [mips_arch_list_matching mips3]
615 run_dump_test_arches "ldc1-n32" \
616 [mips_arch_list_matching mips3]
617 run_dump_test_arches "ldc1-forward-n32" \
618 [mips_arch_list_matching mips3]
619 run_dump_test_arches "sdc1-n32" \
620 [mips_arch_list_matching mips3]
621 run_dump_test_arches "sdc1-forward-n32" \
622 [mips_arch_list_matching mips3]
623 run_dump_test_arches "ld-n64" \
624 [mips_arch_list_matching mips3]
625 run_dump_test_arches "ld-forward-n64" \
626 [mips_arch_list_matching mips3]
627 run_dump_test_arches "sd-n64" \
628 [mips_arch_list_matching mips3]
629 run_dump_test_arches "sd-forward-n64" \
630 [mips_arch_list_matching mips3]
631 run_dump_test_arches "l_d-n64" \
632 [mips_arch_list_matching mips3]
633 run_dump_test_arches "l_d-forward-n64" \
634 [mips_arch_list_matching mips3]
635 run_dump_test_arches "s_d-n64" \
636 [mips_arch_list_matching mips3]
637 run_dump_test_arches "s_d-forward-n64" \
638 [mips_arch_list_matching mips3]
639 run_dump_test_arches "ldc1-n64" \
640 [mips_arch_list_matching mips3]
641 run_dump_test_arches "ldc1-forward-n64" \
642 [mips_arch_list_matching mips3]
643 run_dump_test_arches "sdc1-n64" \
644 [mips_arch_list_matching mips3]
645 run_dump_test_arches "sdc1-forward-n64" \
646 [mips_arch_list_matching mips3]
649 if $elf { run_dump_test "ld-svr4pic" }
650 if $elf { run_dump_test "ld-xgot" }
651 run_dump_test_arches "li" [mips_arch_list_matching mips1]
652 if !$aout { run_dump_test "lifloat" }
653 if $elf { run_dump_test "lif-svr4pic" }
654 if $elf { run_dump_test "lif-xgot" }
655 run_dump_test_arches "mips4" [mips_arch_list_matching mips4]
656 run_dump_test_arches "mips4-fp" "-32" \
657 [mips_arch_list_matching fpisa4]
658 run_dump_test_arches "mips4-fp" "-mabi=o64" \
659 [mips_arch_list_matching fpisa4 gpr64]
660 run_list_test_arches "mips4-fp" "-32 -msoft-float" \
661 [mips_arch_list_matching fpisa4]
662 run_dump_test_arches "mips4-branch-likely" \
663 [mips_arch_list_matching mips4]
664 run_list_test_arches "mips4-branch-likely" "-32 -msoft-float" \
665 [mips_arch_list_matching mips4]
666 run_dump_test_arches "mips5-fp" "-32" \
667 [mips_arch_list_matching fpisa5]
668 run_dump_test_arches "mips5-fp" "-mabi=o64" \
669 [mips_arch_list_matching fpisa5 gpr64]
672 run_dump_test_arches "rol" [mips_arch_list_matching mips1 !ror]
673 run_dump_test_arches "rol-hw" [mips_arch_list_matching ror]
675 run_dump_test_arches "rol64" [mips_arch_list_matching gpr64 !ror]
676 run_dump_test_arches "rol64-hw" [mips_arch_list_matching gpr64 ror]
678 if !$aout { run_dump_test "sb" }
679 run_dump_test "trunc"
680 if !$aout { run_dump_test "ulh" }
681 run_dump_test_arches "ulh2-eb" [mips_arch_list_matching mips1]
682 run_dump_test_arches "ulh2-el" [mips_arch_list_matching mips1]
683 if $elf { run_dump_test "ulh-svr4pic" }
684 if $elf { run_dump_test "ulh-xgot" }
692 run_dump_test_arches "ulw2-eb" \
693 [mips_arch_list_matching mips1 !gpr_ilocks]
694 run_dump_test_arches "ulw2-eb-ilocks" [mips_arch_list_matching gpr_ilocks]
695 run_dump_test_arches "ulw2-el" \
696 [mips_arch_list_matching mips1 !gpr_ilocks]
697 run_dump_test_arches "ulw2-el-ilocks" [mips_arch_list_matching gpr_ilocks]
699 run_dump_test_arches "uld2-eb" [mips_arch_list_matching mips3]
700 run_dump_test_arches "uld2-el" [mips_arch_list_matching mips3]
702 # The mips16 test can only be run on ELF, because only ELF
703 # supports the necessary mips16 reloc.
704 if { $elf && !$no_mips16 } {
705 run_dump_test "mips16"
706 run_dump_test "mips16-64"
707 # Check MIPS16e extensions
708 run_dump_test_arches "mips16e" \
709 [mips_arch_list_matching mips32 !micromips]
710 # Check jalx handling
711 run_dump_test "mips16-jalx"
712 run_dump_test "mips-jalx"
713 run_dump_test "mips-jalx-2"
714 # Check MIPS16 HI16/LO16 relocations
715 run_dump_test "mips16-hilo"
717 run_dump_test "mips16-hilo-n32"
719 run_dump_test "mips16-hilo-match"
721 run_dump_test "delay"
722 run_dump_test "nodelay"
723 run_dump_test "mips4010"
724 run_dump_test "mips4650"
725 run_dump_test "mips4100"
726 run_dump_test "vr4111"
727 run_dump_test "vr4120"
728 run_dump_test "vr4120-2"
729 run_dump_test "vr4130"
730 run_dump_test "vr5400"
731 run_dump_test "vr5500"
732 run_dump_test "rm7000"
733 run_dump_test "perfcount"
734 run_dump_test "lineno"
737 run_dump_test_arches "mips32" [mips_arch_list_matching mips32]
738 run_dump_test_arches "mips32-imm" [mips_arch_list_matching mips32]
740 run_dump_test_arches "mips32-sf32" [mips_arch_list_matching mips32]
741 run_list_test_arches "mips32-sf32" "-32 -msoft-float" \
742 [mips_arch_list_matching mips32]
743 run_dump_test_arches "mips32-cp2" [mips_arch_list_matching mips32 \
746 run_dump_test_arches "mips32r2" [mips_arch_list_matching mips32r2]
747 run_dump_test_arches "mips32r2-cp2" [mips_arch_list_matching mips32r2 \
749 run_dump_test_arches "mips32r2-fp32" \
750 [mips_arch_list_matching mips32r2]
751 run_list_test_arches "mips32r2-fp32" "-32 -msoft-float" \
752 [mips_arch_list_matching mips32r2]
753 run_list_test_arches "mips32r2-ill" "-32" \
754 [mips_arch_list_matching mips32r2 gpr32]
755 run_list_test_arches "mips32r2-ill-fp64" "-mabi=o64" \
756 [mips_arch_list_matching mips32r2 gpr64]
757 run_list_test_arches "mips32r2-ill-nofp" "-32 -msoft-float" \
758 [mips_arch_list_matching mips32r2]
760 run_dump_test_arches "mips64" [mips_arch_list_matching mips64]
761 run_dump_test_arches "mips64-cp2" [mips_arch_list_matching mips64 \
764 run_dump_test_arches "mips64r2" [mips_arch_list_matching mips64r2]
765 run_list_test_arches "mips64r2-ill" [mips_arch_list_matching mips64r2]
767 run_dump_test "set-arch"
770 run_dump_test "mips64-mips3d"
771 run_dump_test_arches "mips64-mips3d-incl" [mips_arch_list_matching mips3d]
773 run_dump_test "mips64-mdmx"
774 run_dump_test "sb1-ext-mdmx"
775 run_dump_test "sb1-ext-ps"
776 run_dump_test "xlr-ext"
779 run_dump_test_arches "relax" [mips_arch_list_matching mips2]
780 run_dump_test_arches "relax-at" [mips_arch_list_matching mips2]
781 run_dump_test "relax-swap1-mips1"
782 run_dump_test "relax-swap1-mips2"
783 run_dump_test "relax-swap2"
784 run_dump_test_arches "relax-swap3" [mips_arch_list_all]
785 run_list_test_arches "relax-bposge" "-mdsp -relax-branch" \
786 [mips_arch_list_matching mips64r2 \
789 run_list_test "illegal" "-32"
790 run_list_test "baddata1" "-32"
791 run_list_test "jalr" ""
793 # LOSE: As of 2002-02-08, the next 4 tests fail for target mips-ecoff.
794 # It's unknown whether they _should_ pass as-is, or whether different
795 # variants are needed for ELF and ECOFF.
796 run_dump_test "mips-gp32-fp32"
797 run_dump_test "mips-gp32-fp64"
798 run_dump_test "mips-gp64-fp32"
799 run_dump_test "mips-gp64-fp64"
802 # Make sure that -mcpu=FOO and -mFOO are equivalent. Assemble a file
803 # containing 4650-specific instructions with -m4650 and -mcpu=4650,
804 # and verify that they're the same. Specifically, we're checking
805 # that the EF_MIPS_MACH field is set, and that the 4650 'mul'
806 # instruction does get used. In previous versions of GAS,
807 # only -mcpu=4650 would set the EF_MIPS_MACH field; -m4650 wouldn't.
808 run_dump_test "elf_e_flags1"
809 run_dump_test "elf_e_flags2"
810 run_dump_test "elf_e_flags3"
811 run_dump_test "elf_e_flags4"
813 # Check EF_MIPS_ARCH markings for each supported architecture.
814 run_dump_test "elf_arch_mips1"
815 run_dump_test "elf_arch_mips2"
816 run_dump_test "elf_arch_mips3"
817 run_dump_test "elf_arch_mips4"
818 run_dump_test "elf_arch_mips5"
819 run_dump_test "elf_arch_mips32"
820 run_dump_test "elf_arch_mips32r2"
821 run_dump_test "elf_arch_mips64"
822 run_dump_test "elf_arch_mips64r2"
824 # Verify that ASE markings are handled properly.
826 run_dump_test "elf_ase_mips16"
827 run_dump_test "elf_ase_mips16-2"
829 if { !$no_micromips } {
830 run_dump_test "elf_ase_micromips"
831 run_dump_test "elf_ase_micromips-2"
834 run_dump_test "mips-gp32-fp32-pic"
835 run_dump_test "mips-gp32-fp64-pic"
836 run_dump_test "mips-gp64-fp32-pic"
837 run_dump_test "mips-gp64-fp64-pic"
839 run_dump_test "mips-abi32"
840 run_dump_test "mips-abi32-pic"
841 run_dump_test "mips-abi32-pic2"
843 run_dump_test "elf${el}-rel"
844 run_dump_test_arches "elf${el}-rel2" [mips_arch_list_matching gpr64]
845 run_dump_test "e32${el}-rel2"
846 run_dump_test "elf${el}-rel3"
847 run_dump_test_arches "elf-rel4" [mips_arch_list_matching gpr64]
848 run_dump_test "e32-rel4"
849 run_dump_test "elf-rel5"
850 run_dump_test "elf-rel6"
852 run_dump_test "elf-rel6-n32"
853 run_dump_test "elf-rel6-n64"
855 run_dump_test "elf-rel7"
856 run_dump_test "elf-rel8"
857 run_dump_test "elf-rel8-mips16"
858 run_dump_test "elf-rel9"
859 run_dump_test "elf-rel9-mips16"
861 run_dump_test "elf-rel10"
862 run_dump_test "elf-rel11"
864 run_dump_test "elf-rel12"
865 run_dump_test "elf-rel13"
866 run_dump_test "elf-rel13-mips16"
867 run_dump_test "elf-rel14"
870 run_dump_test "elf-rel15"
871 run_dump_test "elf-rel16"
873 run_dump_test "elf-rel-got-n32"
874 run_dump_test "elf-rel-xgot-n32"
875 run_dump_test "elf-rel-got-n64"
876 run_dump_test "elf-rel-xgot-n64"
878 run_dump_test "elf-rel17"
880 run_dump_test "elf-rel18"
882 run_dump_test "elf-rel19"
883 run_dump_test "elf-rel20"
885 run_dump_test "elf-rel21"
886 run_dump_test "elf-rel22"
887 run_dump_test "elf-rel23"
888 run_dump_test "elf-rel23a"
889 run_dump_test "elf-rel23b"
890 run_dump_test "elf-rel24"
893 run_dump_test "elf-rel25"
894 run_dump_test "elf-rel25a"
895 run_dump_test "elf-rel26"
897 run_dump_test_arches "elf-rel27" [mips_arch_list_all]
900 run_dump_test "elf-rel28-n32"
901 run_dump_test "elf-rel28-n64"
905 run_dump_test "${tmips}mips${el}16-e"
906 run_dump_test "${tmips}mips${el}16-f"
908 run_dump_test "elf-consthilo"
909 run_dump_test "expr1"
911 run_list_test "tls-ill" "-32"
912 run_dump_test "tls-o32"
913 run_dump_test "jalr2"
915 run_dump_test_arches "aent" [mips_arch_list_matching mips1]
917 run_dump_test_arches "branch-misc-4" \
918 [mips_arch_list_matching mips1]
919 run_dump_test_arches "branch-misc-4-64" \
920 [mips_arch_list_matching mips3]
922 run_dump_test_arches "loc-swap" [mips_arch_list_all]
923 run_dump_test_arches "loc-swap-dis" \
925 run_dump_test_arches "loc-swap-2" [mips_arch_list_all]
929 run_dump_test "n32-consec"
932 # tests of objdump's ability to disassemble using different
934 run_dump_test "gpr-names-numeric"
935 run_dump_test "gpr-names-32"
936 run_dump_test "gpr-names-n32"
937 run_dump_test "gpr-names-64"
939 run_dump_test "fpr-names-numeric"
940 run_dump_test "fpr-names-32"
941 run_dump_test "fpr-names-n32"
942 run_dump_test "fpr-names-64"
944 run_dump_test "cp0-names-numeric"
945 run_dump_test "cp0-names-r3000"
946 run_dump_test "cp0-names-r4000" \
947 { { {name} {(r4000)} } { {objdump} {-M cp0-names=r4000} } }
948 run_dump_test "cp0-names-r4000" \
949 { { {name} {(r4400)} } { {objdump} {-M cp0-names=r4400} } }
950 run_dump_test "cp0-names-mips32"
951 run_dump_test "cp0-names-mips32r2"
952 run_dump_test "cp0-names-mips64"
953 run_dump_test "cp0-names-mips64r2"
954 run_dump_test "cp0-names-sb1"
956 run_dump_test "cp0sel-names-numeric"
957 run_dump_test "cp0sel-names-mips32"
958 run_dump_test "cp0sel-names-mips32r2"
959 run_dump_test "cp0sel-names-mips64"
960 run_dump_test "cp0sel-names-mips64r2"
961 run_dump_test "cp0sel-names-sb1"
963 run_dump_test "hwr-names-numeric"
964 run_dump_test "hwr-names-mips32r2"
965 run_dump_test "hwr-names-mips64r2"
967 run_dump_test "ldstla-32"
968 run_dump_test "ldstla-32-mips3"
969 run_dump_test "ldstla-32-shared"
970 run_dump_test "ldstla-32-mips3-shared"
971 run_list_test "ldstla-32-1" "-mabi=32" \
972 "MIPS ld-st-la bad constants (ABI o32)"
973 run_list_test "ldstla-32-mips3-1" "-mabi=32" \
974 "MIPS ld-st-la bad constants (ABI o32, mips3)"
975 run_list_test "ldstla-32-1" "-KPIC -mabi=32" \
976 "MIPS ld-st-la bad constants (ABI o32, shared)"
977 run_list_test "ldstla-32-mips3-1" "-KPIC -mabi=32" \
978 "MIPS ld-st-la bad constants (ABI o32, mips3, shared)"
979 run_dump_test "ldstla-eabi64"
981 run_dump_test "ldstla-n64"
982 run_dump_test "ldstla-n64-shared"
983 run_dump_test "ldstla-n64-sym32"
986 run_dump_test "macro-warn-1"
987 run_dump_test "macro-warn-2"
988 run_dump_test "macro-warn-3"
989 run_dump_test "macro-warn-4"
991 run_dump_test "macro-warn-1-n32"
992 run_dump_test "macro-warn-2-n32"
995 run_dump_test "noat-1"
996 run_list_test "noat-2" ""
997 run_list_test "noat-3" ""
998 run_list_test "noat-4" ""
999 run_list_test "noat-5" ""
1000 run_list_test "noat-6" ""
1001 run_list_test "noat-7" ""
1003 run_dump_test "at-1"
1004 run_list_test "at-2" "-32 -mips1" "MIPS at-2"
1006 run_dump_test "loongson-2e"
1007 run_dump_test "loongson-2f"
1008 run_dump_test "loongson-2f-2"
1009 run_dump_test "loongson-2f-3"
1011 run_dump_test "loongson-3a"
1012 run_dump_test "loongson-3a-2"
1013 run_dump_test "loongson-3a-3"
1015 run_dump_test_arches "octeon" [mips_arch_list_matching octeon]
1016 run_dump_test_arches "octeon-saa-saad" [mips_arch_list_matching octeonp]
1017 run_list_test_arches "octeon-ill" [mips_arch_list_matching octeon]
1018 run_dump_test_arches "octeon-pref" [mips_arch_list_matching octeon]
1020 run_dump_test "smartmips"
1021 run_dump_test "mips32-dsp"
1022 run_dump_test "mips32-dspr2"
1023 run_dump_test "mips64-dsp"
1024 run_dump_test "mips32-mt"
1026 if { $elf && !$no_mips16 } {
1027 run_dump_test "mips16-dwarf2"
1029 run_dump_test "mips16-dwarf2-n32"
1032 if { !$no_mips16 } {
1033 run_dump_test "mips16e-jrc"
1034 run_dump_test "mips16e-save"
1035 run_dump_test "mips16e-64"
1036 run_list_test "mips16e-64" "-march=mips32 -32"
1037 run_dump_test "mips16-intermix"
1039 run_dump_test "vxworks1"
1040 run_dump_test "vxworks1-xgot"
1041 run_dump_test "vxworks1-el"
1042 run_dump_test "vxworks1-xgot-el"
1044 run_dump_test "noreorder"
1045 run_dump_test "align"
1046 run_dump_test "align2"
1047 run_dump_test "align2-el"
1048 run_dump_test "odd-float"
1050 run_list_test_arches "mips-macro-ill-sfp" "-32 -msingle-float" \
1051 [mips_arch_list_matching mips2]
1052 run_list_test_arches "mips-macro-ill-nofp" "-32 -msoft-float" \
1053 [mips_arch_list_matching mips2]
1055 run_list_test_arches "mips-hard-float-flag" \
1056 "-32 -msoft-float -mhard-float" \
1057 [mips_arch_list_matching mips1]
1058 run_list_test_arches "mips-double-float-flag" \
1059 "-32 -msingle-float -mdouble-float" \
1060 [mips_arch_list_matching mips1]
1062 run_dump_test "mips16-vis-1"
1063 run_dump_test "call-nonpic-1"
1064 run_dump_test "mips32-sync"
1065 run_dump_test_arches "mips32r2-sync" \
1066 [mips_arch_list_matching mips32r2]
1067 run_dump_test_arches "alnv_ps-swap" [mips_arch_list_matching fpisa5]
1068 run_dump_test_arches "cache" [lsort -dictionary -unique [concat \
1069 [mips_arch_list_matching mips3] \
1070 [mips_arch_list_matching mips32] ] ]
1071 run_dump_test_arches "daddi" [mips_arch_list_matching mips3]
1072 run_dump_test_arches "pref" [lsort -dictionary -unique [concat \
1073 [mips_arch_list_matching mips4] \
1074 [mips_arch_list_matching mips32] ] ]
1076 if $has_newabi { run_dump_test "cfi-n64-1" }
1078 run_dump_test "pr12915"
1079 run_dump_test "reginfo-1a"
1080 run_dump_test "reginfo-1b"
1082 if { !$no_micromips } {
1083 run_dump_test "micromips"
1084 run_dump_test "micromips-trap"
1085 run_list_test "micromips-size-0" \
1086 "-32 -march=mips64 -mmicromips" "microMIPS instruction size 0"
1087 run_dump_test "micromips-size-1"
1088 run_dump_test "micromips-branch-relax"
1089 run_dump_test "micromips-branch-relax-pic"
1090 run_dump_test "micromips-branch-delay"
1093 run_dump_test_arches "mcu" [mips_arch_list_matching mips32r2 \