Change "error" to "perror" everywhere.
[external/binutils.git] / gas / testsuite / gas / hppa / unsorted / unsorted.exp
1 # Copyright (C) 1993 Free Software Foundation, Inc.
2
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.
7
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.
12
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., 675 Mass Ave, Cambridge, MA 02139, USA.  */
16
17 # Please email any bugs, comments, and/or additions to this file to:
18 # DejaGnu@cygnus.com
19
20 # Written by the Center for Software Science at the University of Utah
21 # and by Cygnus Support.
22
23 proc do_subspace_align_test {} {
24     set testname "ss_align.s: Test subspace alignment (part 2)"
25     set x 0
26
27     if [gas_test_old "ss_align.s" "" "subspace alignment (part 1)"] then {
28         objdump_start_no_subdir "a.out" "-h"
29
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 {
33             while 1 {
34                 expect {
35                     -re "data\[^\n\]*align 2..6\[^\n\]*\n"      { set x 1 }
36                     -re "\[^\n\]*\n"                            { }
37                     timeout                     { perror "timeout\n"; break }
38                     eof                         { break }
39                 }
40             }
41         } else {
42             while 1 {
43                 expect  {
44                     -re "DATA\[^\n\]*align 2..6\[^\n\]*\n"      { set x 1 }
45                     -re "\[^\n\]*\n"                            { }
46                     timeout                     { perror "timeout\n"; break }
47                     eof                         { break }
48                 }
49             }
50         }
51
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.
54         objdump_finish
55
56         # Did we find what we were looking for?  If not, flunk it.
57         if [expr $x==1] then { pass $testname } else { fail $testname }
58     }
59 }
60
61 proc do_local_label_test {} {
62     set testname "locallabel.s: Elimination of local labels (part 2)"
63     set x 0
64
65     if [gas_test_old "locallabel.s" "" "Elimination of local labels (part1)"] {
66         objdump_start_no_subdir "a.out" "-t"
67
68         while 1 {
69             expect {
70                 -re "^00000000\[^\n\]*Label\[^\n\]*\n"          { set x 1 }
71                 -re "^00000000\[^\n\]*L\$01234\[^\n\]*\n"       { set x 0 }
72                 -re "\[^\n\]*\n"                                { }
73                 timeout                         { perror "timeout\n"; break }
74                 eof                             { break }
75             }
76         }
77
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.
80         objdump_finish
81
82         # Did we find what we were looking for?  If not, flunk it.
83         if [expr $x==1] then { pass $testname } else { fail $testname }
84     }
85 }
86
87 proc do_frchain_test {} {
88     set testname "fragbug.s: Test bug in frag chaining (part 2)"
89     set x 0
90
91     if [gas_test_old "fragbug.s" "" "Test bug in frag chaining (part1)"] {
92         objdump_start_no_subdir "a.out" "-d"
93
94         while 1 {
95             expect {
96                 -re "^00000000\[^\n\]*nop\[^\n\]*\n"            { set x 1 }
97                 -re "^00000004\[^\n\]*nop\[^\n\]*\n"            { set x 0 }
98                 -re "\[^\n\]*\n"                                { }
99                 timeout                         { perror "timeout\n"; break }
100                 eof                             { break }
101             }
102         }
103
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.
106         objdump_finish
107
108         # Did we find what we were looking for?  If not, flunk it.
109         if [expr $x==1] then { pass $testname } else { fail $testname }
110     }
111 }
112
113 proc do_align3_test {} {
114     set testname "align3.s: Test for alignment bug when switching subspaces (part2)"
115     set x 0
116
117     if [gas_test_old "align3.s" "" "Test for alignment bug when switching subspaces (part1)"] {
118         objdump_start_no_subdir "a.out" "-d"
119
120         while 1 {
121             expect {
122                 -re "\[^\n\]* <main> nop\[^\n\]*\n"             { set x 1 }
123                 -re "\[^\n\]* <main+.*> nop\[^\n\]*\n"          { set x 0 }
124                 -re "\[^\n\]*\n"                                { }
125                 timeout                         { perror "timeout\n"; break }
126                 eof                             { break }
127             }
128         }
129
130         # This was intended to do any cleanup necessary.  It kinda looks like it
131         # isn't needed, but just in case, please keep it in for now.
132         objdump_finish
133
134         # Did we find what we were looking for?  If not, flunk it.
135         if [expr $x==1] then { pass $testname } else { fail $testname }
136     }
137 }
138
139 if [istarget hppa*-*-*] then {
140     # Make sure subspace alignment requests from the subspace directives
141     # are honored
142     do_subspace_align_test
143
144     # Make sure the correct labels end up in the symbol table
145     do_local_label_test
146
147     # GAS-1.36 choked on this file.
148     gas_test "labeldiffs.s" "" "" "Difference of labels"
149
150     # Test a recent bug where frag chaining wasn't working correctly.
151     do_frchain_test
152
153     # Test bug where switching between subspaces creates bogus alignments
154 ;    do_align3_test
155 }
156