# Therefore this test (as it is currently written) is completely bogus
# for any PA target. Do not bother trying to run it and just claim
# it fails.
-if [istarget hppa*-*-*] then {
+#
+# The C54x uses ".space" to allocate bits, and requires absolute expressions;
+# The ".space" directive is taken care of in the C54x-specific tests, so fail
+# here
+#
+if { [istarget hppa*-*-*] || [istarget *c54x*-*-*] } then {
setup_xfail *-*-*
fail "simplifiable double subtraction"
} else {
gas_test "p1480.s" "" "-a>" "simplifiable double subtraction"
}
-gas_test "float.s" "" "" "simple FP constants"
+# No floating point support in assembly code for CRIS.
+if { ![istarget cris-*-*] && ![istarget crisv32-*-*] } then {
+ gas_test "float.s" "" "" "simple FP constants"
+}
# This test is meaningless for the PA; the difference of two undefined
# symbols is something that is (and must be) supported on the PA.
if ![istarget hppa*-*-*] then {
- # the h8300 fails because we skip all the logic in fixup_segment
- setup_xfail "h8300*-*-*"
gas_test_error "diff1.s" "" "difference of two undefined symbols"
}
+# PR/1387
+setup_xfail "*-*-*"
+gas_test_error "equiv1.s" "" ".equiv for symbol already set to another one"
+gas_test_error "equiv2.s" "" ".equiv for symbol already set to an expression"
+
+# .equ works differently on some targets.
+case $target_triplet in {
+ { hppa*-*-* } { }
+ { *c54x*-*-* } { }
+ default {
+ gas_test "equ-ok.s" "" "" ".equ for symbol already set"
+ gas_test_error "equ-bad.s" "" ".equ for symbol already set through .eqv"
+ }
+}
+
+gas_test "eqv-ok.s" "" "" ".eqv support"
+gas_test_error "eqv-bad.s" "" ".eqv for symbol already set"
+
+gas_test "assign-ok.s" "" "" "== assignment support"
+gas_test_error "assign-bad.s" "" "== assignment for symbol already set"
+
+# .equ works differently on some targets.
+# linkrelax-ing prevents most forward references from working.
+case $target_triplet in {
+ { crx*-*-* } { }
+ { h8300*-*-* } { }
+ { hppa*-*-* } { }
+ { mn10\[23\]00*-*-* } { }
+ { *c54x*-*-* } { }
+ default {
+ # Some targets don't manage to resolve BFD_RELOC_8 for constants.
+ setup_xfail "alpha*-*-*" "avr-*-*" "*c30*-*-*" "*c4x*-*-*" \
+ "d\[13\]0v*-*-*" "i860-*-*" "mips*-*-*" "msp430-*-*" \
+ "pdp11-*-*" "sparc*-*-*" "xtensa-*-*"
+ run_dump_test forward
+ }
+}
+
+# .set works differently on some targets.
+case $target_triplet in {
+ { alpha*-*-* } { }
+ { iq2000*-*-* } { }
+ { mips*-*-* } { }
+ { *c54x*-*-* } { }
+ default {
+ setup_xfail "*c30*-*-*" "*c4x*-*-*" "pdp11-*-*"
+ run_dump_test redef
+ }
+}
+
proc do_comment {} {
set testname "comment.s: comments in listings"
set x1 0
# If ".long" means an 8-byte value on some target someday, this test will have
# to be fixed.
expect {
- -re "^ +1 .... 0000 *0000" { fail $testname; set x 1 }
- -re "^ +1 .... 0400 *0000" { pass $testname; set x 1 }
- -re "^ +1 .... 0000 *0004" { pass $testname; set x 1 }
+ -re "^ +1 .... 00 ?00 ?00 ?00" { fail $testname; set x 1 }
+ -re "^ +1 .... 04 ?00 ?00 ?00" { pass $testname; set x 1 }
+ -re "^ +1 .... 00 ?00 ?00 ?04" { pass $testname; set x 1 }
-re "\[^\n\]*\n" { }
timeout { perror "timeout\n"; break }
eof { break }
if !$x then { fail $testname }
}
-# This test is meaningless for the PA; the difference of two symbols
+# This test is meaningless for the PA and CRX; the difference of two symbols
# must not be resolved by the assembler.
-if ![istarget hppa*-*-*] then {
- # the h8300 fails because we skip all the logic in fixup_segment
- setup_xfail "h8300*-*-*"
+# C54x assembler (for compatibility) does not allow differences between
+# forward references
+# C30 counts a four byte offset as a difference of one.
+if { ![istarget hppa*-*-*] &&
+ ![istarget crx*-*-*] &&
+ ![istarget *c30*-*-*] &&
+ ![istarget *c4x*-*-*] &&
+ ![istarget *c54x*-*-*] } then {
# the vax fails because VMS can apparently actually handle this
# case in relocs, so gas doesn't handle it itself.
- setup_xfail "vax*-*-vms*"
+ setup_xfail "h8300*-*-elf*" "mn10200*-*-*" "mn10300*-*-*" "vax*-*-vms*"
do_930509a
}
-if ![istarget hppa*-*-*] then {
- run_dump_test struct
+# ".struct" and ".align" have different meanings on c54x
+# These directives are done in the c54x-specific tests instead
+case $target_triplet in {
+ { hppa*-*-* } { }
+ { *c4x*-*-* } { }
+ { *c54x*-*-* } { }
+ default {
+ run_dump_test struct
+ run_dump_test align
+ run_dump_test align2
+ }
+}
+
+# '<' and '>' appear to have special meanings on the excluded targets
+case $target_triplet in {
+ { frv-*-* } { }
+ { hppa*-*-* } { }
+ { m32r-*-* } { }
+ { mmix-*-* } { }
+ { *c4x*-*-* } { }
+ { *c54x*-*-* } { }
+ { bfin-*-* } { }
+ default {
+ run_dump_test altmacro
+ # The second test is valid only when '!' is not a comment
+ # character (it is allowed to be a line comment character).
+ if [string match "" [lindex [gas_run excl.s "-o /dev/null" ""] 0]] {
+ run_dump_test altmac2
+ # Similarly this test does not work when ! is a line seperator.
+ run_dump_test eval
+ }
+ }
}
# This test is for any COFF target.
-if { [istarget *-*-coff*] \
- || [istarget *-*-pe*] \
- || [istarget a29k-*-udi*] \
- || [istarget a29k-*-ebmon*] \
- || [istarget a29k-*-sym*] \
- || [istarget a29k-*-vxworks*] \
+# We omit the ARM toolchains because they define locals to
+# start with '.', which eliminates .eos, .text etc from the output.
+# Omit c54x, since .tag and .def mean something different on that target
+if { ([istarget *-*-coff*] && ![istarget *arm*-*-coff] && ![istarget thumb*-*-coff] && ![istarget xscale-*-coff] && ![istarget *c4x*-*-coff] && ![istarget *c54x*-*-coff]) \
+ ||([istarget *-*-pe*] && ![istarget arm*-*-pe*] && ![istarget thumb*-*-pe*]) \
|| [istarget i*86-*-aix*] \
|| [istarget i*86-*-sco*] \
|| [istarget i*86-*-isc*] \
|| [istarget i*86-*-go32*] \
|| [istarget i*86-*-cygwin*] \
|| [istarget i*86-*-*nt] \
+ || [istarget i*86-*-interix*] \
|| ([istarget i960-*-vxworks5.*] && ![istarget i960-*-vxworks5.0*]) } {
run_dump_test cofftag
}
-# FIXME: this is here cause of a bug in DejaGnu 1.1.1. When it is no longer
-# in use, then this can be removed.
-if [info exists errorInfo] then {
- unset errorInfo
+# Test omitting conditionals from listings.
+proc test_cond {} {
+ global comp_output
+ global srcdir
+ global subdir
+
+ set testname "conditional listings"
+ gas_run cond.s "-alc" ">dump.out"
+ if ![string match "" $comp_output] {
+ send_log "$comp_output\n"
+ fail $testname
+ } else {
+ if { [regexp_diff dump.out $srcdir/$subdir/cond.l] } {
+ fail $testname
+ } else {
+ pass $testname
+ }
+ }
}
+
+# This test is not suitable for the PA for various reasons
+# not limited to the fact that it depends on specific section
+# names appearing in the output file.
+# again, p2align doesn't work on c54x target
+case $target_triplet in {
+ { hppa*-*-* } { }
+ { *c4x*-*-* } { }
+ { *c54x*-*-* } { }
+ default {
+ test_cond
+ run_dump_test incbin
+ }
+}
+
+if { ([istarget "i*86-*-*pe*"] && ![istarget "i*86-*-openbsd*"]) \
+ || [istarget "i*86-*-cygwin*"] \
+ || [istarget "i*86-*-mingw32*"] } {
+ gas_test "fastcall.s" "" "" "fastcall labels"
+}
+
+run_dump_test assign
+run_dump_test sleb128
+
+# .quad is 16 bytes on i960.
+if { ![istarget "i960-*-*"] } {
+ run_dump_test quad
+}
+
+run_dump_test weakref1
+run_dump_test weakref1g
+run_dump_test weakref1l
+run_dump_test weakref1u
+run_dump_test weakref1w
+gas_test_error "weakref2.s" "" "e: would close weakref loop: e => a => b => c => d => e"
+gas_test_error "weakref3.s" "" "a: would close weakref loop: a => b => c => d => e => a"
+
+load_lib gas-dg.exp
+dg-init
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/err-*.s $srcdir/$subdir/warn-*.s]] "" ""
+dg-finish