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 "addr16"
83 run_dump_test "addr32"
84 run_dump_test "sse4_1"
85 run_dump_test "sse4_1-intel"
86 run_dump_test "sse4_2"
87 run_dump_test "sse4_2-intel"
89 run_dump_test "crc32-intel"
90 run_list_test "inval-crc32" "-al"
92 run_dump_test "simd-intel"
93 run_dump_test "simd-suffix"
95 run_dump_test "mem-intel"
97 run_dump_test "reg-intel"
99 run_dump_test "compat"
100 run_dump_test "compat-intel"
101 run_dump_test "arch-1"
102 run_dump_test "arch-2"
103 run_dump_test "arch-3"
104 run_dump_test "arch-4"
105 run_dump_test "arch-5"
106 run_dump_test "arch-6"
107 run_dump_test "arch-7"
108 run_dump_test "arch-8"
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 "xsave"
118 run_dump_test "xsave-intel"
120 # These tests require support for 8 and 16 bit relocs,
121 # so we only run them for ELF and COFF targets.
122 if {[is_elf_format] || [istarget "*-*-coff*"]} then {
123 run_dump_test "reloc"
124 run_dump_test "jump16"
125 run_list_test "white" "-al --listing-lhs-width=3"
127 # These tests should in theory work for PE targets as well,
128 # but the relocs we currently produce are slightly different
129 # from those produced for ELF/COFF based toolchains.
130 # So for now we ignore PE targets.
131 run_dump_test "pcrel"
132 run_dump_test "absrel"
136 if [is_elf_format] then {
137 # PIC is only supported on ELF targets.
138 run_dump_test "intelpic"
140 run_dump_test "relax"
141 run_dump_test "gotpc"
143 run_dump_test "tlspic"
144 run_dump_test "tlsnopic"
146 run_dump_test "reloc32"
147 run_list_test "reloc32" "--defsym _bad_=1"
148 run_dump_test "mixed-mode-reloc32"
151 # This is a PE specific test.
152 if { [istarget "*-*-cygwin*"] || [istarget "*-*-pe"]
153 || [istarget "*-*-mingw*"]
155 run_dump_test "secrel"
158 set ASFLAGS "$old_ASFLAGS"
161 if [expr ([istarget "i*86-*-*"] || [istarget "x86_64-*-*"]) && [gas_64_check]] then {
164 set old_ASFLAGS "$ASFLAGS"
165 set ASFLAGS "$ASFLAGS --64"
167 run_dump_test "x86_64"
168 run_dump_test "x86-64-addr32"
169 run_dump_test "x86-64-addr32-intel"
170 run_dump_test "x86-64-opcode"
171 run_dump_test "x86-64-pcrel"
172 run_dump_test "x86-64-rip"
173 run_dump_test "x86-64-rip-intel"
174 run_dump_test "x86-64-stack"
175 run_dump_test "x86-64-stack-intel"
176 run_dump_test "x86-64-stack-suffix"
177 run_list_test "x86-64-inval" "-al"
178 run_list_test "x86-64-segment" "-al"
179 run_list_test "x86-64-inval-seg" "-al"
180 run_dump_test "x86-64-branch"
181 run_dump_test "svme64"
182 run_dump_test "x86-64-amdfam10"
183 run_dump_test "x86-64-vmx"
184 run_dump_test "immed64"
185 run_dump_test "x86-64-prescott"
186 run_dump_test "x86-64-crx"
187 run_dump_test "x86-64-crx-suffix"
188 run_dump_test "x86-64-drx"
189 run_dump_test "x86-64-drx-suffix"
190 run_dump_test "x86-64-merom"
191 run_dump_test "x86-64-rep"
192 run_dump_test "x86-64-rep-suffix"
193 run_dump_test "x86-64-cbw"
194 run_dump_test "x86-64-cbw-intel"
195 run_dump_test "x86-64-io"
196 run_dump_test "x86-64-io-intel"
197 run_dump_test "x86-64-io-suffix"
198 run_dump_test "x86-64-gidt"
199 run_dump_test "x86-64-nops"
200 run_dump_test "x86-64-nops-1"
201 run_dump_test "x86-64-nops-1-k8"
202 run_dump_test "x86-64-nops-1-nocona"
203 run_dump_test "x86-64-nops-1-merom"
204 run_dump_test "x86-64-nops-2"
205 run_dump_test "x86-64-nops-3"
206 run_dump_test "x86-64-nops-4"
207 run_dump_test "x86-64-nops-4-core2"
208 run_dump_test "x86-64-nops-4-k8"
209 run_dump_test "x86-64-sse4_1"
210 run_dump_test "x86-64-sse4_1-intel"
211 run_dump_test "x86-64-sse4_2"
212 run_dump_test "x86-64-sse4_2-intel"
213 run_dump_test "x86-64-crc32"
214 run_dump_test "x86-64-crc32-intel"
215 run_list_test "x86-64-inval-crc32" "-al"
216 run_dump_test "x86-64-simd"
217 run_dump_test "x86-64-simd-intel"
218 run_dump_test "x86-64-simd-suffix"
219 run_dump_test "x86-64-sse5"
220 run_dump_test "x86-64-mem"
221 run_dump_test "x86-64-mem-intel"
222 run_dump_test "x86-64-reg"
223 run_dump_test "x86-64-reg-intel"
224 run_dump_test "x86-64-sib"
225 run_dump_test "x86-64-sib-intel"
226 run_dump_test "x86-64-opcode-inval"
227 run_dump_test "x86-64-opcode-inval-intel"
229 run_dump_test "x86-64-arch-1"
230 run_dump_test "x86-64-arch-10"
231 run_dump_test "x86-64-xsave"
232 run_dump_test "x86-64-xsave-intel"
234 if { ![istarget "*-*-aix*"]
235 && ![istarget "*-*-beos*"]
236 && ![istarget "*-*-*bsd*"]
237 && ![istarget "*-*-chaos*"]
238 && ![istarget "*-*-kaos*"]
239 && ![istarget "*-*-lynx*"]
240 && ![istarget "*-*-moss*"]
241 && ![istarget "*-*-nto-qnx*"]
242 && ![istarget "*-*-rtems*"]
243 && ![istarget "*-*-sco*"]
244 && ![istarget "*-*-solaris*"]
245 && ![istarget "*-*-sysv*"] } then {
249 # For ELF targets verify that @unwind works.
250 if { ([istarget "*-*-elf*"] || [istarget "*-*-linux*"]
251 || [istarget "*-*-solaris2.*"])
252 && ![istarget *-*-linux*aout*]
253 && ![istarget *-*-linux*oldld*] } then {
254 run_dump_test "x86-64-unwind"
258 if [is_elf_format] then {
259 run_dump_test "reloc64"
260 run_list_test "reloc64" "--defsym _bad_=1"
261 run_dump_test "mixed-mode-reloc64"
264 set ASFLAGS "$old_ASFLAGS"