1 # Copyright (C) 1993, 1997, 1999, 2000, 2002, 2004
2 # Free Software Foundation, Inc.
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2 of the License, or
7 # (at your option) any later version.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
18 # Please email any bugs, comments, and/or additions to this file to:
21 # Written by the Center for Software Science at the University of Utah
22 # and by Cygnus Support.
24 proc do_subspace_align_test {} {
25 set testname "ss_align.s: Test subspace alignment (part 2)"
28 if {[istarget hppa*64*-*-*]
29 || [istarget hppa*-*-*elf*] || [istarget hppa*-*-linux*]} then {
33 if [gas_test_old "ss_align.s" "" "subspace alignment (part 1)"] then {
34 objdump_start_no_subdir "a.out" "-h"
36 # Check the headers for the correct alignment value for the
37 # the $DATA$ subspace (som).
40 -re "DATA\[^\n\]* 2..6\[^\n\]*\n" { set x 1 }
42 timeout { perror "timeout\n"; break }
47 # This was intended to do any cleanup necessary. It kinda looks like it
48 # isn't needed, but just in case, please keep it in for now.
51 # Did we find what we were looking for? If not, flunk it.
52 if [expr $x==1] then { pass $testname } else { fail $testname }
56 proc do_local_label_test {} {
57 set testname "locallabel.s: Elimination of local labels (part 2)"
60 if [gas_test_old "locallabel.s" "" "Elimination of local labels (part1)"] {
61 objdump_start_no_subdir "a.out" "-t"
65 -re "^00000000\[^\n\]*Label\[^\n\]*\n" { set x 1 }
66 -re "^00000000\[^\n\]*L\$01234\[^\n\]*\n" { set x 0 }
68 timeout { perror "timeout\n"; break }
73 # This was intended to do any cleanup necessary. It kinda looks like it
74 # isn't needed, but just in case, please keep it in for now.
77 # Did we find what we were looking for? If not, flunk it.
78 if [expr $x==1] then { pass $testname } else { fail $testname }
82 proc do_frchain_test {} {
83 set testname "fragbug.s: Test bug in frag chaining (part 2)"
86 if [gas_test_old "fragbug.s" "" "Test bug in frag chaining (part1)"] {
87 objdump_start_no_subdir "a.out" "--prefix-addresses -d"
91 -re "^0x00000000\[^\n\]*nop\[^\n\]*\n" { set x 1 }
92 -re "^0x00000004\[^\n\]*nop\[^\n\]*\n" { set x 0 }
94 timeout { perror "timeout\n"; break }
99 # This was intended to do any cleanup necessary. It kinda looks like it
100 # isn't needed, but just in case, please keep it in for now.
103 # Did we find what we were looking for? If not, flunk it.
104 if [expr $x==1] then { pass $testname } else { fail $testname }
108 proc do_align3_test {} {
109 set testname "align3.s: Test for alignment bug when switching subspaces (part2)"
112 if {[istarget hppa*64*-*-*]
113 || [istarget hppa*-*-*elf*] || [istarget hppa*-*-linux*]} then {
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*64*-*-*]
145 || [istarget hppa*-*-*elf*] || [istarget hppa*-*-linux*]} then {
149 if [gas_test_old "align4.s" "" "More subspace alignment tests (part1)"] {
150 objdump_start_no_subdir "a.out" "-h"
154 -re "\[^\n\]*MILLICODE\[^\n\]*2..6\[^\n\]*\n"
155 { set x [expr $x+1] }
156 -re "\[^\n\]*YABBA\[^\n\]*2..3\[^\n\]*\n"
157 { set x [expr $x+1] }
158 timeout { perror "timeout\n"; break }
163 # This was intended to do any cleanup necessary. It kinda looks like it
164 # isn't needed, but just in case, please keep it in for now.
167 # Did we find what we were looking for? If not, flunk it.
168 if [expr $x==2] then { pass $testname } else { fail $testname }
172 proc do_import_test {} {
173 set testname "importbug.s: Test for bug in .import directive (part2)"
176 if [gas_test_old "importbug.s" "" "Test for bug in .import directive (part1)"] {
177 objdump_start_no_subdir "a.out" "--syms"
181 -re "\[^\n\]*.DATA..foo\[^\n\]*\n" { set x 1 }
182 -re "\[^\n\]*.data.*foo\[^\n\]*\n" { set x 1 }
184 timeout { perror "timeout\n"; break }
189 # This was intended to do any cleanup necessary. It kinda looks like it
190 # isn't needed, but just in case, please keep it in for now.
193 # Did we find what we were looking for? If not, flunk it.
194 if [expr $x==1] then { pass $testname } else { fail $testname }
198 proc do_common_test {} {
199 # linux has a different .comm syntax
200 if [istarget hppa*-*-linux*] then {
204 set testname "common.s: Test for bug in .comm handling (part2)"
207 if [gas_test_old "common.s" "" "Test for bug in .comm handling (part1)"] {
208 objdump_start_no_subdir "a.out" "--syms"
212 -re "\[^\n\]*.COM.*common_symbol\[^\n\]*\n" { set x 1 }
214 timeout { perror "timeout\n"; break }
219 # This was intended to do any cleanup necessary. It kinda looks like it
220 # isn't needed, but just in case, please keep it in for now.
223 # Did we find what we were looking for? If not, flunk it.
224 if [expr $x==1] then { pass $testname } else { fail $testname }
228 if [istarget hppa*-*-*] then {
229 # Make sure subspace alignment requests from the subspace directives
231 do_subspace_align_test
233 # Make sure the correct labels end up in the symbol table
236 # GAS-1.36 choked on this file.
237 gas_test "labeldiffs.s" "" "" "Difference of labels"
239 # Test a recent bug where frag chaining wasn't working correctly.
242 # Test bug where switching between subspaces creates bogus alignments
245 # Test bug where switching between subspaces creates bogus alignments
248 # Test a problem where $global$ is defined, then used within the
250 setup_xfail hppa*-*-*
251 gas_test "globalbug.s" "" "" "Use \$global\$ in file which defines it"
253 # Test that importing a defined symbol doesn't screw up the symbol's
257 # Test for a buglet in the handling of common symbols
260 # Test for an off-by-2 bug in range check for conditional branches
261 # The labels in brlenbug.s lack colons and are not linux compatible.
262 if {! [istarget *-*-linux*]} then {
263 gas_test_error "brlenbug.s" "" "Check for error(s) in branch length"