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 { [istarget hppa*-*-*elf*] || [istarget hppa*-*-linux*] || [istarget hppa*w-*-*] } then {
31 if [gas_test_old "ss_align.s" "" "subspace alignment (part 1)"] then {
32 objdump_start_no_subdir "a.out" "-h"
34 # Check the headers for the correct alignment value for the
35 # the $DATA$ subspace (som).
38 -re "DATA\[^\n\]* 2..6\[^\n\]*\n" { set x 1 }
40 timeout { perror "timeout\n"; break }
45 # This was intended to do any cleanup necessary. It kinda looks like it
46 # isn't needed, but just in case, please keep it in for now.
49 # Did we find what we were looking for? If not, flunk it.
50 if [expr $x==1] then { pass $testname } else { fail $testname }
54 proc do_local_label_test {} {
55 set testname "locallabel.s: Elimination of local labels (part 2)"
58 if [gas_test_old "locallabel.s" "" "Elimination of local labels (part1)"] {
59 objdump_start_no_subdir "a.out" "-t"
63 -re "^00000000\[^\n\]*Label\[^\n\]*\n" { set x 1 }
64 -re "^00000000\[^\n\]*L\$01234\[^\n\]*\n" { set x 0 }
66 timeout { perror "timeout\n"; break }
71 # This was intended to do any cleanup necessary. It kinda looks like it
72 # isn't needed, but just in case, please keep it in for now.
75 # Did we find what we were looking for? If not, flunk it.
76 if [expr $x==1] then { pass $testname } else { fail $testname }
80 proc do_frchain_test {} {
81 set testname "fragbug.s: Test bug in frag chaining (part 2)"
84 if [gas_test_old "fragbug.s" "" "Test bug in frag chaining (part1)"] {
85 objdump_start_no_subdir "a.out" "--prefix-addresses -d"
89 -re "^0x00000000\[^\n\]*nop\[^\n\]*\n" { set x 1 }
90 -re "^0x00000004\[^\n\]*nop\[^\n\]*\n" { set x 0 }
92 timeout { perror "timeout\n"; break }
97 # This was intended to do any cleanup necessary. It kinda looks like it
98 # isn't needed, but just in case, please keep it in for now.
101 # Did we find what we were looking for? If not, flunk it.
102 if [expr $x==1] then { pass $testname } else { fail $testname }
106 proc do_align3_test {} {
107 set testname "align3.s: Test for alignment bug when switching subspaces (part2)"
110 if { [istarget hppa*-*-*elf*] || [istarget hppa*-*-linux*] || [istarget hppa*w-*-*] } then {
114 if [gas_test_old "align3.s" "" "Test for alignment bug when switching subspaces (part1)"] {
115 objdump_start_no_subdir "a.out" "--prefix-addresses -d"
119 -re "\[^\n\]* <main> nop\[^\n\]*\n" { set x 1 }
120 -re "\[^\n\]* <.*end_main> nop\[^\n\]*\n" { set x 1 }
121 -re "\[^\n\]* <main+.*> nop\[^\n\]*\n" { set x 0 }
123 timeout { perror "timeout\n"; break }
128 # This was intended to do any cleanup necessary. It kinda looks like it
129 # isn't needed, but just in case, please keep it in for now.
132 # Did we find what we were looking for? If not, flunk it.
133 if [expr $x==1] then { pass $testname } else { fail $testname }
137 proc do_align4_test {} {
138 set testname "align4.s: More subspace alignment tests (part2)"
141 if { [istarget hppa*-*-*elf*] || [istarget hppa*-*-linux*] || [istarget hppa*w-*-*] } then {
145 if [gas_test_old "align4.s" "" "More subspace alignment tests (part1)"] {
146 objdump_start_no_subdir "a.out" "-h"
150 -re "\[^\n\]*MILLICODE\[^\n\]*2..6\[^\n\]*\n"
151 { set x [expr $x+1] }
152 -re "\[^\n\]*YABBA\[^\n\]*2..3\[^\n\]*\n"
153 { set x [expr $x+1] }
154 timeout { perror "timeout\n"; break }
159 # This was intended to do any cleanup necessary. It kinda looks like it
160 # isn't needed, but just in case, please keep it in for now.
163 # Did we find what we were looking for? If not, flunk it.
164 if [expr $x==2] then { pass $testname } else { fail $testname }
168 proc do_import_test {} {
169 set testname "importbug.s: Test for bug in .import directive (part2)"
172 if [gas_test_old "importbug.s" "" "Test for bug in .import directive (part1)"] {
173 objdump_start_no_subdir "a.out" "--syms"
177 -re "\[^\n\]*.DATA..foo\[^\n\]*\n" { set x 1 }
178 -re "\[^\n\]*.data.*foo\[^\n\]*\n" { set x 1 }
180 timeout { perror "timeout\n"; break }
185 # This was intended to do any cleanup necessary. It kinda looks like it
186 # isn't needed, but just in case, please keep it in for now.
189 # Did we find what we were looking for? If not, flunk it.
190 if [expr $x==1] then { pass $testname } else { fail $testname }
194 proc do_common_test {} {
195 set testname "common.s: Test for bug in .comm handling (part2)"
198 if [gas_test_old "common.s" "" "Test for bug in .comm handling (part1)"] {
199 objdump_start_no_subdir "a.out" "--syms"
203 -re "\[^\n\]*.COM.*common_symbol\[^\n\]*\n" { set x 1 }
205 timeout { perror "timeout\n"; break }
210 # This was intended to do any cleanup necessary. It kinda looks like it
211 # isn't needed, but just in case, please keep it in for now.
214 # Did we find what we were looking for? If not, flunk it.
215 if [expr $x==1] then { pass $testname } else { fail $testname }
219 if [istarget hppa*-*-*] then {
220 # Make sure subspace alignment requests from the subspace directives
222 do_subspace_align_test
224 # Make sure the correct labels end up in the symbol table
227 # GAS-1.36 choked on this file.
228 gas_test "labeldiffs.s" "" "" "Difference of labels"
230 # Test a recent bug where frag chaining wasn't working correctly.
233 # Test bug where switching between subspaces creates bogus alignments
236 # Test bug where switching between subspaces creates bogus alignments
239 # Test a problem where $global$ is defined, then used within the
241 setup_xfail hppa*-*-*
242 gas_test "globalbug.s" "" "" "Use \$global\$ in file which defines it"
244 # Test that importing a defined symbol doesn't screw up the symbol's
248 # Test for a buglet in the handling of common symbols
251 # Test for an off-by-2 bug in range check for conditional branches
252 gas_test_error "brlenbug.s" "" "Check for error(s) in branch length"