1 |
205 |
julius |
#
|
2 |
|
|
# i386 tests
|
3 |
|
|
#
|
4 |
|
|
proc gas_64_check { } {
|
5 |
|
|
global NM
|
6 |
|
|
global NMFLAGS
|
7 |
|
|
|
8 |
|
|
set status [gas_host_run "$NM $NMFLAGS --help" ""]
|
9 |
|
|
return [regexp "targets:.*x86-64" [lindex $status 1]];
|
10 |
|
|
}
|
11 |
|
|
|
12 |
|
|
proc gas_32_check { } {
|
13 |
|
|
global NM
|
14 |
|
|
global NMFLAGS
|
15 |
|
|
|
16 |
|
|
set status [gas_host_run "$NM $NMFLAGS --help" ""]
|
17 |
|
|
return [regexp "targets:.*i386" [lindex $status 1]];
|
18 |
|
|
}
|
19 |
|
|
|
20 |
|
|
if [expr ([istarget "i*86-*-*"] || [istarget "x86_64-*-*"]) && [gas_32_check]] then {
|
21 |
|
|
|
22 |
|
|
global ASFLAGS
|
23 |
|
|
set old_ASFLAGS "$ASFLAGS"
|
24 |
|
|
set ASFLAGS "$ASFLAGS --32"
|
25 |
|
|
|
26 |
|
|
run_list_test "float" "-al -mmnemonic=att"
|
27 |
|
|
run_list_test "general" "-al --listing-lhs-width=2 -mold-gcc"
|
28 |
|
|
run_list_test "inval" "-al"
|
29 |
|
|
run_list_test "segment" "-al"
|
30 |
|
|
run_list_test "inval-seg" "-al"
|
31 |
|
|
run_list_test "modrm" "-al --listing-lhs-width=2"
|
32 |
|
|
run_dump_test "naked"
|
33 |
|
|
run_dump_test "opcode"
|
34 |
|
|
run_dump_test "opcode-intel"
|
35 |
|
|
run_dump_test "opcode-suffix"
|
36 |
|
|
run_dump_test "intel"
|
37 |
|
|
run_dump_test "intel16"
|
38 |
|
|
run_list_test "intelbad" ""
|
39 |
|
|
run_dump_test "intelok"
|
40 |
|
|
run_dump_test "prefix"
|
41 |
|
|
run_dump_test "amd"
|
42 |
|
|
run_dump_test "katmai"
|
43 |
|
|
run_dump_test "jump"
|
44 |
|
|
run_dump_test "ssemmx2"
|
45 |
|
|
run_dump_test "sse2"
|
46 |
|
|
run_dump_test "sub"
|
47 |
|
|
run_dump_test "prescott"
|
48 |
|
|
run_dump_test "sib"
|
49 |
|
|
run_dump_test "sib-intel"
|
50 |
|
|
run_dump_test "vmx"
|
51 |
|
|
run_dump_test "smx"
|
52 |
|
|
run_dump_test "suffix"
|
53 |
|
|
run_dump_test "immed32"
|
54 |
|
|
run_dump_test "equ"
|
55 |
|
|
run_dump_test "divide"
|
56 |
|
|
run_dump_test "padlock"
|
57 |
|
|
run_dump_test "crx"
|
58 |
|
|
run_list_test "cr-err" ""
|
59 |
|
|
run_dump_test "svme"
|
60 |
|
|
run_dump_test "amdfam10"
|
61 |
|
|
run_dump_test "merom"
|
62 |
|
|
run_dump_test "rep"
|
63 |
|
|
run_dump_test "rep-suffix"
|
64 |
|
|
run_dump_test "fp"
|
65 |
|
|
run_dump_test "nops"
|
66 |
|
|
run_dump_test "nops16-1"
|
67 |
|
|
run_dump_test "nops-1"
|
68 |
|
|
run_dump_test "nops-1-i386"
|
69 |
|
|
run_dump_test "nops-1-i386-i686"
|
70 |
|
|
run_dump_test "nops-1-i686"
|
71 |
|
|
run_dump_test "nops-1-k8"
|
72 |
|
|
run_dump_test "nops-1-merom"
|
73 |
|
|
run_dump_test "nops-2"
|
74 |
|
|
run_dump_test "nops-2-i386"
|
75 |
|
|
run_dump_test "nops-2-merom"
|
76 |
|
|
run_dump_test "nops-3"
|
77 |
|
|
run_dump_test "nops-3-i386"
|
78 |
|
|
run_dump_test "nops-3-i686"
|
79 |
|
|
run_dump_test "nops-4"
|
80 |
|
|
run_dump_test "nops-4-i386"
|
81 |
|
|
run_dump_test "nops-4-i686"
|
82 |
|
|
run_dump_test "nops-5"
|
83 |
|
|
run_dump_test "nops-5-i686"
|
84 |
|
|
run_dump_test "addr16"
|
85 |
|
|
run_dump_test "addr32"
|
86 |
|
|
run_dump_test "sse4_1"
|
87 |
|
|
run_dump_test "sse4_1-intel"
|
88 |
|
|
run_dump_test "sse4_2"
|
89 |
|
|
run_dump_test "sse4_2-intel"
|
90 |
|
|
run_dump_test "crc32"
|
91 |
|
|
run_dump_test "crc32-intel"
|
92 |
|
|
run_list_test "inval-crc32" "-al"
|
93 |
|
|
run_dump_test "simd"
|
94 |
|
|
run_dump_test "simd-intel"
|
95 |
|
|
run_dump_test "simd-suffix"
|
96 |
|
|
run_dump_test "mem"
|
97 |
|
|
run_dump_test "mem-intel"
|
98 |
|
|
run_dump_test "reg"
|
99 |
|
|
run_dump_test "reg-intel"
|
100 |
|
|
run_dump_test "i386"
|
101 |
|
|
run_dump_test "compat"
|
102 |
|
|
run_dump_test "compat-intel"
|
103 |
|
|
run_dump_test "arch-1"
|
104 |
|
|
run_dump_test "arch-2"
|
105 |
|
|
run_dump_test "arch-3"
|
106 |
|
|
run_dump_test "arch-5"
|
107 |
|
|
run_dump_test "arch-6"
|
108 |
|
|
run_dump_test "arch-7"
|
109 |
|
|
run_dump_test "arch-9"
|
110 |
|
|
run_dump_test "arch-10"
|
111 |
|
|
run_list_test "arch-10-1" "-march=generic32 -I${srcdir}/$subdir -al"
|
112 |
|
|
run_list_test "arch-10-2" "-march=i686 -I${srcdir}/$subdir -al"
|
113 |
|
|
run_list_test "arch-10-3" "-march=i686+sse4.2 -I${srcdir}/$subdir -al"
|
114 |
|
|
run_list_test "arch-10-4" "-march=i686+sse4+vmx+smx -I${srcdir}/$subdir -al"
|
115 |
|
|
run_dump_test "arch-11"
|
116 |
|
|
run_dump_test "arch-12"
|
117 |
|
|
run_dump_test "8087"
|
118 |
|
|
run_dump_test "287"
|
119 |
|
|
run_dump_test "387"
|
120 |
|
|
run_list_test "no87" "-al"
|
121 |
|
|
run_list_test "no87-2" "-march=i686+no87 -al"
|
122 |
|
|
run_dump_test "xsave"
|
123 |
|
|
run_dump_test "xsave-intel"
|
124 |
|
|
run_dump_test "aes"
|
125 |
|
|
run_dump_test "aes-intel"
|
126 |
|
|
run_dump_test "clmul"
|
127 |
|
|
run_dump_test "clmul-intel"
|
128 |
|
|
run_dump_test "avx"
|
129 |
|
|
run_dump_test "avx-intel"
|
130 |
|
|
run_dump_test "sse2avx"
|
131 |
|
|
run_list_test "inval-avx" "-al"
|
132 |
|
|
run_dump_test "sse-check"
|
133 |
|
|
run_dump_test "sse-check-none"
|
134 |
|
|
run_dump_test "sse-check-warn"
|
135 |
|
|
run_list_test "sse-check-error" "-msse-check=error -I${srcdir}/$subdir -al"
|
136 |
|
|
run_dump_test "sse-noavx"
|
137 |
|
|
run_dump_test "movbe"
|
138 |
|
|
run_dump_test "movbe-intel"
|
139 |
|
|
run_list_test "inval-movbe" "-al"
|
140 |
|
|
run_dump_test "ept"
|
141 |
|
|
run_dump_test "ept-intel"
|
142 |
|
|
run_list_test "inval-ept" "-al"
|
143 |
|
|
run_dump_test "arch-avx-1"
|
144 |
|
|
run_list_test "arch-avx-1-1" "-march=generic32+avx -I${srcdir}/$subdir -al"
|
145 |
|
|
run_list_test "arch-avx-1-2" "-march=generic32+aes -I${srcdir}/$subdir -al"
|
146 |
|
|
run_list_test "arch-avx-1-3" "-march=generic32+pclmul -I${srcdir}/$subdir -al"
|
147 |
|
|
run_list_test "arch-avx-1-4" "-march=generic32+avx+aes -I${srcdir}/$subdir -al"
|
148 |
|
|
run_list_test "arch-avx-1-5" "-march=generic32+avx+pclmul -I${srcdir}/$subdir -al"
|
149 |
|
|
run_list_test "arch-avx-1-6" "-march=generic32+aes+pclmul -I${srcdir}/$subdir -al"
|
150 |
|
|
run_dump_test "opts"
|
151 |
|
|
run_dump_test "opts-intel"
|
152 |
|
|
run_dump_test "sse2avx-opts"
|
153 |
|
|
run_dump_test "sse2avx-opts-intel"
|
154 |
|
|
run_dump_test "fma"
|
155 |
|
|
run_dump_test "fma-intel"
|
156 |
|
|
run_dump_test "fma4"
|
157 |
|
|
|
158 |
|
|
# These tests require support for 8 and 16 bit relocs,
|
159 |
|
|
# so we only run them for ELF and COFF targets.
|
160 |
|
|
if {[is_elf_format] || [istarget "*-*-coff*"]} then {
|
161 |
|
|
run_dump_test "reloc"
|
162 |
|
|
run_dump_test "jump16"
|
163 |
|
|
run_list_test "white" "-al --listing-lhs-width=3"
|
164 |
|
|
|
165 |
|
|
# These tests should in theory work for PE targets as well,
|
166 |
|
|
# but the relocs we currently produce are slightly different
|
167 |
|
|
# from those produced for ELF/COFF based toolchains.
|
168 |
|
|
# So for now we ignore PE targets.
|
169 |
|
|
run_dump_test "pcrel"
|
170 |
|
|
run_dump_test "absrel"
|
171 |
|
|
}
|
172 |
|
|
|
173 |
|
|
# ELF specific tests
|
174 |
|
|
if [is_elf_format] then {
|
175 |
|
|
# PIC is only supported on ELF targets.
|
176 |
|
|
run_dump_test "intelpic"
|
177 |
|
|
|
178 |
|
|
run_dump_test "relax"
|
179 |
|
|
run_dump_test "gotpc"
|
180 |
|
|
run_dump_test "tlsd"
|
181 |
|
|
run_dump_test "tlspic"
|
182 |
|
|
run_dump_test "tlsnopic"
|
183 |
|
|
run_dump_test "bss"
|
184 |
|
|
run_dump_test "reloc32"
|
185 |
|
|
run_list_test "reloc32" "--defsym _bad_=1"
|
186 |
|
|
run_dump_test "mixed-mode-reloc32"
|
187 |
|
|
run_dump_test "att-regs"
|
188 |
|
|
run_dump_test "intel-regs"
|
189 |
|
|
run_list_test "inval-equ-1" "-al"
|
190 |
|
|
run_list_test "inval-equ-2" "-al"
|
191 |
|
|
run_dump_test "ifunc"
|
192 |
|
|
run_list_test "l1om-inval" "-march=l1om --32"
|
193 |
|
|
}
|
194 |
|
|
|
195 |
|
|
# This is a PE specific test.
|
196 |
|
|
if { [istarget "*-*-cygwin*"] || [istarget "*-*-pe"]
|
197 |
|
|
|| [istarget "*-*-mingw*"]
|
198 |
|
|
} then {
|
199 |
|
|
run_dump_test "secrel"
|
200 |
|
|
}
|
201 |
|
|
|
202 |
|
|
set ASFLAGS "$old_ASFLAGS"
|
203 |
|
|
}
|
204 |
|
|
|
205 |
|
|
if [expr [istarget "i*86-*-*"] || [istarget "x86_64-*-*"]] then {
|
206 |
|
|
run_dump_test "intel-expr"
|
207 |
|
|
run_dump_test "string-ok"
|
208 |
|
|
run_list_test "string-bad" ""
|
209 |
|
|
}
|
210 |
|
|
|
211 |
|
|
if [expr ([istarget "i*86-*-*"] || [istarget "x86_64-*-*"]) && [gas_64_check]] then {
|
212 |
|
|
|
213 |
|
|
global ASFLAGS
|
214 |
|
|
set old_ASFLAGS "$ASFLAGS"
|
215 |
|
|
set ASFLAGS "$ASFLAGS --64"
|
216 |
|
|
|
217 |
|
|
run_dump_test "x86_64"
|
218 |
|
|
run_dump_test "x86-64-addr32"
|
219 |
|
|
run_dump_test "x86-64-addr32-intel"
|
220 |
|
|
run_dump_test "x86-64-opcode"
|
221 |
|
|
run_dump_test "x86-64-intel64"
|
222 |
|
|
if { ![istarget "*-*-mingw*"] } then {
|
223 |
|
|
run_dump_test "x86-64-pcrel"
|
224 |
|
|
} else {
|
225 |
|
|
run_dump_test "x86-64-w64-pcrel"
|
226 |
|
|
}
|
227 |
|
|
run_dump_test "x86-64-rip"
|
228 |
|
|
run_dump_test "x86-64-rip-intel"
|
229 |
|
|
run_dump_test "x86-64-stack"
|
230 |
|
|
run_dump_test "x86-64-stack-intel"
|
231 |
|
|
run_dump_test "x86-64-stack-suffix"
|
232 |
|
|
run_list_test "x86-64-inval" "-al"
|
233 |
|
|
run_list_test "x86-64-segment" "-al"
|
234 |
|
|
run_list_test "x86-64-inval-seg" "-al"
|
235 |
|
|
run_dump_test "x86-64-branch"
|
236 |
|
|
run_dump_test "svme64"
|
237 |
|
|
run_dump_test "x86-64-amdfam10"
|
238 |
|
|
run_dump_test "x86-64-vmx"
|
239 |
|
|
run_dump_test "immed64"
|
240 |
|
|
run_dump_test "x86-64-prescott"
|
241 |
|
|
run_dump_test "x86-64-crx"
|
242 |
|
|
run_dump_test "x86-64-crx-suffix"
|
243 |
|
|
run_dump_test "x86-64-drx"
|
244 |
|
|
run_dump_test "x86-64-drx-suffix"
|
245 |
|
|
run_dump_test "x86-64-merom"
|
246 |
|
|
run_dump_test "x86-64-rep"
|
247 |
|
|
run_dump_test "x86-64-rep-suffix"
|
248 |
|
|
run_dump_test "x86-64-cbw"
|
249 |
|
|
run_dump_test "x86-64-cbw-intel"
|
250 |
|
|
run_dump_test "x86-64-io"
|
251 |
|
|
run_dump_test "x86-64-io-intel"
|
252 |
|
|
run_dump_test "x86-64-io-suffix"
|
253 |
|
|
run_dump_test "x86-64-gidt"
|
254 |
|
|
run_dump_test "x86-64-nops"
|
255 |
|
|
run_dump_test "x86-64-nops-1"
|
256 |
|
|
run_dump_test "x86-64-nops-1-k8"
|
257 |
|
|
run_dump_test "x86-64-nops-1-nocona"
|
258 |
|
|
run_dump_test "x86-64-nops-1-merom"
|
259 |
|
|
run_dump_test "x86-64-nops-1-pentium"
|
260 |
|
|
run_dump_test "x86-64-nops-2"
|
261 |
|
|
run_dump_test "x86-64-nops-3"
|
262 |
|
|
run_dump_test "x86-64-nops-4"
|
263 |
|
|
run_dump_test "x86-64-nops-4-core2"
|
264 |
|
|
run_dump_test "x86-64-nops-4-k8"
|
265 |
|
|
run_dump_test "x86-64-nops-5"
|
266 |
|
|
run_dump_test "x86-64-nops-5-k8"
|
267 |
|
|
run_dump_test "x86-64-sse4_1"
|
268 |
|
|
run_dump_test "x86-64-sse4_1-intel"
|
269 |
|
|
run_dump_test "x86-64-sse4_2"
|
270 |
|
|
run_dump_test "x86-64-sse4_2-intel"
|
271 |
|
|
run_dump_test "x86-64-crc32"
|
272 |
|
|
run_dump_test "x86-64-crc32-intel"
|
273 |
|
|
run_list_test "x86-64-inval-crc32" "-al"
|
274 |
|
|
run_dump_test "x86-64-simd"
|
275 |
|
|
run_dump_test "x86-64-simd-intel"
|
276 |
|
|
run_dump_test "x86-64-simd-suffix"
|
277 |
|
|
run_dump_test "x86-64-mem"
|
278 |
|
|
run_dump_test "x86-64-mem-intel"
|
279 |
|
|
run_dump_test "x86-64-reg"
|
280 |
|
|
run_dump_test "x86-64-reg-intel"
|
281 |
|
|
run_dump_test "x86-64-sib"
|
282 |
|
|
run_dump_test "x86-64-sib-intel"
|
283 |
|
|
if { ![istarget "*-*-mingw*"] } then {
|
284 |
|
|
run_dump_test "x86-64-opcode-inval"
|
285 |
|
|
run_dump_test "x86-64-opcode-inval-intel"
|
286 |
|
|
}
|
287 |
|
|
run_dump_test "rexw"
|
288 |
|
|
run_dump_test "x86-64-arch-1"
|
289 |
|
|
run_dump_test "x86-64-arch-2"
|
290 |
|
|
run_dump_test "x86-64-xsave"
|
291 |
|
|
run_dump_test "x86-64-xsave-intel"
|
292 |
|
|
run_dump_test "x86-64-aes"
|
293 |
|
|
run_dump_test "x86-64-aes-intel"
|
294 |
|
|
run_dump_test "x86-64-clmul"
|
295 |
|
|
run_dump_test "x86-64-clmul-intel"
|
296 |
|
|
run_dump_test "x86-64-avx"
|
297 |
|
|
run_dump_test "x86-64-avx-intel"
|
298 |
|
|
run_dump_test "x86-64-sse2avx"
|
299 |
|
|
run_list_test "x86-64-inval-avx" "-al"
|
300 |
|
|
run_dump_test "x86-64-sse-check"
|
301 |
|
|
run_dump_test "x86-64-sse-check-none"
|
302 |
|
|
run_dump_test "x86-64-sse-check-warn"
|
303 |
|
|
run_list_test "x86-64-sse-check-error" "-msse-check=error -I${srcdir}/$subdir -al"
|
304 |
|
|
run_dump_test "x86-64-sse-noavx"
|
305 |
|
|
run_dump_test "x86-64-movbe"
|
306 |
|
|
run_dump_test "x86-64-movbe-intel"
|
307 |
|
|
run_list_test "x86-64-inval-movbe" "-al"
|
308 |
|
|
run_dump_test "x86-64-ept"
|
309 |
|
|
run_dump_test "x86-64-ept-intel"
|
310 |
|
|
run_list_test "x86-64-inval-ept" "-al"
|
311 |
|
|
run_dump_test "x86-64-opts"
|
312 |
|
|
run_dump_test "x86-64-opts-intel"
|
313 |
|
|
run_dump_test "x86-64-sse2avx-opts"
|
314 |
|
|
run_dump_test "x86-64-sse2avx-opts-intel"
|
315 |
|
|
run_dump_test "x86-64-avx-swap"
|
316 |
|
|
run_dump_test "x86-64-avx-swap-intel"
|
317 |
|
|
run_dump_test "x86-64-fma"
|
318 |
|
|
run_dump_test "x86-64-fma-intel"
|
319 |
|
|
run_dump_test "x86-64-fma4"
|
320 |
|
|
|
321 |
|
|
if { ![istarget "*-*-aix*"]
|
322 |
|
|
&& ![istarget "*-*-beos*"]
|
323 |
|
|
&& ![istarget "*-*-*bsd*"]
|
324 |
|
|
&& ![istarget "*-*-chaos*"]
|
325 |
|
|
&& ![istarget "*-*-kaos*"]
|
326 |
|
|
&& ![istarget "*-*-lynx*"]
|
327 |
|
|
&& ![istarget "*-*-moss*"]
|
328 |
|
|
&& ![istarget "*-*-nto-qnx*"]
|
329 |
|
|
&& ![istarget "*-*-rtems*"]
|
330 |
|
|
&& ![istarget "*-*-sco*"]
|
331 |
|
|
&& ![istarget "*-*-solaris*"]
|
332 |
|
|
&& ![istarget "*-*-sysv*"] } then {
|
333 |
|
|
run_dump_test "rex"
|
334 |
|
|
}
|
335 |
|
|
|
336 |
|
|
# For ELF targets verify that @unwind works.
|
337 |
|
|
if { ([istarget "*-*-elf*"] || [istarget "*-*-linux*"]
|
338 |
|
|
|| [istarget "*-*-solaris2.*"])
|
339 |
|
|
&& ![istarget *-*-linux*aout*]
|
340 |
|
|
&& ![istarget *-*-linux*oldld*] } then {
|
341 |
|
|
run_dump_test "x86-64-unwind"
|
342 |
|
|
}
|
343 |
|
|
|
344 |
|
|
# ELF specific tests
|
345 |
|
|
if [is_elf_format] then {
|
346 |
|
|
run_dump_test "reloc64"
|
347 |
|
|
run_list_test "reloc64" "--defsym _bad_=1"
|
348 |
|
|
run_dump_test "mixed-mode-reloc64"
|
349 |
|
|
run_dump_test "x86-64-ifunc"
|
350 |
|
|
run_dump_test "l1om"
|
351 |
|
|
}
|
352 |
|
|
|
353 |
|
|
set ASFLAGS "$old_ASFLAGS"
|
354 |
|
|
}
|