summaryrefslogtreecommitdiffstats
path: root/binutils-2.25/gas/testsuite/gas/mips/mips.exp
blob: 6c0c9c8e4b4d3447e9c0d895645f06b9edfbd338 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
# Copyright (C) 2012-2014 Free Software Foundation, Inc.

# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
# 
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.  

#
# Some generic MIPS tests
#

# When adding a new test to this file, try to do the following things:
#
# * If testing assembly and disassembly of code, don't forget to test
# the actual bit encodings of the instructions (using the
# --show-raw-insn flag to objdump). 
#
# * Try to run the test for as many architectures as appropriate,
# using the "run_dump_test_arches" or "run_list_test_arches" functions,
# along with the output from a call to "mips_arch_list_matching."
#
# * Be sure to compare the test output before and after your testsuite
# changes, to verify that existing and new tests were run as expected.
# Look for expect ERROR messages in the testsuite .log file to make sure
# the new expect code did not contain errors.

# To add support for a new CPU to this file, add an appropriate entry
# to the sequence of "mips_arch_create" function calls below, and test
# the result.  The new CPU should automatically be used when running
# various tests.  If the new CPU is the default CPU for any tool
# targets, make sure the call to "mips_arch_create" reflects that fact.


# The functions below create and manipulate an "architecture data
# array" which contains entries for each MIPS architecture (or CPU)
# known to these tests.  The array contains the following information
# for each architecture, indexed by the name of the architecture
# described by the entry:
#
# displayname: The name of the entry to be used for pretty-printing.
#
# gprsize: The size in bits of General Purpose Registers provided by
# the architecture (must be 32 or 64).
#
# props: A list of text strings which are associated with the
# architecture.  These include the architecture name as well as
# information about what instructions the CPU supports.  When matching
# based on properties, an additional property is added to the normal
# property list, "gpr<gprsize>" so that tests can match CPUs which
# have GPRs of a specific size.  The following properties are most
# useful when matching properties for generic (i.e., not CPU-specific)
# tests:
#
#	mips1, mips2, mips3, mips4, mips5, mips32, mips64
#		The architecture includes the instructions defined
#		by that MIPS ISA.
#
#	fpisa3, fpisa4, fpisa5
#		The architecture includes the floating-point
#		instructions defined by that MIPS ISA.
#
#	gpr_ilocks
#		The architecture interlocks GPRs accesses.  (That is,
#		there are no load delay slots.)
#
#	mips3d	The architecture includes the MIPS-3D ASE.
#
#	ror	The architecture includes hardware rotate instructions.
#
#	gpr32, gpr64
#		The architecture provides 32- or 64-bit General Purpose
#		Registers.
#
#	singlefloat
#		The CPU is 64 bit, but only supports 32 bit FPU.
#
#	nollsc
#		The CPU doesn't support ll, sc, lld and scd instructions.
#
#	oddspreg
#		The CPU has odd-numbered single-precision registers
#		available and GAS enables use of them by default.
#
# as_flags: The assembler flags used when assembling tests for this
# architecture.
#
# objdump_flags: The objdump flags used when disassembling tests for
# this architecture.
#
# Most entries in the architecture array will have values in all of
# the fields above.  One entry, "default" represents the default CPU
# based on the target of the assembler being built.  If always has
# empty "as_flags" and "objdump_flags."

# mips_arch_init
#
# This function initializes the architecture data array ("mips_arches")
# to be empty.
proc mips_arch_init {} {
    global mips_arches

    # Catch because the variable won't be set the first time through.
    catch {unset mips_arches}
}

# mips_arch_create ARCH GPRSIZE EXTENDS PROPS AS_FLAGS OBJDUMP_FLAGS \
#		   (optional:) DEFAULT_FOR_TARGETS
#
# This function creates a new entry in the architecture data array,
# for the architecture or CPU named ARCH, and fills in the entry
# according to the rest of the arguments.
#
# The new entry's property list is initialized to contain ARCH, any
# properties specified by PROPS, and the properties associated with
# the entry specified by EXTENDS.  (The new architecture is considered
# to extend the capabilities provided by that architecture.)
#
# If DEFAULT_FOR_TARGETS is specified, it is a list of targets for which
# this architecture is the default architecture.  If "istarget" returns
# true for any of the targets in the list, a "default" entry will be
# added to the architecture array which indicates that ARCH is the default
# architecture.
proc mips_arch_create {arch gprsize extends props as_flags objdump_flags
		       {default_for_targets {}}} {
    global mips_arches

    if { [info exists mips_arches($arch)] } {
             error "mips_arch_create: arch \"$arch\" already exists"
    }
    if { $gprsize != 32 && $gprsize != 64 } {
	error "mips_arch_create: invalid GPR size $gprsize"
    }

    set archdata(displayname) $arch
    set archdata(gprsize) $gprsize
    set archdata(as_flags) $as_flags
    set archdata(objdump_flags) $objdump_flags
    set archdata(props) $arch
    eval lappend archdata(props) $props
    if { [string length $extends] != 0 } {
	eval lappend archdata(props) [mips_arch_properties $extends 0]
    }

    set mips_arches($arch) [array get archdata]

    # Set as default if appropriate.
    foreach target $default_for_targets {
	if { [istarget $target] } {
	    if { [info exists mips_arches(default)] } {
		error "mips_arch_create: default arch already exists"
	    }

	    set archdata(displayname) "default = $arch"
    	    set archdata(as_flags) ""
	    set archdata(objdump_flags) ""

	    set mips_arches(default) [array get archdata]
	    break
	}
    }
}

# mips_arch_destroy ARCH
#
# The opposite of the above.  This function removes an entry from
# the architecture data array, for the architecture or CPU named ARCH.

proc mips_arch_destroy {arch} {
    global mips_arches

    if { [info exists mips_arches($arch)] } {
	unset mips_arches($arch)
    }
}

# mips_arch_list_all
#
# This function returns the list of all names of entries in the
# architecture data array (including the default entry, if a default
# is known).
proc mips_arch_list_all {} {
    global mips_arches
    return [lsort -dictionary [array names mips_arches]]
}

# mips_arch_data ARCH
#
# This function returns the information associated with ARCH
# in the architecture data array, in "array get" form.
proc mips_arch_data {arch} {
    global mips_arches

    if { ! [info exists mips_arches($arch)] } {
	error "mips_arch_data: unknown arch \"$arch\""
    }
    return $mips_arches($arch)
}

# mips_arch_displayname ARCH
#
# This function returns the printable name associated with ARCH in
# the architecture data array.
proc mips_arch_displayname {arch} {
    array set archdata [mips_arch_data $arch]
    return $archdata(displayname)
}

# mips_arch_properties ARCH (optional:) INCLUDE_GPRSIZE
#
# This function returns the property list associated with ARCH in the
# architecture data array, including the "canonical" target name as the
# first element.
#
# If INCLUDE_GPRSIZE is non-zero, an additional "gpr32" or "gpr64"
# property will be returned as part of the list based on the
# architecture's GPR size.
proc mips_arch_properties {arch {include_gprsize 1}} {
    array set archdata [mips_arch_data $arch]
    set props $archdata(props)
    if { $include_gprsize } {
	lappend props gpr$archdata(gprsize)
    }
    return $props
}

# mips_arch_as_flags ARCH
#
# This function returns the assembler flags associated with ARCH in
# the architecture data array. 
proc mips_arch_as_flags {arch} {
    array set archdata [mips_arch_data $arch]
    return $archdata(as_flags)
}

# mips_arch_objdump_flags ARCH
#
# This function returns the objdump disassembly flags associated with
# ARCH in the architecture data array. 
proc mips_arch_objdump_flags {arch} {
    array set archdata [mips_arch_data $arch]
    return $archdata(objdump_flags)
}

# mips_arch_matches ARCH PROPMATCHLIST
#
# This function returns non-zero if ARCH matches the set of properties
# described by PROPMATCHLIST.  Each entry in PROPMATCHLIST can either
# be the name of a property which must be matched, or "!" followed by
# the name of a property which must not be matched.  ARCH matches
# PROPMATCHLIST if and only if all of the conditions specified by
# PROPMATCHLIST are satisfied.
proc mips_arch_matches {arch propmatchlist} {
    foreach pm $propmatchlist {
	if { [string match {!*} $pm] } {
	    # fail if present.
	    set inverted 1
	    set p [string range $pm 1 end]
	} {
	    # fail if not present.
	    set inverted 0
	    set p $pm
	}

	set loc [lsearch -exact [mips_arch_properties $arch] $p]

	# required-absent and found, or required-present and not found: fail.
	if { ($inverted && $loc != -1) || (! $inverted && $loc == -1) } {
	    return 0
	}
    }
    return 1
}

