* Makefile.am: Bfin support.
[deliverable/binutils-gdb.git] / gas / testsuite / gas / all / gas.exp
CommitLineData
252b5132
RH
1#
2# These tests should be valid on all targets.
3#
4
5# I think currently all targets fail this one when listings are enabled.
6gas_test "p2425.s" "" "" "pcrel values in assignment"
7
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".
10#
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
13# it fails.
39bec121
TW
14#
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
17# here
18#
19if { [istarget hppa*-*-*] || [istarget *c54x*-*-*] } then {
252b5132
RH
20 setup_xfail *-*-*
21 fail "simplifiable double subtraction"
22} else {
23 gas_test "p1480.s" "" "-a>" "simplifiable double subtraction"
24}
25
483f05e3 26# No floating point support in assembly code for CRIS.
05e6b315 27if { ![istarget cris-*-*] && ![istarget crisv32-*-*] } then {
483f05e3
HPN
28 gas_test "float.s" "" "" "simple FP constants"
29}
252b5132
RH
30
31# This test is meaningless for the PA; the difference of two undefined
32# symbols is something that is (and must be) supported on the PA.
33if ![istarget hppa*-*-*] then {
34 gas_test_error "diff1.s" "" "difference of two undefined symbols"
35}
36
37proc do_comment {} {
38 set testname "comment.s: comments in listings"
39 set x1 0
40 set x2 0
41 set x3 0
42 set white {[ \t]*}
43 gas_start "comment.s" "-al"
44 while 1 {
45# Apparently CRLF is received when using ptys for subprocesses; hence the
46# \r\n for line 3.
47 expect {
48 -re "^ +1\[ \t\]+# This\[^\n\]*\n" { set x1 1 }
49 -re "^ +2\[ \t\]+# correctly\[^\n\]*\n" { set x2 1 }
50 -re "^ +3\[ \t\]+/. C comments too. ./\r?\n" { set x3 1 }
51 -re "\[^\n\]*\n" { }
52 timeout { perror "timeout\n"; break }
53 eof { break }
54 }
55 }
56 gas_finish
57 if [all_ones $x1 $x2 $x3] then { pass $testname } else { fail $testname }
58}
59
60do_comment
61
62#
63# Test x930509a -- correct assembly of differences involving forward
64# references.
65#
66
67proc do_930509a {} {
68 set testname "difference between forward references"
69 set x 0
70 gas_start "x930509.s" "-al"
71 while 1 {
72# We need to accomodate both byte orders here.
73# If ".long" means an 8-byte value on some target someday, this test will have
74# to be fixed.
75 expect {
224de7a5
AM
76 -re "^ +1 .... 00 ?00 ?00 ?00" { fail $testname; set x 1 }
77 -re "^ +1 .... 04 ?00 ?00 ?00" { pass $testname; set x 1 }
78 -re "^ +1 .... 00 ?00 ?00 ?04" { pass $testname; set x 1 }
252b5132
RH
79 -re "\[^\n\]*\n" { }
80 timeout { perror "timeout\n"; break }
81 eof { break }
82 }
83 }
84 gas_finish
85 if !$x then { fail $testname }
86}
87
670ec21d 88# This test is meaningless for the PA and CRX; the difference of two symbols
252b5132 89# must not be resolved by the assembler.
39bec121
TW
90# C54x assembler (for compatibility) does not allow differences between
91# forward references
8bda4946 92# C30 counts a four byte offset as a difference of one.
48c5eb8a 93if { ![istarget hppa*-*-*] &&
670ec21d 94 ![istarget crx*-*-*] &&
48c5eb8a
SS
95 ![istarget *c30*-*-*] &&
96 ![istarget *c4x*-*-*] &&
97 ![istarget *c54x*-*-*] } then {
252b5132
RH
98 # the vax fails because VMS can apparently actually handle this
99 # case in relocs, so gas doesn't handle it itself.
8bda4946 100 setup_xfail "h8300*-*-elf*" "mn10200*-*-*" "mn10300*-*-*" "vax*-*-vms*"
252b5132
RH
101 do_930509a
102}
103
39bec121
TW
104# ".struct" and ".align" have different meanings on c54x
105# These directives are done in the c54x-specific tests instead
252b5132
RH
106case $target_triplet in {
107 { hppa*-*-* } { }
48c5eb8a 108 { *c4x*-*-* } { }
39bec121 109 { *c54x*-*-* } { }
252b5132
RH
110 default {
111 run_dump_test struct
112 run_dump_test align
76101304 113 run_dump_test align2
252b5132
RH
114 }
115}
116
5069eab2
NC
117# '<' and '>' appear to have special meanings on the excluded targets
118case $target_triplet in {
5069eab2
NC
119 { frv-*-* } { }
120 { hppa*-*-* } { }
121 { m32r-*-* } { }
122 { mmix-*-* } { }
123 { *c4x*-*-* } { }
124 { *c54x*-*-* } { }
125 default {
126 run_dump_test altmacro
127 # The second test is valid only when '!' is not a comment
128 # character (it is allowed to be a line comment character).
26a78d4a 129 if [string match "" [lindex [gas_run excl.s "-o /dev/null" ""] 0]] {
5069eab2
NC
130 run_dump_test altmac2
131 }
132 }
133}
caa32fe5 134
252b5132 135# This test is for any COFF target.
252b5132
RH
136# We omit the ARM toolchains because they define locals to
137# start with '.', which eliminates .eos, .text etc from the output.
39bec121 138# Omit c54x, since .tag and .def mean something different on that target
f7348dad 139if { ([istarget *-*-coff*] && ![istarget *arm*-*-coff] && ![istarget thumb*-*-coff] && ![istarget xscale-*-coff] && ![istarget *c4x*-*-coff] && ![istarget *c54x*-*-coff]) \
252b5132 140 ||([istarget *-*-pe*] && ![istarget arm*-*-pe*] && ![istarget thumb*-*-pe*]) \
252b5132
RH
141 || [istarget i*86-*-aix*] \
142 || [istarget i*86-*-sco*] \
143 || [istarget i*86-*-isc*] \
144 || [istarget i*86-*-go32*] \
145 || [istarget i*86-*-cygwin*] \
146 || [istarget i*86-*-*nt] \
61feeec2 147 || [istarget i*86-*-interix*] \
252b5132
RH
148 || ([istarget i960-*-vxworks5.*] && ![istarget i960-*-vxworks5.0*]) } {
149 run_dump_test cofftag
150}
151
152# Test omitting conditionals from listings.
153proc test_cond {} {
154 global comp_output
155 global srcdir
156 global subdir
157
158 set testname "conditional listings"
224de7a5 159 gas_run cond.s "-alc" ">dump.out"
252b5132
RH
160 if ![string match "" $comp_output] {
161 send_log "$comp_output\n"
162 fail $testname
163 } else {
164 if { [regexp_diff dump.out $srcdir/$subdir/cond.d] } {
165 fail $testname
166 } else {
167 pass $testname
168 }
169 }
170}
171
c8060cba
JL
172# This test is not suitable for the PA for various reasons
173# not limited to the fact that it depends on specific section
174# names appearing in the output file.
39bec121 175# again, p2align doesn't work on c54x target
aceebfd6
NC
176case $target_triplet in {
177 { hppa*-*-* } { }
48c5eb8a 178 { *c4x*-*-* } { }
aceebfd6
NC
179 { *c54x*-*-* } { }
180 default {
181 test_cond
182 run_dump_test incbin
183 }
39bec121 184}
c9e38879 185
01ed09aa 186if { ([istarget "i*86-*-*pe*"] && ![istarget "i*86-*-openbsd*"]) \
b46c1691
NC
187 || [istarget "i*86-*-cygwin*"] \
188 || [istarget "i*86-*-mingw32*"] } {
189 gas_test "fastcall.s" "" "" "fastcall labels"
190}
a7eec876 191
6efba987 192run_dump_test assign
e5604d79 193run_dump_test sleb128
ddc07134
AM
194
195# .quad is 16 bytes on i960.
196if { ![istarget "i960-*-*"] } {
197 run_dump_test quad
198}
e5604d79 199
a7eec876
HPN
200load_lib gas-dg.exp
201dg-init
202dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/err-*.s $srcdir/$subdir/warn-*.s]] "" ""
203dg-finish
This page took 0.325564 seconds and 4 git commands to generate.