This commit was generated by cvs2svn to track changes on a CVS vendor
[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 gas_test "float.s" "" "" "simple FP constants"
27
28 # This test is meaningless for the PA; the difference of two undefined
29 # symbols is something that is (and must be) supported on the PA.
30 if ![istarget hppa*-*-*] then {
31 gas_test_error "diff1.s" "" "difference of two undefined symbols"
32 }
33
34 proc do_comment {} {
35 set testname "comment.s: comments in listings"
36 set x1 0
37 set x2 0
38 set x3 0
39 set white {[ \t]*}
40 gas_start "comment.s" "-al"
41 while 1 {
42 # Apparently CRLF is received when using ptys for subprocesses; hence the
43 # \r\n for line 3.
44 expect {
45 -re "^ +1\[ \t\]+# This\[^\n\]*\n" { set x1 1 }
46 -re "^ +2\[ \t\]+# correctly\[^\n\]*\n" { set x2 1 }
47 -re "^ +3\[ \t\]+/. C comments too. ./\r?\n" { set x3 1 }
48 -re "\[^\n\]*\n" { }
49 timeout { perror "timeout\n"; break }
50 eof { break }
51 }
52 }
53 gas_finish
54 if [all_ones $x1 $x2 $x3] then { pass $testname } else { fail $testname }
55 }
56
57 do_comment
58
59 #
60 # Test x930509a -- correct assembly of differences involving forward
61 # references.
62 #
63
64 proc do_930509a {} {
65 set testname "difference between forward references"
66 set x 0
67 gas_start "x930509.s" "-al"
68 while 1 {
69 # We need to accomodate both byte orders here.
70 # If ".long" means an 8-byte value on some target someday, this test will have
71 # to be fixed.
72 expect {
73 -re "^ +1 .... 00 ?00 ?00 ?00" { fail $testname; set x 1 }
74 -re "^ +1 .... 04 ?00 ?00 ?00" { pass $testname; set x 1 }
75 -re "^ +1 .... 00 ?00 ?00 ?04" { pass $testname; set x 1 }
76 -re "\[^\n\]*\n" { }
77 timeout { perror "timeout\n"; break }
78 eof { break }
79 }
80 }
81 gas_finish
82 if !$x then { fail $testname }
83 }
84
85 # This test is meaningless for the PA; the difference of two symbols
86 # must not be resolved by the assembler.
87 # C54x assembler (for compatibility) does not allow differences between
88 # forward references
89 if { ![istarget hppa*-*-*] && ![istarget *c54x*-*-*] } then {
90 # the vax fails because VMS can apparently actually handle this
91 # case in relocs, so gas doesn't handle it itself.
92 setup_xfail "vax*-*-vms*"
93 setup_xfail "mn10300*-*-*"
94 setup_xfail "mn10200*-*-*"
95 do_930509a
96 }
97
98 # ".struct" and ".align" have different meanings on c54x
99 # These directives are done in the c54x-specific tests instead
100 case $target_triplet in {
101 { hppa*-*-* } { }
102 { *c54x*-*-* } { }
103 default {
104 run_dump_test struct
105 run_dump_test align
106 }
107 }
108
109 # This test is for any COFF target.
110 # We omit m88k COFF because it uses weird pseudo-op names.
111 # We omit the ARM toolchains because they define locals to
112 # start with '.', which eliminates .eos, .text etc from the output.
113 # Omit c54x, since .tag and .def mean something different on that target
114 if { ([istarget *-*-coff*] && ![istarget m88*-*-*] && ![istarget *arm*-*-coff] && ![istarget thumb*-*-coff] && ![istarget *c54x*-*-coff]) \
115 ||([istarget *-*-pe*] && ![istarget arm*-*-pe*] && ![istarget thumb*-*-pe*]) \
116 || [istarget a29k-*-udi*] \
117 || [istarget a29k-*-ebmon*] \
118 || [istarget a29k-*-sym*] \
119 || [istarget a29k-*-vxworks*] \
120 || [istarget i*86-*-aix*] \
121 || [istarget i*86-*-sco*] \
122 || [istarget i*86-*-isc*] \
123 || [istarget i*86-*-go32*] \
124 || [istarget i*86-*-cygwin*] \
125 || [istarget i*86-*-*nt] \
126 || [istarget i*86-*-interix*] \
127 || ([istarget i960-*-vxworks5.*] && ![istarget i960-*-vxworks5.0*]) } {
128 run_dump_test cofftag
129 }
130
131 # Test omitting conditionals from listings.
132 proc test_cond {} {
133 global comp_output
134 global srcdir
135 global subdir
136
137 set testname "conditional listings"
138 gas_run cond.s "-alc" ">dump.out"
139 if ![string match "" $comp_output] {
140 send_log "$comp_output\n"
141 fail $testname
142 } else {
143 if { [regexp_diff dump.out $srcdir/$subdir/cond.d] } {
144 fail $testname
145 } else {
146 pass $testname
147 }
148 }
149 }
150
151 # again, p2align doesn't work on c54x target
152 if ![istarget *c54x*-*-*] then {
153 test_cond
154 }
155
156 # FIXME: this is here cause of a bug in DejaGnu 1.1.1. When it is no longer
157 # in use, then this can be removed.
158 if [info exists errorInfo] then {
159 unset errorInfo
160 }
This page took 0.04024 seconds and 5 git commands to generate.