TI C54x target.
[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
26gas_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.
30if ![istarget hppa*-*-*] then {
31 gas_test_error "diff1.s" "" "difference of two undefined symbols"
32}
33
34proc 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
57do_comment
58
59#
60# Test x930509a -- correct assembly of differences involving forward
61# references.
62#
63
64proc 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 {
224de7a5
AM
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 }
252b5132
RH
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.
39bec121
TW
87# C54x assembler (for compatibility) does not allow differences between
88# forward references
89if { ![istarget hppa*-*-*] && ![istarget *c54x*-*-*] } then {
252b5132
RH
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
39bec121
TW
98# ".struct" and ".align" have different meanings on c54x
99# These directives are done in the c54x-specific tests instead
252b5132
RH
100case $target_triplet in {
101 { hppa*-*-* } { }
39bec121 102 { *c54x*-*-* } { }
252b5132
RH
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.
39bec121
TW
113# Omit c54x, since .tag and .def mean something different on that target
114if { ([istarget *-*-coff*] && ![istarget m88*-*-*] && ![istarget *arm*-*-coff] && ![istarget thumb*-*-coff] && ![istarget *c54x*-*-coff]) \
252b5132
RH
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] \
61feeec2 126 || [istarget i*86-*-interix*] \
252b5132
RH
127 || ([istarget i960-*-vxworks5.*] && ![istarget i960-*-vxworks5.0*]) } {
128 run_dump_test cofftag
129}
130
131# Test omitting conditionals from listings.
132proc test_cond {} {
133 global comp_output
134 global srcdir
135 global subdir
136
137 set testname "conditional listings"
224de7a5 138 gas_run cond.s "-alc" ">dump.out"
252b5132
RH
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
39bec121
TW
151# again, p2align doesn't work on c54x target
152if ![istarget *c54x*-*-*] then {
153 test_cond
154}
252b5132
RH
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.
158if [info exists errorInfo] then {
159 unset errorInfo
160}
This page took 0.052859 seconds and 4 git commands to generate.