2 # These tests should be valid on all targets.
5 # I think currently all targets fail this one when listings are enabled.
6 gas_test "p2425.s" "" "" "pcrel values in assignment"
8 # p1480.s uses a ".space" directive which for most assemblers means
9 # "allocate some space". On the PA it means "switch into this space".
11 # Therefore this test (as it is currently written) is completely bogus
12 # for any PA target. Do not bother trying to run it and just claim
15 # The C54x uses ".space" to allocate bits, and requires absolute expressions;
16 # The ".space" directive is taken care of in the C54x-specific tests, so fail
19 # The test also doesn't work on mep targets, since they use RELC, and it
20 # will avoid simplifying the expression since it conservatively assumes
21 # ugly expressions can be saved until link-time.
22 if { [istarget hppa*-*-*] || [istarget *c54x*-*-*] || [istarget mep*-*-*]} then {
24 fail "simplifiable double subtraction"
26 gas_test "p1480.s" "" "-a>" "simplifiable double subtraction"
29 # No floating point support in assembly code for CRIS and Z80.
30 if { ![istarget cris-*-*] && ![istarget crisv32-*-*]
31 && ![istarget z80-*-*] } then {
32 gas_test "float.s" "" "" "simple FP constants"
35 # This test is meaningless for the PA; the difference of two undefined
36 # symbols is something that is (and must be) supported on the PA.
37 # The same is true for alpha-vms
39 # The MN10300 port supports link time relaxation which in turn allows
40 # for link time resolution of the differneces of two symbols which are
41 # undefined at assembly time. Hence this test will not pass for the
42 # MN10300. The same thing is true for the RX port as well.
43 if { ![istarget hppa*-*-*]
44 && ![istarget alpha*-*-*vms*]
46 && ![istarget mn10300-*-*]
47 && ![istarget am3*-*-*] } then {
48 gas_test_error "diff1.s" "" "difference of two undefined symbols"
51 gas_test_error "equiv1.s" "" ".equiv for symbol already set to another one"
52 gas_test_error "equiv2.s" "" ".equiv for symbol already set to an expression"
54 # .equ works differently on some targets.
55 case $target_triplet in {
59 gas_test "equ-ok.s" "" "" ".equ for symbol already set"
60 gas_test_error "equ-bad.s" "" ".equ for symbol already set through .eqv"
64 gas_test "eqv-ok.s" "" "" ".eqv support"
65 gas_test_error "eqv-bad.s" "" ".eqv for symbol already set"
67 if { ![istarget "bfin-*-*"] } then {
68 gas_test "assign-ok.s" "" "" "== assignment support"
70 gas_test_error "assign-bad.s" "" "== assignment for symbol already set"
72 # .equ works differently on some targets.
73 # linkrelax-ing prevents most forward references from working.
74 case $target_triplet in {
81 { mn10\[23\]00*-*-* } { }
83 # Some targets don't manage to resolve BFD_RELOC_8 for constants.
84 setup_xfail "alpha*-*-*" "*c30*-*-*" "*c4x*-*-*" \
85 "d\[13\]0v*-*-*" "i860-*-*" "mips*-*-*" "msp430-*-*" \
86 "pdp11-*-*" "sparc*-*-*" "xtensa*-*-*"
91 # aout relocs are often weird, so is mep and mips-ecoff. don't bother testing
92 # som doesn't use a .text section
93 # mmix doesn't like .L1:
94 # ti addresses aren't octets.
95 if { ![is_aout_format] } {
96 case $target_triplet in {
100 { hppa*-*-hpux* } { }
102 { mips*-*-ecoff* } { }
113 # .set works differently on some targets.
114 # most of the tests won't work on targets that set linkrelax.
115 # 4 octet bytes confuse address matching on ti targets.
116 # pdp11 gets unexpected reloc types.
117 case $target_triplet in {
133 # These targets fail redef2 because they disallow redefined
135 setup_xfail "m68hc*-*-*" "rx-*-*" "vax*-*-*" "z8k-*-*"
137 setup_xfail "m68hc*-*-*" "rx-*-*" "vax*-*-*" "z8k-*-*"
138 # rs6000-aix disallows redefinition via .comm.
139 setup_xfail "*-*-aix*"
140 # SOM uses a different syntax for .comm
141 setup_xfail "hppa*-*-hpux*"
142 # These targets fail redef3 because section contents for the
143 # word referencing the .comm sym is not zero and/or its reloc
144 # has a non-zero addend. Relaxing the test would hide real
145 # failures such as or32-elf.
146 setup_xfail "bfin-*-*" "i\[3-7\]86-*-*coff" \
147 "i\[3-7\]86-*-*pe" "i\[3-7\]86-*-go32*" \
148 "i\[3-7\]86-*-cygwin*" "i\[3-7\]86-*-mingw*" "86_64-*-mingw*"
150 gas_test_error "redef4.s" "" ".set for symbol already used as label"
151 gas_test_error "redef5.s" "" ".set for symbol already defined through .comm"
156 set testname "comment.s: comments in listings"
161 gas_start "comment.s" "-al"
163 # Apparently CRLF is received when using ptys for subprocesses; hence the
166 -re "^ +1\[ \t\]+# This\[^\n\]*\n" { set x1 1 }
167 -re "^ +2\[ \t\]+# correctly\[^\n\]*\n" { set x2 1 }
168 -re "^ +3\[ \t\]+/. C comments too. ./\r?\r?\n" { set x3 1 }
170 timeout { perror "timeout\n"; break }
175 if [all_ones $x1 $x2 $x3] then { pass $testname } else { fail $testname }
178 # m32c pads out sections, even empty ones.
179 case $target_triplet in {
186 # This test checks the output of the -ag switch. It must detect at least
187 # the name of the input file, output file, and options passed.
188 proc general_info_section {} {
189 set testname "general info section in listings"
194 gas_start "comment.s" "-agn"
197 -re "^ \[^\n\]*\t: .*\-agn\[^\n\]*\n" { set x1 1 }
198 -re "^ \[^\n\]*\t: \[^\n\]*comment\.s\[^\n\]*\n" { set x2 1 }
199 -re "^ \[^\n\]*\t: a\.out\[^\n\]*\n" { set x3 1 }
201 timeout { perror "timeout\n"; break }
206 if [all_ones $x1 $x2 $x3] then { pass $testname } else { fail $testname }
212 # Test x930509a -- correct assembly of differences involving forward
217 set testname "difference between forward references"
219 gas_start "x930509.s" "-al"
221 # We need to accomodate both byte orders here.
222 # If ".long" means an 8-byte value on some target someday, this test will have
225 -re "^ +1 .... 00 ?00 ?00 ?00" { fail $testname; set x 1 }
226 -re "^ +1 .... 04 ?00 ?00 ?00" { pass $testname; set x 1 }
227 -re "^ +1 .... 00 ?00 ?00 ?04" { pass $testname; set x 1 }
229 timeout { perror "timeout\n"; break }
234 if !$x then { fail $testname }
237 # This test is meaningless for the PA and CR16/CRX: the difference of two
238 # symbols cannot be resolved by the assembler.
239 # C54x assembler (for compatibility) does not allow differences between
240 # forward references.
241 # C30 counts a four byte offset as a difference of one.
242 if { ![istarget hppa*-*-*] &&
243 ![istarget cr16*-*-*] &&
244 ![istarget crx*-*-*] &&
245 ![istarget *c30*-*-*] &&
246 ![istarget *c4x*-*-*] &&
247 ![istarget *c54x*-*-*] } then {
248 # the vax fails because VMS can apparently actually handle this
249 # case in relocs, so gas doesn't handle it itself.
250 # mn10300 emits two relocs to handle the difference of two symbols.
251 setup_xfail "mn10300*-*-*" "vax*-*-vms*"
255 # ".struct" and ".align" have different meanings on c54x
256 # These directives are done in the c54x-specific tests instead
257 case $target_triplet in {
268 # '<' and '>' appear to have special meanings on the excluded targets
269 case $target_triplet in {
278 run_dump_test altmacro
279 # The second test is valid only when '!' is not a comment
280 # character (it is allowed to be a line comment character).
281 if [string match "" [lindex [gas_run excl.s "-o /dev/null" ""] 0]] {
282 run_dump_test altmac2
283 # Similarly this test does not work when ! is a line seperator.
289 # This test is for any COFF target.
290 # We omit the ARM toolchains because they define locals to
291 # start with '.', which eliminates .eos, .text etc from the output.
292 # Omit c54x, since .tag and .def mean something different on that target
293 if { ([istarget *-*-coff*] && ![istarget arm*-*-coff] && ![istarget *c4x*-*-coff] && ![istarget *c54x*-*-coff]) \
294 ||([istarget *-*-pe*] && ![istarget arm*-*-pe*]) \
295 || [istarget i*86-*-aix*] \
296 || [istarget i*86-*-sco*] \
297 || [istarget i*86-*-isc*] \
298 || [istarget i*86-*-go32*] \
299 || [istarget i*86-*-cygwin*] \
300 || [istarget x86_64-*-mingw*] \
301 || [istarget i*86-*-*nt] \
302 || [istarget i*86-*-interix*] \
303 || ([istarget i960-*-vxworks5.*] && ![istarget i960-*-vxworks5.0*]) } {
304 run_dump_test cofftag
307 # Test omitting conditionals from listings.
313 set testname "conditional listings"
314 gas_run cond.s "-alc" ">dump.out"
315 if ![string match "" $comp_output] {
316 send_log "$comp_output\n"
319 if { [regexp_diff dump.out $srcdir/$subdir/cond.l] } {
327 # This test is not suitable for the PA for various reasons
328 # not limited to the fact that it depends on specific section
329 # names appearing in the output file.
330 # again, p2align doesn't work on c54x target
331 case $target_triplet in {
338 remote_download host "$srcdir/$subdir/incbin.dat"
343 if { ([istarget "i*86-*-*pe*"] && ![istarget "i*86-*-openbsd*"]) \
344 || [istarget "i*86-*-cygwin*"] \
345 || [istarget "i*86-*-mingw32*"] } {
346 gas_test "fastcall.s" "" "" "fastcall labels"
349 if { ![istarget "bfin-*-*"] } then {
352 run_dump_test sleb128
354 # .byte is 32 bits on tic4x, and .p2align isn't supported on tic54x
355 # .space is different on hppa*-hpux.
356 # MeP put bytes into packets.
357 if { ![istarget "tic4x*-*-*"] && ![istarget "tic54x*-*-*"] && ![istarget "hppa*-*-hpux*"] && ![istarget "mep*-*-*"] } {
361 # powerpc and s390 allow a string argument to .byte
362 if { ![istarget "powerpc*-*-*"] && ![istarget "rs6000*-*-*"] && ![istarget "s390*-*-*"] } {
366 # .quad is 16 bytes on i960.
367 if { ![istarget "i960-*-*"] } {
371 # som doesn't use .data section.
372 case $target_triplet in {
376 { hppa*-*-hpux* } { }
382 # .set works differently on some targets.
383 case $target_triplet in {
389 run_dump_test weakref1
390 run_dump_test weakref1g
391 run_dump_test weakref1l
392 run_dump_test weakref1u
393 run_dump_test weakref1w
396 gas_test_error "weakref2.s" "" "e: would close weakref loop: e => a => b => c => d => e"
397 gas_test_error "weakref3.s" "" "a: would close weakref loop: a => b => c => d => e => a"
398 gas_test_error "weakref4.s" "" "is already defined"
404 dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/err-*.s $srcdir/$subdir/warn-*.s]] "" ""