1 # Copyright
(C
) 1993, 1997 Free Software Foundation
, Inc.
3 # This
program is free software
; you can redistribute it and
/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation
; either version
2 of the License
, or
6 #
(at your option
) any later version.
8 # This
program is distributed in the hope that it will be useful
,
9 # but WITHOUT
ANY WARRANTY
; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License
for more details.
13 # You should have received a copy of the GNU General Public License
14 # along with this
program; if not
, write to the Free Software
15 # Foundation
, Inc.
, 59 Temple Place
- Suite
330, Boston
, MA
02111-1307, USA.
17 # Please email
any bugs
, comments
, and
/or additions to this file to
:
20 # Written by the Center
for Software Science at the University of Utah
21 # and by Cygnus Support.
23 proc do_subspace_align_test
{} {
24 set testname
"ss_align.s: Test subspace alignment (part 2)"
27 if [gas_test_old
"ss_align.s" "" "subspace alignment (part 1)"] then {
28 objdump_start_no_subdir
"a.out" "-h"
30 # Check the headers
for the correct alignment value
for the
31 # .data section
(elf
) or the $DATA$ subspace
(som
).
32 if [istarget hppa
*-*-*elf
*] then {
35 -re
"data\[^\n\]* 2..6\[^\n\]*\n" { set x 1 }
37 timeout
{ perror
"timeout\n"; break }
44 -re
"DATA\[^\n\]* 2..6\[^\n\]*\n" { set x 1 }
46 timeout
{ perror
"timeout\n"; break }
52 # This was intended to
do any cleanup necessary. It kinda looks like it
53 # isn
't needed, but just in case, please keep it in for now.
56 # Did we find what we were looking for? If not, flunk it.
57 if [expr $x==1] then { pass $testname } else { fail $testname }
61 proc do_local_label_test {} {
62 set testname "locallabel.s: Elimination of local labels (part 2)"
65 if [gas_test_old "locallabel.s" "" "Elimination of local labels (part1)"] {
66 objdump_start_no_subdir "a.out" "-t"
70 -re "^00000000\[^\n\]*Label\[^\n\]*\n" { set x 1 }
71 -re "^00000000\[^\n\]*L\$01234\[^\n\]*\n" { set x 0 }
73 timeout { perror "timeout\n"; break }
78 # This was intended to do any cleanup necessary. It kinda looks like it
79 # isn't needed
, but just in case
, please keep it in
for now.
82 # Did we find what we were looking
for?
If not
, flunk it.
83 if [expr $x
==1] then { pass $testname
} else { fail $testname
}
87 proc do_frchain_test
{} {
88 set testname
"fragbug.s: Test bug in frag chaining (part 2)"
91 if [gas_test_old
"fragbug.s" "" "Test bug in frag chaining (part1)"] {
92 objdump_start_no_subdir
"a.out" "--prefix-addresses -d"
96 -re
"^0x00000000\[^\n\]*nop\[^\n\]*\n" { set x 1 }
97 -re
"^0x00000004\[^\n\]*nop\[^\n\]*\n" { set x 0 }
99 timeout
{ perror
"timeout\n"; break }
104 # This was intended to
do any cleanup necessary. It kinda looks like it
105 # isn
't needed, but just in case, please keep it in for now.
108 # Did we find what we were looking for? If not, flunk it.
109 if [expr $x==1] then { pass $testname } else { fail $testname }
113 proc do_align3_test {} {
114 set testname "align3.s: Test for alignment bug when switching subspaces (part2)"
117 if [gas_test_old "align3.s" "" "Test for alignment bug when switching subspaces (part1)"] {
118 objdump_start_no_subdir "a.out" "--prefix-addresses -d"
122 -re "\[^\n\]* <main> nop\[^\n\]*\n" { set x 1 }
123 -re "\[^\n\]* <.*end_main> nop\[^\n\]*\n" { set x 1 }
124 -re "\[^\n\]* <main+.*> nop\[^\n\]*\n" { set x 0 }
126 timeout { perror "timeout\n"; break }
131 # This was intended to do any cleanup necessary. It kinda looks like it
132 # isn't needed
, but just in case
, please keep it in
for now.
135 # Did we find what we were looking
for?
If not
, flunk it.
136 if [expr $x
==1] then { pass $testname
} else { fail $testname
}
140 proc do_align4_test
{} {
141 set testname
"align4.s: More subspace alignment tests (part2)"
144 if [istarget hppa
*-*-*elf
*] then {
148 if [gas_test_old
"align4.s" "" "More subspace alignment tests (part1)"] {
149 objdump_start_no_subdir
"a.out" "-h"
153 -re
"\[^\n\]*MILLICODE\[^\n\]*2..6\[^\n\]*\n"
154 { set x
[expr $x
+1] }
155 -re
"\[^\n\]*YABBA\[^\n\]*2..3\[^\n\]*\n"
156 { set x
[expr $x
+1] }
157 timeout
{ perror
"timeout\n"; break }
162 # This was intended to
do any cleanup necessary. It kinda looks like it
163 # isn
't needed, but just in case, please keep it in for now.
166 # Did we find what we were looking for? If not, flunk it.
167 if [expr $x==2] then { pass $testname } else { fail $testname }
171 proc do_import_test {} {
172 set testname "importbug.s: Test for bug in .import directive (part2)"
175 if [gas_test_old "importbug.s" "" "Test for bug in .import directive (part1)"] {
176 objdump_start_no_subdir "a.out" "--syms"
180 -re "\[^\n\]*.DATA..foo\[^\n\]*\n" { set x 1 }
181 -re "\[^\n\]*.data.*foo\[^\n\]*\n" { set x 1 }
183 timeout { perror "timeout\n"; break }
188 # This was intended to do any cleanup necessary. It kinda looks like it
189 # isn't needed
, but just in case
, please keep it in
for now.
192 # Did we find what we were looking
for?
If not
, flunk it.
193 if [expr $x
==1] then { pass $testname
} else { fail $testname
}
197 proc do_common_test
{} {
198 set testname
"common.s: Test for bug in .comm handling (part2)"
201 if [gas_test_old
"common.s" "" "Test for bug in .comm handling (part1)"] {
202 objdump_start_no_subdir
"a.out" "--syms"
206 -re
"\[^\n\]*.COM.*common_symbol\[^\n\]*\n" { set x 1 }
208 timeout
{ perror
"timeout\n"; break }
213 # This was intended to
do any cleanup necessary. It kinda looks like it
214 # isn
't needed, but just in case, please keep it in for now.
217 # Did we find what we were looking for? If not, flunk it.
218 if [expr $x==1] then { pass $testname } else { fail $testname }
222 if [istarget hppa*-*-*] then {
223 # Make sure subspace alignment requests from the subspace directives
225 do_subspace_align_test
227 # Make sure the correct labels end up in the symbol table
230 # GAS-1.36 choked on this file.
231 gas_test "labeldiffs.s" "" "" "Difference of labels"
233 # Test a recent bug where frag chaining wasn't working correctly.
236 # Test bug where switching between subspaces creates bogus alignments
239 # Test bug where switching between subspaces creates bogus alignments
242 # Test a problem where $global$ is defined
, then used within the
244 setup_xfail hppa
*-*-*
245 gas_test
"globalbug.s" "" "" "Use \$global\$ in file which defines it"
247 # Test that importing a defined symbol doesn
't screw up the symbol's
251 # Test
for a buglet in the handling of common symbols
254 # Test
for an
off-by
-2 bug in range check
for conditional branches
255 gas_test_error
"brlenbug.s" "" "Check for error(s) in branch length"