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