gas/ChangeLog:
[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
9497f5ac
NC
37# PR/1387
38setup_xfail "*-*-*"
39gas_test_error "equiv1.s" "" ".equiv for symbol already set to another one"
40gas_test_error "equiv2.s" "" ".equiv for symbol already set to an expression"
41
42# .equ works differently on some targets.
43case $target_triplet in {
44 { hppa*-*-* } { }
45 { *c54x*-*-* } { }
46 default {
47 gas_test "equ-ok.s" "" "" ".equ for symbol already set"
48 gas_test_error "equ-bad.s" "" ".equ for symbol already set through .eqv"
49 }
50}
51
52gas_test "eqv-ok.s" "" "" ".eqv support"
53gas_test_error "eqv-bad.s" "" ".eqv for symbol already set"
54
55gas_test "assign-ok.s" "" "" "== assignment support"
56gas_test_error "assign-bad.s" "" "== assignment for symbol already set"
57
58# .equ works differently on some targets.
59# linkrelax-ing prevents most forward references from working.
60case $target_triplet in {
61 { crx*-*-* } { }
62 { h8300*-*-* } { }
63 { hppa*-*-* } { }
64 { mn10\[23\]00*-*-* } { }
65 { *c54x*-*-* } { }
66 default {
67 # Some targets don't manage to resolve BFD_RELOC_8 for constants.
68 setup_xfail "alpha*-*-*" "avr-*-*" "*c30*-*-*" "*c4x*-*-*" \
69 "d\[13\]0v*-*-*" "i860-*-*" "mips*-*-*" "msp430-*-*" \
70 "pdp11-*-*" "sparc*-*-*" "xtensa-*-*"
71 run_dump_test forward
72 }
73}
74
75# .set works differently on some targets.
76case $target_triplet in {
77 { alpha*-*-* } { }
78 { iq2000*-*-* } { }
79 { mips*-*-* } { }
80 { *c54x*-*-* } { }
81 default {
82 setup_xfail "*c30*-*-*" "*c4x*-*-*" "pdp11-*-*"
83 run_dump_test redef
84 }
85}
86
252b5132
RH
87proc do_comment {} {
88 set testname "comment.s: comments in listings"
89 set x1 0
90 set x2 0
91 set x3 0
92 set white {[ \t]*}
93 gas_start "comment.s" "-al"
94 while 1 {
95# Apparently CRLF is received when using ptys for subprocesses; hence the
96# \r\n for line 3.
97 expect {
98 -re "^ +1\[ \t\]+# This\[^\n\]*\n" { set x1 1 }
99 -re "^ +2\[ \t\]+# correctly\[^\n\]*\n" { set x2 1 }
100 -re "^ +3\[ \t\]+/. C comments too. ./\r?\n" { set x3 1 }
101 -re "\[^\n\]*\n" { }
102 timeout { perror "timeout\n"; break }
103 eof { break }
104 }
105 }
106 gas_finish
107 if [all_ones $x1 $x2 $x3] then { pass $testname } else { fail $testname }
108}
109
110do_comment
111
112#
113# Test x930509a -- correct assembly of differences involving forward
114# references.
115#
116
117proc do_930509a {} {
118 set testname "difference between forward references"
119 set x 0
120 gas_start "x930509.s" "-al"
121 while 1 {
122# We need to accomodate both byte orders here.
123# If ".long" means an 8-byte value on some target someday, this test will have
124# to be fixed.
125 expect {
224de7a5
AM
126 -re "^ +1 .... 00 ?00 ?00 ?00" { fail $testname; set x 1 }
127 -re "^ +1 .... 04 ?00 ?00 ?00" { pass $testname; set x 1 }
128 -re "^ +1 .... 00 ?00 ?00 ?04" { pass $testname; set x 1 }
252b5132
RH
129 -re "\[^\n\]*\n" { }
130 timeout { perror "timeout\n"; break }
131 eof { break }
132 }
133 }
134 gas_finish
135 if !$x then { fail $testname }
136}
137
670ec21d 138# This test is meaningless for the PA and CRX; the difference of two symbols
252b5132 139# must not be resolved by the assembler.
39bec121
TW
140# C54x assembler (for compatibility) does not allow differences between
141# forward references
8bda4946 142# C30 counts a four byte offset as a difference of one.
48c5eb8a 143if { ![istarget hppa*-*-*] &&
670ec21d 144 ![istarget crx*-*-*] &&
48c5eb8a
SS
145 ![istarget *c30*-*-*] &&
146 ![istarget *c4x*-*-*] &&
147 ![istarget *c54x*-*-*] } then {
252b5132
RH
148 # the vax fails because VMS can apparently actually handle this
149 # case in relocs, so gas doesn't handle it itself.
8bda4946 150 setup_xfail "h8300*-*-elf*" "mn10200*-*-*" "mn10300*-*-*" "vax*-*-vms*"
252b5132
RH
151 do_930509a
152}
153
39bec121
TW
154# ".struct" and ".align" have different meanings on c54x
155# These directives are done in the c54x-specific tests instead
252b5132
RH
156case $target_triplet in {
157 { hppa*-*-* } { }
48c5eb8a 158 { *c4x*-*-* } { }
39bec121 159 { *c54x*-*-* } { }
252b5132
RH
160 default {
161 run_dump_test struct
162 run_dump_test align
76101304 163 run_dump_test align2
252b5132
RH
164 }
165}
166
5069eab2
NC
167# '<' and '>' appear to have special meanings on the excluded targets
168case $target_triplet in {
5069eab2
NC
169 { frv-*-* } { }
170 { hppa*-*-* } { }
171 { m32r-*-* } { }
172 { mmix-*-* } { }
173 { *c4x*-*-* } { }
174 { *c54x*-*-* } { }
8df55cb8 175 { bfin-*-* } { }
5069eab2
NC
176 default {
177 run_dump_test altmacro
178 # The second test is valid only when '!' is not a comment
179 # character (it is allowed to be a line comment character).
26a78d4a 180 if [string match "" [lindex [gas_run excl.s "-o /dev/null" ""] 0]] {
5069eab2 181 run_dump_test altmac2
9497f5ac
NC
182 # Similarly this test does not work when ! is a line seperator.
183 run_dump_test eval
5069eab2
NC
184 }
185 }
186}
caa32fe5 187
252b5132 188# This test is for any COFF target.
252b5132
RH
189# We omit the ARM toolchains because they define locals to
190# start with '.', which eliminates .eos, .text etc from the output.
39bec121 191# Omit c54x, since .tag and .def mean something different on that target
f7348dad 192if { ([istarget *-*-coff*] && ![istarget *arm*-*-coff] && ![istarget thumb*-*-coff] && ![istarget xscale-*-coff] && ![istarget *c4x*-*-coff] && ![istarget *c54x*-*-coff]) \
252b5132 193 ||([istarget *-*-pe*] && ![istarget arm*-*-pe*] && ![istarget thumb*-*-pe*]) \
252b5132
RH
194 || [istarget i*86-*-aix*] \
195 || [istarget i*86-*-sco*] \
196 || [istarget i*86-*-isc*] \
197 || [istarget i*86-*-go32*] \
198 || [istarget i*86-*-cygwin*] \
199 || [istarget i*86-*-*nt] \
61feeec2 200 || [istarget i*86-*-interix*] \
252b5132
RH
201 || ([istarget i960-*-vxworks5.*] && ![istarget i960-*-vxworks5.0*]) } {
202 run_dump_test cofftag
203}
204
205# Test omitting conditionals from listings.
206proc test_cond {} {
207 global comp_output
208 global srcdir
209 global subdir
210
211 set testname "conditional listings"
224de7a5 212 gas_run cond.s "-alc" ">dump.out"
252b5132
RH
213 if ![string match "" $comp_output] {
214 send_log "$comp_output\n"
215 fail $testname
216 } else {
9497f5ac 217 if { [regexp_diff dump.out $srcdir/$subdir/cond.l] } {
252b5132
RH
218 fail $testname
219 } else {
220 pass $testname
221 }
222 }
223}
224
c8060cba
JL
225# This test is not suitable for the PA for various reasons
226# not limited to the fact that it depends on specific section
227# names appearing in the output file.
39bec121 228# again, p2align doesn't work on c54x target
aceebfd6
NC
229case $target_triplet in {
230 { hppa*-*-* } { }
48c5eb8a 231 { *c4x*-*-* } { }
aceebfd6
NC
232 { *c54x*-*-* } { }
233 default {
234 test_cond
235 run_dump_test incbin
236 }
39bec121 237}
c9e38879 238
01ed09aa 239if { ([istarget "i*86-*-*pe*"] && ![istarget "i*86-*-openbsd*"]) \
b46c1691
NC
240 || [istarget "i*86-*-cygwin*"] \
241 || [istarget "i*86-*-mingw32*"] } {
242 gas_test "fastcall.s" "" "" "fastcall labels"
243}
a7eec876 244
6efba987 245run_dump_test assign
e5604d79 246run_dump_test sleb128
ddc07134
AM
247
248# .quad is 16 bytes on i960.
249if { ![istarget "i960-*-*"] } {
250 run_dump_test quad
251}
e5604d79 252
06e77878
AO
253run_dump_test weakref1
254run_dump_test weakref1g
255run_dump_test weakref1l
256run_dump_test weakref1u
257run_dump_test weakref1w
258gas_test_error "weakref2.s" "" "e: would close weakref loop: e => a => b => c => d => e"
259gas_test_error "weakref3.s" "" "a: would close weakref loop: a => b => c => d => e => a"
260
a7eec876
HPN
261load_lib gas-dg.exp
262dg-init
263dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/err-*.s $srcdir/$subdir/warn-*.s]] "" ""
264dg-finish
This page took 0.294231 seconds and 4 git commands to generate.