bfd/
[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"
252b5132 31 run_list_test "modrm" "-al --listing-lhs-width=2"
3f9ed93b 32 run_dump_test "naked"
252b5132 33 run_dump_test "opcode"
8a82f7e3
JB
34 run_dump_test "opcode-intel"
35 run_dump_test "opcode-suffix"
cc5ca5ce 36 run_dump_test "intel"
be66c492 37 run_dump_test "intel16"
9306ca4a
JB
38 run_list_test "intelbad" ""
39 run_dump_test "intelok"
252b5132
RH
40 run_dump_test "prefix"
41 run_dump_test "amd"
c608c12e 42 run_dump_test "katmai"
a3d1c52b 43 run_dump_test "jump"
de9d65b5
JH
44 run_dump_test "ssemmx2"
45 run_dump_test "sse2"
4dd8d67b 46 run_dump_test "sub"
ca164297 47 run_dump_test "prescott"
2033b4b9 48 run_dump_test "sib"
db51cc60 49 run_dump_test "sib-intel"
90700ea2 50 run_dump_test "vmx"
47dd174c 51 run_dump_test "smx"
22cbf2e7 52 run_dump_test "suffix"
9cd96992 53 run_dump_test "immed32"
4d1bb795 54 run_dump_test "equ"
5157cd8a 55 run_dump_test "divide"
26f07657 56 run_dump_test "padlock"
c4a530c5
JB
57 run_dump_test "crx"
58 run_list_test "cr-err" ""
30123838 59 run_dump_test "svme"
050dfa73 60 run_dump_test "amdfam10"
331d2d0d 61 run_dump_test "merom"
35c52694
L
62 run_dump_test "rep"
63 run_dump_test "rep-suffix"
5645cf1e 64 run_dump_test "fp"
15965411 65 run_dump_test "nops"
76bc74dc 66 run_dump_test "nops16-1"
ccc9c027
L
67 run_dump_test "nops-1"
68 run_dump_test "nops-1-i386"
76bc74dc 69 run_dump_test "nops-1-i386-i686"
ccc9c027 70 run_dump_test "nops-1-i686"
76bc74dc 71 run_dump_test "nops-1-k8"
ccc9c027
L
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"
c0f91ba6 76 run_dump_test "nops-3"
76bc74dc
L
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"
fbf3f584
L
82 run_dump_test "nops-5"
83 run_dump_test "nops-5-i686"
539e75ad
L
84 run_dump_test "addr16"
85 run_dump_test "addr32"
42903f7f 86 run_dump_test "sse4_1"
c3ad16c0 87 run_dump_test "sse4_1-intel"
381d071f 88 run_dump_test "sse4_2"
c3ad16c0 89 run_dump_test "sse4_2-intel"
9344ff29
L
90 run_dump_test "crc32"
91 run_dump_test "crc32-intel"
20592a94 92 run_list_test "inval-crc32" "-al"
09a2c6cf
L
93 run_dump_test "simd"
94 run_dump_test "simd-intel"
8a72226a 95 run_dump_test "simd-suffix"
d9a5e5e5
L
96 run_dump_test "mem"
97 run_dump_test "mem-intel"
b844680a
L
98 run_dump_test "reg"
99 run_dump_test "reg-intel"
ca61edf2 100 run_dump_test "i386"
9d141669
L
101 run_dump_test "compat"
102 run_dump_test "compat-intel"
8d79a8c8
L
103 run_dump_test "arch-1"
104 run_dump_test "arch-2"
105 run_dump_test "arch-3"
e0329a22
L
106 run_dump_test "arch-5"
107 run_dump_test "arch-6"
108 run_dump_test "arch-7"
3629bb00 109 run_dump_test "arch-9"
6305a203
L
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"
115c7c25
L
115 run_dump_test "arch-11"
116 run_dump_test "arch-12"
309d3373
JB
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"
475a2301
L
122 run_dump_test "xsave"
123 run_dump_test "xsave-intel"
c0f3af97
L
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"
daf50ae7 132 run_dump_test "sse-check"
cb19c032 133 run_dump_test "sse-check-none"
daf50ae7
L
134 run_dump_test "sse-check-warn"
135 run_list_test "sse-check-error" "-msse-check=error -I${srcdir}/$subdir -al"
9ba52a26 136 run_dump_test "sse-noavx"
f1f8f695
L
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"
a5ff0eb2
L
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"
ce2f5b3c
L
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"
b6169b20
L
150 run_dump_test "opts"
151 run_dump_test "opts-intel"
152 run_dump_test "sse2avx-opts"
153 run_dump_test "sse2avx-opts-intel"
0bfee649
L
154 run_dump_test "fma"
155 run_dump_test "fma-intel"
922d8de8 156 run_dump_test "fma4"
252b5132 157
a3d1c52b
AM
158 # These tests require support for 8 and 16 bit relocs,
159 # so we only run them for ELF and COFF targets.
62e88f3c 160 if {[is_elf_format] || [istarget "*-*-coff*"]} then {
252b5132 161 run_dump_test "reloc"
a3d1c52b 162 run_dump_test "jump16"
252b5132 163 run_list_test "white" "-al --listing-lhs-width=3"
3d983505
NC
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"
252b5132 171 }
00687228 172
62e88f3c
NC
173 # ELF specific tests
174 if [is_elf_format] then {
175 # PIC is only supported on ELF targets.
176 run_dump_test "intelpic"
177
00687228 178 run_dump_test "relax"
2bbd9c25 179 run_dump_test "gotpc"
13ae64f3
JJ
180 run_dump_test "tlsd"
181 run_dump_test "tlspic"
182 run_dump_test "tlsnopic"
8a75718c 183 run_dump_test "bss"
3956db08
JB
184 run_dump_test "reloc32"
185 run_list_test "reloc32" "--defsym _bad_=1"
4fa24527 186 run_dump_test "mixed-mode-reloc32"
192dc9c6
JB
187 run_dump_test "att-regs"
188 run_dump_test "intel-regs"
d0548f34
L
189 run_list_test "inval-equ-1" "-al"
190 run_list_test "inval-equ-2" "-al"
915bcca5 191 run_dump_test "ifunc"
8a9036a4 192 run_list_test "l1om-inval" "-march=l1om --32"
00687228
L
193 }
194
6482c264
NC
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
b96d3a20
JH
202 set ASFLAGS "$old_ASFLAGS"
203}
6e0b89ee 204
fc0763e6 205if [expr [istarget "i*86-*-*"] || [istarget "x86_64-*-*"]] then {
ee86248c 206 run_dump_test "intel-expr"
fc0763e6
JB
207 run_dump_test "string-ok"
208 run_list_test "string-bad" ""
209}
210
fc847f15 211if [expr ([istarget "i*86-*-*"] || [istarget "x86_64-*-*"]) && [gas_64_check]] then {
b96d3a20
JH
212
213 global ASFLAGS
214 set old_ASFLAGS "$ASFLAGS"
215 set ASFLAGS "$ASFLAGS --64"
216
217 run_dump_test "x86_64"
20f0a1fc 218 run_dump_test "x86-64-addr32"
185b1163 219 run_dump_test "x86-64-addr32-intel"
831b02f6 220 run_dump_test "x86-64-opcode"
dfb07592 221 run_dump_test "x86-64-intel64"
0cd63f3d
KT
222 if { ![istarget "*-*-mingw*"] } then {
223 run_dump_test "x86-64-pcrel"
224 } else {
225 run_dump_test "x86-64-w64-pcrel"
226 }
20f0a1fc 227 run_dump_test "x86-64-rip"
185b1163 228 run_dump_test "x86-64-rip-intel"
1a114b12
JB
229 run_dump_test "x86-64-stack"
230 run_dump_test "x86-64-stack-intel"
231 run_dump_test "x86-64-stack-suffix"
831b02f6 232 run_list_test "x86-64-inval" "-al"
4cc91dba
L
233 run_list_test "x86-64-segment" "-al"
234 run_list_test "x86-64-inval-seg" "-al"
003519a7 235 run_dump_test "x86-64-branch"
30123838 236 run_dump_test "svme64"
050dfa73 237 run_dump_test "x86-64-amdfam10"
90700ea2 238 run_dump_test "x86-64-vmx"
9cd96992 239 run_dump_test "immed64"
cb712a9e 240 run_dump_test "x86-64-prescott"
6dd5059a
L
241 run_dump_test "x86-64-crx"
242 run_dump_test "x86-64-crx-suffix"
a1cfb73e
L
243 run_dump_test "x86-64-drx"
244 run_dump_test "x86-64-drx-suffix"
331d2d0d 245 run_dump_test "x86-64-merom"
35c52694
L
246 run_dump_test "x86-64-rep"
247 run_dump_test "x86-64-rep-suffix"
a35ca55a
JB
248 run_dump_test "x86-64-cbw"
249 run_dump_test "x86-64-cbw-intel"
52fd6d94
JB
250 run_dump_test "x86-64-io"
251 run_dump_test "x86-64-io-intel"
252 run_dump_test "x86-64-io-suffix"
cb6d3433 253 run_dump_test "x86-64-gidt"
15965411 254 run_dump_test "x86-64-nops"
872ce6ff 255 run_dump_test "x86-64-nops-1"
ccc9c027
L
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"
711eedef 259 run_dump_test "x86-64-nops-1-pentium"
76bc74dc
L
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"
fbf3f584
L
265 run_dump_test "x86-64-nops-5"
266 run_dump_test "x86-64-nops-5-k8"
42903f7f 267 run_dump_test "x86-64-sse4_1"
c3ad16c0 268 run_dump_test "x86-64-sse4_1-intel"
381d071f 269 run_dump_test "x86-64-sse4_2"
c3ad16c0 270 run_dump_test "x86-64-sse4_2-intel"
9344ff29
L
271 run_dump_test "x86-64-crc32"
272 run_dump_test "x86-64-crc32-intel"
20592a94 273 run_list_test "x86-64-inval-crc32" "-al"
09a2c6cf
L
274 run_dump_test "x86-64-simd"
275 run_dump_test "x86-64-simd-intel"
8a72226a 276 run_dump_test "x86-64-simd-suffix"
d9a5e5e5
L
277 run_dump_test "x86-64-mem"
278 run_dump_test "x86-64-mem-intel"
5cee3fe6
L
279 run_dump_test "x86-64-reg"
280 run_dump_test "x86-64-reg-intel"
db51cc60
L
281 run_dump_test "x86-64-sib"
282 run_dump_test "x86-64-sib-intel"
0cd63f3d
KT
283 if { ![istarget "*-*-mingw*"] } then {
284 run_dump_test "x86-64-opcode-inval"
285 run_dump_test "x86-64-opcode-inval-intel"
286 }
c6add537 287 run_dump_test "rexw"
599121aa 288 run_dump_test "x86-64-arch-1"
e8efc4d9 289 run_dump_test "x86-64-arch-2"
475a2301
L
290 run_dump_test "x86-64-xsave"
291 run_dump_test "x86-64-xsave-intel"
c0f3af97
L
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"
daf50ae7 300 run_dump_test "x86-64-sse-check"
cb19c032 301 run_dump_test "x86-64-sse-check-none"
daf50ae7
L
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"
9ba52a26 304 run_dump_test "x86-64-sse-noavx"
f1f8f695
L
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"
b6169b20
L
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"
fa99fab2
L
315 run_dump_test "x86-64-avx-swap"
316 run_dump_test "x86-64-avx-swap-intel"
0bfee649
L
317 run_dump_test "x86-64-fma"
318 run_dump_test "x86-64-fma-intel"
922d8de8 319 run_dump_test "x86-64-fma4"
b96d3a20 320
b1905489
JB
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
d2b2c203
DJ
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
3956db08
JB
344 # ELF specific tests
345 if [is_elf_format] then {
346 run_dump_test "reloc64"
347 run_list_test "reloc64" "--defsym _bad_=1"
4fa24527 348 run_dump_test "mixed-mode-reloc64"
915bcca5 349 run_dump_test "x86-64-ifunc"
8a9036a4 350 run_dump_test "l1om"
3956db08
JB
351 }
352
b96d3a20 353 set ASFLAGS "$old_ASFLAGS"
252b5132 354}
This page took 0.487639 seconds and 4 git commands to generate.