4 proc gas_64_check { } {
9 catch "exec $srcdir/lib/run $NM $NMFLAGS --help" nm_help
10 return [regexp "targets:.*x86-64" $nm_help]
13 proc gas_32_check { } {
18 catch "exec $srcdir/lib/run $NM $NMFLAGS --help" nm_help
19 return [regexp "targets:.*i386" $nm_help]
22 if [expr ([istarget "i*86-*-*"] || [istarget "x86_64-*-*"]) && [gas_32_check]] then {
25 set old_ASFLAGS "$ASFLAGS"
26 set ASFLAGS "$ASFLAGS --32"
28 run_list_test "float" "-al"
29 run_list_test "general" "-al --listing-lhs-width=2"
30 run_list_test "inval" "-al"
31 run_list_test "segment" "-al"
32 run_list_test "inval-seg" "-al"
33 run_list_test "modrm" "-al --listing-lhs-width=2"
35 run_dump_test "opcode"
36 run_dump_test "opcode-intel"
37 run_dump_test "opcode-suffix"
39 run_dump_test "intel16"
40 run_list_test "intelbad" ""
41 run_dump_test "intelok"
42 run_dump_test "prefix"
44 run_dump_test "katmai"
46 run_dump_test "ssemmx2"
49 run_dump_test "prescott"
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"
94 # These tests require support for 8 and 16 bit relocs,
95 # so we only run them for ELF and COFF targets.
96 if {[is_elf_format] || [istarget "*-*-coff*"]} then {
98 run_dump_test "jump16"
99 run_list_test "white" "-al --listing-lhs-width=3"
101 # These tests should in theory work for PE targets as well,
102 # but the relocs we currently produce are slightly different
103 # from those produced for ELF/COFF based toolchains.
104 # So for now we ignore PE targets.
105 run_dump_test "pcrel"
106 run_dump_test "absrel"
110 if [is_elf_format] then {
111 # PIC is only supported on ELF targets.
112 run_dump_test "intelpic"
114 run_dump_test "relax"
115 run_dump_test "gotpc"
117 run_dump_test "tlspic"
118 run_dump_test "tlsnopic"
120 run_dump_test "reloc32"
121 run_list_test "reloc32" "--defsym _bad_=1"
122 run_dump_test "mixed-mode-reloc32"
125 # This is a PE specific test.
126 if { [istarget "*-*-cygwin*"] || [istarget "*-*-pe"]
127 || [istarget "*-*-mingw*"]
129 run_dump_test "secrel"
132 set ASFLAGS "$old_ASFLAGS"
135 if [expr ([istarget "i*86-*-*"] || [istarget "x86_64-*-*"]) && [gas_64_check]] then {
138 set old_ASFLAGS "$ASFLAGS"
139 set ASFLAGS "$ASFLAGS --64"
141 run_dump_test "x86_64"
142 run_dump_test "x86-64-addr32"
143 run_dump_test "x86-64-addr32-intel"
144 run_dump_test "x86-64-opcode"
145 run_dump_test "x86-64-pcrel"
146 run_dump_test "x86-64-rip"
147 run_dump_test "x86-64-rip-intel"
148 run_dump_test "x86-64-stack"
149 run_dump_test "x86-64-stack-intel"
150 run_dump_test "x86-64-stack-suffix"
151 run_list_test "x86-64-inval" "-al"
152 run_list_test "x86-64-segment" "-al"
153 run_list_test "x86-64-inval-seg" "-al"
154 run_dump_test "x86-64-branch"
155 run_dump_test "svme64"
156 run_dump_test "x86-64-amdfam10"
157 run_dump_test "x86-64-vmx"
158 run_dump_test "immed64"
159 run_dump_test "x86-64-prescott"
160 run_dump_test "x86-64-crx"
161 run_dump_test "x86-64-crx-suffix"
162 run_dump_test "x86-64-drx"
163 run_dump_test "x86-64-drx-suffix"
164 run_dump_test "x86-64-merom"
165 run_dump_test "x86-64-rep"
166 run_dump_test "x86-64-rep-suffix"
167 run_dump_test "x86-64-cbw"
168 run_dump_test "x86-64-cbw-intel"
169 run_dump_test "x86-64-io"
170 run_dump_test "x86-64-io-intel"
171 run_dump_test "x86-64-io-suffix"
172 run_dump_test "x86-64-gidt"
173 run_dump_test "x86-64-nops"
174 run_dump_test "x86-64-nops-1"
175 run_dump_test "x86-64-nops-1-k8"
176 run_dump_test "x86-64-nops-1-nocona"
177 run_dump_test "x86-64-nops-1-merom"
178 run_dump_test "x86-64-nops-2"
179 run_dump_test "x86-64-nops-3"
180 run_dump_test "x86-64-nops-4"
181 run_dump_test "x86-64-nops-4-core2"
182 run_dump_test "x86-64-nops-4-k8"
183 run_dump_test "x86-64-sse4_1"
184 run_dump_test "x86-64-sse4_1-intel"
185 run_dump_test "x86-64-sse4_2"
186 run_dump_test "x86-64-sse4_2-intel"
187 run_dump_test "x86-64-crc32"
188 run_dump_test "x86-64-crc32-intel"
189 run_list_test "x86-64-inval-crc32" "-al"
190 run_dump_test "x86-64-simd"
191 run_dump_test "x86-64-simd-intel"
193 if { ![istarget "*-*-aix*"]
194 && ![istarget "*-*-beos*"]
195 && ![istarget "*-*-*bsd*"]
196 && ![istarget "*-*-chaos*"]
197 && ![istarget "*-*-kaos*"]
198 && ![istarget "*-*-lynx*"]
199 && ![istarget "*-*-moss*"]
200 && ![istarget "*-*-nto-qnx*"]
201 && ![istarget "*-*-rtems*"]
202 && ![istarget "*-*-sco*"]
203 && ![istarget "*-*-solaris*"]
204 && ![istarget "*-*-sysv*"] } then {
208 # For ELF targets verify that @unwind works.
209 if { ([istarget "*-*-elf*"] || [istarget "*-*-linux*"]
210 || [istarget "*-*-solaris2.*"])
211 && ![istarget *-*-linux*aout*]
212 && ![istarget *-*-linux*oldld*] } then {
213 run_dump_test "x86-64-unwind"
217 if [is_elf_format] then {
218 run_dump_test "reloc64"
219 run_list_test "reloc64" "--defsym _bad_=1"
220 run_dump_test "mixed-mode-reloc64"
223 set ASFLAGS "$old_ASFLAGS"