# mips_arch_list_matching ARGS
#
# This function returns a list of all architectures which match
# the conditions described by its arguments.  Its arguments are
# taken as a list and used as the PROPMATCHLIST in a call to
# "mips_arch_matches" for each known architecture.
proc mips_arch_list_matching {args} {
    set l ""
    foreach arch [mips_arch_list_all] {
	# For now, don't match default arch until we know what its
	# properties actually are.
	if { [string compare $arch default] == 0
	     && [string length [mips_arch_properties default]] == 0} {
	    continue
	}
	if { [mips_arch_matches $arch $args] } {
	    lappend l $arch
	}
    }
    return $l
}


# The functions below facilitate running various types of tests.

# run_dump_test_arch NAME OPTS ARCH
#
# Invoke "run_dump_test" for test NAME with additional assembler options OPTS.
# Add the assembler and disassembler flags that are associated with
# architecture ARCH.
#
# You can override the expected output for particular architectures.
# The possible test names are, in order of preference:
#
# 1. CARCH@NAME.d
# 2. NAME.d
#
# where CARCH is the "canonical" name of architecture ARCH as recorded
# in its associated property list.
proc run_dump_test_arch { name opts arch } {
    global subdir srcdir

    set proparch [lindex [mips_arch_properties $arch 0] 0]
    set prefixes [list ${proparch}@ ]
    if { [ string match "octeon*" $proparch ] && $proparch != "octeon" } {
	lappend prefixes octeon@
    }
    if { [ string match "mips*r6" $proparch ]} {
	lappend prefixes mipsr6@
    }
    foreach prefix ${prefixes} {
	set archname ${prefix}${name}
	if { [file exists "$srcdir/$subdir/${archname}.d"] } {
	    set name $archname
	    break
	}
    }

    if [catch {run_dump_test $name \
		   "{name    {([concat $opts [mips_arch_displayname $arch]])}}
		    {objdump {[mips_arch_objdump_flags $arch]}}
		    {as      {[concat $opts [mips_arch_as_flags $arch]]}}"} rv] {
        perror "$rv"
        untested "$subdir/$name ($arch)"
    }
}

# run_dump_test_arches NAME [OPTS] ARCH_LIST
#
# Invoke "run_dump_test_arch" for test NAME, for each architecture
# listed in ARCH_LIST.  OPTS, if specified, is a list of additional
# assembler options that should be used for all architectures.
proc run_dump_test_arches { name args } {
    set opts ""
    if { [llength $args] > 1 } {
	set opts [lindex $args 0]
	set args [lrange $args 1 end]
    }
    set arch_list [lindex $args 0]
    foreach arch $arch_list {
	run_dump_test_arch $name $opts $arch
    }
}

# run_list_test_arch NAME OPTS ARCH
#
# Invoke "run_list_test" for test NAME with additional assembler options OPTS.
# Add the assembler flags that are associated with architecture ARCH.
proc run_list_test_arch { name opts arch } {
    global subdir srcdir

    set testname "MIPS $name ([concat $opts [mips_arch_displayname $arch]])"
    set proparch [lindex [mips_arch_properties $arch 0] 0]
    set prefixes [list ${proparch}@ ]
    if { [ string match "octeon*" $proparch ] && $proparch != "octeon" } {
	lappend prefixes octeon@
    }
    if { [ string match "mips*r6" $proparch ]} {
	lappend prefixes mipsr6@
    }
    foreach prefix ${prefixes} {
	set archname ${prefix}${name}
	if { [file exists "$srcdir/$subdir/${archname}.l"] } {
	    set name $archname
	    break
	}
    }

    if [catch {run_list_test \
		   $name \
		   [concat $opts [mips_arch_as_flags $arch]] \
		   $testname} rv] {
        perror "$rv"
        untested "$testname"
    }
}

# run_list_test_arches NAME [OPTS] ARCH_LIST
#
# Invoke "run_list_test_arch" for test NAME, for each architecture listed
# in ARCH_LIST.  OPTS, if specified, is a list of additional assembler
# options that should be used for all architectures.
proc run_list_test_arches { name args } {
    set opts ""
    if { [llength $args] > 1 } {
	set opts [lindex $args 0]
	set args [lrange $args 1 end]
    }
    set arch_list [lindex $args 0]
    foreach arch $arch_list {
	run_list_test_arch "$name" "$opts" "$arch"
    }
}


# Create the architecture data array by providing data for all
# known architectures.
#
# Note that several targets pick default CPU based on ABI.  We
# can't easily handle that; do NOT list those targets as defaulting
# to any architecture.
mips_arch_init
mips_arch_create mips1 	32	{}	{} \
			{ -march=mips1 -mtune=mips1 } { -mmips:3000 }
mips_arch_create mips2 	32	mips1	{ gpr_ilocks } \
		        { -march=mips2 -mtune=mips2 } { -mmips:6000 }
mips_arch_create mips3 	64	mips2	{ fpisa3 } \
			{ -march=mips3 -mtune=mips3 } { -mmips:4000 }
mips_arch_create mips4 	64	mips3	{ fpisa4 } \
			{ -march=mips4 -mtune=mips4 } { -mmips:8000 }
mips_arch_create mips5 	64	mips4	{ fpisa5 } \
			{ -march=mips5 -mtune=mips5 } { -mmips:mips5 }
mips_arch_create mips32	32	mips2	{} \
			{ -march=mips32 -mtune=mips32 } { -mmips:isa32 } \
			{ mipsisa32-*-* mipsisa32el-*-* }
mips_arch_create mips32r2 32	mips32	{ fpisa3 fpisa4 fpisa5 ror } \
			{ -march=mips32r2 -mtune=mips32r2 } \
			{ -mmips:isa32r2 } \
			{ mipsisa32r2-*-* mipsisa32r2el-*-* }
mips_arch_create mips32r3 32	mips32r2 { fpisa3 fpisa4 fpisa5 ror } \
			{ -march=mips32r3 -mtune=mips32r3 } \
			{ -mmips:isa32r3 } \
			{ mipsisa32r3-*-* mipsisa32r3el-*-* }
mips_arch_create mips32r5 32	mips32r3 { fpisa3 fpisa4 fpisa5 ror } \
			{ -march=mips32r5 -mtune=mips32r5 } \
			{ -mmips:isa32r5 } \
			{ mipsisa32r5-*-* mipsisa32r5el-*-* }
mips_arch_create mips32r6 32	mips32r5 { fpisa3 fpisa4 fpisa5 ror } \
			{ -march=mips32r6 -mtune=mips32r6 --defsym r6=} \
			{ -mmips:isa32r6 } \
			{ mipsisa32r6-*-* mipsisa32r6el-*-* }
mips_arch_create mips64	64	mips5	{ mips32 } \
			{ -march=mips64 -mtune=mips64 } { -mmips:isa64 } \
			{ mipsisa64-*-* mipsisa64el-*-* }
mips_arch_create mips64r2 64	mips64	{ mips32r2 ror } \
			{ -march=mips64r2 -mtune=mips64r2 } \
			{ -mmips:isa64r2 } \
			{ mipsisa64r2-*-* mipsisa64r2el-*-* }
mips_arch_create mips64r3 64	mips64r2 { mips32r3 ror } \
			{ -march=mips64r3 -mtune=mips64r3 } \
			{ -mmips:isa64r3 } \
			{ mipsisa64r3-*-* mipsisa64r3el-*-* }
mips_arch_create mips64r5 64	mips64r3 { mips32r5 ror } \
			{ -march=mips64r5 -mtune=mips64r5 } \
			{ -mmips:isa64r5 } \
			{ mipsisa64r5-*-* mipsisa64r5el-*-* }
mips_arch_create mips64r6 64	mips64r5 { mips32r6 ror } \
			{ -march=mips64r6 -mtune=mips64r6 --defsym r6=} \
			{ -mmips:isa64r6 } \
			{ mipsisa64r6-*-* mipsisa64r6el-*-* }
mips_arch_create mips16	32	{}	{} \
			{ -march=mips1 -mips16 } { -mmips:16 }
mips_arch_create micromips 64	mips64r2 {} \
			{ -march=mips64r2 -mmicromips } {}
mips_arch_create r3000 	32	mips1	{} \
			{ -march=r3000 -mtune=r3000 } { -mmips:3000 }
mips_arch_create r3900 	32	mips1	{ gpr_ilocks } \
			{ -march=r3900 -mtune=r3900 } { -mmips:3900 } \
			{ mipstx39-*-* mipstx39el-*-* }
mips_arch_create r4000 	64	mips3	{} \
			{ -march=r4000 -mtune=r4000 } { -mmips:4000 }
mips_arch_create vr5400	64	mips4	{ ror } \
			{ -march=vr5400 -mtune=vr5400 } { -mmips:5400 }
mips_arch_create sb1 	64	mips64	{ mips3d oddspreg } \
			{ -march=sb1 -mtune=sb1 } { -mmips:sb1 } \
			{ mipsisa64sb1-*-* mipsisa64sb1el-*-* }
mips_arch_create octeon 64	mips64r2 { oddspreg } \
			{ -march=octeon -mtune=octeon } { -mmips:octeon } \
			{ mips64octeon*-*-* }
mips_arch_create octeonp 64	octeon { oddspreg } \
			{ -march=octeon+ -mtune=octeon+ } { -mmips:octeon+ } \
			{ }
mips_arch_create octeon2 64	octeonp { oddspreg } \
			{ -march=octeon2 -mtune=octeon2 } { -mmips:octeon2 } \
			{ }
mips_arch_create xlr 	64	mips64	{ oddspreg } \
			{ -march=xlr -mtune=xlr } { -mmips:xlr }
mips_arch_create r5900 	64	mips3	{ gpr_ilocks singlefloat nollsc } \
			{ -march=r5900 -mtune=r5900 } { -mmips:5900 } \
			{ mipsr5900el-*-* mips64r5900el-*-* }

#
# And now begin the actual tests!  VxWorks uses RELA rather than REL
# relocations, so most of the generic dump tests will not work there.
#
if { [istarget mips*-*-vxworks*] } {
    run_dump_test "vxworks1"
    run_dump_test "vxworks1-xgot"
    run_dump_test "vxworks1-el"
    run_dump_test "vxworks1-xgot-el"
} elseif { [istarget mips*-*-*] } {
    set addr32 [expr [istarget mipstx39*-*-*] || [istarget mips-*-linux*] || [istarget mipsel-*-linux*] \
		     || [istarget mipsisa32-*-linux*] || [istarget mipsisa32el-*-linux*]]
    set has_newabi [expr [istarget *-*-irix6*] || [istarget mips*-*-linux*] \
                         || [istarget mips*-sde-elf*] || [istarget mips*-mti-elf*] \
                         || [istarget mips*-img-elf*]]

    if { [istarget "mips*-*-*linux*"]
	 || [istarget "mips*-sde-elf*"]
	 || [istarget "mips*-mti-elf*"]
	 || [istarget "mips*-img-elf*"]
	 || [istarget "mips*-*-*bsd*"] } then {
	set tmips "t"
    } else {
	set tmips ""
    }
    if [istarget mips*el-*-*] {
	set el "el"
    } {
	set el ""
    }

    run_dump_test_arches "dot-1"	[mips_arch_list_matching mips1]
    run_dump_test_arches "abs"		[mips_arch_list_matching mips1]
    run_dump_test_arches "add"		[mips_arch_list_matching mips1]
    run_dump_test_arches "and"		[mips_arch_list_matching mips1]
    run_dump_test_arches "mips1-fp"	[mips_arch_list_matching mips1]
    run_list_test_arches "mips1-fp" "-32 -msoft-float" \
					[mips_arch_list_matching mips1]
    run_dump_test "break20"
    run_dump_test "trap20"

    run_dump_test_arches "beq"		[mips_arch_list_matching mips1]
    run_dump_test_arches "bge"		[mips_arch_list_matching mips1]
    run_dump_test_arches "bgeu"		[mips_arch_list_matching mips1]
    run_dump_test_arches "blt"		[mips_arch_list_matching mips1]
    run_dump_test_arches "bltu"		[mips_arch_list_matching mips1]
    run_dump_test_arches "branch-likely" [mips_arch_list_matching mips2 !mips32r6]
    run_dump_test_arches "branch-misc-1" [mips_arch_list_matching mips1]
    run_dump_test_arches "branch-misc-2" [mips_arch_list_matching mips1]
    run_dump_test_arches "branch-misc-2pic" [mips_arch_list_matching mips1]
    run_dump_test_arches "branch-misc-2-64" [mips_arch_list_matching mips3]
    run_dump_test_arches "branch-misc-2pic-64" [mips_arch_list_matching mips3]
    run_dump_test "branch-misc-3"
    run_dump_test "branch-swap"

    # Sweep a range of branch offsets so that it hits a position where
    # it is at the beginning of a frag and then swapped with a 16-bit
    # instruction from the preceding frag.  The offset will be somewhere
    # close below 4096 as this is the default obstack size limit that
    # we use and some space will have been already consumed.  The exact
    # amount depends on the host's programming model.
    for { set count 960 } { $count <= 1024 } { incr count } {
	run_list_test "branch-swap-2" "--defsym count=$count" \
	    "MIPS branch swapping ($count)"
    }

    run_dump_test "div"

    if { !$addr32 } {
	run_dump_test_arches "dli"	[mips_arch_list_matching mips3]
    }
    run_dump_test_arches "jal"		[mips_arch_list_matching mips1]
    run_dump_test_arches "jal-mask-11"	[mips_arch_list_matching mips1]
    run_dump_test_arches "jal-mask-12"	[mips_arch_list_matching mips1]
    run_dump_test_arches "jal-mask-21"	[mips_arch_list_matching micromips]
    run_dump_test_arches "jal-mask-22"	[mips_arch_list_matching micromips]
    run_dump_test "eret-1"
    run_dump_test "eret-2"
    run_dump_test "eret-3"
    run_dump_test_arches "fix-rm7000-1" \
					[mips_arch_list_matching mips3 !singlefloat \
						!mips64r6]
    run_dump_test_arches "fix-rm7000-2" \
					[mips_arch_list_matching mips3 !singlefloat \
						!mips64r6]
    run_dump_test_arches "24k-branch-delay-1" \
					[mips_arch_list_matching mips1]
    run_dump_test_arches "24k-triple-stores-1" \
				[mips_arch_list_matching fpisa5 !octeon]
    run_dump_test_arches "24k-triple-stores-2" \
					[mips_arch_list_matching mips2]
    run_dump_test_arches "24k-triple-stores-2-llsc" \
					[mips_arch_list_matching mips2 !nollsc]
    run_dump_test_arches "24k-triple-stores-3" \
					[mips_arch_list_matching mips2]
    run_dump_test_arches "24k-triple-stores-4" \
					[mips_arch_list_matching mips2 !singlefloat]
    run_dump_test_arches "24k-triple-stores-5" \
					[mips_arch_list_matching mips1]
    run_dump_test_arches "24k-triple-stores-6" \
					[mips_arch_list_matching mips2 !singlefloat]
    run_dump_test_arches "24k-triple-stores-7" \
					[mips_arch_list_matching mips2 !singlefloat]
    run_dump_test_arches "24k-triple-stores-8" \
					[mips_arch_list_matching mips1]
    run_dump_test_arches "24k-triple-stores-9" \
					[mips_arch_list_matching mips1]
    run_dump_test_arches "24k-triple-stores-10" \
					[mips_arch_list_matching mips1]
    run_dump_test_arches "24k-triple-stores-11" \
	    				[mips_arch_list_matching mips1]

    run_dump_test_arches "jal-svr4pic"	[mips_arch_list_matching mips1]
    run_dump_test_arches "jal-svr4pic-noreorder" \
					[mips_arch_list_matching mips1]
    run_dump_test "jal-xgot"
    run_list_test_arches "jal-range" "-32" [mips_arch_list_matching mips1]
    if $has_newabi { run_dump_test "jal-newabi" }
    run_dump_test "la"
    run_dump_test "la-svr4pic"
    run_dump_test "la-xgot"
    run_dump_test "lca-svr4pic"
    run_dump_test "lca-xgot"
    # XXX FIXME: Has mips2 and later insns with mips1 disassemblies.
    # (Should split and then use appropriate arch lists.)
    run_dump_test_arches "lb"	[mips_arch_list_matching mips1 !mips2]
    run_dump_test_arches "lb-svr4pic" \
				[mips_arch_list_matching mips1 !gpr_ilocks]
    run_dump_test_arches "lb-svr4pic-ilocks" [mips_arch_list_matching gpr_ilocks]
    # Both versions specify the cpu, so we can run both regardless of
    # the interlocking in the configured default cpu.
    run_dump_test "lb-xgot"
    run_dump_test "lb-xgot-ilocks"
    run_dump_test_arches "ld"		[mips_arch_list_matching mips1]
    run_dump_test_arches "ld-forward" 	[mips_arch_list_matching mips1]
    run_dump_test_arches "sd"		[mips_arch_list_matching mips1]
    run_dump_test_arches "sd-forward" 	[mips_arch_list_matching mips1]
    run_dump_test_arches "l_d" 		[mips_arch_list_matching mips1 !singlefloat]
    run_dump_test_arches "l_d-single"	[mips_arch_list_matching mips1 singlefloat]
    run_dump_test_arches "l_d-forward"	[mips_arch_list_matching mips1 !singlefloat]
    run_dump_test_arches "s_d"		[mips_arch_list_matching mips1 !singlefloat]
    run_dump_test_arches "s_d-single"	[mips_arch_list_matching mips1 singlefloat]
    run_dump_test_arches "s_d-forward" 	[mips_arch_list_matching mips1 !singlefloat]
    run_dump_test_arches "ldc1"		[mips_arch_list_matching mips2 !singlefloat]
    run_dump_test_arches "ldc1-forward" [mips_arch_list_matching mips2 !singlefloat]
    run_dump_test_arches "sdc1"		[mips_arch_list_matching mips2 !singlefloat]
    run_dump_test_arches "sdc1-forward" [mips_arch_list_matching mips2 !singlefloat]
    if $has_newabi {
	run_dump_test_arches "ld-n32" 	[mips_arch_list_matching mips3]
	run_dump_test_arches "ld-forward-n32" \
					[mips_arch_list_matching mips3]
	run_dump_test_arches "sd-n32" 	[mips_arch_list_matching mips3]
	run_dump_test_arches "sd-forward-n32" \
					[mips_arch_list_matching mips3]
	run_dump_test_arches "l_d-n32" 	[mips_arch_list_matching mips3 !singlefloat]
	run_dump_test_arches "l_d-forward-n32" \
					[mips_arch_list_matching mips3 !singlefloat]
	run_dump_test_arches "s_d-n32" 	[mips_arch_list_matching mips3 !singlefloat]
	run_dump_test_arches "s_d-forward-n32" \
					[mips_arch_list_matching mips3 !singlefloat]
	run_dump_test_arches "ldc1-n32" [mips_arch_list_matching mips3 !singlefloat]
	run_dump_test_arches "ldc1-forward-n32" \
					[mips_arch_list_matching mips3 !singlefloat]
	run_dump_test_arches "sdc1-n32" [mips_arch_list_matching mips3 !singlefloat]
	run_dump_test_arches "sdc1-forward-n32" \
					[mips_arch_list_matching mips3 !singlefloat]
	run_dump_test_arches "ld-n64"	[mips_arch_list_matching mips3]
	run_dump_test_arches "ld-forward-n64" \
					[mips_arch_list_matching mips3]
	run_dump_test_arches "sd-n64"	[mips_arch_list_matching mips3]
	run_dump_test_arches "sd-forward-n64" \
					[mips_arch_list_matching mips3]
	run_dump_test_arches "l_d-n64"	[mips_arch_list_matching mips3 !singlefloat]
	run_dump_test_arches "l_d-forward-n64" \
					[mips_arch_list_matching mips3 !singlefloat]
	run_dump_test_arches "s_d-n64"	[mips_arch_list_matching mips3 !singlefloat]
	run_dump_test_arches "s_d-forward-n64" \
					[mips_arch_list_matching mips3 !singlefloat]
	run_dump_test_arches "ldc1-n64"	[mips_arch_list_matching mips3 !singlefloat]
	run_dump_test_arches "ldc1-forward-n64" \
					[mips_arch_list_matching mips3 !singlefloat]
	run_dump_test_arches "sdc1-n64"	[mips_arch_list_matching mips3 !singlefloat]
	run_dump_test_arches "sdc1-forward-n64" \
					[mips_arch_list_matching mips3 !singlefloat]
    }
    run_dump_test_arches "ld-zero"	[mips_arch_list_matching mips1]
    run_dump_test_arches "ld-zero-2"	[mips_arch_list_matching mips2 !nollsc]
    run_dump_test_arches "ld-zero-3"	[mips_arch_list_matching mips3 !nollsc]
    run_dump_test_arches "ld-zero-u"	[mips_arch_list_matching micromips]
    run_dump_test_arches "ld-zero-q"	[mips_arch_list_matching r5900]
    run_dump_test "ld-svr4pic"
    run_dump_test "ld-xgot"
    run_dump_test_arches "li"		[mips_arch_list_matching mips1]
    run_dump_test "lifloat"
    run_dump_test "lif-svr4pic"
    run_dump_test "lif-xgot"
    run_dump_test_arches "mips4"	[mips_arch_list_matching mips4]
    run_dump_test_arches "mips4-fp" "-32" \
					[mips_arch_list_matching fpisa4]
    run_dump_test_arches "mips4-fp" "-mabi=o64" \
					[mips_arch_list_matching fpisa4 gpr64]
    run_list_test_arches "mips4-fp" "-32 -msoft-float" \
					[mips_arch_list_matching fpisa4]
    run_dump_test_arches "mips4-branch-likely" \
					[mips_arch_list_matching mips4 !mips32r6]
    run_list_test_arches "mips4-branch-likely" "-32 -msoft-float" \
					[mips_arch_list_matching mips4 !mips32r6]
    run_dump_test_arches "mips5-fp" "-32" \
					[mips_arch_list_matching fpisa5]
    run_dump_test_arches "mips5-fp" "-mabi=o64" \
					[mips_arch_list_matching fpisa5 gpr64]
    run_dump_test "mul"

    run_dump_test_arches "rol"		[mips_arch_list_matching mips1 !ror]
    run_dump_test_arches "rol-hw" 	[mips_arch_list_matching ror]

    run_dump_test_arches "rol64"	[mips_arch_list_matching gpr64 !ror]
    run_dump_test_arches "rol64-hw"	[mips_arch_list_matching gpr64 ror]

    run_dump_test "sb"
    run_dump_test "trunc"
    run_dump_test "ulh"
    run_dump_test_arches "ulh2-eb"	[mips_arch_list_matching mips1 !mips32r6]
    run_dump_test_arches "ulh2-el"	[mips_arch_list_matching mips1 !mips32r6]
    run_dump_test "ulh-svr4pic"
    run_dump_test "ulh-xgot"
    run_dump_test "ulw"
    run_dump_test "uld"
    run_dump_test "ush"
    run_dump_test "usw"
    run_dump_test "usd"
    run_dump_test_arches "ulw2-eb" [mips_arch_list_matching mips1 !gpr_ilocks \
					!mips32r6]
    run_dump_test_arches "ulw2-eb-ilocks" [mips_arch_list_matching gpr_ilocks \
					!mips32r6]
    run_dump_test_arches "ulw2-el" [mips_arch_list_matching mips1 !gpr_ilocks \
					!mips32r6]
    run_dump_test_arches "ulw2-el-ilocks" [mips_arch_list_matching gpr_ilocks \
					!mips32r6]

    run_dump_test_arches "uld2-eb" [mips_arch_list_matching mips3 !mips32r6]
    run_dump_test_arches "uld2-el" [mips_arch_list_matching mips3 !mips32r6]

    run_dump_test "mips16"
    run_dump_test "mips16-64"
    run_dump_test "mips16-macro"
    # Check MIPS16e extensions
    run_dump_test_arches "mips16e" [mips_arch_list_matching mips32 !micromips \
					!mips32r6]
    # Check jalx handling
    run_dump_test "mips16-jalx"
    run_dump_test "mips-jalx"
    run_dump_test "mips-jalx-2"
    # Check MIPS16 HI16/LO16 relocations
    run_dump_test "mips16-hilo"
    if $has_newabi {
	run_dump_test "mips16-hilo-n32"
    }
    run_dump_test "mips16-hilo-match"
    run_dump_test "delay"
    run_dump_test "nodelay"
    run_dump_test "mips4010"
    run_dump_test "mips4650"
    run_dump_test "mips4100"
    run_dump_test "vr4111"
    run_dump_test "vr4120"
    run_dump_test "vr4120-2"
    run_dump_test "vr4130"
    run_dump_test "vr5400"
    run_list_test "vr5400-ill" "-march=vr5400"
    run_dump_test "vr5500"
    run_dump_test "rm7000"
    run_dump_test "perfcount"
    run_dump_test "lineno"
    run_dump_test "sync"

    run_dump_test_arches "virt"		[mips_arch_list_matching mips32r2]
    run_dump_test_arches "virt64"	[mips_arch_list_matching mips64r2]

    run_dump_test_arches "mips32"	[mips_arch_list_matching mips32]
    run_dump_test_arches "mips32-imm"	[mips_arch_list_matching mips32]

    run_dump_test_arches "mips32-sf32"	[mips_arch_list_matching mips32]
    run_list_test_arches "mips32-sf32" "-32 -msoft-float" \
					[mips_arch_list_matching mips32]
    run_dump_test_arches "mips32-cp2"	[mips_arch_list_matching mips32 \
					    !octeon]

    run_dump_test_arches "mips32r2"	[mips_arch_list_matching mips32r2]
    run_dump_test_arches "mips32r2-cp2"	[mips_arch_list_matching mips32r2 \
					    !octeon]
    run_dump_test_arches "mips32r2-fp32" \
					[mips_arch_list_matching mips32r2]
    run_list_test_arches "mips32r2-fp32" "-32 -msoft-float" \
					[mips_arch_list_matching mips32r2]
    run_list_test_arches "mips32r2-ill" "-32" \
			[mips_arch_list_matching mips32r2 gpr32]
    run_list_test_arches "mips32r2-ill-fp64" "-mabi=o64" \
			[mips_arch_list_matching mips32r2 gpr64]
    run_list_test_arches "mips32r2-ill-nofp" "-32 -msoft-float" \
			[mips_arch_list_matching mips32r2]

    run_dump_test_arches "mips64"	[mips_arch_list_matching mips64]
    run_dump_test_arches "mips64-cp2"	[mips_arch_list_matching mips64 \
					    !octeon]

    run_dump_test_arches "mips64r2"	[mips_arch_list_matching mips64r2]
    run_list_test_arches "mips64r2-ill"	[mips_arch_list_matching mips64r2]

    run_dump_test "set-arch"

    if { !$addr32 } {
	run_dump_test "mips64-mips3d"
	run_dump_test_arches "mips64-mips3d-incl" [mips_arch_list_matching mips3d]

	run_dump_test "mips64-mdmx"
	run_dump_test "sb1-ext-mdmx"
	run_dump_test "sb1-ext-ps"
	run_dump_test "xlr-ext"
    }

    run_dump_test_arches "relax"	[mips_arch_list_matching mips2 !mips32r6]
    run_dump_test_arches "relax-at"	[mips_arch_list_matching mips2 !mips32r6]
    run_dump_test "relax-swap1-mips1"
    run_dump_test "relax-swap1-mips2"
    run_dump_test "relax-swap2"
    run_dump_test_arches "relax-swap3"	[mips_arch_list_all]
    run_list_test_arches "relax-bc1any" "-mips3d -mabi=o64 -relax-branch" \
					[mips_arch_list_matching mips64 \
					    !micromips !mips32r6]
    run_list_test_arches "relax-bposge" "-mdsp -relax-branch" \
					[mips_arch_list_matching mips64r2 \
					    !micromips !mips32r6]

    run_dump_test_arches "eva"		[mips_arch_list_matching mips32r2 !octeon]

    run_list_test "illegal" "-32"
    run_list_test "baddata1" "-32"
    run_list_test "jalr" ""

    run_dump_test "mips-gp32-fp32"
    run_dump_test "mips-gp32-fp64"
    run_dump_test "mips-gp64-fp32"
    run_dump_test "mips-gp64-fp64"

    # Make sure that -mcpu=FOO and -mFOO are equivalent.  Assemble a file
    # containing 4650-specific instructions with -m4650 and -mcpu=4650,
    # and verify that they're the same.  Specifically, we're checking
    # that the EF_MIPS_MACH field is set, and that the 4650 'mul'
    # instruction does get used.  In previous versions of GAS,
    # only -mcpu=4650 would set the EF_MIPS_MACH field; -m4650 wouldn't.
    run_dump_test "elf_e_flags1"
    run_dump_test "elf_e_flags2"
    run_dump_test "elf_e_flags3"
    run_dump_test "elf_e_flags4"

    # Check EF_MIPS_ARCH markings for each supported architecture.
    run_dump_test "elf_arch_mips1"
    run_dump_test "elf_arch_mips2"
    run_dump_test "elf_arch_mips3"
    run_dump_test "elf_arch_mips4"
    run_dump_test "elf_arch_mips5"
    run_dump_test "elf_arch_mips32"
    run_dump_test "elf_arch_mips32r2"
    run_dump_test "elf_arch_mips32r3"
    run_dump_test "elf_arch_mips32r5"
    run_dump_test "elf_arch_mips32r6"
    run_dump_test "elf_arch_mips64"
    run_dump_test "elf_arch_mips64r2"
    run_dump_test "elf_arch_mips64r3"
    run_dump_test "elf_arch_mips64r5"
    run_dump_test "elf_arch_mips64r6"

    # Verify that ASE markings are handled properly.
    run_dump_test "elf_ase_mips16"
    run_dump_test "elf_ase_mips16-2"

    run_dump_test "elf_ase_micromips"
    run_dump_test "elf_ase_micromips-2"

    run_dump_test "mips-gp32-fp32-pic"
    run_dump_test "mips-gp32-fp64-pic"
    run_dump_test "mips-gp64-fp32-pic"
    run_dump_test "mips-gp64-fp64-pic"

    run_dump_test "mips-abi32"
    run_dump_test "mips-abi32-pic"
    run_dump_test "mips-abi32-pic2"

    run_dump_test "elf${el}-rel"
    run_dump_test_arches "elf${el}-rel2" [mips_arch_list_matching gpr64 !singlefloat]
    run_dump_test "e32${el}-rel2"
    run_dump_test "elf${el}-rel3"
    run_dump_test_arches "elf-rel4" [mips_arch_list_matching gpr64]
    run_dump_test "e32-rel4"
    run_dump_test "elf-rel5"
    run_dump_test "elf-rel6"
    if $has_newabi {
	run_dump_test "elf-rel6-n32"
	run_dump_test "elf-rel6-n64"
    }
    run_dump_test "elf-rel7"
    run_dump_test "elf-rel8"
    run_dump_test "elf-rel8-mips16"
    run_dump_test "elf-rel9"
    run_dump_test "elf-rel9-mips16"
    if $has_newabi {
	run_dump_test "elf-rel10"
	run_dump_test "elf-rel11"
    }
    run_dump_test "elf-rel12"
    run_dump_test "elf-rel13"
    run_dump_test "elf-rel13-mips16"
    run_dump_test "elf-rel14"

    if $has_newabi {
	run_dump_test "elf-rel15"
	run_dump_test "elf-rel16"

	run_dump_test "elf-rel-got-n32"
	run_dump_test "elf-rel-xgot-n32"
	run_dump_test "elf-rel-got-n64"
	run_dump_test "elf-rel-xgot-n64"
    }
    run_dump_test "elf-rel17"
    if $has_newabi {
	run_dump_test "elf-rel18"
    }
    run_dump_test "elf-rel19"
    run_dump_test "elf-rel20"
    if $has_newabi {
	run_dump_test "elf-rel21"
	run_dump_test "elf-rel22"
	run_dump_test "elf-rel23"
	run_dump_test "elf-rel23a"
	run_dump_test "elf-rel23b"
	run_dump_test "elf-rel24"
    }

    run_dump_test "elf-rel25"
    run_dump_test "elf-rel25a"
    run_dump_test "elf-rel26"

    run_dump_test_arches "elf-rel27" [mips_arch_list_all]

    if $has_newabi {
	run_dump_test "elf-rel28-n32"
	run_dump_test "elf-rel28-n64"
	run_dump_test_arches "elf-rel29" [mips_arch_list_matching mips3]
    }
    run_list_test_arches "elf-rel30" "-32" [mips_arch_list_all]

    run_dump_test "${tmips}mips${el}16-e"
    run_dump_test "${tmips}mips${el}16-f"

    run_dump_test "elf-consthilo"
    run_dump_test "expr1"

    run_list_test "tls-ill" "-32"
    run_dump_test "tls-o32"
    run_dump_test "tls-relw"
    run_dump_test "jalr2"
    run_dump_test_arches "jalr3"	[mips_arch_list_matching mips1 \
					    !micromips]
    if $has_newabi {
	run_dump_test_arches "jalr3-n32" \
					[mips_arch_list_matching mips3 \
					    !micromips]
	run_dump_test_arches "jalr3-n64" \
					[mips_arch_list_matching mips3 \
					    !micromips]
    }

    run_dump_test_arches "aent"	[mips_arch_list_matching mips1]

    run_dump_test_arches "branch-misc-4"	[mips_arch_list_matching mips1]
    run_dump_test_arches "branch-misc-4-64"	[mips_arch_list_matching mips3]

    run_dump_test_arches "loc-swap"	[mips_arch_list_all]
    run_dump_test_arches "loc-swap-dis"	[mips_arch_list_all]
    run_dump_test_arches "loc-swap-2"	[mips_arch_list_all]
    run_dump_test_arches "loc-swap-3"	[mips_arch_list_all]

    run_dump_test "nan-legacy-1"
    run_dump_test "nan-legacy-2"
    run_dump_test "nan-legacy-3"
    run_dump_test "nan-legacy-4"
    run_dump_test "nan-legacy-5"

    run_dump_test "nan-2008-1"
    run_dump_test "nan-2008-2"
    run_dump_test "nan-2008-3"
    run_dump_test "nan-2008-4"

    run_list_test "nan-error-1"
    run_list_test "nan-error-2" "-mnan=foo"

    if $has_newabi {
	run_dump_test "n32-consec"
    }

    # tests of objdump's ability to disassemble using different
    # register names.
    run_dump_test "gpr-names-numeric"
    run_dump_test "gpr-names-32"
    run_dump_test "gpr-names-n32"
    run_dump_test "gpr-names-64"

    run_dump_test "fpr-names-numeric"
    run_dump_test "fpr-names-32"
    run_dump_test "fpr-names-n32"
    run_dump_test "fpr-names-64"

    run_dump_test "cp0-names-numeric"
    run_dump_test "cp0-names-r3000"
    run_dump_test "cp0-names-r4000" \
		  { { {name} {(r4000)} } { {objdump} {-M cp0-names=r4000} } }
    run_dump_test "cp0-names-r4000" \
		  { { {name} {(r4400)} } { {objdump} {-M cp0-names=r4400} } }
    run_dump_test "cp0-names-mips32"
    run_dump_test "cp0-names-mips32r2"
    run_dump_test "cp0-names-mips64"
    run_dump_test "cp0-names-mips64r2"
    run_dump_test "cp0-names-sb1"

    run_dump_test "cp0sel-names-numeric"
    run_dump_test "cp0sel-names-mips32"
    run_dump_test "cp0sel-names-mips32r2"
    run_dump_test "cp0sel-names-mips64"
    run_dump_test "cp0sel-names-mips64r2"
    run_dump_test "cp0sel-names-sb1"

    run_dump_test "cp1-names-numeric"
    run_dump_test "cp1-names-r3000"
    run_dump_test "cp1-names-r4000" \
		  { { {name} {(r4000)} } { {objdump} {-M cp0-names=r4000} } }
    run_dump_test "cp1-names-r4000" \
		  { { {name} {(r4400)} } { {objdump} {-M cp0-names=r4400} } }
    run_dump_test "cp1-names-mips32"
    run_dump_test "cp1-names-mips32r2"
    run_dump_test "cp1-names-mips64"
    run_dump_test "cp1-names-mips64r2"
    run_dump_test "cp1-names-sb1"

    run_dump_test "hwr-names-numeric"
    run_dump_test "hwr-names-mips32r2"
    run_dump_test "hwr-names-mips64r2"

    run_dump_test "ldstla-32"
    run_dump_test "ldstla-32-mips3"
    run_dump_test "ldstla-32-shared"
    run_dump_test "ldstla-32-mips3-shared"
    run_list_test "ldstla-32-1" "-mabi=32" \
	"MIPS ld-st-la bad constants (ABI o32)"
    run_list_test "ldstla-32-mips3-1" "-mabi=32" \
	"MIPS ld-st-la bad constants (ABI o32, mips3)"
    run_list_test "ldstla-32-1" "-KPIC -mabi=32" \
	"MIPS ld-st-la bad constants (ABI o32, shared)"
    run_list_test "ldstla-32-mips3-1" "-KPIC -mabi=32" \
	"MIPS ld-st-la bad constants (ABI o32, mips3, shared)"
    run_dump_test "ldstla-eabi64"
    if $has_newabi {
	run_dump_test "ldstla-n64"
	run_dump_test "ldstla-n64-shared"
	run_dump_test "ldstla-n64-sym32"
    }

    run_dump_test "macro-warn-1"
    run_dump_test "macro-warn-2"
    run_dump_test "macro-warn-3"
    run_dump_test "macro-warn-4"
    if $has_newabi {
	run_dump_test "macro-warn-1-n32"
	run_dump_test "macro-warn-2-n32"
    }

    run_dump_test "noat-1"
    run_list_test "noat-2" ""
    run_list_test "noat-3" ""
    run_list_test "noat-4" ""
    run_list_test "noat-5" ""
    run_list_test "noat-6" ""
    run_list_test "noat-7" ""

    run_dump_test "at-1"
    run_list_test "at-2" "-32 -mips1" "MIPS at-2"

    run_dump_test "loongson-2e"
    run_dump_test "loongson-2f"
    run_dump_test "loongson-2f-2"
    run_dump_test "loongson-2f-3"

    run_dump_test "loongson-3a"
    run_dump_test "loongson-3a-2"
    run_dump_test "loongson-3a-3"

    run_dump_test_arches "octeon"	[mips_arch_list_matching octeon]
    run_dump_test_arches "octeon-saa-saad" [mips_arch_list_matching octeonp]
    run_list_test_arches "octeon-ill"	[mips_arch_list_matching octeon]
    run_dump_test_arches "octeon-pref"	[mips_arch_list_matching octeon]
    run_dump_test_arches "octeon2"	[mips_arch_list_matching octeon2]

    run_dump_test "smartmips"
    run_dump_test_arches "mips32-dsp"	[mips_arch_list_matching mips32r2 \
					    !octeon]
    run_dump_test_arches "mips32-dspr2"	[mips_arch_list_matching mips32r2 \
					    !octeon]
    run_dump_test "mips64-dsp"
    run_dump_test "mips32-mt"

    run_dump_test "mips16-dwarf2"
    if $has_newabi {
	run_dump_test "mips16-dwarf2-n32"
    }
    run_dump_test "mips16-stabs"

    run_dump_test "mips16e-jrc"
    run_dump_test "mips16e-save"
    run_list_test "mips16e-save-err" "-march=mips32 -32"
    run_dump_test "mips16e-64"
    run_list_test "mips16e-64" "-march=mips32 -32"
    run_dump_test "mips16-intermix"

    run_dump_test "vxworks1"
    run_dump_test "vxworks1-xgot"
    run_dump_test "vxworks1-el"
    run_dump_test "vxworks1-xgot-el"

    run_dump_test "noreorder"
    run_dump_test "align"
    run_dump_test "align2"
    run_dump_test "align2-el"
    run_dump_test "align3"
    run_dump_test "odd-float"
    run_dump_test "ehword"
    run_dump_test "insn-opts"

    run_list_test_arches "mips-macro-ill-sfp" "-32 -msingle-float" \
					[mips_arch_list_matching mips2]
    run_list_test_arches "mips-macro-ill-nofp" "-32 -msoft-float" \
					[mips_arch_list_matching mips2]

    run_list_test_arches "mips-hard-float-flag" \
	"-32 -msoft-float -mhard-float" \
	[mips_arch_list_matching mips1 !singlefloat]
    run_list_test_arches "mips-double-float-flag" \
	"-32 -msingle-float -mdouble-float" \
	[mips_arch_list_matching mips1 !singlefloat]

    run_dump_test "mips16-vis-1"
    run_dump_test "call-nonpic-1"
    run_dump_test "mips32-sync"
    run_dump_test_arches "mips32r2-sync" \
					[mips_arch_list_matching mips32r2]
    run_dump_test_arches "alnv_ps-swap" [mips_arch_list_matching fpisa5 \
						!mips32r6]
    run_dump_test_arches "cache" [lsort -dictionary -unique [concat \
					[mips_arch_list_matching mips3] \
					[mips_arch_list_matching mips32] ] ]
    run_dump_test_arches "daddi"	[mips_arch_list_matching mips3 \
						!mips32r6]
    run_dump_test_arches "pref" [lsort -dictionary -unique [concat \
					[mips_arch_list_matching mips4] \
					[mips_arch_list_matching mips32] ] ]

    if $has_newabi { run_dump_test "cfi-n64-1" }

    run_dump_test "pr12915"
    run_dump_test "reginfo-1a"
    run_dump_test "reginfo-1b"

    run_dump_test "micromips"
    run_dump_test "micromips-trap"
    run_dump_test "micromips-insn32"
    run_dump_test "micromips-noinsn32"
    run_list_test "micromips" "-mips32r2 -32 -mfp64 -minsn32" \
	"microMIPS for MIPS32r2 (instructions invalid in insn32 mode)"
    run_list_test "micromips-size-0" \
	"-32 -march=mips64 -mmicromips" "microMIPS instruction size 0"
    run_dump_test "micromips-size-1"
    run_dump_test "micromips-branch-relax"
    run_dump_test "micromips-branch-relax-pic"
    run_dump_test "micromips-branch-delay"
    run_dump_test "micromips-warn-branch-delay"
    run_dump_test "micromips-warn-branch-delay-1"
    run_dump_test "micromips-b16"
    run_list_test "micromips-ill"

    run_dump_test_arches "mcu"		[mips_arch_list_matching mips32r2 \
					    !octeon]
    run_dump_test_arches "hilo-diff-eb"	[mips_arch_list_all]
    run_dump_test_arches "hilo-diff-el"	[mips_arch_list_all]
    if $has_newabi {
	run_dump_test_arches "hilo-diff-eb-n32" [mips_arch_list_matching mips3]
	run_dump_test_arches "hilo-diff-el-n32" [mips_arch_list_matching mips3]
	run_dump_test_arches "hilo-diff-eb-n64" [mips_arch_list_matching mips3]
	run_dump_test_arches "hilo-diff-el-n64" [mips_arch_list_matching mips3]
    }
    run_dump_test_arches "lui"		[mips_arch_list_matching mips1]
    run_list_test_arches "lui-1" "-32"	[mips_arch_list_matching mips1]
    run_list_test_arches "lui-2" "-32"	[mips_arch_list_matching mips1]

    run_dump_test "r5900"
    run_dump_test "r5900-full"
    run_list_test "r5900-nollsc" "-mabi=o64 -march=r5900"
    run_dump_test "r5900-vu0"
    run_dump_test "r5900-full-vu0"
    run_dump_test "r5900-all-vu0"
    run_list_test "r5900-error-vu0" "-march=r5900"

    run_list_test_arches "ext-ill"	[mips_arch_list_matching mips64r2]

    run_list_test "ase-errors-1" "-mabi=32 -march=mips1" "ASE errors (1)"
    run_list_test "ase-errors-2" "-mabi=o64 -march=mips3" "ASE errors (2)"
    run_list_test "ase-errors-3" "-mabi=32 -march=mips1" "ASE errors (3)"
    run_list_test "ase-errors-4" "-mabi=o64 -march=mips3" "ASE errors (4)"

    run_dump_test_arches "la-reloc"	[mips_arch_list_matching mips1]
    if { $has_newabi } {
	run_dump_test_arches "dla-reloc" [mips_arch_list_matching mips3]
    }

    # Start with MIPS II to avoid load delay nops.
    run_dump_test_arches "ld-reloc"	[mips_arch_list_matching mips2]
    run_dump_test_arches "ulw-reloc"	[mips_arch_list_matching mips2 !mips32r6]
    run_dump_test_arches "ulh-reloc"	[mips_arch_list_matching mips2 !mips32r6]

    run_dump_test "l_d-reloc"
    run_list_test "bltzal"

    run_dump_test_arches "msa"		[mips_arch_list_matching mips32r2]
    run_dump_test_arches "msa64"	[mips_arch_list_matching mips64r2]
    run_dump_test_arches "msa-relax"	[mips_arch_list_matching mips32r2 !mips32r6]
    run_dump_test_arches "msa-branch"	[mips_arch_list_matching mips32r2]

    run_dump_test_arches "xpa"		[mips_arch_list_matching mips32r2 !micromips]
    run_dump_test_arches "r5" "-32"	[mips_arch_list_matching mips32r5 !micromips]

    run_dump_test "pcrel-1"
    run_dump_test "pcrel-2"
    run_list_test "pcrel-3" "" "Invalid cross-section PC-relative references"
    run_dump_test "pcrel-4-32"
    if $has_newabi {
	run_dump_test "pcrel-4-n32"
	run_dump_test "pcrel-4-64"
    }

    run_dump_test_arches "attr-gnu-4-0" "-32" \
				    [mips_arch_list_matching mips1]
    run_dump_test_arches "attr-gnu-4-0" "-64" \
				    [mips_arch_list_matching mips3]
    run_dump_test_arches "attr-gnu-4-0" "-mfp32 -32" \
				    [mips_arch_list_matching mips1 !mips32r6]
    run_dump_test_arches "attr-gnu-4-0" "-mfpxx -32" \
				    [mips_arch_list_matching mips2 !r5900]
    run_dump_test_arches "attr-gnu-4-0" "-mfp64 -32" \
				    [mips_arch_list_matching mips32r2]
    run_dump_test_arches "attr-gnu-4-0" "-mfp64 -mno-odd-spreg -32" \
				    [mips_arch_list_matching mips32r2]
    run_dump_test_arches "attr-gnu-4-0" "-mfp64 -64" \
				    [mips_arch_list_matching mips3]
    run_dump_test_arches "attr-gnu-4-0" "-msingle-float -32" \
				    [mips_arch_list_matching mips1]
    run_dump_test_arches "attr-gnu-4-0" "-msingle-float -64" \
				    [mips_arch_list_matching mips3]
    run_dump_test_arches "attr-gnu-4-0" "-msoft-float -32" \
				    [mips_arch_list_matching mips1]
    run_dump_test_arches "attr-gnu-4-0" "-msoft-float -64" \
				    [mips_arch_list_matching mips3]
    run_dump_test_arches "attr-none-double" "-32" \
				    [mips_arch_list_matching mips1 !mips32r6]
    run_dump_test_arches "r6-attr-none-double" "-32" \
				    [mips_arch_list_matching mips32r6]
    run_dump_test_arches "attr-none-double" "-64" \
				    [mips_arch_list_matching mips3]
    run_dump_test_arches "attr-none-o32-fpxx" \
				    [mips_arch_list_matching mips2 !r5900]
    run_dump_test_arches "attr-none-o32-fp64" \
				    [mips_arch_list_matching mips32r2]
    run_dump_test_arches "attr-none-o32-fp64-nooddspreg" \
				    [mips_arch_list_matching mips32r2]
    run_dump_test_arches "attr-none-single-float" "-32" \
				    [mips_arch_list_matching mips1]
    run_dump_test_arches "attr-none-single-float" "-64" \
				    [mips_arch_list_matching mips3]
    run_dump_test_arches "attr-none-soft-float" "-32 -msoft-float" \
				    [mips_arch_list_matching mips1]
    run_dump_test_arches "attr-none-soft-float" "-64 -msoft-float" \
				    [mips_arch_list_matching mips3]

    run_list_test_arches "attr-gnu-4-1-mfp64" \
				    "-32 -mfp64 -mno-odd-spreg" \
				    [mips_arch_list_matching mips32r2]
    run_list_test_arches "attr-gnu-4-1-mfp64" "-32 -mfp64" \
				    [mips_arch_list_matching mips32r2]
    run_list_test_arches "attr-gnu-4-1-mfp32" "-64 -mfp32" \
				    [mips_arch_list_matching mips3 !mips64r6]
    run_list_test_arches "attr-gnu-4-1-msingle-float" "-32 -msingle-float" \
				    [mips_arch_list_matching mips1]
    run_list_test_arches "attr-gnu-4-1-msoft-float" "-32 -msoft-float" \
				    [mips_arch_list_matching mips1]
    run_dump_test_arches "attr-gnu-4-1" "-32 -mfpxx" \
				    [mips_arch_list_matching mips2 !r5900]
    run_dump_test_arches "attr-gnu-4-1" "-32 -mfp32" \
				    [mips_arch_list_matching mips1 !mips32r6]
    run_dump_test_arches "attr-gnu-4-1" "-64 -mfp64" \
				    [mips_arch_list_matching mips3]

    run_list_test_arches "attr-gnu-4-2-mdouble-float" "-32 -mfp32" \
				    [mips_arch_list_matching mips1 !mips32r6]
    run_list_test_arches "attr-gnu-4-2-mdouble-float" "-32 -mfpxx" \
				    [mips_arch_list_matching mips2 !r5900]
    run_list_test_arches "attr-gnu-4-2-mdouble-float" "-32 -mfp64" \
				    [mips_arch_list_matching mips32r2]
    run_list_test_arches "attr-gnu-4-2-mdouble-float" \
				    "-32 -mfp64 -mno-odd-spreg" \
				    [mips_arch_list_matching mips32r2]
    run_list_test_arches "attr-gnu-4-2-mdouble-float" "-64 -mfp64" \
				    [mips_arch_list_matching mips3]
    run_list_test_arches "attr-gnu-4-2-msoft-float" "-32 -msoft-float" \
				    [mips_arch_list_matching mips1]
    run_dump_test_arches "attr-gnu-4-2" "-32" \
				    [mips_arch_list_matching mips1]
    run_dump_test_arches "attr-gnu-4-2" "-64" \
				    [mips_arch_list_matching mips3]

    run_list_test_arches "attr-gnu-4-3-mhard-float" "-32 -mfp32" \
				    [mips_arch_list_matching mips1 !mips32r6]
    run_list_test_arches "attr-gnu-4-3-mhard-float" "-32 -mfpxx" \
				    [mips_arch_list_matching mips2 !r5900]
    run_list_test_arches "attr-gnu-4-3-mhard-float" "-32 -mfp64" \
				    [mips_arch_list_matching mips32r2]
    run_list_test_arches "attr-gnu-4-3-mhard-float" \
				    "-32 -mfp64 -mno-odd-spreg" \
				    [mips_arch_list_matching mips32r2]
    run_list_test_arches "attr-gnu-4-3-mhard-float" "-64 -mfp64" \
				    [mips_arch_list_matching mips3]
    run_list_test_arches "attr-gnu-4-3-mhard-float" "-32 -msingle-float" \
				    [mips_arch_list_matching mips1]
    run_dump_test_arches "attr-gnu-4-3" "-32" \
				    [mips_arch_list_matching mips1]
    run_dump_test_arches "attr-gnu-4-3" "-64" \
				    [mips_arch_list_matching mips3]
 
    run_list_test_arches "attr-gnu-4-4" "-32 -mfp32" \
				    [mips_arch_list_matching mips1 !mips32r6]
    run_list_test_arches "attr-gnu-4-4" "-32 -mfpxx" \
				    [mips_arch_list_matching mips2 !r5900]
    run_list_test_arches "attr-gnu-4-4" "-32 -mfp64" \
				    [mips_arch_list_matching mips32r2]
    run_list_test_arches "attr-gnu-4-4" "-32 -mfp64 -mno-odd-spreg" \
				    [mips_arch_list_matching mips32r2]
    run_list_test_arches "attr-gnu-4-4" "-64 -mfp64" \
				    [mips_arch_list_matching mips3]
    run_list_test_arches "attr-gnu-4-4" "-32 -msingle-float" \
				    [mips_arch_list_matching mips1]
    run_list_test_arches "attr-gnu-4-4" "-32 -msoft-float" \
				    [mips_arch_list_matching mips1]

    run_list_test_arches "attr-gnu-4-5" "-32 -mfp32" \
				    [mips_arch_list_matching mips1 !mips32r6]
    run_list_test_arches "attr-gnu-4-5" "-32 -mfp64" \
				    [mips_arch_list_matching mips32r2]
    run_list_test_arches "attr-gnu-4-5" "-32 -mfp64 -mno-odd-spreg" \
				    [mips_arch_list_matching mips32r2]
    run_list_test_arches "attr-gnu-4-5-64" "-64 -mfp64" \
				    [mips_arch_list_matching mips3]
    run_list_test_arches "attr-gnu-4-5-msingle-float" "-32 -msingle-float" \
				    [mips_arch_list_matching mips1]
    run_list_test_arches "attr-gnu-4-5-msoft-float" "-32 -msoft-float" \
				    [mips_arch_list_matching mips1]
    run_dump_test_arches "attr-gnu-4-5" \
				    [mips_arch_list_matching mips2 !r5900]

    run_list_test_arches "attr-gnu-4-6" "-32 -mfp32" \
				    [mips_arch_list_matching mips1 !mips32r6]
    run_list_test_arches "attr-gnu-4-6-noodd" "-32 -mfp64 -mno-odd-spreg" \
				    [mips_arch_list_matching mips32r2]
    run_list_test_arches "attr-gnu-4-6-64" "-64 -mfp64" \
				    [mips_arch_list_matching mips3]
    run_list_test_arches "attr-gnu-4-6-msingle-float" "-32 -msingle-float" \
				    [mips_arch_list_matching mips1]
    run_list_test_arches "attr-gnu-4-6-msoft-float" "-32 -msoft-float" \
				    [mips_arch_list_matching mips1]
    run_list_test_arches "attr-gnu-4-6" "-32 -mfpxx" \
				    [mips_arch_list_matching mips2 !r5900]
    run_dump_test_arches "attr-gnu-4-6" "-32 -mfp64" \
				    [mips_arch_list_matching mips32r2]

    run_list_test_arches "attr-gnu-4-7" "-32 -mfp32" \
				    [mips_arch_list_matching mips1 !mips32r6]
    run_list_test_arches "attr-gnu-4-7-odd" "-32 -mfp64" \
				    [mips_arch_list_matching mips32r2]
    run_list_test_arches "attr-gnu-4-7-64" "-64 -mfp64" \
				    [mips_arch_list_matching mips3]
    run_list_test_arches "attr-gnu-4-7-msingle-float" "-32 -msingle-float" \
				    [mips_arch_list_matching mips1]
    run_list_test_arches "attr-gnu-4-7-msoft-float" "-32 -msoft-float" \
				    [mips_arch_list_matching mips1]
    run_list_test_arches "attr-gnu-4-7" "-32 -mfpxx" \
				    [mips_arch_list_matching mips2 !r5900]
    run_dump_test_arches "attr-gnu-4-7" "-32 -mfp64 -mno-odd-spreg" \
				    [mips_arch_list_matching mips32r2]

    run_dump_test "attr-gnu-abi-fp-1"
    run_dump_test "attr-gnu-abi-msa-1"

    run_dump_test "module-override"
    run_dump_test "module-defer-warn1"
    run_list_test "module-defer-warn2" "-32"

    foreach testopt [list -mfp32 -mfpxx -mfp64 "-mfp64-noodd" \
			  -msingle-float -msoft-float] {
      foreach cmdopt [list -mfp32 -mfpxx -mfp64 "-mfp64 -mno-odd-spreg" \
			   -msingle-float -msoft-float] {
        run_dump_test "module${testopt}" \
			    [list [list as $cmdopt] [list name ($cmdopt)]]
      }
    }

    run_dump_test "module-set-mfpxx"
    run_list_test_arches "fpxx-oddfpreg" "-32 -mfpxx" \
			[mips_arch_list_matching mips2 !singlefloat]
    run_list_test_arches "fpxx-oddfpreg" "-32 -mfpxx -mno-odd-spreg" \
			[mips_arch_list_matching mips2 !singlefloat]
    run_dump_test_arches "fpxx-oddfpreg" \
			[mips_arch_list_matching oddspreg]
    run_dump_test_arches "odd-spreg" "-mfp32" [mips_arch_list_matching oddspreg]
    run_dump_test_arches "odd-spreg" "-mfpxx" [mips_arch_list_matching oddspreg]
    run_dump_test_arches "odd-spreg" "-mfp64" [mips_arch_list_matching mips32r2]
    run_dump_test_arches "no-odd-spreg" "-mfp32" [mips_arch_list_matching mips1 \
							!mips32r6]
    run_dump_test_arches "no-odd-spreg" "-mfpxx" [mips_arch_list_matching mips2 !r5900]
    run_dump_test_arches "no-odd-spreg" "-mfp64" [mips_arch_list_matching mips32r2]
    run_dump_test "module-check"
    run_list_test "module-check-warn" "-32"

    run_dump_test "li-d"

    run_dump_test_arches "r6"		[mips_arch_list_matching mips32r6]
    if $has_newabi {
	run_dump_test_arches "r6-n32"	[mips_arch_list_matching mips64r6]
	run_dump_test_arches "r6-n64"	[mips_arch_list_matching mips64r6]
	run_dump_test_arches "r6-64-n32"	[mips_arch_list_matching mips64r6]
	run_dump_test_arches "r6-64-n64"	[mips_arch_list_matching mips64r6]
    }
    run_list_test_arches "r6-removed"	"-32" [mips_arch_list_matching mips32r6]
    run_list_test_arches "r6-64-removed"	[mips_arch_list_matching mips64r6]
}