]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - gas/testsuite/gas/mips/mips.exp
* linux-nat.c (linux_child_follow_fork): Call also CHECK_FOR_THREAD_DB.
[thirdparty/binutils-gdb.git] / gas / testsuite / gas / mips / mips.exp
CommitLineData
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#
af22f5b2
CD
58# gpr_ilocks
59# The architecture interlocks GPRs accesses. (That is,
60# there are no load delay slots.)
61#
5915a74a
CD
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
4d8728e1
CD
81# mips_arch_init
82#
83# This function initializes the architecture data array ("mips_arches")
84# to be empty.
85proc mips_arch_init {} {
86 global mips_arches
74cb52a6
CD
87
88 # Catch becuase the variable won't be set the first time through.
89 catch {unset mips_arches}
4d8728e1
CD
90}
91
5915a74a
CD
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.
109proc 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_list_all
150#
151# This function returns the list of all names of entries in the
152# architecture data array (including the default entry, if a default
153# is known).
154proc mips_arch_list_all {} {
155 global mips_arches
156 return [lsort -dictionary [array names mips_arches]]
157}
158
159# mips_arch_data ARCH
160#
161# This function returns the information associated with ARCH
162# in the architecture data array, in "array get" form.
163proc mips_arch_data {arch} {
164 global mips_arches
165
166 if { ! [info exists mips_arches($arch)] } {
167 error "mips_arch_data: unknown arch \"$arch\""
168 }
169 return $mips_arches($arch)
170}
171
172# mips_arch_displayname ARCH
173#
174# This function returns the printable name associated with ARCH in
175# the architecture data array.
176proc mips_arch_displayname {arch} {
177 array set archdata [mips_arch_data $arch]
178 return $archdata(displayname)
179}
180
181# mips_arch_properties ARCH (optional:) INCLUDE_GPRSIZE
182#
183# This function returns the property list associated with ARCH in the
184# architecture data array. If INCLUDE_GPRSIZE is non-zero, an additional
185# "gpr32" or "gpr64" property will be returned as part of the list based
186# on the architecture's GPR size.
187proc mips_arch_properties {arch {include_gprsize 1}} {
188 array set archdata [mips_arch_data $arch]
189 set props $archdata(props)
190 if { $include_gprsize } {
191 lappend props gpr$archdata(gprsize)
192 }
193 return $props
194}
195
196# mips_arch_as_flags ARCH
197#
198# This function returns the assembler flags associated with ARCH in
199# the architecture data array.
200proc mips_arch_as_flags {arch} {
201 array set archdata [mips_arch_data $arch]
202 return $archdata(as_flags)
203}
204
205# mips_arch_objdump_flags ARCH
206#
207# This function returns the objdump disassembly flags associated with
208# ARCH in the architecture data array.
209proc mips_arch_objdump_flags {arch} {
210 array set archdata [mips_arch_data $arch]
211 return $archdata(objdump_flags)
212}
213
214# mips_arch_matches ARCH PROPMATCHLIST
215#
216# This function returns non-zero if ARCH matches the set of properties
217# described by PROPMATCHLIST. Each entry in PROPMATCHLIST can either
218# be the name of a property which must be matched, or "!" followed by
219# the name of a property which must not be matched. ARCH matches
220# PROPMATCHLIST if and only if all of the conditions specified by
221# PROPMATCHLIST are satisfied.
222proc mips_arch_matches {arch propmatchlist} {
223 foreach pm $propmatchlist {
224 if { [string match {!*} $pm] } {
225 # fail if present.
226 set inverted 1
227 set p [string range $pm 1 end]
228 } {
229 # fail if not present.
230 set inverted 0
231 set p $pm
232 }
233
234 set loc [lsearch -exact [mips_arch_properties $arch] $p]
235
236 # required-absent and found, or required-present and not found: fail.
237 if { ($inverted && $loc != -1) || (! $inverted && $loc == -1) } {
238 return 0
239 }
240 }
241 return 1
242}
243
244# mips_arch_list_matching ARGS
245#
246# This function returns a list of all architectures which match
247# the conditions described by its arguments. Its arguments are
248# taken as a list and used as the PROPMATCHLIST in a call to
249# "mips_arch_matches" for each known architecture.
250proc mips_arch_list_matching {args} {
251 set l ""
252 foreach arch [mips_arch_list_all] {
253 # For now, don't match default arch until we know what its
254 # properties actually are.
255 if { [string compare $arch default] == 0
256 && [string length [mips_arch_properties default]] == 0} {
c0b22597 257 continue
5915a74a
CD
258 }
259 if { [mips_arch_matches $arch $args] } {
260 lappend l $arch
261 }
262 }
263 return $l
264}
265
266
267# The functions below facilitate running various types of tests.
268
269# run_dump_test_arch NAME ARCH
270#
271# Invoke "run_dump_test" for test NAME, with extra assembler and
272# disassembler flags to test architecture ARCH.
273proc run_dump_test_arch { name arch } {
274 global subdir
275
276 if [catch {run_dump_test $name \
277 "{name {([mips_arch_displayname $arch])}}
278 {objdump {[mips_arch_objdump_flags $arch]}}
279 {as {[mips_arch_as_flags $arch]}}"} rv] {
280 perror "$rv"
281 untested "$subdir/$name ($arch)"
282 }
283}
284
285# run_dump_test_arches NAME ARCH_LIST
286#
287# Invoke "run_dump_test_arch" for test NAME, for each architecture
288# listed in ARCH_LIST.
289proc run_dump_test_arches { name arch_list } {
290 foreach arch $arch_list {
291 run_dump_test_arch "$name" "$arch"
292 }
293}
294
5915a74a
CD
295# run_list_test_arch NAME OPTS ARCH
296#
297# Invoke "run_list_test" for test NAME with options OPTS, with extra
298# assembler flags to test architecture ARCH.
299proc run_list_test_arch { name opts arch } {
300 global subdir
301
302 set testname "MIPS $name ([mips_arch_displayname $arch])"
303 if [catch {run_list_test "$name" "$opts [mips_arch_as_flags $arch]" \
304 "$testname"} rv] {
305 perror "$rv"
306 untested "$testname"
307 }
308}
309
310# run_list_test_arches NAME OPTS ARCH_LIST
311#
312# Invoke "run_list_test_arch" for test NAME with options OPTS, for each
313# architecture listed in ARCH_LIST.
314proc run_list_test_arches { name opts arch_list } {
315 foreach arch $arch_list {
316 run_list_test_arch "$name" "$opts" "$arch"
317 }
318}
319
320
321# Create the architecture data array by providing data for all
322# known architectures.
323#
324# Note that several targets pick default CPU based on ABI. We
325# can't easily handle that; do NOT list those targets as defaulting
326# to any architecture.
4d8728e1 327mips_arch_init
5915a74a
CD
328mips_arch_create mips1 32 {} {} \
329 { -march=mips1 -mtune=mips1 } { -mmips:3000 }
af22f5b2 330mips_arch_create mips2 32 mips1 { gpr_ilocks } \
5915a74a
CD
331 { -march=mips2 -mtune=mips2 } { -mmips:6000 }
332mips_arch_create mips3 64 mips2 {} \
333 { -march=mips3 -mtune=mips3 } { -mmips:4000 }
334mips_arch_create mips4 64 mips3 {} \
335 { -march=mips4 -mtune=mips4 } { -mmips:8000 }
336mips_arch_create mips5 64 mips4 {} \
337 { -march=mips5 -mtune=mips5 } { -mmips:mips5 }
338mips_arch_create mips32 32 mips2 {} \
339 { -march=mips32 -mtune=mips32 } { -mmips:isa32 } \
340 { mipsisa32-*-* mipsisa32el-*-* }
af7ee8bf
CD
341mips_arch_create mips32r2 32 mips32 { ror } \
342 { -march=mips32r2 -mtune=mips32r2 } \
343 { -mmips:isa32r2 } \
344 { mipsisa32r2-*-* mipsisa32r2el-*-* }
5915a74a
CD
345mips_arch_create mips64 64 mips5 { mips32 } \
346 { -march=mips64 -mtune=mips64 } { -mmips:isa64 } \
347 { mipsisa64-*-* mipsisa64el-*-* }
5f74bc13
CD
348mips_arch_create mips64r2 64 mips64 { mips32r2 ror } \
349 { -march=mips64r2 -mtune=mips64r2 } \
350 { -mmips:isa64r2 } \
351 { mipsisa64r2-*-* mipsisa64r2el-*-* }
5915a74a
CD
352mips_arch_create r3000 32 mips1 {} \
353 { -march=r3000 -mtune=r3000 } { -mmips:3000 }
af22f5b2 354mips_arch_create r3900 32 mips1 { gpr_ilocks } \
5915a74a
CD
355 { -march=r3900 -mtune=r3900 } { -mmips:3900 } \
356 { mipstx39-*-* mipstx39el-*-* }
357mips_arch_create r4000 64 mips3 {} \
358 { -march=r4000 -mtune=r4000 } { -mmips:4000 }
359mips_arch_create vr5400 64 mips4 { ror } \
360 { -march=vr5400 -mtune=vr5400 } { -mmips:5400 }
361mips_arch_create sb1 64 mips64 { mips3d } \
362 { -march=sb1 -mtune=sb1 } { -mmips:sb1 } \
363 { mipsisa64sb1-*-* mipsisa64sb1el-*-* }
364
5915a74a 365#
0a44bf69
RS
366# And now begin the actual tests! VxWorks uses RELA rather than REL
367# relocations, so most of the generic dump tests will not work there.
5915a74a 368#
0a44bf69
RS
369if { [istarget mips*-*-vxworks*] } {
370 run_dump_test "vxworks1"
371 run_dump_test "vxworks1-xgot"
a284cff1
TS
372 run_dump_test "vxworks1-el"
373 run_dump_test "vxworks1-xgot-el"
0a44bf69 374} elseif { [istarget mips*-*-*] } {
252b5132 375 set no_mips16 0
ae948b86
TS
376 set elf [expr [istarget *-*-elf*] || [istarget *-*-irix5*] || [istarget *-*-irix6* ] || [istarget *-*-linux*] || [istarget *-*-netbsd*] ]
377 set ecoff [expr [istarget *-*-ecoff*] || [istarget *-*-ultrix*] || [istarget *-*-irix\[1-4\]*] ]
9fb9af6e 378 set aout [expr [istarget *-*-bsd*] || [istarget *-*-openbsd*] ]
252b5132
RH
379 set ilocks [istarget mipstx39*-*-*]
380 set gpr_ilocks [expr [istarget mipstx39*-*-*]]
b892b944 381 set addr32 [expr [istarget mipstx39*-*-*] || [istarget mips-*-linux*] || [istarget mipsel-*-linux*]]
5e0116d5 382 set has_newabi [expr [istarget *-*-irix6*] || [istarget mips64*-*-linux*]]
252b5132 383
4be041b2 384 if { [istarget "mips*-*-*linux*"] || [istarget "mips*-sde-elf*"] } then {
ff8715d0
L
385 set tmips "t"
386 } else {
387 set tmips ""
388 }
0c4ec151 389 if [istarget mips*el-*-*] {
5ef0935e 390 set el "el"
0c4ec151
RS
391 } {
392 set el ""
393 }
252b5132 394
5915a74a
CD
395 run_dump_test_arches "abs" [mips_arch_list_matching mips1]
396 run_dump_test_arches "add" [mips_arch_list_matching mips1]
397 run_dump_test_arches "and" [mips_arch_list_matching mips1]
252b5132
RH
398 run_dump_test "break20"
399 run_dump_test "trap20"
51124b6c
CD
400
401 # LOSE: As of 2002-02-08, "beq" through "bltu" fail for target mips-ecoff.
402 # See http://sources.redhat.com/ml/binutils/2001-10/msg00418.html for
403 # more information. Not sure if the fixes there are correct; should
404 # branches to external labels be allowed for ECOFF?
5915a74a
CD
405 # XXX FIXME: the following tests require -mips2 disasm for
406 # branch-likely instructions. They should be split.
407 run_dump_test_arches "beq" [mips_arch_list_matching mips2]
408 run_dump_test_arches "bge" [mips_arch_list_matching mips2]
409 run_dump_test_arches "bgeu" [mips_arch_list_matching mips2]
410 run_dump_test_arches "blt" [mips_arch_list_matching mips2]
411 run_dump_test_arches "bltu" [mips_arch_list_matching mips2]
412 run_dump_test_arches "branch-misc-1" [mips_arch_list_matching mips1]
bad36eac
DJ
413 run_dump_test_arches "branch-misc-2" [mips_arch_list_matching mips1]
414 run_dump_test_arches "branch-misc-2pic" [mips_arch_list_matching mips1]
415 run_dump_test_arches "branch-misc-2-64" [mips_arch_list_matching mips3]
416 run_dump_test_arches "branch-misc-2pic-64" [mips_arch_list_matching mips3]
dc36a61f 417 run_dump_test "branch-misc-3"
f7870c8d 418 run_dump_test "branch-swap"
51124b6c 419
f22ba854
NC
420 if $ilocks {
421 run_dump_test "div-ilocks"
422 } else {
423 run_dump_test "div"
424 }
b892b944
TS
425 if { !$addr32 } {
426 run_dump_test_arches "dli" [mips_arch_list_matching mips3]
427 }
ae948b86 428 if $elf {
5915a74a 429 run_dump_test_arches "elf-jal" [mips_arch_list_matching mips1]
7388e440
L
430 } else {
431 run_dump_test "jal"
432 }
ae948b86
TS
433 if $elf { run_dump_test "jal-svr4pic" }
434 if $elf { run_dump_test "jal-xgot" }
21b99e26 435 run_list_test_arches "jal-range" "-32" [mips_arch_list_matching mips1]
3302cdec 436 if $has_newabi { run_dump_test "jal-newabi" }
252b5132 437 if !$aout { run_dump_test "la" }
ae948b86
TS
438 if $elf { run_dump_test "la-svr4pic" }
439 if $elf { run_dump_test "la-xgot" }
1abe91b1
MR
440 if $elf { run_dump_test "lca-svr4pic" }
441 if $elf { run_dump_test "lca-xgot" }
5915a74a
CD
442 if !$aout {
443 # XXX FIXME: Has mips2 and later insns with mips1 disassemblies.
444 # (Should split and then use appropriate arch lists.)
445 run_dump_test_arches "lb" [mips_arch_list_matching !mips2]
446 }
447 if $elf {
269137b2
TS
448 run_dump_test_arches "lb-svr4pic" [mips_arch_list_matching !gpr_ilocks]
449 run_dump_test_arches "lb-svr4pic-ilocks" [mips_arch_list_matching gpr_ilocks]
5915a74a 450 }
ae948b86 451 if $elf {
252b5132
RH
452 # Both versions specify the cpu, so we can run both regardless of
453 # the interlocking in the configured default cpu.
454 run_dump_test "lb-xgot"
455 run_dump_test "lb-xgot-ilocks"
456 }
f22ba854
NC
457 if !$aout {
458 if !$gpr_ilocks {
459 run_dump_test "ld"
252b5132
RH
460 } else {
461 if !$addr32 {
462 run_dump_test "ld-ilocks"
463 } else {
464 run_dump_test "ld-ilocks-addr32"
465 }
466 }
467 }
ae948b86
TS
468 if $elf { run_dump_test "ld-svr4pic" }
469 if $elf { run_dump_test "ld-xgot" }
5915a74a 470 run_dump_test_arches "li" [mips_arch_list_matching mips1]
252b5132 471 if !$aout { run_dump_test "lifloat" }
ae948b86
TS
472 if $elf { run_dump_test "lif-svr4pic" }
473 if $elf { run_dump_test "lif-xgot" }
5915a74a 474 run_dump_test_arches "mips4" [mips_arch_list_matching mips4]
97f2bd8b 475 run_dump_test_arches "mips5" [mips_arch_list_matching mips5]
f22ba854
NC
476 if $ilocks {
477 run_dump_test "mul-ilocks"
478 } else {
479 run_dump_test "mul"
480 }
5915a74a
CD
481
482 run_dump_test_arches "rol" [mips_arch_list_matching !ror]
483 run_dump_test_arches "rol-hw" [mips_arch_list_matching ror]
484
485 run_dump_test_arches "rol64" [mips_arch_list_matching gpr64 !ror]
486 run_dump_test_arches "rol64-hw" [mips_arch_list_matching gpr64 ror]
487
252b5132
RH
488 if !$aout { run_dump_test "sb" }
489 run_dump_test "trunc"
490 if !$aout { run_dump_test "ulh" }
af22f5b2
CD
491 run_dump_test_arches "ulh2-eb" [mips_arch_list_matching mips1]
492 run_dump_test_arches "ulh2-el" [mips_arch_list_matching mips1]
ae948b86
TS
493 if $elf { run_dump_test "ulh-svr4pic" }
494 if $elf { run_dump_test "ulh-xgot" }
252b5132
RH
495 if !$aout {
496 run_dump_test "ulw"
497 run_dump_test "uld"
498 run_dump_test "ush"
499 run_dump_test "usw"
500 run_dump_test "usd"
501 }
af22f5b2
CD
502 run_dump_test_arches "ulw2-eb" [mips_arch_list_matching !gpr_ilocks]
503 run_dump_test_arches "ulw2-eb-ilocks" [mips_arch_list_matching gpr_ilocks]
504 run_dump_test_arches "ulw2-el" [mips_arch_list_matching !gpr_ilocks]
505 run_dump_test_arches "ulw2-el-ilocks" [mips_arch_list_matching gpr_ilocks]
506
507 run_dump_test_arches "uld2-eb" [mips_arch_list_matching mips3]
508 run_dump_test_arches "uld2-el" [mips_arch_list_matching mips3]
509
252b5132
RH
510 # The mips16 test can only be run on ELF, because only ELF
511 # supports the necessary mips16 reloc.
3396de36
TS
512 if { $elf && !$no_mips16 } {
513 run_dump_test "mips16"
32159579 514 run_dump_test "mips16-64"
cd9260d9
TS
515 # Check MIPS16e extensions
516 run_dump_test_arches "mips16e" [mips_arch_list_matching mips32]
3396de36
TS
517 # Check jalx handling
518 run_dump_test "mips16-jalx"
519 run_dump_test "mips-jalx"
d6f16593
MR
520 # Check MIPS16 HI16/LO16 relocations
521 run_dump_test "mips16-hilo"
522 if $has_newabi {
523 run_dump_test "mips16-hilo-n32"
524 }
3396de36 525 }
21b99e26 526 run_list_test "mips-no-jalx" "-32"
252b5132
RH
527 run_dump_test "delay"
528 run_dump_test "nodelay"
529 run_dump_test "mips4010"
530 run_dump_test "mips4650"
531 run_dump_test "mips4100"
60b63b72
RS
532 run_dump_test "vr4111"
533 run_dump_test "vr4120"
532c738a 534 run_dump_test "vr4120-2"
11db99f8 535 run_dump_test "vr4130"
60b63b72
RS
536 run_dump_test "vr5400"
537 run_dump_test "vr5500"
5a7ea749 538 run_dump_test "rm7000"
99c14723 539 run_dump_test "perfcount"
252b5132
RH
540 run_dump_test "lineno"
541 run_dump_test "sync"
5915a74a
CD
542
543 run_dump_test_arches "mips32" [mips_arch_list_matching mips32]
544
1787fe5b
TS
545 run_dump_test_arches "mips32-sf32" [mips_arch_list_matching mips32]
546
af7ee8bf 547 run_dump_test_arches "mips32r2" [mips_arch_list_matching mips32r2]
5f74bc13
CD
548 run_list_test_arches "mips32r2-ill" "-32" \
549 [mips_arch_list_matching mips32r2 gpr32]
550 run_list_test_arches "mips32r2-ill-fp64" "-mabi=o64" \
551 [mips_arch_list_matching mips32r2 gpr64]
af7ee8bf 552
5915a74a
CD
553 run_dump_test_arches "mips64" [mips_arch_list_matching mips64]
554
5f74bc13
CD
555 run_dump_test_arches "mips64r2" [mips_arch_list_matching mips64r2]
556 run_list_test_arches "mips64r2-ill" "" [mips_arch_list_matching mips64r2]
557
fef14a42
TS
558 run_dump_test "set-arch"
559
b892b944
TS
560 if { !$addr32 } {
561 run_dump_test "mips64-mips3d"
562 run_dump_test_arches "mips64-mips3d-incl" [mips_arch_list_matching mips3d]
5915a74a 563
b892b944
TS
564 run_dump_test "mips64-mdmx"
565 run_dump_test "sb1-ext-mdmx"
566 run_dump_test "sb1-ext-ps"
567 }
252b5132 568
594e740f 569 run_dump_test "relax"
895921c9
MR
570 run_dump_test "relax-swap1-mips1"
571 run_dump_test "relax-swap1-mips2"
572 run_dump_test "relax-swap2"
594e740f 573
21b99e26
AO
574 run_list_test "illegal" "-32"
575 run_list_test "baddata1" "-32"
d9e138e2 576
51124b6c
CD
577 # LOSE: As of 2002-02-08, the next 4 tests fail for target mips-ecoff.
578 # It's unknown whether they _should_ pass as-is, or whether different
579 # variants are needed for ELF and ECOFF.
dc462216
RS
580 run_dump_test "mips-gp32-fp32"
581 run_dump_test "mips-gp32-fp64"
582 run_dump_test "mips-gp64-fp32"
583 run_dump_test "mips-gp64-fp64"
dc462216 584
ae948b86 585 if $elf {
2cd5676f
CD
586 # Make sure that -mcpu=FOO and -mFOO are equivalent. Assemble a file
587 # containing 4650-specific instructions with -m4650 and -mcpu=4650,
588 # and verify that they're the same. Specifically, we're checking
589 # that the EF_MIPS_MACH field is set, and that the 4650 'mul'
f22ba854 590 # instruction does get used. In previous versions of GAS,
2cd5676f
CD
591 # only -mcpu=4650 would set the EF_MIPS_MACH field; -m4650 wouldn't.
592 run_dump_test "elf_e_flags1"
593 run_dump_test "elf_e_flags2"
594 run_dump_test "elf_e_flags3"
595 run_dump_test "elf_e_flags4"
f22ba854 596
b337e146
CD
597 # Check EF_MIPS_ARCH markings for each supported architecture.
598 run_dump_test "elf_arch_mips1"
599 run_dump_test "elf_arch_mips2"
600 run_dump_test "elf_arch_mips3"
601 run_dump_test "elf_arch_mips4"
602 run_dump_test "elf_arch_mips5"
603 run_dump_test "elf_arch_mips32"
604 run_dump_test "elf_arch_mips32r2"
605 run_dump_test "elf_arch_mips64"
5f74bc13 606 run_dump_test "elf_arch_mips64r2"
b337e146 607
70a31400
CD
608 # Verify that ASE markings are handled properly.
609 if { !$no_mips16 } { run_dump_test "elf_ase_mips16" }
610
dc462216
RS
611 run_dump_test "mips-gp32-fp32-pic"
612 run_dump_test "mips-gp32-fp64-pic"
613 run_dump_test "mips-gp64-fp32-pic"
614 run_dump_test "mips-gp64-fp64-pic"
ae948b86
TS
615
616 run_dump_test "mips-abi32"
617 run_dump_test "mips-abi32-pic"
885add95 618 run_dump_test "mips-abi32-pic2"
ff8715d0 619
0c4ec151 620 run_dump_test "elf${el}-rel"
cd9260d9
TS
621 run_dump_test_arches "elf${el}-rel2" [mips_arch_list_matching gpr64]
622 run_dump_test "e32${el}-rel2"
0c4ec151 623 run_dump_test "elf${el}-rel3"
cd9260d9
TS
624 run_dump_test_arches "elf-rel4" [mips_arch_list_matching gpr64]
625 run_dump_test "e32-rel4"
5f266a81 626 run_dump_test "elf-rel5"
98605598 627 run_dump_test "elf-rel6"
1dd3d627
TS
628 if $has_newabi {
629 run_dump_test "elf-rel6-n32"
630 run_dump_test "elf-rel6-n64"
631 }
631cb423 632 run_dump_test "elf-rel7"
5e0116d5
RS
633 run_dump_test "elf-rel8"
634 run_dump_test "elf-rel9"
635 if $has_newabi {
636 run_dump_test "elf-rel10"
637 run_dump_test "elf-rel11"
638 }
5919d012
RS
639 run_dump_test "elf-rel12"
640 run_dump_test "elf-rel13"
64bdfcaf 641 run_dump_test "elf-rel14"
05760fd2
AO
642
643 if $has_newabi {
34ce925e 644 run_dump_test "elf-rel15"
0a6ace1e 645 run_dump_test "elf-rel16"
34ce925e 646
05760fd2
AO
647 run_dump_test "elf-rel-got-n32"
648 run_dump_test "elf-rel-xgot-n32"
649 run_dump_test "elf-rel-got-n64"
650 run_dump_test "elf-rel-xgot-n64"
651 }
30ac9238 652 run_dump_test "elf-rel17"
cc3d92a5
RS
653 if $has_newabi {
654 run_dump_test "elf-rel18"
655 }
4d7206a2 656 run_dump_test "elf-rel19"
3b91255e 657 run_dump_test "elf-rel20"
b1dca8ee
RS
658 if $has_newabi {
659 run_dump_test "elf-rel21"
99022dfb 660 run_dump_test "elf-rel22"
6e1304d8 661 run_dump_test "elf-rel23"
e8ede7c7
ILT
662 run_dump_test "elf-rel23a"
663 run_dump_test "elf-rel23b"
6e1304d8 664 run_dump_test "elf-rel24"
b1dca8ee 665 }
05760fd2 666
e8ede7c7
ILT
667 run_dump_test "elf-rel25"
668 run_dump_test "elf-rel25a"
df1f3cda 669 run_dump_test "elf-rel26"
e8ede7c7 670
f22ba854
NC
671 if { !$no_mips16 } {
672 run_dump_test "${tmips}mips${el}16-e"
673 run_dump_test "${tmips}mips${el}16-f"
bb2d6cd7 674 }
fdb987ee 675 run_dump_test "elf-consthilo"
09b8f35a 676 run_dump_test "expr1"
b2715587
RS
677
678 run_list_test "tls-ill" "-32"
679 run_dump_test "tls-o32"
07147777 680 }
640c0ccd 681
5e0116d5 682 if $has_newabi {
a4cb6c4d
AO
683 run_dump_test "n32-consec"
684 }
685
640c0ccd
CD
686 # tests of objdump's ability to disassemble using different
687 # register names.
688 run_dump_test "gpr-names-numeric"
689 run_dump_test "gpr-names-32"
690 run_dump_test "gpr-names-n32"
691 run_dump_test "gpr-names-64"
692
693 run_dump_test "fpr-names-numeric"
694 run_dump_test "fpr-names-32"
695 run_dump_test "fpr-names-n32"
696 run_dump_test "fpr-names-64"
697
698 run_dump_test "cp0-names-numeric"
f409fd1e
MR
699 run_dump_test "cp0-names-r3000"
700 run_dump_test "cp0-names-r4000" \
701 { { {name} {(r4000)} } { {objdump} {-M cp0-names=r4000} } }
702 run_dump_test "cp0-names-r4000" \
703 { { {name} {(r4400)} } { {objdump} {-M cp0-names=r4400} } }
640c0ccd 704 run_dump_test "cp0-names-mips32"
af7ee8bf 705 run_dump_test "cp0-names-mips32r2"
640c0ccd 706 run_dump_test "cp0-names-mips64"
5f74bc13 707 run_dump_test "cp0-names-mips64r2"
640c0ccd 708 run_dump_test "cp0-names-sb1"
af7ee8bf 709
bbcc0807
CD
710 run_dump_test "cp0sel-names-numeric"
711 run_dump_test "cp0sel-names-mips32"
712 run_dump_test "cp0sel-names-mips32r2"
713 run_dump_test "cp0sel-names-mips64"
5f74bc13 714 run_dump_test "cp0sel-names-mips64r2"
bbcc0807
CD
715 run_dump_test "cp0sel-names-sb1"
716
af7ee8bf
CD
717 run_dump_test "hwr-names-numeric"
718 run_dump_test "hwr-names-mips32r2"
5f74bc13 719 run_dump_test "hwr-names-mips64r2"
ecd13cd3
TS
720
721 run_dump_test "ldstla-32"
2051e8c4 722 run_dump_test "ldstla-32-mips3"
ecd13cd3 723 run_dump_test "ldstla-32-shared"
2051e8c4
MR
724 run_dump_test "ldstla-32-mips3-shared"
725 run_list_test "ldstla-32-1" "-mabi=32" \
726 "MIPS ld-st-la bad constants (ABI o32)"
727 run_list_test "ldstla-32-mips3-1" "-mabi=32" \
728 "MIPS ld-st-la bad constants (ABI o32, mips3)"
729 run_list_test "ldstla-32-1" "-KPIC -mabi=32" \
730 "MIPS ld-st-la bad constants (ABI o32, shared)"
731 run_list_test "ldstla-32-mips3-1" "-KPIC -mabi=32" \
732 "MIPS ld-st-la bad constants (ABI o32, mips3, shared)"
aed1a261 733 run_dump_test "ldstla-eabi64"
ecd13cd3 734 if $has_newabi {
ecd13cd3
TS
735 run_dump_test "ldstla-n64"
736 run_dump_test "ldstla-n64-shared"
aed1a261 737 run_dump_test "ldstla-n64-sym32"
ecd13cd3 738 }
5fc68419
RS
739
740 run_dump_test "macro-warn-1"
741 run_dump_test "macro-warn-2"
742 run_dump_test "macro-warn-3"
743 run_dump_test "macro-warn-4"
744 if $has_newabi {
745 run_dump_test "macro-warn-1-n32"
746 run_dump_test "macro-warn-2-n32"
747 }
8fc2e39e
TS
748
749 run_dump_test "noat-1"
750 run_list_test "noat-2" ""
751 run_list_test "noat-3" ""
752 run_list_test "noat-4" ""
753 run_list_test "noat-5" ""
754 run_list_test "noat-6" ""
755 run_list_test "noat-7" ""
58e2ea4d 756
741fe287
MR
757 run_dump_test "at-1"
758 run_list_test "at-2" "-32 -mips1" "MIPS at-2"
759
350cc38d
MS
760 run_dump_test "loongson-2e"
761 run_dump_test "loongson-2f"
762
e16bfa71 763 run_dump_test_arches "smartmips" [mips_arch_list_matching mips32 !gpr64]
39a7806d 764 run_dump_test_arches "mips32-dsp" [mips_arch_list_matching mips32r2]
8b082fb1 765 run_dump_test_arches "mips32-dspr2" [mips_arch_list_matching mips32r2]
65263ce3 766 run_dump_test_arches "mips64-dsp" [mips_arch_list_matching mips64r2]
e0d52083 767 run_dump_test_arches "mips32-mt" [mips_arch_list_matching mips32r2 !gpr64]
305e06d3 768
58e2ea4d
MR
769 if { $elf && !$no_mips16 } {
770 run_dump_test "mips16-dwarf2"
9def96e7
MR
771 if $has_newabi {
772 run_dump_test "mips16-dwarf2-n32"
773 }
58e2ea4d 774 }
0499d65b
TS
775 if { !$no_mips16 } {
776 run_dump_test "mips16e-jrc"
777 run_dump_test "mips16e-save"
9b3f89ee 778 run_dump_test "mips16e-64"
21b956c6 779 run_list_test "mips16e-64" "-march=mips32 -32"
b9d58d71 780 run_dump_test "mips16-intermix"
0499d65b 781 }
0a44bf69
RS
782 run_dump_test "vxworks1"
783 run_dump_test "vxworks1-xgot"
a284cff1
TS
784 run_dump_test "vxworks1-el"
785 run_dump_test "vxworks1-xgot-el"
ef75f014
TS
786
787 run_dump_test "noreorder"
49954fb4 788 run_dump_test "align"
742a56fe
RS
789 run_dump_test "align2"
790 run_dump_test "align2-el"
c8ab98e0 791 run_dump_test "odd-float"
252b5132 792}