Commit | Line | Data |
---|---|---|
252b5132 RH |
1 | # |
2 | # Some generic MIPS tests | |
3 | # | |
d9e138e2 | 4 | |
51124b6c CD |
5 | # "LOSE" marks information about tests which fail at a particular point |
6 | # in time, but which are not XFAILed. Either they used to pass | |
7 | # and indicate either regressions or the need to tweak the tests to keep | |
8 | # up the with code, or they are new tests and it is unknown whether or not | |
9 | # they should pass as-is for the given object formats. | |
10 | ||
d9e138e2 L |
11 | proc run_list_test { name opts } { |
12 | global srcdir subdir | |
13 | set testname "MIPS $name" | |
14 | set file $srcdir/$subdir/$name | |
15 | gas_run ${name}.s $opts ">&dump.out" | |
16 | if { [regexp_diff "dump.out" "${file}.l"] } then { | |
17 | fail $testname | |
18 | verbose "output is [file_contents "dump.out"]" 2 | |
19 | return | |
20 | } | |
21 | pass $testname | |
22 | } | |
23 | ||
0285c67d | 24 | if { [istarget mips*-*-*] } then { |
252b5132 | 25 | set no_mips16 0 |
ae948b86 TS |
26 | set elf [expr [istarget *-*-elf*] || [istarget *-*-irix5*] || [istarget *-*-irix6* ] || [istarget *-*-linux*] || [istarget *-*-netbsd*] ] |
27 | set ecoff [expr [istarget *-*-ecoff*] || [istarget *-*-ultrix*] || [istarget *-*-irix\[1-4\]*] ] | |
9fb9af6e | 28 | set aout [expr [istarget *-*-bsd*] || [istarget *-*-openbsd*] ] |
252b5132 RH |
29 | set ilocks [istarget mipstx39*-*-*] |
30 | set gpr_ilocks [expr [istarget mipstx39*-*-*]] | |
31 | set addr32 [expr [istarget mipstx39*-*-*]] | |
32 | ||
dda688fc | 33 | if { [istarget "mips*-*-*linux*"] } then { |
ff8715d0 L |
34 | set tmips "t" |
35 | } else { | |
36 | set tmips "" | |
37 | } | |
0c4ec151 RS |
38 | if [istarget mips*el-*-*] { |
39 | set el el | |
40 | } { | |
41 | set el "" | |
42 | } | |
252b5132 RH |
43 | |
44 | run_dump_test "abs" | |
45 | run_dump_test "add" | |
46 | run_dump_test "and" | |
47 | run_dump_test "break20" | |
48 | run_dump_test "trap20" | |
51124b6c CD |
49 | |
50 | # LOSE: As of 2002-02-08, "beq" through "bltu" fail for target mips-ecoff. | |
51 | # See http://sources.redhat.com/ml/binutils/2001-10/msg00418.html for | |
52 | # more information. Not sure if the fixes there are correct; should | |
53 | # branches to external labels be allowed for ECOFF? | |
252b5132 RH |
54 | run_dump_test "beq" |
55 | run_dump_test "bge" | |
56 | run_dump_test "bgeu" | |
57 | run_dump_test "blt" | |
58 | run_dump_test "bltu" | |
2dc83527 CD |
59 | run_dump_test "branch-misc-1" |
60 | run_dump_test "branch-misc-2" | |
51124b6c | 61 | |
f22ba854 NC |
62 | if $ilocks { |
63 | run_dump_test "div-ilocks" | |
64 | } else { | |
65 | run_dump_test "div" | |
66 | } | |
252b5132 | 67 | run_dump_test "dli" |
ae948b86 | 68 | if $elf { |
7388e440 L |
69 | run_dump_test "elf-jal" |
70 | } else { | |
71 | run_dump_test "jal" | |
72 | } | |
ae948b86 TS |
73 | if $elf { run_dump_test "jal-svr4pic" } |
74 | if $elf { run_dump_test "jal-xgot" } | |
51124b6c CD |
75 | # LOSE: As of 2002-02-08, the jal-empic test fails for target mips-ecoff. |
76 | # It appears that it broke between 2000-03-11 00:00UTC and | |
77 | # 2000-03-12 00:00 UTC. | |
ae948b86 | 78 | if $ecoff { run_dump_test "jal-empic" } |
d65d31a6 CD |
79 | if $elf { run_dump_test "jal-empic-elf" } |
80 | if $elf { run_dump_test "jal-empic-elf-2" } | |
81 | if $elf { run_dump_test "jal-empic-elf-3" } | |
f697dfed | 82 | run_list_test "jal-range" "" |
252b5132 | 83 | if !$aout { run_dump_test "la" } |
ae948b86 TS |
84 | if $elf { run_dump_test "la-svr4pic" } |
85 | if $elf { run_dump_test "la-xgot" } | |
51124b6c CD |
86 | # LOSE: As of 2002-02-08, the la-empic test fails for target mips-ecoff. |
87 | # Not sure when it first cropped up, but may be related to addition of | |
88 | # "la" -> "addiu" pattern in MIPS opcode table long ago. | |
ae948b86 | 89 | if $ecoff { run_dump_test "la-empic" } |
252b5132 | 90 | if !$aout { run_dump_test "lb" } |
ae948b86 TS |
91 | if $elf { run_dump_test "lb-svr4pic" } |
92 | if $elf { | |
252b5132 RH |
93 | # Both versions specify the cpu, so we can run both regardless of |
94 | # the interlocking in the configured default cpu. | |
95 | run_dump_test "lb-xgot" | |
96 | run_dump_test "lb-xgot-ilocks" | |
97 | } | |
ae948b86 | 98 | if $ecoff { run_dump_test "lb-empic" } |
f22ba854 NC |
99 | if !$aout { |
100 | if !$gpr_ilocks { | |
101 | run_dump_test "ld" | |
252b5132 RH |
102 | } else { |
103 | if !$addr32 { | |
104 | run_dump_test "ld-ilocks" | |
105 | } else { | |
106 | run_dump_test "ld-ilocks-addr32" | |
107 | } | |
108 | } | |
109 | } | |
ae948b86 TS |
110 | if $elf { run_dump_test "ld-svr4pic" } |
111 | if $elf { run_dump_test "ld-xgot" } | |
112 | if $ecoff { run_dump_test "ld-empic" } | |
252b5132 RH |
113 | run_dump_test "li" |
114 | if !$aout { run_dump_test "lifloat" } | |
ae948b86 TS |
115 | if $elf { run_dump_test "lif-svr4pic" } |
116 | if $elf { run_dump_test "lif-xgot" } | |
51124b6c CD |
117 | # LOSE: As of 2002-02-08, the lif-empic test fails for target mips-ecoff. |
118 | # It appears that it broke between 2000-03-11 00:00UTC and | |
119 | # 2000-03-12 00:00 UTC. | |
ae948b86 | 120 | if $ecoff { run_dump_test "lif-empic" } |
252b5132 | 121 | run_dump_test "mips4" |
f22ba854 NC |
122 | if $ilocks { |
123 | run_dump_test "mul-ilocks" | |
124 | } else { | |
125 | run_dump_test "mul" | |
126 | } | |
252b5132 | 127 | run_dump_test "rol" |
771c7ce4 | 128 | run_dump_test "rol64" |
252b5132 RH |
129 | if !$aout { run_dump_test "sb" } |
130 | run_dump_test "trunc" | |
131 | if !$aout { run_dump_test "ulh" } | |
ae948b86 TS |
132 | if $elf { run_dump_test "ulh-svr4pic" } |
133 | if $elf { run_dump_test "ulh-xgot" } | |
134 | if $ecoff { run_dump_test "ulh-empic" } | |
252b5132 RH |
135 | if !$aout { |
136 | run_dump_test "ulw" | |
137 | run_dump_test "uld" | |
138 | run_dump_test "ush" | |
139 | run_dump_test "usw" | |
140 | run_dump_test "usd" | |
141 | } | |
142 | # The mips16 test can only be run on ELF, because only ELF | |
143 | # supports the necessary mips16 reloc. | |
3396de36 TS |
144 | if { $elf && !$no_mips16 } { |
145 | run_dump_test "mips16" | |
146 | # Check jalx handling | |
147 | run_dump_test "mips16-jalx" | |
148 | run_dump_test "mips-jalx" | |
149 | } | |
150 | run_list_test "mips-no-jalx" "" | |
252b5132 RH |
151 | run_dump_test "delay" |
152 | run_dump_test "nodelay" | |
153 | run_dump_test "mips4010" | |
154 | run_dump_test "mips4650" | |
155 | run_dump_test "mips4100" | |
60b63b72 RS |
156 | run_dump_test "vr4111" |
157 | run_dump_test "vr4120" | |
158 | run_dump_test "vr4122" | |
159 | run_dump_test "vr5400" | |
160 | run_dump_test "vr5500" | |
99c14723 | 161 | run_dump_test "perfcount" |
252b5132 RH |
162 | run_dump_test "lineno" |
163 | run_dump_test "sync" | |
e7af610e | 164 | run_dump_test "mips32" |
0808b8a9 | 165 | run_dump_test "mips64" |
1f25f5d3 | 166 | run_dump_test "mips64-mips3d" |
deec1734 | 167 | run_dump_test "mips64-mdmx" |
107c6e1a | 168 | run_dump_test "sb1-ext-mdmx" |
2228315b | 169 | run_dump_test "sb1-ext-ps" |
252b5132 | 170 | |
594e740f L |
171 | run_dump_test "relax" |
172 | ||
d9e138e2 | 173 | run_list_test "illegal" "" |
e8dcafb0 | 174 | run_list_test "baddata1" "" |
d9e138e2 | 175 | |
51124b6c CD |
176 | # LOSE: As of 2002-02-08, the next 4 tests fail for target mips-ecoff. |
177 | # It's unknown whether they _should_ pass as-is, or whether different | |
178 | # variants are needed for ELF and ECOFF. | |
dc462216 RS |
179 | run_dump_test "mips-gp32-fp32" |
180 | run_dump_test "mips-gp32-fp64" | |
181 | run_dump_test "mips-gp64-fp32" | |
182 | run_dump_test "mips-gp64-fp64" | |
dc462216 | 183 | |
ae948b86 | 184 | if $elf { |
2cd5676f CD |
185 | # Make sure that -mcpu=FOO and -mFOO are equivalent. Assemble a file |
186 | # containing 4650-specific instructions with -m4650 and -mcpu=4650, | |
187 | # and verify that they're the same. Specifically, we're checking | |
188 | # that the EF_MIPS_MACH field is set, and that the 4650 'mul' | |
f22ba854 | 189 | # instruction does get used. In previous versions of GAS, |
2cd5676f CD |
190 | # only -mcpu=4650 would set the EF_MIPS_MACH field; -m4650 wouldn't. |
191 | run_dump_test "elf_e_flags1" | |
192 | run_dump_test "elf_e_flags2" | |
193 | run_dump_test "elf_e_flags3" | |
194 | run_dump_test "elf_e_flags4" | |
f22ba854 | 195 | |
70a31400 CD |
196 | # Verify that ASE markings are handled properly. |
197 | if { !$no_mips16 } { run_dump_test "elf_ase_mips16" } | |
198 | ||
dc462216 RS |
199 | run_dump_test "mips-gp32-fp32-pic" |
200 | run_dump_test "mips-gp32-fp64-pic" | |
201 | run_dump_test "mips-gp64-fp32-pic" | |
202 | run_dump_test "mips-gp64-fp64-pic" | |
ae948b86 TS |
203 | |
204 | run_dump_test "mips-abi32" | |
205 | run_dump_test "mips-abi32-pic" | |
885add95 | 206 | run_dump_test "mips-abi32-pic2" |
ff8715d0 | 207 | |
0c4ec151 | 208 | run_dump_test "elf${el}-rel" |
b4dc22a8 CD |
209 | if {[istarget mips64*-*-*] || [istarget mipsisa32*-*-*] |
210 | || [istarget mipsisa64*-*-*]} { | |
15ba8cc1 | 211 | run_dump_test "elf${el}-rel2" |
7ad8fb54 | 212 | } else { |
15ba8cc1 | 213 | run_dump_test "e32${el}-rel2" |
a90335ee | 214 | } |
0c4ec151 | 215 | run_dump_test "elf${el}-rel3" |
7ad8fb54 CD |
216 | if {[istarget mips64*-*-*]} { |
217 | run_dump_test "elf-rel4" | |
218 | } else { | |
219 | run_dump_test "e32-rel4" | |
220 | } | |
5f266a81 | 221 | run_dump_test "elf-rel5" |
98605598 | 222 | run_dump_test "elf-rel6" |
631cb423 | 223 | run_dump_test "elf-rel7" |
0c4ec151 | 224 | run_dump_test "${tmips}${el}empic" |
afdbd6d0 | 225 | run_dump_test "empic2" |
a657e7c1 CD |
226 | run_dump_test "empic3_e" |
227 | run_dump_test "empic3_g1" | |
228 | run_dump_test "empic3_g2" | |
f22ba854 NC |
229 | if { !$no_mips16 } { |
230 | run_dump_test "${tmips}mips${el}16-e" | |
231 | run_dump_test "${tmips}mips${el}16-f" | |
bb2d6cd7 | 232 | } |
fdb987ee | 233 | run_dump_test "elf-consthilo" |
07147777 | 234 | } |
252b5132 | 235 | } |