2002-05-23 H.J. Lu <hjl@gnu.org>
[deliverable/binutils-gdb.git] / gas / testsuite / gas / all / gas.exp
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.
6 gas_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.
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 #
19 if { [istarget hppa*-*-*] || [istarget *c54x*-*-*] } then {
20 setup_xfail *-*-*
21 fail "simplifiable double subtraction"
22 } else {
23 gas_test "p1480.s" "" "-a>" "simplifiable double subtraction"
24 }
25
26 # No floating point support in assembly code for CRIS.
27 if ![istarget cris-*-*] then {
28 gas_test "float.s" "" "" "simple FP constants"
29 }
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.
33 if ![istarget hppa*-*-*] then {
34 gas_test_error "diff1.s" "" "difference of two undefined symbols"
35 }
36
37 proc 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
60 do_comment
61
62 #
63 # Test x930509a -- correct assembly of differences involving forward
64 # references.
65 #
66
67 proc 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 {
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 }
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
88 # This test is meaningless for the PA; the difference of two symbols
89 # must not be resolved by the assembler.
90 # C54x assembler (for compatibility) does not allow differences between
91 # forward references
92 if { ![istarget hppa*-*-*] && ![istarget *c54x*-*-*] } then {
93 # the vax fails because VMS can apparently actually handle this
94 # case in relocs, so gas doesn't handle it itself.
95 setup_xfail "vax*-*-vms*"
96 setup_xfail "mn10300*-*-*"
97 setup_xfail "mn10200*-*-*"
98 setup_xfail "h8300*-*-elf*"
99 do_930509a
100 }
101
102 # ".struct" and ".align" have different meanings on c54x
103 # These directives are done in the c54x-specific tests instead
104 case $target_triplet in {
105 { hppa*-*-* } { }
106 { *c54x*-*-* } { }
107 default {
108 run_dump_test struct
109 run_dump_test align
110 run_dump_test align2
111 }
112 }
113
114 # This test is for any COFF target.
115 # We omit m88k COFF because it uses weird pseudo-op names.
116 # We omit the ARM toolchains because they define locals to
117 # start with '.', which eliminates .eos, .text etc from the output.
118 # Omit c54x, since .tag and .def mean something different on that target
119 if { ([istarget *-*-coff*] && ![istarget m88*-*-*] && ![istarget *arm*-*-coff] && ![istarget thumb*-*-coff] && ![istarget xscale-*-coff] && ![istarget *c54x*-*-coff]) \
120 ||([istarget *-*-pe*] && ![istarget arm*-*-pe*] && ![istarget thumb*-*-pe*]) \
121 || [istarget a29k-*-udi*] \
122 || [istarget a29k-*-ebmon*] \
123 || [istarget a29k-*-sym*] \
124 || [istarget a29k-*-vxworks*] \
125 || [istarget i*86-*-aix*] \
126 || [istarget i*86-*-sco*] \
127 || [istarget i*86-*-isc*] \
128 || [istarget i*86-*-go32*] \
129 || [istarget i*86-*-cygwin*] \
130 || [istarget i*86-*-*nt] \
131 || [istarget i*86-*-interix*] \
132 || ([istarget i960-*-vxworks5.*] && ![istarget i960-*-vxworks5.0*]) } {
133 run_dump_test cofftag
134 }
135
136 # Test omitting conditionals from listings.
137 proc test_cond {} {
138 global comp_output
139 global srcdir
140 global subdir
141
142 set testname "conditional listings"
143 gas_run cond.s "-alc" ">dump.out"
144 if ![string match "" $comp_output] {
145 send_log "$comp_output\n"
146 fail $testname
147 } else {
148 if { [regexp_diff dump.out $srcdir/$subdir/cond.d] } {
149 fail $testname
150 } else {
151 pass $testname
152 }
153 }
154 }
155
156 # This test is not suitable for the PA for various reasons
157 # not limited to the fact that it depends on specific section
158 # names appearing in the output file.
159 # again, p2align doesn't work on c54x target
160 case $target_triplet in {
161 { hppa*-*-* } { }
162 { *c54x*-*-* } { }
163 default {
164 test_cond
165 run_dump_test incbin
166 }
167 }
168
169 # FIXME: this is here cause of a bug in DejaGnu 1.1.1. When it is no longer
170 # in use, then this can be removed.
171 if [info exists errorInfo] then {
172 unset errorInfo
173 }
This page took 0.035704 seconds and 5 git commands to generate.