* configure.ac (mips*-*-bsd*, mips*-*-ultrix*, mips*-*-osf*)
[deliverable/binutils-gdb.git] / gas / testsuite / gas / all / gas.exp
index 294d091818f7daacbdb6982081087fe417c53baf..35bcd9594e3247b3a9b963fc478745d852c9a16e 100644 (file)
@@ -1,3 +1,20 @@
+# Copyright 2012
+# Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.  
+
 #
 # These tests should be valid on all targets.
 #
@@ -16,7 +33,10 @@ gas_test "p2425.s" ""   "" "pcrel values in assignment"
 # The ".space" directive is taken care of in the C54x-specific tests, so fail
 #  here 
 #
-if { [istarget hppa*-*-*] || [istarget *c54x*-*-*] } then {
+# The test also doesn't work on mep targets, since they use RELC, and it
+# will avoid simplifying the expression since it conservatively assumes
+# ugly expressions can be saved until link-time.
+if { [istarget hppa*-*-*] || [istarget *c54x*-*-*] || [istarget mep*-*-*]} then {
     setup_xfail *-*-*
     fail "simplifiable double subtraction"
 } else {
@@ -31,7 +51,18 @@ if { ![istarget cris-*-*] && ![istarget crisv32-*-*]
 
 # 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 same is true for alpha-vms
+#
+# The MN10300 port supports link time relaxation which in turn allows
+# for link time resolution of the differneces of two symbols which are
+# undefined at assembly time.  Hence this test will not pass for the
+# MN10300.  The same thing is true for the RX port as well.
+if { ![istarget hppa*-*-*]
+     && ![istarget alpha*-*-*vms*]
+     && ![istarget rx-*-*]
+     && ![istarget mn10300-*-*]
+     && ![istarget msp430*-*-*]
+     && ![istarget am3*-*-*] } then {
     gas_test_error "diff1.s" "" "difference of two undefined symbols"
 }
 
@@ -51,46 +82,92 @@ case $target_triplet in {
 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"
+if { ![istarget "bfin-*-*"] } then {
+    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 {
+    { *c54x*-*-* } { }
+    { cr16*-*-* } { }
     { crx*-*-* } { }
     { h8300*-*-* } { }
     { hppa*-*-* } { }
+    { mep-*-* } { }
     { 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-*-*"
+       setup_xfail "alpha*-*-*" "*c30*-*-*" "*c4x*-*-*" \
+           "d\[13\]0v*-*-*" "i860-*-*" "mips*-*-*" \
+           "pdp11-*-*" "xtensa*-*-*"
        run_dump_test forward
     }
 }
 
+# aout relocs are often weird, so is mep. don't bother testing
+# som doesn't use a .text section
+# mmix doesn't like .L1:
+# ti addresses aren't octets.
+if { ![is_aout_format] } {
+    case $target_triplet in {
+       { hppa*64*-*-* } {
+           run_dump_test fwdexp
+       }
+       { hppa*-*-hpux* } { }
+       { mep-*-* } { }
+       { mmix-*-* } { }
+       { tic30*-*-* } { }
+       { tic4x*-*-* } { }
+       { tic54x*-*-* } { }
+       default {
+           run_dump_test fwdexp
+       }
+    }
+}
+
 # .set works differently on some targets.
+# most of the tests won't work on targets that set linkrelax.
+# 4 octet bytes confuse address matching on ti targets.
+# pdp11 gets unexpected reloc types.
 case $target_triplet in {
     { alpha*-*-* } { }
+    { cr16*-*-* } { }
+    { crx*-*-* } { }
+    { h8300-*-* } { }
     { mips*-*-* } { }
-    { *c54x*-*-* } { }
+    { mn10200-*-* } { }
+    { mn10300-*-* } { }
+    { msp430*-*-* } { }
+    { pdp11-*-* } { }
+    { tic30*-*-* } { }
+    { tic4x*-*-* } { }
+    { tic54x*-*-* } { }
+    { xtensa*-*-* } { }
     { z80-*-* } { }
     default {
-       setup_xfail "*c30*-*-*" "*c4x*-*-*" "pdp11-*-*"
        run_dump_test redef
-       setup_xfail "*c30*-*-*" "*c4x*-*-*" "*arm*-*-*aout*" "*arm*-*-*coff" \
-           "*arm*-*-pe" "crx*-*-*" "h8300*-*-*" "m68hc*-*-*" "maxq-*-*" \
-           "pdp11-*-*" "vax*-*-*" "z8k-*-*"
+       # These targets fail redef2 because they disallow redefined
+       # symbols on relocs.
+       setup_xfail "m68hc1*-*-*" "m6811-*-*" "m6812-*-*"
+       setup_xfail "rx-*-*" "vax*-*-*" "xgate*-*-*" "z8k-*-*"
        run_dump_test redef2
-       setup_xfail "*-*-aix*" "*-*-coff" "*-*-cygwin" "*-*-mingw*" "*-*-pe*" \
-           "bfin-*-*" "*c4x*-*-*" "crx*-*-*" "h8300*-*-*" "hppa*-*-hpux*" \
-           "m68hc*-*-*" "maxq-*-*" "or32-*-*" "pdp11-*-*" "vax*-*-*" "z8k-*-*"
+       setup_xfail "m68hc1*-*-*" "m6811-*-*" "m6812-*-*"
+       setup_xfail "rx-*-*" "vax*-*-*" "xgate*-*-*" "z8k-*-*"
+       # rs6000-aix disallows redefinition via .comm.
+       setup_xfail "*-*-aix*"
+       # SOM uses a different syntax for .comm
+       setup_xfail "hppa*-*-hpux*"
+       # These targets fail redef3 because section contents for the
+       # word referencing the .comm sym is not zero and/or its reloc
+       # has a non-zero addend.  Relaxing the test would hide real
+       # failures such as or32-elf.
+       setup_xfail "bfin-*-*" "i\[3-7\]86-*-*coff" \
+           "i\[3-7\]86-*-*pe" "i\[3-7\]86-*-go32*" \
+           "i\[3-7\]86-*-cygwin*" "i\[3-7\]86-*-mingw*" "x86_64-*-mingw*"
        run_dump_test redef3
-       setup_xfail "*c4x*-*-*"
        gas_test_error "redef4.s" "" ".set for symbol already used as label"
-       setup_xfail "*c4x*-*-*"
        gas_test_error "redef5.s" "" ".set for symbol already defined through .comm"
     }
 }
@@ -108,7 +185,7 @@ proc do_comment {} {
        expect {
            -re "^ +1\[ \t\]+# This\[^\n\]*\n"          { set x1 1 }
            -re "^ +2\[ \t\]+# correctly\[^\n\]*\n"     { set x2 1 }
-           -re "^ +3\[ \t\]+/. C comments too. ./\r?\n" { set x3 1 }
+           -re "^ +3\[ \t\]+/. C comments too. ./\r?\r?\n" { set x3 1 }
            -re "\[^\n\]*\n"                            { }
            timeout                             { perror "timeout\n"; break }
            eof                                 { break }
@@ -118,7 +195,38 @@ proc do_comment {} {
     if [all_ones $x1 $x2 $x3] then { pass $testname } else { fail $testname }
 }
 
-do_comment
+# m32c pads out sections, even empty ones.
+case $target_triplet in {
+    { m32c-*-* } { }
+    default {
+       do_comment
+    }
+}
+
+# This test checks the output of the -ag switch. It must detect at least
+# the name of the input file, output file, and options passed.
+proc general_info_section {} {
+    set testname "general info section in listings"
+    set x1 0
+    set x2 0
+    set x3 0
+    set white {[ \t]*}
+    gas_start "comment.s" "-agn"
+    while 1 {
+       expect {
+           -re "^ \[^\n\]*\t: .*\-agn\[^\n\]*\n"                { set x1 1 }
+           -re "^ \[^\n\]*\t: \[^\n\]*comment\.s\[^\n\]*\n"   { set x2 1 }
+           -re "^ \[^\n\]*\t: a\.out\[^\n\]*\n"               { set x3 1 }
+           -re "\[^\n\]*\n"     { }
+           timeout              { perror "timeout\n"; break }
+           eof                  { break }
+       }
+    }
+    gas_finish
+    if [all_ones $x1 $x2 $x3] then { pass $testname } else { fail $testname }
+}
+
+general_info_section
 
 #
 # Test x930509a -- correct assembly of differences involving forward
@@ -146,19 +254,21 @@ proc do_930509a {} {
     if !$x then { fail $testname }
 }
 
-# This test is meaningless for the PA and CRX; the difference of two symbols
-# must not be resolved by the assembler.
+# This test is meaningless for the PA and CR16/CRX: the difference of two
+# symbols cannot be resolved by the assembler.
 # C54x assembler (for compatibility) does not allow differences between
-# forward references
+# forward references.
 # C30 counts a four byte offset as a difference of one.
 if { ![istarget hppa*-*-*] &&
+     ![istarget cr16*-*-*] &&
      ![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 "h8300*-*-elf*" "mn10200*-*-*" "mn10300*-*-*" "vax*-*-vms*"
+    # msp430 and mn10300 emit two relocs to handle the difference of two symbols.
+    setup_xfail "mn10300*-*-*" "msp430*-*-*" "vax*-*-vms*"
     do_930509a
 }
 
@@ -200,8 +310,8 @@ case $target_triplet in {
 # 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*]) \
+if {   ([istarget *-*-coff*] && ![istarget arm*-*-coff] && ![istarget *c4x*-*-coff] && ![istarget *c54x*-*-coff]) \
+     ||([istarget *-*-pe*] && ![istarget arm*-*-pe*]) \
      || [istarget i*86-*-aix*] \
      || [istarget i*86-*-sco*] \
      || [istarget i*86-*-isc*] \
@@ -242,8 +352,10 @@ case $target_triplet in {
     { hppa*-*-* } { }
     { *c4x*-*-* } { }
     { *c54x*-*-* } { }
+    { rx-*-* } { }
     default {
         test_cond
+       remote_download host "$srcdir/$subdir/incbin.dat"
         run_dump_test incbin
     }
 }
@@ -254,14 +366,46 @@ if {  ([istarget "i*86-*-*pe*"] && ![istarget "i*86-*-openbsd*"]) \
   gas_test "fastcall.s" ""   "" "fastcall labels"
 }
 
-run_dump_test assign
+if { ![istarget "bfin-*-*"] } then {
+    run_dump_test assign
+}
 run_dump_test sleb128
+run_dump_test sleb128-2
+run_dump_test sleb128-3
+run_dump_test sleb128-4
+run_dump_test sleb128-5
+# .byte is not 8 bits on either tic4x or tic54x
+if { ![istarget "tic4x*-*-*"] && ![istarget "tic54x*-*-*"] } {
+    run_dump_test sleb128-7
+}
+
+# .byte is 32 bits on tic4x, and .p2align isn't supported on tic54x
+# .space is different on hppa*-hpux.
+# MeP put bytes into packets.
+if { ![istarget "tic4x*-*-*"] && ![istarget "tic54x*-*-*"] && ![istarget "hppa*-*-hpux*"] && ![istarget "mep*-*-*"] } {
+    run_dump_test relax
+}
+
+# powerpc and s390 allow a string argument to .byte
+if { ![istarget "powerpc*-*-*"] && ![istarget "rs6000*-*-*"] && ![istarget "s390*-*-*"] } {
+    run_dump_test byte
+}
 
 # .quad is 16 bytes on i960.
 if { ![istarget "i960-*-*"] } {
     run_dump_test quad
 }
 
+# som doesn't use .data section.
+case $target_triplet in {
+    { hppa*64*-*-* } {
+       run_dump_test octa
+    }
+    { hppa*-*-hpux* } { }
+    default {
+       run_dump_test octa
+    }
+}
 
 # .set works differently on some targets.
 case $target_triplet in {
@@ -281,6 +425,8 @@ gas_test_error "weakref2.s" "" "e: would close weakref loop: e => a => b => c =>
 gas_test_error "weakref3.s" "" "a: would close weakref loop: a => b => c => d => e => a"
 gas_test_error "weakref4.s" "" "is already defined"
 
+run_dump_test string
+
 load_lib gas-dg.exp
 dg-init
 dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/err-*.s $srcdir/$subdir/warn-*.s]] "" ""
This page took 0.02721 seconds and 4 git commands to generate.