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