Commit | Line | Data |
---|---|---|
252b5132 RH |
1 | # |
2 | # Some generic MIPS tests | |
3 | # | |
d9e138e2 | 4 | |
5915a74a CD |
5 | # When adding a new test to this file, try to do the following things: |
6 | # | |
7 | # * If testing assembly and disassembly of code, don't forget to test | |
8 | # the actual bit encodings of the instructions (using the | |
9 | # --show-raw-insn flag to objdump). | |
10 | # | |
11 | # * Try to run the test for as many architectures as appropriate, | |
12 | # using the "run_dump_test_arches" or "run_list_test_arches" functions, | |
13 | # along with the output from a call to "mips_arch_list_matching." | |
14 | # | |
15 | # * Be sure to compare the test output before and after your testsuite | |
16 | # changes, to verify that existing and new tests were run as expected. | |
17 | # Look for expect ERROR messages in the testsuite .log file to make sure | |
18 | # the new expect code did not contain errors. | |
19 | ||
20 | # To add support for a new CPU to this file, add an appropriate entry | |
21 | # to the sequence of "mips_arch_create" function calls below, and test | |
22 | # the result. The new CPU should automatically be used when running | |
23 | # various tests. If the new CPU is the default CPU for any tool | |
24 | # targets, make sure the call to "mips_arch_create" reflects that fact. | |
25 | ||
26 | ||
51124b6c CD |
27 | # "LOSE" marks information about tests which fail at a particular point |
28 | # in time, but which are not XFAILed. Either they used to pass | |
29 | # and indicate either regressions or the need to tweak the tests to keep | |
30 | # up the with code, or they are new tests and it is unknown whether or not | |
31 | # they should pass as-is for the given object formats. | |
32 | ||
5915a74a CD |
33 | |
34 | # The functions below create and manipulate an "architecture data | |
35 | # array" which contains entries for each MIPS architecture (or CPU) | |
36 | # known to these tests. The array contains the following information | |
37 | # for each architecture, indexed by the name of the architecture | |
38 | # described by the entry: | |
39 | # | |
40 | # displayname: The name of the entry to be used for pretty-printing. | |
41 | # | |
42 | # gprsize: The size in bits of General Purpose Registers provided by | |
43 | # the architecture (must be 32 or 64). | |
44 | # | |
45 | # props: A list of text strings which are associated with the | |
46 | # architecture. These include the architecture name as well as | |
47 | # information about what instructions the CPU supports. When matching | |
48 | # based on properties, an additional property is added to the normal | |
49 | # property list, "gpr<gprsize>" so that tests can match CPUs which | |
50 | # have GPRs of a specific size. The following properties are most | |
51 | # useful when matching properties for generic (i.e., not CPU-specific) | |
52 | # tests: | |
53 | # | |
54 | # mips1, mips2, mips3, mips4, mips5, mips32, mips64 | |
55 | # The architecture includes the instructions defined | |
56 | # by that MIPS ISA. | |
57 | # | |
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. | |
85 | proc 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. | |
109 | proc mips_arch_create {arch gprsize extends props as_flags objdump_flags | |
110 | {default_for_targets {}}} { | |
111 | global mips_arches | |
112 | ||
113 | if { [info exists mips_arches($arch)] } { | |
114 | error "mips_arch_create: arch \"$arch\" already exists" | |
115 | } | |
116 | if { $gprsize != 32 && $gprsize != 64 } { | |
117 | error "mips_arch_create: invalid GPR size $gprsize" | |
118 | } | |
119 | ||
120 | set archdata(displayname) $arch | |
121 | set archdata(gprsize) $gprsize | |
122 | set archdata(as_flags) $as_flags | |
123 | set archdata(objdump_flags) $objdump_flags | |
124 | set archdata(props) $arch | |
125 | eval lappend archdata(props) $props | |
126 | if { [string length $extends] != 0 } { | |
127 | eval lappend archdata(props) [mips_arch_properties $extends 0] | |
128 | } | |
129 | ||
130 | set mips_arches($arch) [array get archdata] | |
131 | ||
132 | # Set as default if appropriate. | |
133 | foreach target $default_for_targets { | |
134 | if { [istarget $target] } { | |
135 | if { [info exists mips_arches(default)] } { | |
136 | error "mips_arch_create: default arch already exists" | |
137 | } | |
138 | ||
139 | set archdata(displayname) "default = $arch" | |
140 | set archdata(as_flags) "" | |
141 | set archdata(objdump_flags) "" | |
142 | ||
143 | set mips_arches(default) [array get archdata] | |
144 | break | |
145 | } | |
146 | } | |
147 | } | |
148 | ||
149 | # mips_arch_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). | |
154 | proc 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. | |
163 | proc 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. | |
176 | proc 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. | |
187 | proc 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. | |
200 | proc 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. | |
209 | proc 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. | |
222 | proc 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. | |
250 | proc 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} { | |
257 | continue; | |
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. | |
273 | proc 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. | |
289 | proc run_dump_test_arches { name arch_list } { | |
290 | foreach arch $arch_list { | |
291 | run_dump_test_arch "$name" "$arch" | |
292 | } | |
293 | } | |
294 | ||
295 | # run_list_test NAME OPTS (optional): TESTNAME | |
296 | # | |
297 | # Assemble the file "NAME.d" and compare the assembler standard error | |
298 | # output against the regular expressions given in the file "NAME.l". | |
299 | # The assembler is passed the flags given in OPTS. If TESTNAME is | |
300 | # provided, it will be used as the name of the test. | |
301 | proc run_list_test { name opts {testname {}} } { | |
d9e138e2 | 302 | global srcdir subdir |
5915a74a CD |
303 | if { [string length $testname] == 0 } then { |
304 | set testname "MIPS $name" | |
305 | } | |
d9e138e2 L |
306 | set file $srcdir/$subdir/$name |
307 | gas_run ${name}.s $opts ">&dump.out" | |
308 | if { [regexp_diff "dump.out" "${file}.l"] } then { | |
309 | fail $testname | |
310 | verbose "output is [file_contents "dump.out"]" 2 | |
311 | return | |
312 | } | |
313 | pass $testname | |
314 | } | |
315 | ||
5915a74a CD |
316 | # run_list_test_arch NAME OPTS ARCH |
317 | # | |
318 | # Invoke "run_list_test" for test NAME with options OPTS, with extra | |
319 | # assembler flags to test architecture ARCH. | |
320 | proc run_list_test_arch { name opts arch } { | |
321 | global subdir | |
322 | ||
323 | set testname "MIPS $name ([mips_arch_displayname $arch])" | |
324 | if [catch {run_list_test "$name" "$opts [mips_arch_as_flags $arch]" \ | |
325 | "$testname"} rv] { | |
326 | perror "$rv" | |
327 | untested "$testname" | |
328 | } | |
329 | } | |
330 | ||
331 | # run_list_test_arches NAME OPTS ARCH_LIST | |
332 | # | |
333 | # Invoke "run_list_test_arch" for test NAME with options OPTS, for each | |
334 | # architecture listed in ARCH_LIST. | |
335 | proc run_list_test_arches { name opts arch_list } { | |
336 | foreach arch $arch_list { | |
337 | run_list_test_arch "$name" "$opts" "$arch" | |
338 | } | |
339 | } | |
340 | ||
341 | ||
342 | # Create the architecture data array by providing data for all | |
343 | # known architectures. | |
344 | # | |
345 | # Note that several targets pick default CPU based on ABI. We | |
346 | # can't easily handle that; do NOT list those targets as defaulting | |
347 | # to any architecture. | |
4d8728e1 | 348 | mips_arch_init |
5915a74a CD |
349 | mips_arch_create mips1 32 {} {} \ |
350 | { -march=mips1 -mtune=mips1 } { -mmips:3000 } | |
af22f5b2 | 351 | mips_arch_create mips2 32 mips1 { gpr_ilocks } \ |
5915a74a CD |
352 | { -march=mips2 -mtune=mips2 } { -mmips:6000 } |
353 | mips_arch_create mips3 64 mips2 {} \ | |
354 | { -march=mips3 -mtune=mips3 } { -mmips:4000 } | |
355 | mips_arch_create mips4 64 mips3 {} \ | |
356 | { -march=mips4 -mtune=mips4 } { -mmips:8000 } | |
357 | mips_arch_create mips5 64 mips4 {} \ | |
358 | { -march=mips5 -mtune=mips5 } { -mmips:mips5 } | |
359 | mips_arch_create mips32 32 mips2 {} \ | |
360 | { -march=mips32 -mtune=mips32 } { -mmips:isa32 } \ | |
361 | { mipsisa32-*-* mipsisa32el-*-* } | |
af7ee8bf CD |
362 | mips_arch_create mips32r2 32 mips32 { ror } \ |
363 | { -march=mips32r2 -mtune=mips32r2 } \ | |
364 | { -mmips:isa32r2 } \ | |
365 | { mipsisa32r2-*-* mipsisa32r2el-*-* } | |
5915a74a CD |
366 | mips_arch_create mips64 64 mips5 { mips32 } \ |
367 | { -march=mips64 -mtune=mips64 } { -mmips:isa64 } \ | |
368 | { mipsisa64-*-* mipsisa64el-*-* } | |
5f74bc13 CD |
369 | mips_arch_create mips64r2 64 mips64 { mips32r2 ror } \ |
370 | { -march=mips64r2 -mtune=mips64r2 } \ | |
371 | { -mmips:isa64r2 } \ | |
372 | { mipsisa64r2-*-* mipsisa64r2el-*-* } | |
5915a74a CD |
373 | mips_arch_create r3000 32 mips1 {} \ |
374 | { -march=r3000 -mtune=r3000 } { -mmips:3000 } | |
af22f5b2 | 375 | mips_arch_create r3900 32 mips1 { gpr_ilocks } \ |
5915a74a CD |
376 | { -march=r3900 -mtune=r3900 } { -mmips:3900 } \ |
377 | { mipstx39-*-* mipstx39el-*-* } | |
378 | mips_arch_create r4000 64 mips3 {} \ | |
379 | { -march=r4000 -mtune=r4000 } { -mmips:4000 } | |
380 | mips_arch_create vr5400 64 mips4 { ror } \ | |
381 | { -march=vr5400 -mtune=vr5400 } { -mmips:5400 } | |
382 | mips_arch_create sb1 64 mips64 { mips3d } \ | |
383 | { -march=sb1 -mtune=sb1 } { -mmips:sb1 } \ | |
384 | { mipsisa64sb1-*-* mipsisa64sb1el-*-* } | |
385 | ||
386 | ||
387 | # | |
388 | # And now begin the actual tests! | |
389 | # | |
390 | ||
0285c67d | 391 | if { [istarget mips*-*-*] } then { |
252b5132 | 392 | set no_mips16 0 |
ae948b86 TS |
393 | set elf [expr [istarget *-*-elf*] || [istarget *-*-irix5*] || [istarget *-*-irix6* ] || [istarget *-*-linux*] || [istarget *-*-netbsd*] ] |
394 | set ecoff [expr [istarget *-*-ecoff*] || [istarget *-*-ultrix*] || [istarget *-*-irix\[1-4\]*] ] | |
9fb9af6e | 395 | set aout [expr [istarget *-*-bsd*] || [istarget *-*-openbsd*] ] |
252b5132 RH |
396 | set ilocks [istarget mipstx39*-*-*] |
397 | set gpr_ilocks [expr [istarget mipstx39*-*-*]] | |
b892b944 | 398 | set addr32 [expr [istarget mipstx39*-*-*] || [istarget mips-*-linux*] || [istarget mipsel-*-linux*]] |
5e0116d5 | 399 | set has_newabi [expr [istarget *-*-irix6*] || [istarget mips64*-*-linux*]] |
252b5132 | 400 | |
dda688fc | 401 | if { [istarget "mips*-*-*linux*"] } then { |
ff8715d0 L |
402 | set tmips "t" |
403 | } else { | |
404 | set tmips "" | |
405 | } | |
0c4ec151 | 406 | if [istarget mips*el-*-*] { |
5ef0935e | 407 | set el "el" |
0c4ec151 RS |
408 | } { |
409 | set el "" | |
410 | } | |
252b5132 | 411 | |
5915a74a CD |
412 | run_dump_test_arches "abs" [mips_arch_list_matching mips1] |
413 | run_dump_test_arches "add" [mips_arch_list_matching mips1] | |
414 | run_dump_test_arches "and" [mips_arch_list_matching mips1] | |
252b5132 RH |
415 | run_dump_test "break20" |
416 | run_dump_test "trap20" | |
51124b6c CD |
417 | |
418 | # LOSE: As of 2002-02-08, "beq" through "bltu" fail for target mips-ecoff. | |
419 | # See http://sources.redhat.com/ml/binutils/2001-10/msg00418.html for | |
420 | # more information. Not sure if the fixes there are correct; should | |
421 | # branches to external labels be allowed for ECOFF? | |
5915a74a CD |
422 | # XXX FIXME: the following tests require -mips2 disasm for |
423 | # branch-likely instructions. They should be split. | |
424 | run_dump_test_arches "beq" [mips_arch_list_matching mips2] | |
425 | run_dump_test_arches "bge" [mips_arch_list_matching mips2] | |
426 | run_dump_test_arches "bgeu" [mips_arch_list_matching mips2] | |
427 | run_dump_test_arches "blt" [mips_arch_list_matching mips2] | |
428 | run_dump_test_arches "bltu" [mips_arch_list_matching mips2] | |
429 | run_dump_test_arches "branch-misc-1" [mips_arch_list_matching mips1] | |
115695a8 CD |
430 | run_list_test_arches "branch-misc-2" "-32 -non_shared" [mips_arch_list_matching mips1] |
431 | run_list_test_arches "branch-misc-2pic" "-32 -call_shared" [mips_arch_list_matching mips1] | |
51124b6c | 432 | |
f22ba854 NC |
433 | if $ilocks { |
434 | run_dump_test "div-ilocks" | |
435 | } else { | |
436 | run_dump_test "div" | |
437 | } | |
b892b944 TS |
438 | if { !$addr32 } { |
439 | run_dump_test_arches "dli" [mips_arch_list_matching mips3] | |
440 | } | |
ae948b86 | 441 | if $elf { |
5915a74a | 442 | run_dump_test_arches "elf-jal" [mips_arch_list_matching mips1] |
7388e440 L |
443 | } else { |
444 | run_dump_test "jal" | |
445 | } | |
ae948b86 TS |
446 | if $elf { run_dump_test "jal-svr4pic" } |
447 | if $elf { run_dump_test "jal-xgot" } | |
51124b6c CD |
448 | # LOSE: As of 2002-02-08, the jal-empic test fails for target mips-ecoff. |
449 | # It appears that it broke between 2000-03-11 00:00UTC and | |
450 | # 2000-03-12 00:00 UTC. | |
ae948b86 | 451 | if $ecoff { run_dump_test "jal-empic" } |
5915a74a CD |
452 | if $elf { |
453 | run_dump_test_arches "jal-empic-elf" [mips_arch_list_matching mips1] | |
454 | run_dump_test_arches "jal-empic-elf-2" [mips_arch_list_matching mips1] | |
455 | run_dump_test_arches "jal-empic-elf-3" [mips_arch_list_matching mips1] | |
456 | } | |
21b99e26 | 457 | run_list_test_arches "jal-range" "-32" [mips_arch_list_matching mips1] |
3302cdec | 458 | if $has_newabi { run_dump_test "jal-newabi" } |
252b5132 | 459 | if !$aout { run_dump_test "la" } |
ae948b86 TS |
460 | if $elf { run_dump_test "la-svr4pic" } |
461 | if $elf { run_dump_test "la-xgot" } | |
51124b6c CD |
462 | # LOSE: As of 2002-02-08, the la-empic test fails for target mips-ecoff. |
463 | # Not sure when it first cropped up, but may be related to addition of | |
464 | # "la" -> "addiu" pattern in MIPS opcode table long ago. | |
ae948b86 | 465 | if $ecoff { run_dump_test "la-empic" } |
5915a74a CD |
466 | if !$aout { |
467 | # XXX FIXME: Has mips2 and later insns with mips1 disassemblies. | |
468 | # (Should split and then use appropriate arch lists.) | |
469 | run_dump_test_arches "lb" [mips_arch_list_matching !mips2] | |
470 | } | |
471 | if $elf { | |
472 | run_dump_test_arches "lb-svr4pic" [mips_arch_list_matching mips1] | |
473 | } | |
ae948b86 | 474 | if $elf { |
252b5132 RH |
475 | # Both versions specify the cpu, so we can run both regardless of |
476 | # the interlocking in the configured default cpu. | |
477 | run_dump_test "lb-xgot" | |
478 | run_dump_test "lb-xgot-ilocks" | |
479 | } | |
ae948b86 | 480 | if $ecoff { run_dump_test "lb-empic" } |
f22ba854 NC |
481 | if !$aout { |
482 | if !$gpr_ilocks { | |
483 | run_dump_test "ld" | |
252b5132 RH |
484 | } else { |
485 | if !$addr32 { | |
486 | run_dump_test "ld-ilocks" | |
487 | } else { | |
488 | run_dump_test "ld-ilocks-addr32" | |
489 | } | |
490 | } | |
491 | } | |
ae948b86 TS |
492 | if $elf { run_dump_test "ld-svr4pic" } |
493 | if $elf { run_dump_test "ld-xgot" } | |
494 | if $ecoff { run_dump_test "ld-empic" } | |
5915a74a | 495 | run_dump_test_arches "li" [mips_arch_list_matching mips1] |
252b5132 | 496 | if !$aout { run_dump_test "lifloat" } |
ae948b86 TS |
497 | if $elf { run_dump_test "lif-svr4pic" } |
498 | if $elf { run_dump_test "lif-xgot" } | |
51124b6c CD |
499 | # LOSE: As of 2002-02-08, the lif-empic test fails for target mips-ecoff. |
500 | # It appears that it broke between 2000-03-11 00:00UTC and | |
501 | # 2000-03-12 00:00 UTC. | |
ae948b86 | 502 | if $ecoff { run_dump_test "lif-empic" } |
5915a74a | 503 | run_dump_test_arches "mips4" [mips_arch_list_matching mips4] |
97f2bd8b | 504 | run_dump_test_arches "mips5" [mips_arch_list_matching mips5] |
f22ba854 NC |
505 | if $ilocks { |
506 | run_dump_test "mul-ilocks" | |
507 | } else { | |
508 | run_dump_test "mul" | |
509 | } | |
5915a74a CD |
510 | |
511 | run_dump_test_arches "rol" [mips_arch_list_matching !ror] | |
512 | run_dump_test_arches "rol-hw" [mips_arch_list_matching ror] | |
513 | ||
514 | run_dump_test_arches "rol64" [mips_arch_list_matching gpr64 !ror] | |
515 | run_dump_test_arches "rol64-hw" [mips_arch_list_matching gpr64 ror] | |
516 | ||
252b5132 RH |
517 | if !$aout { run_dump_test "sb" } |
518 | run_dump_test "trunc" | |
519 | if !$aout { run_dump_test "ulh" } | |
af22f5b2 CD |
520 | run_dump_test_arches "ulh2-eb" [mips_arch_list_matching mips1] |
521 | run_dump_test_arches "ulh2-el" [mips_arch_list_matching mips1] | |
ae948b86 TS |
522 | if $elf { run_dump_test "ulh-svr4pic" } |
523 | if $elf { run_dump_test "ulh-xgot" } | |
524 | if $ecoff { run_dump_test "ulh-empic" } | |
252b5132 RH |
525 | if !$aout { |
526 | run_dump_test "ulw" | |
527 | run_dump_test "uld" | |
528 | run_dump_test "ush" | |
529 | run_dump_test "usw" | |
530 | run_dump_test "usd" | |
531 | } | |
af22f5b2 CD |
532 | run_dump_test_arches "ulw2-eb" [mips_arch_list_matching !gpr_ilocks] |
533 | run_dump_test_arches "ulw2-eb-ilocks" [mips_arch_list_matching gpr_ilocks] | |
534 | run_dump_test_arches "ulw2-el" [mips_arch_list_matching !gpr_ilocks] | |
535 | run_dump_test_arches "ulw2-el-ilocks" [mips_arch_list_matching gpr_ilocks] | |
536 | ||
537 | run_dump_test_arches "uld2-eb" [mips_arch_list_matching mips3] | |
538 | run_dump_test_arches "uld2-el" [mips_arch_list_matching mips3] | |
539 | ||
252b5132 RH |
540 | # The mips16 test can only be run on ELF, because only ELF |
541 | # supports the necessary mips16 reloc. | |
3396de36 TS |
542 | if { $elf && !$no_mips16 } { |
543 | run_dump_test "mips16" | |
544 | # Check jalx handling | |
545 | run_dump_test "mips16-jalx" | |
546 | run_dump_test "mips-jalx" | |
547 | } | |
21b99e26 | 548 | run_list_test "mips-no-jalx" "-32" |
252b5132 RH |
549 | run_dump_test "delay" |
550 | run_dump_test "nodelay" | |
551 | run_dump_test "mips4010" | |
552 | run_dump_test "mips4650" | |
553 | run_dump_test "mips4100" | |
60b63b72 RS |
554 | run_dump_test "vr4111" |
555 | run_dump_test "vr4120" | |
556 | run_dump_test "vr4122" | |
557 | run_dump_test "vr5400" | |
558 | run_dump_test "vr5500" | |
5a7ea749 | 559 | run_dump_test "rm7000" |
99c14723 | 560 | run_dump_test "perfcount" |
252b5132 RH |
561 | run_dump_test "lineno" |
562 | run_dump_test "sync" | |
5915a74a CD |
563 | |
564 | run_dump_test_arches "mips32" [mips_arch_list_matching mips32] | |
565 | ||
af7ee8bf | 566 | run_dump_test_arches "mips32r2" [mips_arch_list_matching mips32r2] |
5f74bc13 CD |
567 | run_list_test_arches "mips32r2-ill" "-32" \ |
568 | [mips_arch_list_matching mips32r2 gpr32] | |
569 | run_list_test_arches "mips32r2-ill-fp64" "-mabi=o64" \ | |
570 | [mips_arch_list_matching mips32r2 gpr64] | |
af7ee8bf | 571 | |
5915a74a CD |
572 | run_dump_test_arches "mips64" [mips_arch_list_matching mips64] |
573 | ||
5f74bc13 CD |
574 | run_dump_test_arches "mips64r2" [mips_arch_list_matching mips64r2] |
575 | run_list_test_arches "mips64r2-ill" "" [mips_arch_list_matching mips64r2] | |
576 | ||
fef14a42 TS |
577 | run_dump_test "set-arch" |
578 | ||
b892b944 TS |
579 | if { !$addr32 } { |
580 | run_dump_test "mips64-mips3d" | |
581 | run_dump_test_arches "mips64-mips3d-incl" [mips_arch_list_matching mips3d] | |
5915a74a | 582 | |
b892b944 TS |
583 | run_dump_test "mips64-mdmx" |
584 | run_dump_test "sb1-ext-mdmx" | |
585 | run_dump_test "sb1-ext-ps" | |
586 | } | |
252b5132 | 587 | |
594e740f L |
588 | run_dump_test "relax" |
589 | ||
21b99e26 AO |
590 | run_list_test "illegal" "-32" |
591 | run_list_test "baddata1" "-32" | |
d9e138e2 | 592 | |
51124b6c CD |
593 | # LOSE: As of 2002-02-08, the next 4 tests fail for target mips-ecoff. |
594 | # It's unknown whether they _should_ pass as-is, or whether different | |
595 | # variants are needed for ELF and ECOFF. | |
dc462216 RS |
596 | run_dump_test "mips-gp32-fp32" |
597 | run_dump_test "mips-gp32-fp64" | |
598 | run_dump_test "mips-gp64-fp32" | |
599 | run_dump_test "mips-gp64-fp64" | |
dc462216 | 600 | |
ae948b86 | 601 | if $elf { |
2cd5676f CD |
602 | # Make sure that -mcpu=FOO and -mFOO are equivalent. Assemble a file |
603 | # containing 4650-specific instructions with -m4650 and -mcpu=4650, | |
604 | # and verify that they're the same. Specifically, we're checking | |
605 | # that the EF_MIPS_MACH field is set, and that the 4650 'mul' | |
f22ba854 | 606 | # instruction does get used. In previous versions of GAS, |
2cd5676f CD |
607 | # only -mcpu=4650 would set the EF_MIPS_MACH field; -m4650 wouldn't. |
608 | run_dump_test "elf_e_flags1" | |
609 | run_dump_test "elf_e_flags2" | |
610 | run_dump_test "elf_e_flags3" | |
611 | run_dump_test "elf_e_flags4" | |
f22ba854 | 612 | |
b337e146 CD |
613 | # Check EF_MIPS_ARCH markings for each supported architecture. |
614 | run_dump_test "elf_arch_mips1" | |
615 | run_dump_test "elf_arch_mips2" | |
616 | run_dump_test "elf_arch_mips3" | |
617 | run_dump_test "elf_arch_mips4" | |
618 | run_dump_test "elf_arch_mips5" | |
619 | run_dump_test "elf_arch_mips32" | |
620 | run_dump_test "elf_arch_mips32r2" | |
621 | run_dump_test "elf_arch_mips64" | |
5f74bc13 | 622 | run_dump_test "elf_arch_mips64r2" |
b337e146 | 623 | |
70a31400 CD |
624 | # Verify that ASE markings are handled properly. |
625 | if { !$no_mips16 } { run_dump_test "elf_ase_mips16" } | |
626 | ||
dc462216 RS |
627 | run_dump_test "mips-gp32-fp32-pic" |
628 | run_dump_test "mips-gp32-fp64-pic" | |
629 | run_dump_test "mips-gp64-fp32-pic" | |
630 | run_dump_test "mips-gp64-fp64-pic" | |
ae948b86 TS |
631 | |
632 | run_dump_test "mips-abi32" | |
633 | run_dump_test "mips-abi32-pic" | |
885add95 | 634 | run_dump_test "mips-abi32-pic2" |
ff8715d0 | 635 | |
0c4ec151 | 636 | run_dump_test "elf${el}-rel" |
b4dc22a8 CD |
637 | if {[istarget mips64*-*-*] || [istarget mipsisa32*-*-*] |
638 | || [istarget mipsisa64*-*-*]} { | |
15ba8cc1 | 639 | run_dump_test "elf${el}-rel2" |
7ad8fb54 | 640 | } else { |
15ba8cc1 | 641 | run_dump_test "e32${el}-rel2" |
a90335ee | 642 | } |
0c4ec151 | 643 | run_dump_test "elf${el}-rel3" |
7ad8fb54 CD |
644 | if {[istarget mips64*-*-*]} { |
645 | run_dump_test "elf-rel4" | |
646 | } else { | |
647 | run_dump_test "e32-rel4" | |
648 | } | |
5f266a81 | 649 | run_dump_test "elf-rel5" |
98605598 | 650 | run_dump_test "elf-rel6" |
631cb423 | 651 | run_dump_test "elf-rel7" |
5e0116d5 RS |
652 | run_dump_test "elf-rel8" |
653 | run_dump_test "elf-rel9" | |
654 | if $has_newabi { | |
655 | run_dump_test "elf-rel10" | |
656 | run_dump_test "elf-rel11" | |
657 | } | |
5919d012 RS |
658 | run_dump_test "elf-rel12" |
659 | run_dump_test "elf-rel13" | |
64bdfcaf | 660 | run_dump_test "elf-rel14" |
05760fd2 AO |
661 | |
662 | if $has_newabi { | |
34ce925e RS |
663 | run_dump_test "elf-rel15" |
664 | ||
05760fd2 AO |
665 | run_dump_test "elf-rel-got-n32" |
666 | run_dump_test "elf-rel-xgot-n32" | |
667 | run_dump_test "elf-rel-got-n64" | |
668 | run_dump_test "elf-rel-xgot-n64" | |
669 | } | |
670 | ||
0c4ec151 | 671 | run_dump_test "${tmips}${el}empic" |
afdbd6d0 | 672 | run_dump_test "empic2" |
a657e7c1 CD |
673 | run_dump_test "empic3_e" |
674 | run_dump_test "empic3_g1" | |
675 | run_dump_test "empic3_g2" | |
f22ba854 NC |
676 | if { !$no_mips16 } { |
677 | run_dump_test "${tmips}mips${el}16-e" | |
678 | run_dump_test "${tmips}mips${el}16-f" | |
bb2d6cd7 | 679 | } |
fdb987ee | 680 | run_dump_test "elf-consthilo" |
09b8f35a | 681 | run_dump_test "expr1" |
07147777 | 682 | } |
640c0ccd | 683 | |
5e0116d5 | 684 | if $has_newabi { |
a4cb6c4d AO |
685 | run_dump_test "n32-consec" |
686 | } | |
687 | ||
640c0ccd CD |
688 | # tests of objdump's ability to disassemble using different |
689 | # register names. | |
690 | run_dump_test "gpr-names-numeric" | |
691 | run_dump_test "gpr-names-32" | |
692 | run_dump_test "gpr-names-n32" | |
693 | run_dump_test "gpr-names-64" | |
694 | ||
695 | run_dump_test "fpr-names-numeric" | |
696 | run_dump_test "fpr-names-32" | |
697 | run_dump_test "fpr-names-n32" | |
698 | run_dump_test "fpr-names-64" | |
699 | ||
700 | run_dump_test "cp0-names-numeric" | |
701 | run_dump_test "cp0-names-mips32" | |
af7ee8bf | 702 | run_dump_test "cp0-names-mips32r2" |
640c0ccd | 703 | run_dump_test "cp0-names-mips64" |
5f74bc13 | 704 | run_dump_test "cp0-names-mips64r2" |
640c0ccd | 705 | run_dump_test "cp0-names-sb1" |
af7ee8bf | 706 | |
bbcc0807 CD |
707 | run_dump_test "cp0sel-names-numeric" |
708 | run_dump_test "cp0sel-names-mips32" | |
709 | run_dump_test "cp0sel-names-mips32r2" | |
710 | run_dump_test "cp0sel-names-mips64" | |
5f74bc13 | 711 | run_dump_test "cp0sel-names-mips64r2" |
bbcc0807 CD |
712 | run_dump_test "cp0sel-names-sb1" |
713 | ||
af7ee8bf CD |
714 | run_dump_test "hwr-names-numeric" |
715 | run_dump_test "hwr-names-mips32r2" | |
5f74bc13 | 716 | run_dump_test "hwr-names-mips64r2" |
252b5132 | 717 | } |