1 # Copyright (C) 1993-2016 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 3 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., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, 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_string_tests {} {
24 set testname "stringer.s: Test embedded quotes and octal escapes in strings"
27 gas_start "stringer.s" "-al"
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).
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] }
41 timeout { perror "timeout\n"; break }
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.
50 # Did we find what we were looking for? If not, flunk it.
51 if [expr $x==6] then { pass $testname } else { fail $testname }
54 proc do_lsel_test {} {
55 set testname "lselbugs.s: lselbug"
58 gas_start "lselbug.s" "-al"
60 # Make sure we correctly handle field selectors.
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] }
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==4] then { pass $testname } else { fail $testname }
81 proc do_valid_align_tests {} {
82 set testname "align1.s: valid alignment tests"
85 gas_start "align1.s" "-al"
87 # Make sure we correctly handle field selectors.
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"
95 -re "^ +\[0-9\]+ 0400\[^\n\]*BLOCK\[^\n\]*1024\[^\n\]*\n"
97 -re "^ +\[0-9\]+ 0800\[^\n\]*BLOCK\[^\n\]*4\[^\n\]*\n"
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] }
108 timeout { perror "timeout\n"; break }
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.
117 # Did we find what we were looking for? If not, flunk it.
118 if [expr $x==10] then { pass $testname } else { fail $testname }
121 if [istarget hppa*-*-*] then {
122 if { ![istarget hppa*-*-linux*]
123 && ![istarget hppa*-*-netbsd*] } {
124 # GAS-2.0 does not always parse ! as a line separator when it should.
125 setup_xfail hppa*-*-*
127 gas_test "linesepbug.s" "" "" "line separator bug"
129 # Make sure GAS accepts syntax for accessing static data.
130 gas_test "global.s" "" "" "check for sym-\$global\$ acceptance"
132 # GAS-2.0 (and 1.36 for that matter) can not handle a .proc which
133 # has no label before it.
134 gas_test "procbug.s" "" "" "Label following .proc"
136 # One is required to explicitly IMPORT any non-local symbol used
137 # in an assembly file. Make sure we give an error if we use
138 # an undefined symbol.
139 setup_xfail hppa*-*-*
140 gas_test_error "undefbug.s" "" "Check for error when using undefined symbol"
142 # This file has code and assembler directives before switching into any
143 # space/subspace pair. This should report an error for SOM (it is not
144 # an error for ELF. The file also has mismatched entry/exit and
145 # proc/procend pairs which are errors for both SOM and ELF.
146 gas_test_error "nosubspace.s" "" "Check for error(s) in input file "
148 # This file should return errors for both the ENTRY_GR and ENTRY_FR
149 # directives (they are out-of-range)
150 gas_test_error "entrybug.s" "" "Check for error on entry_gr and entry_fr"
152 # Make sure embedded quotes and octal escapes in strings work
155 # Make sure we do not die on a .version directive
156 gas_test "versionbug.s" "" "" ".version directive"
158 # Make sure we give an error on a bogus .space directive.
159 # recent version of gas2 went into infinite loops printing
160 # errors on this test.
161 gas_test_error "spacebug.s" "" "Check for error on bogus .space directive"
163 # GAS should give an error for this test.
164 gas_test_error "calldatabug.s" "" "Check for invalid aguments on .call"
166 # Old versions of gas incorrectly gave errors on some valid .EXPORT lines
167 gas_test "exportbug.s" "" "" "syntax check for an old .EXPORT bug"
169 # Old versions of gas choked on this file for some reason
170 gas_test "fixup7bug.s" "" "" "check for old \"fixup7\" gas bug"
172 # Test an L% selector parsing bug which existed in gas-1.36
175 # First check how some valid alignments are handled.
178 # Now check to make sure an invalid argument is flagged as an error.
179 gas_test_error "align2.s" "" "Check for error on bogus argument to .align"
181 gas_test "block1.s" "" "" "Check min/max values for .block"
183 # Now check for an invalid argument
184 gas_test_error "block2.s" "" "Check for error on bogus argument to .block"
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"
190 # Bad things happen in the PA ELF backend (others too?) if a non-default
191 # section is created...
192 setup_xfail "hppa*-*-*elf*" "hppa*-*-linux*" "hppa*64*-*-*"
193 gas_test "ssbug.s" "" "" "Check for acceptance of non-default subspaces"
195 # To be compatible 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"
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"
203 # Make sure GAS will accept a label without a colon.
204 setup_xfail "hppa*-*-linux*"
205 gas_test "labelbug.s" "" "" "Test label without colon"
207 # Make sure we grok # line directives.
208 gas_test "appbug.s" "" "" "Test acceptance of #line directives"
210 # Make sure we give errors if a floating point format is specified
211 # for an xmpyu instruction (integer multiple)
212 gas_test_error "xmpyubug.s" "" "Check for error on bogus argument to xmpyu"
214 # Make sure gas handles various kinds of .reg pseudo-ops
215 gas_test "regpopbug.s" "" "" "Test for bugs in .reg pseudo-op"
217 # Check some bugs that have appeared in parsing .callinfo directives
218 gas_test "callinfobug.s" "" "" "Test for bugs in .callinfo directive"
220 # Check for bogus registers in single precision fmpyadd/fmpysub
222 gas_test_error "badfmpyadd.s" "" "Check for error on bad fmpyadd insn"
224 # Make sure we grok spaces in directives.
225 gas_test "space.s" "" "" "Test acceptance of spaces in directives"