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" | |
51124b6c | 59 | |
f22ba854 NC |
60 | if $ilocks { |
61 | run_dump_test "div-ilocks" | |
62 | } else { | |
63 | run_dump_test "div" | |
64 | } | |
252b5132 | 65 | run_dump_test "dli" |
ae948b86 | 66 | if $elf { |
7388e440 L |
67 | run_dump_test "elf-jal" |
68 | } else { | |
69 | run_dump_test "jal" | |
70 | } | |
ae948b86 TS |
71 | if $elf { run_dump_test "jal-svr4pic" } |
72 | if $elf { run_dump_test "jal-xgot" } | |
51124b6c CD |
73 | # LOSE: As of 2002-02-08, the jal-empic test fails for target mips-ecoff. |
74 | # It appears that it broke between 2000-03-11 00:00UTC and | |
75 | # 2000-03-12 00:00 UTC. | |
ae948b86 | 76 | if $ecoff { run_dump_test "jal-empic" } |
d65d31a6 CD |
77 | if $elf { run_dump_test "jal-empic-elf" } |
78 | if $elf { run_dump_test "jal-empic-elf-2" } | |
79 | if $elf { run_dump_test "jal-empic-elf-3" } | |
252b5132 | 80 | if !$aout { run_dump_test "la" } |
ae948b86 TS |
81 | if $elf { run_dump_test "la-svr4pic" } |
82 | if $elf { run_dump_test "la-xgot" } | |
51124b6c CD |
83 | # LOSE: As of 2002-02-08, the la-empic test fails for target mips-ecoff. |
84 | # Not sure when it first cropped up, but may be related to addition of | |
85 | # "la" -> "addiu" pattern in MIPS opcode table long ago. | |
ae948b86 | 86 | if $ecoff { run_dump_test "la-empic" } |
252b5132 | 87 | if !$aout { run_dump_test "lb" } |
ae948b86 TS |
88 | if $elf { run_dump_test "lb-svr4pic" } |
89 | if $elf { | |
252b5132 RH |
90 | # Both versions specify the cpu, so we can run both regardless of |
91 | # the interlocking in the configured default cpu. | |
92 | run_dump_test "lb-xgot" | |
93 | run_dump_test "lb-xgot-ilocks" | |
94 | } | |
ae948b86 | 95 | if $ecoff { run_dump_test "lb-empic" } |
f22ba854 NC |
96 | if !$aout { |
97 | if !$gpr_ilocks { | |
98 | run_dump_test "ld" | |
252b5132 RH |
99 | } else { |
100 | if !$addr32 { | |
101 | run_dump_test "ld-ilocks" | |
102 | } else { | |
103 | run_dump_test "ld-ilocks-addr32" | |
104 | } | |
105 | } | |
106 | } | |
ae948b86 TS |
107 | if $elf { run_dump_test "ld-svr4pic" } |
108 | if $elf { run_dump_test "ld-xgot" } | |
109 | if $ecoff { run_dump_test "ld-empic" } | |
252b5132 RH |
110 | run_dump_test "li" |
111 | if !$aout { run_dump_test "lifloat" } | |
ae948b86 TS |
112 | if $elf { run_dump_test "lif-svr4pic" } |
113 | if $elf { run_dump_test "lif-xgot" } | |
51124b6c CD |
114 | # LOSE: As of 2002-02-08, the lif-empic test fails for target mips-ecoff. |
115 | # It appears that it broke between 2000-03-11 00:00UTC and | |
116 | # 2000-03-12 00:00 UTC. | |
ae948b86 | 117 | if $ecoff { run_dump_test "lif-empic" } |
252b5132 | 118 | run_dump_test "mips4" |
f22ba854 NC |
119 | if $ilocks { |
120 | run_dump_test "mul-ilocks" | |
121 | } else { | |
122 | run_dump_test "mul" | |
123 | } | |
252b5132 | 124 | run_dump_test "rol" |
771c7ce4 | 125 | run_dump_test "rol64" |
252b5132 RH |
126 | if !$aout { run_dump_test "sb" } |
127 | run_dump_test "trunc" | |
128 | if !$aout { run_dump_test "ulh" } | |
ae948b86 TS |
129 | if $elf { run_dump_test "ulh-svr4pic" } |
130 | if $elf { run_dump_test "ulh-xgot" } | |
131 | if $ecoff { run_dump_test "ulh-empic" } | |
252b5132 RH |
132 | if !$aout { |
133 | run_dump_test "ulw" | |
134 | run_dump_test "uld" | |
135 | run_dump_test "ush" | |
136 | run_dump_test "usw" | |
137 | run_dump_test "usd" | |
138 | } | |
139 | # The mips16 test can only be run on ELF, because only ELF | |
140 | # supports the necessary mips16 reloc. | |
ae948b86 | 141 | if { $elf && !$no_mips16 } { run_dump_test "mips16" } |
252b5132 RH |
142 | run_dump_test "delay" |
143 | run_dump_test "nodelay" | |
144 | run_dump_test "mips4010" | |
145 | run_dump_test "mips4650" | |
146 | run_dump_test "mips4100" | |
99c14723 | 147 | run_dump_test "perfcount" |
252b5132 RH |
148 | run_dump_test "lineno" |
149 | run_dump_test "sync" | |
e7af610e | 150 | run_dump_test "mips32" |
0808b8a9 | 151 | run_dump_test "mips64" |
1f25f5d3 | 152 | run_dump_test "mips64-mips3d" |
deec1734 | 153 | run_dump_test "mips64-mdmx" |
107c6e1a | 154 | run_dump_test "sb1-ext-mdmx" |
2228315b | 155 | run_dump_test "sb1-ext-ps" |
252b5132 | 156 | |
594e740f L |
157 | # It will always fail until someone fixes it. |
158 | setup_xfail "mips*-*-*" | |
159 | run_dump_test "relax" | |
160 | ||
d9e138e2 L |
161 | run_list_test "illegal" "" |
162 | ||
51124b6c CD |
163 | # LOSE: As of 2002-02-08, the next 4 tests fail for target mips-ecoff. |
164 | # It's unknown whether they _should_ pass as-is, or whether different | |
165 | # variants are needed for ELF and ECOFF. | |
dc462216 RS |
166 | run_dump_test "mips-gp32-fp32" |
167 | run_dump_test "mips-gp32-fp64" | |
168 | run_dump_test "mips-gp64-fp32" | |
169 | run_dump_test "mips-gp64-fp64" | |
dc462216 | 170 | |
ae948b86 | 171 | if $elf { |
2cd5676f CD |
172 | # Make sure that -mcpu=FOO and -mFOO are equivalent. Assemble a file |
173 | # containing 4650-specific instructions with -m4650 and -mcpu=4650, | |
174 | # and verify that they're the same. Specifically, we're checking | |
175 | # that the EF_MIPS_MACH field is set, and that the 4650 'mul' | |
f22ba854 | 176 | # instruction does get used. In previous versions of GAS, |
2cd5676f CD |
177 | # only -mcpu=4650 would set the EF_MIPS_MACH field; -m4650 wouldn't. |
178 | run_dump_test "elf_e_flags1" | |
179 | run_dump_test "elf_e_flags2" | |
180 | run_dump_test "elf_e_flags3" | |
181 | run_dump_test "elf_e_flags4" | |
f22ba854 | 182 | |
dc462216 RS |
183 | run_dump_test "mips-gp32-fp32-pic" |
184 | run_dump_test "mips-gp32-fp64-pic" | |
185 | run_dump_test "mips-gp64-fp32-pic" | |
186 | run_dump_test "mips-gp64-fp64-pic" | |
ae948b86 TS |
187 | |
188 | run_dump_test "mips-abi32" | |
189 | run_dump_test "mips-abi32-pic" | |
ff8715d0 | 190 | |
0c4ec151 | 191 | run_dump_test "elf${el}-rel" |
b4dc22a8 CD |
192 | if {[istarget mips64*-*-*] || [istarget mipsisa32*-*-*] |
193 | || [istarget mipsisa64*-*-*]} { | |
15ba8cc1 | 194 | run_dump_test "elf${el}-rel2" |
7ad8fb54 | 195 | } else { |
15ba8cc1 | 196 | run_dump_test "e32${el}-rel2" |
a90335ee | 197 | } |
0c4ec151 | 198 | run_dump_test "elf${el}-rel3" |
7ad8fb54 CD |
199 | if {[istarget mips64*-*-*]} { |
200 | run_dump_test "elf-rel4" | |
201 | } else { | |
202 | run_dump_test "e32-rel4" | |
203 | } | |
5f266a81 | 204 | run_dump_test "elf-rel5" |
0c4ec151 | 205 | run_dump_test "${tmips}${el}empic" |
afdbd6d0 | 206 | run_dump_test "empic2" |
a657e7c1 CD |
207 | run_dump_test "empic3_e" |
208 | run_dump_test "empic3_g1" | |
209 | run_dump_test "empic3_g2" | |
f22ba854 NC |
210 | if { !$no_mips16 } { |
211 | run_dump_test "${tmips}mips${el}16-e" | |
212 | run_dump_test "${tmips}mips${el}16-f" | |
bb2d6cd7 | 213 | } |
07147777 | 214 | } |
252b5132 | 215 | } |