4 proc gas_64_check { } {
8 set status [gas_host_run "$NM $NMFLAGS --help" ""]
9 return [regexp "targets:.*x86-64" [lindex $status 1]];
12 proc gas_32_check { } {
16 set status [gas_host_run "$NM $NMFLAGS --help" ""]
17 return [regexp "targets:.*i386" [lindex $status 1]];
20 if [expr ([istarget "i*86-*-*"] || [istarget "x86_64-*-*"]) && [gas_32_check]] then {
23 set old_ASFLAGS "$ASFLAGS"
24 set ASFLAGS "$ASFLAGS --32"
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"
33 run_dump_test "opcode"
34 run_dump_test "opcode-intel"
35 run_dump_test "opcode-suffix"
37 run_dump_test "intel16"
38 run_list_test "intelbad" ""
39 run_dump_test "intelok"
40 run_dump_test "prefix"
42 run_dump_test "katmai"
44 run_dump_test "ssemmx2"
47 run_dump_test "prescott"
49 run_dump_test "sib-intel"
52 run_dump_test "suffix"
53 run_dump_test "immed32"
55 run_dump_test "divide"
56 run_dump_test "padlock"
58 run_list_test "cr-err" ""
60 run_dump_test "amdfam10"
63 run_dump_test "rep-suffix"
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"
91 run_dump_test "crc32-intel"
92 run_list_test "inval-crc32" "-al"
94 run_dump_test "simd-intel"
95 run_dump_test "simd-suffix"
97 run_dump_test "mem-intel"
99 run_dump_test "reg-intel"
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"
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"
125 run_dump_test "aes-intel"
126 run_dump_test "clmul"
127 run_dump_test "clmul-intel"
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"
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"
151 run_dump_test "opts-intel"
152 run_dump_test "sse2avx-opts"
153 run_dump_test "sse2avx-opts-intel"
155 run_dump_test "fma-intel"
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"
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"
174 if [is_elf_format] then {
175 # PIC is only supported on ELF targets.
176 run_dump_test "intelpic"
178 run_dump_test "relax"
179 run_dump_test "gotpc"
181 run_dump_test "tlspic"
182 run_dump_test "tlsnopic"
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"
194 # This is a PE specific test.
195 if { [istarget "*-*-cygwin*"] || [istarget "*-*-pe"]
196 || [istarget "*-*-mingw*"]
198 run_dump_test "secrel"
201 set ASFLAGS "$old_ASFLAGS"
204 if [expr [istarget "i*86-*-*"] || [istarget "x86_64-*-*"]] then {
205 run_dump_test "intel-expr"
206 run_dump_test "string-ok"
207 run_list_test "string-bad" ""
210 if [expr ([istarget "i*86-*-*"] || [istarget "x86_64-*-*"]) && [gas_64_check]] then {
213 set old_ASFLAGS "$ASFLAGS"
214 set ASFLAGS "$ASFLAGS --64"
216 run_dump_test "x86_64"
217 run_dump_test "x86-64-addr32"
218 run_dump_test "x86-64-addr32-intel"
219 run_dump_test "x86-64-opcode"
220 run_dump_test "x86-64-intel64"
221 if { ![istarget "*-*-mingw*"] } then {
222 run_dump_test "x86-64-pcrel"
224 run_dump_test "x86-64-w64-pcrel"
226 run_dump_test "x86-64-rip"
227 run_dump_test "x86-64-rip-intel"
228 run_dump_test "x86-64-stack"
229 run_dump_test "x86-64-stack-intel"
230 run_dump_test "x86-64-stack-suffix"
231 run_list_test "x86-64-inval" "-al"
232 run_list_test "x86-64-segment" "-al"
233 run_list_test "x86-64-inval-seg" "-al"
234 run_dump_test "x86-64-branch"
235 run_dump_test "svme64"
236 run_dump_test "x86-64-amdfam10"
237 run_dump_test "x86-64-vmx"
238 run_dump_test "immed64"
239 run_dump_test "x86-64-prescott"
240 run_dump_test "x86-64-crx"
241 run_dump_test "x86-64-crx-suffix"
242 run_dump_test "x86-64-drx"
243 run_dump_test "x86-64-drx-suffix"
244 run_dump_test "x86-64-merom"
245 run_dump_test "x86-64-rep"
246 run_dump_test "x86-64-rep-suffix"
247 run_dump_test "x86-64-cbw"
248 run_dump_test "x86-64-cbw-intel"
249 run_dump_test "x86-64-io"
250 run_dump_test "x86-64-io-intel"
251 run_dump_test "x86-64-io-suffix"
252 run_dump_test "x86-64-gidt"
253 run_dump_test "x86-64-nops"
254 run_dump_test "x86-64-nops-1"
255 run_dump_test "x86-64-nops-1-k8"
256 run_dump_test "x86-64-nops-1-nocona"
257 run_dump_test "x86-64-nops-1-merom"
258 run_dump_test "x86-64-nops-1-pentium"
259 run_dump_test "x86-64-nops-2"
260 run_dump_test "x86-64-nops-3"
261 run_dump_test "x86-64-nops-4"
262 run_dump_test "x86-64-nops-4-core2"
263 run_dump_test "x86-64-nops-4-k8"
264 run_dump_test "x86-64-nops-5"
265 run_dump_test "x86-64-nops-5-k8"
266 run_dump_test "x86-64-sse4_1"
267 run_dump_test "x86-64-sse4_1-intel"
268 run_dump_test "x86-64-sse4_2"
269 run_dump_test "x86-64-sse4_2-intel"
270 run_dump_test "x86-64-crc32"
271 run_dump_test "x86-64-crc32-intel"
272 run_list_test "x86-64-inval-crc32" "-al"
273 run_dump_test "x86-64-simd"
274 run_dump_test "x86-64-simd-intel"
275 run_dump_test "x86-64-simd-suffix"
276 run_dump_test "x86-64-mem"
277 run_dump_test "x86-64-mem-intel"
278 run_dump_test "x86-64-reg"
279 run_dump_test "x86-64-reg-intel"
280 run_dump_test "x86-64-sib"
281 run_dump_test "x86-64-sib-intel"
282 if { ![istarget "*-*-mingw*"] } then {
283 run_dump_test "x86-64-opcode-inval"
284 run_dump_test "x86-64-opcode-inval-intel"
287 run_dump_test "x86-64-arch-1"
288 run_dump_test "x86-64-arch-2"
289 run_dump_test "x86-64-xsave"
290 run_dump_test "x86-64-xsave-intel"
291 run_dump_test "x86-64-aes"
292 run_dump_test "x86-64-aes-intel"
293 run_dump_test "x86-64-clmul"
294 run_dump_test "x86-64-clmul-intel"
295 run_dump_test "x86-64-avx"
296 run_dump_test "x86-64-avx-intel"
297 run_dump_test "x86-64-sse2avx"
298 run_list_test "x86-64-inval-avx" "-al"
299 run_dump_test "x86-64-sse-check"
300 run_dump_test "x86-64-sse-check-none"
301 run_dump_test "x86-64-sse-check-warn"
302 run_list_test "x86-64-sse-check-error" "-msse-check=error -I${srcdir}/$subdir -al"
303 run_dump_test "x86-64-sse-noavx"
304 run_dump_test "x86-64-movbe"
305 run_dump_test "x86-64-movbe-intel"
306 run_list_test "x86-64-inval-movbe" "-al"
307 run_dump_test "x86-64-ept"
308 run_dump_test "x86-64-ept-intel"
309 run_list_test "x86-64-inval-ept" "-al"
310 run_dump_test "x86-64-opts"
311 run_dump_test "x86-64-opts-intel"
312 run_dump_test "x86-64-sse2avx-opts"
313 run_dump_test "x86-64-sse2avx-opts-intel"
314 run_dump_test "x86-64-avx-swap"
315 run_dump_test "x86-64-avx-swap-intel"
316 run_dump_test "x86-64-fma"
317 run_dump_test "x86-64-fma-intel"
318 run_dump_test "x86-64-fma4"
320 if { ![istarget "*-*-aix*"]
321 && ![istarget "*-*-beos*"]
322 && ![istarget "*-*-*bsd*"]
323 && ![istarget "*-*-chaos*"]
324 && ![istarget "*-*-kaos*"]
325 && ![istarget "*-*-lynx*"]
326 && ![istarget "*-*-moss*"]
327 && ![istarget "*-*-nto-qnx*"]
328 && ![istarget "*-*-rtems*"]
329 && ![istarget "*-*-sco*"]
330 && ![istarget "*-*-solaris*"]
331 && ![istarget "*-*-sysv*"] } then {
335 # For ELF targets verify that @unwind works.
336 if { ([istarget "*-*-elf*"] || [istarget "*-*-linux*"]
337 || [istarget "*-*-solaris2.*"])
338 && ![istarget *-*-linux*aout*]
339 && ![istarget *-*-linux*oldld*] } then {
340 run_dump_test "x86-64-unwind"
344 if [is_elf_format] then {
345 run_dump_test "reloc64"
346 run_list_test "reloc64" "--defsym _bad_=1"
347 run_dump_test "mixed-mode-reloc64"
348 run_dump_test "x86-64-ifunc"
351 set ASFLAGS "$old_ASFLAGS"