Commit | Line | Data |
---|---|---|
7b5b8e51 JL |
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_string_tests {} { | |
24 | set testname "stringer.s: Test embedded quotes and octal escapes in strings" | |
25 | set x 0 | |
26 | ||
27 | gas_start "stringer.s" "-al" | |
28 | ||
29 | # Instead of having a variable for each match string just increment the | |
30 | # total number of matches seen. That's simpler when testing large numbers | |
31 | # of instructions (as these tests to). | |
32 | while 1 { | |
33 | expect { | |
34 | -re "^ +\[0-9\]+ 0000 23696E63\[^\n\]*\n" { set x [expr $x+1] } | |
35 | -re "^ +\[0-9\]+ 6C756465\[^\n\]*\n" { set x [expr $x+1] } | |
36 | -re "^ +\[0-9\]+ 6B2E6465\[^\n\]*\n" { set x [expr $x+1] } | |
37 | -re "^ +\[0-9\]+ 66220A00\[^\n\]*\n" { set x [expr $x+1] } | |
38 | -re "^ +\[0-9\]+ 0014 09307831\[^\n\]*\n" { set x [expr $x+1] } | |
39 | -re "^ +\[0-9\]+ 3233\[^\n\]*\n" { set x [expr $x+1] } | |
40 | -re "\[^\n\]*\n" { } | |
41 | timeout { error "timeout\n"; break } | |
42 | eof { break } | |
43 | } | |
44 | } | |
45 | ||
46 | # This was intended to do any cleanup necessary. It kinda looks like it | |
47 | # isn't needed, but just in case, please keep it in for now. | |
48 | gas_finish | |
49 | ||
50 | # Did we find what we were looking for? If not, flunk it. | |
51 | if [expr $x==6] then { pass $testname } else { fail $testname } | |
52 | } | |
53 | ||
54 | proc do_lsel_test {} { | |
55 | set testname "lselbugs.s: lselbug" | |
56 | set x 0 | |
57 | ||
58 | gas_start "lselbug.s" "-al" | |
59 | ||
60 | # Make sure we correctly handle field selectors. | |
61 | while 1 { | |
62 | expect { | |
63 | -re "^ +\[0-9\]+ 0000 22A04000\[^\n\]*\n" { set x [expr $x+1] } | |
64 | -re "^ +\[0-9\]+ 0004 36B50100\[^\n\]*\n" { set x [expr $x+1] } | |
65 | -re "^ +\[0-9\]+ 0008 22A04000\[^\n\]*\n" { set x [expr $x+1] } | |
66 | -re "^ +\[0-9\]+ 000c 36B50100\[^\n\]*\n" { set x [expr $x+1] } | |
67 | -re "\[^\n\]*\n" { } | |
68 | timeout { error "timeout\n"; break } | |
69 | eof { break } | |
70 | } | |
71 | } | |
72 | ||
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. | |
75 | gas_finish | |
76 | ||
77 | # Did we find what we were looking for? If not, flunk it. | |
78 | if [expr $x==4] then { pass $testname } else { fail $testname } | |
79 | } | |
80 | ||
81 | proc do_valid_align_tests {} { | |
82 | set testname "align1.s: valid alignment tests" | |
83 | set x 0 | |
84 | ||
85 | gas_start "align1.s" "-al" | |
86 | ||
87 | # Make sure we correctly handle field selectors. | |
88 | while 1 { | |
89 | expect { | |
90 | -re "^ +\[0-9\]+ 0000 08000240\[^\n\]*\n" { set x [expr $x+1] } | |
91 | -re "^ +\[0-9\]+ 0008 08000240\[^\n\]*\n" { set x [expr $x+1] } | |
92 | -re "^ +\[0-9\]+ 1000 08000240\[^\n\]*\n" { set x [expr $x+1] } | |
93 | -re "^ +\[0-9\]+ 0000\[^\n\]*BLOCK\[^\n\]*1024\[^\n\]*\n" | |
94 | { set x [expr $x+1] } | |
95 | -re "^ +\[0-9\]+ 0400\[^\n\]*BLOCK\[^\n\]*1024\[^\n\]*\n" | |
96 | { set x [expr $x+1] } | |
97 | -re "^ +\[0-9\]+ 0800\[^\n\]*BLOCK\[^\n\]*4\[^\n\]*\n" | |
98 | { set x [expr $x+1] } | |
99 | -re "^ +\[0-9\]+ 0804\[^\n\]*ALIGN\[^\n\]*8\[^\n\]*\n" | |
100 | { set x [expr $x+1] } | |
101 | -re "^ +\[0-9\]+ 0808\[^\n\]*BLOCK\[^\n\]*30\[^\n\]*\n" | |
102 | { set x [expr $x+1] } | |
103 | -re "^ +\[0-9\]+ 0826\[^\n\]*ALIGN\[^\n\]*4\[^\n\]*\n" | |
104 | { set x [expr $x+1] } | |
105 | -re "^ +\[0-9\]+ 0828\[^\n\]*BLOCK\[^\n\]*4\[^\n\]*\n" | |
106 | { set x [expr $x+1] } | |
107 | -re "\[^\n\]*\n" { } | |
108 | timeout { error "timeout\n"; break } | |
109 | eof { break } | |
110 | } | |
111 | } | |
112 | ||
113 | # This was intended to do any cleanup necessary. It kinda looks like it | |
114 | # isn't needed, but just in case, please keep it in for now. | |
115 | gas_finish | |
116 | ||
117 | # Did we find what we were looking for? If not, flunk it. | |
118 | if [expr $x==10] then { pass $testname } else { fail $testname } | |
119 | } | |
120 | ||
121 | if [istarget hppa*-*-*] then { | |
122 | # GAS-2.0 does not always parse ! as a line separator when it should. | |
123 | setup_xfail hppa*-*-* | |
124 | gas_test "linesepbug.s" "" "" "line separator bug" | |
125 | ||
126 | # Make sure GAS accepts syntax for accessing static data. | |
127 | gas_test "global.s" "" "" "check for sym-\$global\$ acceptance" | |
128 | ||
129 | # GAS-2.0 (and 1.36 for that matter) can not handle a .proc which | |
130 | # has no label before it. | |
7b5b8e51 JL |
131 | gas_test "procbug.s" "" "" "Label following .proc" |
132 | ||
133 | # One is required to explicitly IMPORT any non-local symbol used | |
134 | # in an assembly file. Make sure we give an error if we use | |
135 | # an undefined symbol. | |
136 | setup_xfail hppa*-*-* | |
137 | gas_test_error "undefbug.s" "" "Check for error when using undefined symbol" | |
138 | ||
139 | # This file has code and assembler directives before switching into any | |
140 | # space/subspace pair. This should report an error. | |
25631628 JL |
141 | if ![istarget hppa*-*-*elf*] then { |
142 | setup_xfail hppa*-*-* | |
143 | } | |
7b5b8e51 JL |
144 | gas_test_error "nosubspace.s" "" "Check for error if no subspace directive" |
145 | ||
146 | # This file should return errors for both the ENTRY_GR and ENTRY_FR | |
147 | # directives (they are out-of-range) | |
148 | gas_test_error "entrybug.s" "" "Check for error on entry_gr and entry_fr" | |
149 | ||
150 | # Make sure embedded quotes and octal escapes in strings work | |
151 | do_string_tests | |
152 | ||
153 | # Make sure we do not die on a .version directive | |
154 | gas_test "versionbug.s" "" "" ".version directive" | |
155 | ||
156 | # Make sure we give an error on a bogus .space directive. | |
157 | # recent version of gas2 went into infinite loops printing | |
158 | # errors on this test. | |
159 | gas_test_error "spacebug.s" "" "Check for error on bogus .space directive" | |
160 | ||
161 | # GAS should give an error for this test. | |
162 | gas_test_error "calldatabug.s" "" "Check for invalid aguments on .call" | |
163 | ||
164 | # Old versions of gas incorrectly gave errors on some valid .EXPORT lines | |
165 | gas_test "exportbug.s" "" "" "syntax check for an old .EXPORT bug" | |
166 | ||
167 | # Old versions of gas choked on this file for some reason | |
168 | gas_test "fixup7bug.s" "" "" "check for old \"fixup7\" gas bug" | |
169 | ||
170 | # Test an L% selector parsing bug which existed in gas-1.36 | |
171 | do_lsel_test | |
172 | ||
173 | # First check how some valid alignments are handled. | |
174 | do_valid_align_tests | |
175 | ||
176 | # Now check to make sure an invalid argument is flagged as an error. | |
177 | gas_test_error "align2.s" "" "Check for error on bogus argument to .align" | |
178 | ||
179 | # GAS can't handle upper bound for a PA .block[z] directive | |
180 | setup_xfail hppa*-*-* | |
762df61d | 181 | gas_test "block1.s" "" "" "Check min/max values for .block" |
7b5b8e51 JL |
182 | |
183 | # Now check for an invalid argument | |
762df61d | 184 | gas_test_error "block2.s" "" "Check for error on bogus argument to .block" |
7b5b8e51 JL |
185 | |
186 | # GAS-1.36 choked on this file. | |
187 | # FIXME. Should check relocations made for this test! | |
188 | gas_test "exprbug.s" "" "" "Check for sym1-sym2 acceptance" | |
03cc338b JL |
189 | |
190 | # Bad things happen in the PA ELF backend (others too?) if a non-default | |
191 | # section is created... | |
a2f0b507 | 192 | setup_xfail hppa*-*-*elf* |
03cc338b | 193 | gas_test "ssbug.s" "" "" "Check for acceptance of non-default subspaces" |
9ac55bec JL |
194 | |
195 | # To be compatable with certain "features" of the HP compiler | |
196 | # non-existant registers should default to %r0. | |
197 | gas_test "defbug.s" "" "" "Missing register should default to %%r0" | |
198 | ||
199 | # Make sure GAS understands a reasonable set of standard predefined | |
200 | # registers. eg %rp, %dp, %sp, etc. | |
201 | gas_test "stdreg.s" "" "" "Test standard predefined registers" | |
1421609c JL |
202 | |
203 | # Make sure GAS will accept a label without a colon. | |
204 | gas_test "labelbug.s" "" "" "Test label without colon" | |
6e4eda33 JL |
205 | |
206 | # Make sure we grok # line directives. | |
207 | gas_test "appbug.s" "" "" "Test acceptance of #line directives" | |
4fc3b3b4 JL |
208 | |
209 | # Make sure we give errors if a floating point format is specified | |
210 | # for an xmpyu instruction (integer multiple) | |
211 | gas_test_error "xmpyubug.s" "" "Check for error on bogus argument to .block" | |
7b5b8e51 JL |
212 | } |
213 |