PR 12590
[deliverable/binutils-gdb.git] / gas / testsuite / gas / i386 / i386.exp
CommitLineData
252b5132
RH
1#
2# i386 tests
3#
b96d3a20
JH
4proc gas_64_check { } {
5 global NM
6 global NMFLAGS
252b5132 7
7f6a71ff
JM
8 set status [gas_host_run "$NM $NMFLAGS --help" ""]
9 return [regexp "targets:.*x86-64" [lindex $status 1]];
b96d3a20 10}
6e0b89ee 11
b96d3a20
JH
12proc gas_32_check { } {
13 global NM
14 global NMFLAGS
b96d3a20 15
7f6a71ff
JM
16 set status [gas_host_run "$NM $NMFLAGS --help" ""]
17 return [regexp "targets:.*i386" [lindex $status 1]];
b96d3a20
JH
18}
19
b96d3a20
JH
20if [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"
252b5132 25
1efbbeb4
L
26 run_list_test "float" "-al -mmnemonic=att"
27 run_list_test "general" "-al --listing-lhs-width=2 -mold-gcc"
252b5132 28 run_list_test "inval" "-al"
4cc91dba
L
29 run_list_test "segment" "-al"
30 run_list_test "inval-seg" "-al"
56ffb741 31 run_list_test "inval-reg" "-al"
252b5132 32 run_list_test "modrm" "-al --listing-lhs-width=2"
3f9ed93b 33 run_dump_test "naked"
252b5132 34 run_dump_test "opcode"
8a82f7e3
JB
35 run_dump_test "opcode-intel"
36 run_dump_test "opcode-suffix"
cc5ca5ce 37 run_dump_test "intel"
be66c492 38 run_dump_test "intel16"
9306ca4a
JB
39 run_list_test "intelbad" ""
40 run_dump_test "intelok"
252b5132
RH
41 run_dump_test "prefix"
42 run_dump_test "amd"
c608c12e 43 run_dump_test "katmai"
a3d1c52b 44 run_dump_test "jump"
7898a2b1
L
45 run_dump_test "relax-1"
46 run_dump_test "relax-2"
de9d65b5
JH
47 run_dump_test "ssemmx2"
48 run_dump_test "sse2"
4dd8d67b 49 run_dump_test "sub"
bc2ae10b 50 run_dump_test "sse3"
2033b4b9 51 run_dump_test "sib"
db51cc60 52 run_dump_test "sib-intel"
0e1147d9 53 run_dump_test "disp"
6cee4cda 54 run_dump_test "disp-intel"
f8a5c266 55 run_dump_test "disp32"
90700ea2 56 run_dump_test "vmx"
47dd174c 57 run_dump_test "smx"
22cbf2e7 58 run_dump_test "suffix"
9cd96992 59 run_dump_test "immed32"
4d1bb795 60 run_dump_test "equ"
5157cd8a 61 run_dump_test "divide"
26f07657 62 run_dump_test "padlock"
c4a530c5
JB
63 run_dump_test "crx"
64 run_list_test "cr-err" ""
30123838 65 run_dump_test "svme"
050dfa73 66 run_dump_test "amdfam10"
bc2ae10b 67 run_dump_test "ssse3"
35c52694
L
68 run_dump_test "rep"
69 run_dump_test "rep-suffix"
c32fa91d
L
70 run_dump_test "lock-1"
71 run_dump_test "lock-1-intel"
72 run_list_test "lockbad-1" "-al"
f16cd0d5
L
73 run_dump_test "long-1"
74 run_dump_test "long-1-intel"
5645cf1e 75 run_dump_test "fp"
15965411 76 run_dump_test "nops"
76bc74dc 77 run_dump_test "nops16-1"
ccc9c027
L
78 run_dump_test "nops-1"
79 run_dump_test "nops-1-i386"
76bc74dc 80 run_dump_test "nops-1-i386-i686"
ccc9c027 81 run_dump_test "nops-1-i686"
76bc74dc 82 run_dump_test "nops-1-k8"
bc2ae10b 83 run_dump_test "nops-1-core2"
68339fdf 84 run_dump_test "nops-1-bdver1"
ccc9c027
L
85 run_dump_test "nops-2"
86 run_dump_test "nops-2-i386"
bc2ae10b 87 run_dump_test "nops-2-core2"
c0f91ba6 88 run_dump_test "nops-3"
76bc74dc
L
89 run_dump_test "nops-3-i386"
90 run_dump_test "nops-3-i686"
91 run_dump_test "nops-4"
92 run_dump_test "nops-4-i386"
93 run_dump_test "nops-4-i686"
a586129e 94 run_dump_test "nops-4a-i686"
fbf3f584
L
95 run_dump_test "nops-5"
96 run_dump_test "nops-5-i686"
a586129e 97 run_dump_test "nops-6"
539e75ad
L
98 run_dump_test "addr16"
99 run_dump_test "addr32"
42903f7f 100 run_dump_test "sse4_1"
c3ad16c0 101 run_dump_test "sse4_1-intel"
381d071f 102 run_dump_test "sse4_2"
c3ad16c0 103 run_dump_test "sse4_2-intel"
9344ff29
L
104 run_dump_test "crc32"
105 run_dump_test "crc32-intel"
20592a94 106 run_list_test "inval-crc32" "-al"
09a2c6cf
L
107 run_dump_test "simd"
108 run_dump_test "simd-intel"
8a72226a 109 run_dump_test "simd-suffix"
d9a5e5e5
L
110 run_dump_test "mem"
111 run_dump_test "mem-intel"
b844680a
L
112 run_dump_test "reg"
113 run_dump_test "reg-intel"
ca61edf2 114 run_dump_test "i386"
9d141669
L
115 run_dump_test "compat"
116 run_dump_test "compat-intel"
8d79a8c8
L
117 run_dump_test "arch-1"
118 run_dump_test "arch-2"
119 run_dump_test "arch-3"
b414985b 120 run_dump_test "arch-4"
e0329a22
L
121 run_dump_test "arch-5"
122 run_dump_test "arch-6"
123 run_dump_test "arch-7"
3629bb00 124 run_dump_test "arch-9"
6305a203
L
125 run_dump_test "arch-10"
126 run_list_test "arch-10-1" "-march=generic32 -I${srcdir}/$subdir -al"
127 run_list_test "arch-10-2" "-march=i686 -I${srcdir}/$subdir -al"
128 run_list_test "arch-10-3" "-march=i686+sse4.2 -I${srcdir}/$subdir -al"
129 run_list_test "arch-10-4" "-march=i686+sse4+vmx+smx -I${srcdir}/$subdir -al"
115c7c25
L
130 run_dump_test "arch-11"
131 run_dump_test "arch-12"
309d3373
JB
132 run_dump_test "8087"
133 run_dump_test "287"
134 run_dump_test "387"
135 run_list_test "no87" "-al"
136 run_list_test "no87-2" "-march=i686+no87 -al"
475a2301
L
137 run_dump_test "xsave"
138 run_dump_test "xsave-intel"
c0f3af97
L
139 run_dump_test "aes"
140 run_dump_test "aes-intel"
141 run_dump_test "clmul"
142 run_dump_test "clmul-intel"
143 run_dump_test "avx"
144 run_dump_test "avx-intel"
539f890d
L
145 run_dump_test "avx-scalar"
146 run_dump_test "avx-scalar-intel"
c0f3af97
L
147 run_dump_test "sse2avx"
148 run_list_test "inval-avx" "-al"
daf50ae7 149 run_dump_test "sse-check"
cb19c032 150 run_dump_test "sse-check-none"
daf50ae7
L
151 run_dump_test "sse-check-warn"
152 run_list_test "sse-check-error" "-msse-check=error -I${srcdir}/$subdir -al"
9ba52a26 153 run_dump_test "sse-noavx"
f1f8f695
L
154 run_dump_test "movbe"
155 run_dump_test "movbe-intel"
156 run_list_test "inval-movbe" "-al"
157 run_dump_test "ept"
158 run_dump_test "ept-intel"
159 run_list_test "inval-ept" "-al"
a5ff0eb2
L
160 run_dump_test "arch-avx-1"
161 run_list_test "arch-avx-1-1" "-march=generic32+avx -I${srcdir}/$subdir -al"
162 run_list_test "arch-avx-1-2" "-march=generic32+aes -I${srcdir}/$subdir -al"
ce2f5b3c
L
163 run_list_test "arch-avx-1-3" "-march=generic32+pclmul -I${srcdir}/$subdir -al"
164 run_list_test "arch-avx-1-4" "-march=generic32+avx+aes -I${srcdir}/$subdir -al"
165 run_list_test "arch-avx-1-5" "-march=generic32+avx+pclmul -I${srcdir}/$subdir -al"
166 run_list_test "arch-avx-1-6" "-march=generic32+aes+pclmul -I${srcdir}/$subdir -al"
b6169b20
L
167 run_dump_test "opts"
168 run_dump_test "opts-intel"
169 run_dump_test "sse2avx-opts"
170 run_dump_test "sse2avx-opts-intel"
0bfee649
L
171 run_dump_test "fma"
172 run_dump_test "fma-intel"
1c480963
L
173 run_dump_test "fma-scalar"
174 run_dump_test "fma-scalar-intel"
922d8de8 175 run_dump_test "fma4"
f88c9eb0 176 run_dump_test "lwp"
5dd85c99 177 run_dump_test "xop"
f12dc422
L
178 run_dump_test "bmi"
179 run_dump_test "bmi-intel"
2a2a0f38
QN
180 run_dump_test "tbm"
181 run_dump_test "tbm-intel"
c7b8aa3a
L
182 run_dump_test "f16c"
183 run_dump_test "f16c-intel"
184 run_dump_test "fsgs"
185 run_dump_test "fsgs-intel"
186 run_dump_test "rdrnd"
187 run_dump_test "rdrnd-intel"
252b5132 188
a3d1c52b
AM
189 # These tests require support for 8 and 16 bit relocs,
190 # so we only run them for ELF and COFF targets.
62e88f3c 191 if {[is_elf_format] || [istarget "*-*-coff*"]} then {
252b5132 192 run_dump_test "reloc"
a3d1c52b 193 run_dump_test "jump16"
252b5132 194 run_list_test "white" "-al --listing-lhs-width=3"
3d983505
NC
195
196 # These tests should in theory work for PE targets as well,
197 # but the relocs we currently produce are slightly different
198 # from those produced for ELF/COFF based toolchains.
199 # So for now we ignore PE targets.
200 run_dump_test "pcrel"
201 run_dump_test "absrel"
252b5132 202 }
00687228 203
62e88f3c
NC
204 # ELF specific tests
205 if [is_elf_format] then {
206 # PIC is only supported on ELF targets.
207 run_dump_test "intelpic"
208
00687228 209 run_dump_test "relax"
2bbd9c25 210 run_dump_test "gotpc"
13ae64f3
JJ
211 run_dump_test "tlsd"
212 run_dump_test "tlspic"
213 run_dump_test "tlsnopic"
8a75718c 214 run_dump_test "bss"
3956db08
JB
215 run_dump_test "reloc32"
216 run_list_test "reloc32" "--defsym _bad_=1"
4fa24527 217 run_dump_test "mixed-mode-reloc32"
192dc9c6 218 run_dump_test "att-regs"
4261360e 219 run_dump_test "intel-got32"
192dc9c6 220 run_dump_test "intel-regs"
d0548f34
L
221 run_list_test "inval-equ-1" "-al"
222 run_list_test "inval-equ-2" "-al"
915bcca5 223 run_dump_test "ifunc"
c969da64
RS
224 run_list_test "ifunc-2"
225 run_dump_test "ifunc-3"
8a9036a4 226 run_list_test "l1om-inval" "-march=l1om --32"
2a86604a 227 run_dump_test "localpic"
df1c40a7 228 run_dump_test "debug1"
502abbdf 229
089b8992 230 run_dump_test "dw2-compress-2"
21be61f5
L
231
232 run_dump_test "bad-size"
00687228
L
233 }
234
6482c264
NC
235 # This is a PE specific test.
236 if { [istarget "*-*-cygwin*"] || [istarget "*-*-pe"]
237 || [istarget "*-*-mingw*"]
238 } then {
239 run_dump_test "secrel"
240 }
241
b96d3a20
JH
242 set ASFLAGS "$old_ASFLAGS"
243}
6e0b89ee 244
cdcf9467 245# Common tests
fc0763e6 246if [expr [istarget "i*86-*-*"] || [istarget "x86_64-*-*"]] then {
ee86248c 247 run_dump_test "intel-expr"
fc0763e6
JB
248 run_dump_test "string-ok"
249 run_list_test "string-bad" ""
cdcf9467 250 run_list_test "space1" "-al"
4f9adf89
L
251 if [is_elf_format] then {
252 run_list_test_stdin "list-1" "-al"
253 run_list_test_stdin "list-2" "-al"
254 run_list_test_stdin "list-3" "-al"
12a8b92e
L
255 run_dump_test "dw2-compress-1"
256 }
fc0763e6
JB
257}
258
fc847f15 259if [expr ([istarget "i*86-*-*"] || [istarget "x86_64-*-*"]) && [gas_64_check]] then {
b96d3a20
JH
260
261 global ASFLAGS
262 set old_ASFLAGS "$ASFLAGS"
263 set ASFLAGS "$ASFLAGS --64"
264
265 run_dump_test "x86_64"
20f0a1fc 266 run_dump_test "x86-64-addr32"
185b1163 267 run_dump_test "x86-64-addr32-intel"
831b02f6 268 run_dump_test "x86-64-opcode"
dfb07592 269 run_dump_test "x86-64-intel64"
0cd63f3d
KT
270 if { ![istarget "*-*-mingw*"] } then {
271 run_dump_test "x86-64-pcrel"
272 } else {
273 run_dump_test "x86-64-w64-pcrel"
274 }
20f0a1fc 275 run_dump_test "x86-64-rip"
185b1163 276 run_dump_test "x86-64-rip-intel"
1a114b12
JB
277 run_dump_test "x86-64-stack"
278 run_dump_test "x86-64-stack-intel"
279 run_dump_test "x86-64-stack-suffix"
831b02f6 280 run_list_test "x86-64-inval" "-al"
4cc91dba
L
281 run_list_test "x86-64-segment" "-al"
282 run_list_test "x86-64-inval-seg" "-al"
003519a7 283 run_dump_test "x86-64-branch"
7898a2b1 284 run_dump_test "x86-64-relax-1"
30123838 285 run_dump_test "svme64"
050dfa73 286 run_dump_test "x86-64-amdfam10"
90700ea2 287 run_dump_test "x86-64-vmx"
9cd96992 288 run_dump_test "immed64"
bc2ae10b 289 run_dump_test "x86-64-sse3"
6dd5059a
L
290 run_dump_test "x86-64-crx"
291 run_dump_test "x86-64-crx-suffix"
a1cfb73e
L
292 run_dump_test "x86-64-drx"
293 run_dump_test "x86-64-drx-suffix"
bc2ae10b 294 run_dump_test "x86-64-ssse3"
35c52694
L
295 run_dump_test "x86-64-rep"
296 run_dump_test "x86-64-rep-suffix"
c32fa91d
L
297 run_dump_test "x86-64-lock-1"
298 run_dump_test "x86-64-lock-1-intel"
299 run_list_test "x86-64-lockbad-1" "-al"
f16cd0d5
L
300 run_dump_test "x86-64-long-1"
301 run_dump_test "x86-64-long-1-intel"
a35ca55a
JB
302 run_dump_test "x86-64-cbw"
303 run_dump_test "x86-64-cbw-intel"
52fd6d94
JB
304 run_dump_test "x86-64-io"
305 run_dump_test "x86-64-io-intel"
306 run_dump_test "x86-64-io-suffix"
cb6d3433 307 run_dump_test "x86-64-gidt"
15965411 308 run_dump_test "x86-64-nops"
872ce6ff 309 run_dump_test "x86-64-nops-1"
da98bb4c 310 run_dump_test "x86-64-nops-1-g64"
ccc9c027
L
311 run_dump_test "x86-64-nops-1-k8"
312 run_dump_test "x86-64-nops-1-nocona"
bc2ae10b 313 run_dump_test "x86-64-nops-1-core2"
711eedef 314 run_dump_test "x86-64-nops-1-pentium"
68339fdf 315 run_dump_test "x86-64-nops-1-bdver1"
76bc74dc
L
316 run_dump_test "x86-64-nops-2"
317 run_dump_test "x86-64-nops-3"
318 run_dump_test "x86-64-nops-4"
319 run_dump_test "x86-64-nops-4-core2"
320 run_dump_test "x86-64-nops-4-k8"
fbf3f584
L
321 run_dump_test "x86-64-nops-5"
322 run_dump_test "x86-64-nops-5-k8"
42903f7f 323 run_dump_test "x86-64-sse4_1"
c3ad16c0 324 run_dump_test "x86-64-sse4_1-intel"
381d071f 325 run_dump_test "x86-64-sse4_2"
c3ad16c0 326 run_dump_test "x86-64-sse4_2-intel"
9344ff29
L
327 run_dump_test "x86-64-crc32"
328 run_dump_test "x86-64-crc32-intel"
20592a94 329 run_list_test "x86-64-inval-crc32" "-al"
09a2c6cf
L
330 run_dump_test "x86-64-simd"
331 run_dump_test "x86-64-simd-intel"
8a72226a 332 run_dump_test "x86-64-simd-suffix"
d9a5e5e5
L
333 run_dump_test "x86-64-mem"
334 run_dump_test "x86-64-mem-intel"
5cee3fe6
L
335 run_dump_test "x86-64-reg"
336 run_dump_test "x86-64-reg-intel"
db51cc60
L
337 run_dump_test "x86-64-sib"
338 run_dump_test "x86-64-sib-intel"
0e1147d9 339 run_dump_test "x86-64-disp"
6cee4cda 340 run_dump_test "x86-64-disp-intel"
f8a5c266 341 run_dump_test "x86-64-disp32"
c6add537 342 run_dump_test "rexw"
eacc9c89
L
343 run_dump_test "x86-64-fxsave"
344 run_dump_test "x86-64-fxsave-intel"
599121aa 345 run_dump_test "x86-64-arch-1"
e8efc4d9 346 run_dump_test "x86-64-arch-2"
475a2301
L
347 run_dump_test "x86-64-xsave"
348 run_dump_test "x86-64-xsave-intel"
c0f3af97
L
349 run_dump_test "x86-64-aes"
350 run_dump_test "x86-64-aes-intel"
351 run_dump_test "x86-64-clmul"
352 run_dump_test "x86-64-clmul-intel"
353 run_dump_test "x86-64-avx"
354 run_dump_test "x86-64-avx-intel"
539f890d
L
355 run_dump_test "x86-64-avx-scalar"
356 run_dump_test "x86-64-avx-scalar-intel"
c0f3af97
L
357 run_dump_test "x86-64-sse2avx"
358 run_list_test "x86-64-inval-avx" "-al"
daf50ae7 359 run_dump_test "x86-64-sse-check"
cb19c032 360 run_dump_test "x86-64-sse-check-none"
daf50ae7
L
361 run_dump_test "x86-64-sse-check-warn"
362 run_list_test "x86-64-sse-check-error" "-msse-check=error -I${srcdir}/$subdir -al"
9ba52a26 363 run_dump_test "x86-64-sse-noavx"
f1f8f695
L
364 run_dump_test "x86-64-movbe"
365 run_dump_test "x86-64-movbe-intel"
366 run_list_test "x86-64-inval-movbe" "-al"
367 run_dump_test "x86-64-ept"
368 run_dump_test "x86-64-ept-intel"
369 run_list_test "x86-64-inval-ept" "-al"
b6169b20
L
370 run_dump_test "x86-64-opts"
371 run_dump_test "x86-64-opts-intel"
372 run_dump_test "x86-64-sse2avx-opts"
373 run_dump_test "x86-64-sse2avx-opts-intel"
fa99fab2
L
374 run_dump_test "x86-64-avx-swap"
375 run_dump_test "x86-64-avx-swap-intel"
0bfee649
L
376 run_dump_test "x86-64-fma"
377 run_dump_test "x86-64-fma-intel"
1c480963
L
378 run_dump_test "x86-64-fma-scalar"
379 run_dump_test "x86-64-fma-scalar-intel"
922d8de8 380 run_dump_test "x86-64-fma4"
f88c9eb0 381 run_dump_test "x86-64-lwp"
5dd85c99 382 run_dump_test "x86-64-xop"
f12dc422
L
383 run_dump_test "x86-64-bmi"
384 run_dump_test "x86-64-bmi-intel"
2a2a0f38
QN
385 run_dump_test "x86-64-tbm"
386 run_dump_test "x86-64-tbm-intel"
c7b8aa3a
L
387 run_dump_test "x86-64-f16c"
388 run_dump_test "x86-64-f16c-intel"
389 run_dump_test "x86-64-fsgs"
390 run_dump_test "x86-64-fsgs-intel"
391 run_dump_test "x86-64-rdrnd"
392 run_dump_test "x86-64-rdrnd-intel"
b96d3a20 393
b1905489
JB
394 if { ![istarget "*-*-aix*"]
395 && ![istarget "*-*-beos*"]
396 && ![istarget "*-*-*bsd*"]
397 && ![istarget "*-*-chaos*"]
398 && ![istarget "*-*-kaos*"]
399 && ![istarget "*-*-lynx*"]
400 && ![istarget "*-*-moss*"]
401 && ![istarget "*-*-nto-qnx*"]
402 && ![istarget "*-*-rtems*"]
403 && ![istarget "*-*-sco*"]
404 && ![istarget "*-*-solaris*"]
405 && ![istarget "*-*-sysv*"] } then {
406 run_dump_test "rex"
407 }
408
3956db08
JB
409 # ELF specific tests
410 if [is_elf_format] then {
f5d9e816
L
411 # Verify that @unwind works.
412 run_dump_test "x86-64-unwind"
413
3956db08
JB
414 run_dump_test "reloc64"
415 run_list_test "reloc64" "--defsym _bad_=1"
4fa24527 416 run_dump_test "mixed-mode-reloc64"
915bcca5 417 run_dump_test "x86-64-ifunc"
4261360e
AM
418 run_dump_test "x86-64-opcode-inval"
419 run_dump_test "x86-64-opcode-inval-intel"
420 run_dump_test "intel-got64"
8a9036a4 421 run_dump_test "l1om"
f5d9e816 422 run_dump_test "x86-64-localpic"
df1c40a7 423 run_dump_test "debug1"
368886ac 424
089b8992 425 run_dump_test "x86-64-dw2-compress-2"
3956db08
JB
426 }
427
b96d3a20 428 set ASFLAGS "$old_ASFLAGS"
252b5132 429}
This page took 0.514549 seconds and 4 git commands to generate.