1 # Copyright (C) 1996, 2002, 2003, 2004, 2005, 2007
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 3 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 Cygnus Support.
24 set testname "arith.s: Arithmetic operations"
27 gas_start "arith.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).
32 # -re "^ +\[0-9\]+ 0000 489A0000\[^\n\]*\n" { set x [expr $x+1] }
35 -re "^ +\[0-9\]+ 0000 C531\[^\n\]*\n" { set x [expr $x+1] }
36 -re "^ +\[0-9\]+ 0002 4532\[^\n\]*\n" { set x [expr $x+1] }
37 -re "^ +\[0-9\]+ 0004 05360700\[^\n\]*\n" { set x [expr $x+1] }
38 -re "^ +\[0-9\]+ 0008 4530\[^\n\]*\n" { set x [expr $x+1] }
39 -re "^ +\[0-9\]+ 000a E530\[^\n\]*\n" { set x [expr $x+1] }
40 -re "^ +\[0-9\]+ 000c E532\[^\n\]*\n" { set x [expr $x+1] }
41 -re "^ +\[0-9\]+ 000e E5360700\[^\n\]*\n" { set x [expr $x+1] }
42 -re "^ +\[0-9\]+ 0012 E537A000\[^\n\]*\n" { set x [expr $x+1] }
43 -re "^ +\[0-9\]+ 0016 BF32\[^\n\]*\n" { set x [expr $x+1] }
44 -re "^ +\[0-9\]+ 0018 C530\[^\n\]*\n" { set x [expr $x+1] }
45 -re "^ +\[0-9\]+ 001a 2532\[^\n\]*\n" { set x [expr $x+1] }
46 -re "^ +\[0-9\]+ 001c A530\[^\n\]*\n" { set x [expr $x+1] }
47 -re "^ +\[0-9\]+ 001e 65360700\[^\n\]*\n" { set x [expr $x+1] }
48 -re "^ +\[0-9\]+ 0022 8530\[^\n\]*\n" { set x [expr $x+1] }
49 -re "^ +\[0-9\]+ 0024 E537C000\[^\n\]*\n" { set x [expr $x+1] }
50 -re "^ +\[0-9\]+ 0028 DF32\[^\n\]*\n" { set x [expr $x+1] }
51 -re "^ +\[0-9\]+ 002a E5378000\[^\n\]*\n" { set x [expr $x+1] }
52 -re "^ +\[0-9\]+ 002e 9F32\[^\n\]*\n" { set x [expr $x+1] }
53 -re "^ +\[0-9\]+ 0030 A531\[^\n\]*\n" { set x [expr $x+1] }
54 -re "^ +\[0-9\]+ 0032 8531\[^\n\]*\n" { set x [expr $x+1] }
56 timeout { perror "timeout\n"; break }
61 # This was intended to do any cleanup necessary. It kinda looks like it
62 # isn't needed, but just in case, please keep it in for now.
65 # Did we find what we were looking for? If not, flunk it.
66 if [expr $x==20] then { pass $testname } else { fail $testname }
70 set testname "bit.s: bit operations"
73 gas_start "bit.s" "-al"
75 # Instead of having a variable for each match string just increment the
76 # total number of matches seen. That's simpler when testing large numbers
77 # of instructions (as these tests to).
80 -re "^ +\[0-9\]+ 0000 C6AF1000\[^\n\]*\n" { set x [expr $x+1] }
81 -re "^ +\[0-9\]+ 0004 C66F1000\[^\n\]*\n" { set x [expr $x+1] }
82 -re "^ +\[0-9\]+ 0008 C62F1000\[^\n\]*\n" { set x [expr $x+1] }
83 -re "^ +\[0-9\]+ 000c C6EF1000\[^\n\]*\n" { set x [expr $x+1] }
85 timeout { perror "timeout\n"; break }
90 # This was intended to do any cleanup necessary. It kinda looks like it
91 # isn't needed, but just in case, please keep it in for now.
94 # Did we find what we were looking for? If not, flunk it.
95 if [expr $x==4] then { pass $testname } else { fail $testname }
99 set testname "branch.s: branch operations"
102 gas_start "branch.s" "-al"
104 # Instead of having a variable for each match string just increment the
105 # total number of matches seen. That's simpler when testing large numbers
106 # of instructions (as these tests to).
109 -re "^ +\[0-9\]+ 0000 8F05\[^\n\]*\n" { set x [expr $x+1] }
110 -re "^ +\[0-9\]+ 0002 FEFD\[^\n\]*\n" { set x [expr $x+1] }
111 -re "^ +\[0-9\]+ 0004 E6FD\[^\n\]*\n" { set x [expr $x+1] }
112 -re "^ +\[0-9\]+ 0006 D7FD\[^\n\]*\n" { set x [expr $x+1] }
113 -re "^ +\[0-9\]+ 0008 CBFD\[^\n\]*\n" { set x [expr $x+1] }
114 -re "^ +\[0-9\]+ 000a B9FD\[^\n\]*\n" { set x [expr $x+1] }
115 -re "^ +\[0-9\]+ 000c A1FD\[^\n\]*\n" { set x [expr $x+1] }
116 -re "^ +\[0-9\]+ 000e 93FD\[^\n\]*\n" { set x [expr $x+1] }
117 -re "^ +\[0-9\]+ 0010 82FD\[^\n\]*\n" { set x [expr $x+1] }
118 -re "^ +\[0-9\]+ 0012 FAF5\[^\n\]*\n" { set x [expr $x+1] }
119 -re "^ +\[0-9\]+ 0014 E0F5\[^\n\]*\n" { set x [expr $x+1] }
120 -re "^ +\[0-9\]+ 0016 D8F5\[^\n\]*\n" { set x [expr $x+1] }
121 -re "^ +\[0-9\]+ 0018 C4F5\[^\n\]*\n" { set x [expr $x+1] }
122 -re "^ +\[0-9\]+ 001a BCF5\[^\n\]*\n" { set x [expr $x+1] }
123 -re "^ +\[0-9\]+ 001c A1F5\[^\n\]*\n" { set x [expr $x+1] }
124 -re "^ +\[0-9\]+ 001e 99F5\[^\n\]*\n" { set x [expr $x+1] }
125 -re "^ +\[0-9\]+ 0020 82F5\[^\n\]*\n" { set x [expr $x+1] }
126 -re "^ +\[0-9\]+ 0022 FAED\[^\n\]*\n" { set x [expr $x+1] }
127 -re "^ +\[0-9\]+ 0024 E5ED\[^\n\]*\n" { set x [expr $x+1] }
128 -re "^ +\[0-9\]+ 0026 DDED\[^\n\]*\n" { set x [expr $x+1] }
130 timeout { perror "timeout\n"; break }
135 # This was intended to do any cleanup necessary. It kinda looks like it
136 # isn't needed, but just in case, please keep it in for now.
139 # Did we find what we were looking for? If not, flunk it.
140 if [expr $x==20] then { pass $testname } else { fail $testname }
144 set testname "compare.s: compare operations"
147 gas_start "compare.s" "-al"
149 # Instead of having a variable for each match string just increment the
150 # total number of matches seen. That's simpler when testing large numbers
151 # of instructions (as these tests to).
154 -re "^ +\[0-9\]+ 0000 E531\[^\n\]*\n" { set x [expr $x+1] }
155 -re "^ +\[0-9\]+ 0002 6532\[^\n\]*\n" { set x [expr $x+1] }
156 -re "^ +\[0-9\]+ 0004 E02F0000\[^\n\]*\n" { set x [expr $x+1] }
157 -re "^ +\[0-9\]+ 0008 E82F0000\[^\n\]*\n" { set x [expr $x+1] }
158 -re "^ +\[0-9\]+ 000c E12F0000\[^\n\]*\n" { set x [expr $x+1] }
159 -re "^ +\[0-9\]+ 0010 E12F0000\[^\n\]*\n" { set x [expr $x+1] }
160 -re "^ +\[0-9\]+ 0014 E92F0000\[^\n\]*\n" { set x [expr $x+1] }
161 -re "^ +\[0-9\]+ 0018 E92F0000\[^\n\]*\n" { set x [expr $x+1] }
162 -re "^ +\[0-9\]+ 001c E22F0000\[^\n\]*\n" { set x [expr $x+1] }
163 -re "^ +\[0-9\]+ 0020 EA2F0000\[^\n\]*\n" { set x [expr $x+1] }
164 -re "^ +\[0-9\]+ 0024 E32F0000\[^\n\]*\n" { set x [expr $x+1] }
165 -re "^ +\[0-9\]+ 0028 EB2F0000\[^\n\]*\n" { set x [expr $x+1] }
166 -re "^ +\[0-9\]+ 002c E42F0000\[^\n\]*\n" { set x [expr $x+1] }
167 -re "^ +\[0-9\]+ 0030 E42F0000\[^\n\]*\n" { set x [expr $x+1] }
168 -re "^ +\[0-9\]+ 0034 EC2F0000\[^\n\]*\n" { set x [expr $x+1] }
169 -re "^ +\[0-9\]+ 0038 EC2F0000\[^\n\]*\n" { set x [expr $x+1] }
170 -re "^ +\[0-9\]+ 003c E52F0000\[^\n\]*\n" { set x [expr $x+1] }
171 -re "^ +\[0-9\]+ 0040 ED2F0000\[^\n\]*\n" { set x [expr $x+1] }
172 -re "^ +\[0-9\]+ 0044 E62F0000\[^\n\]*\n" { set x [expr $x+1] }
173 -re "^ +\[0-9\]+ 0048 EE2F0000\[^\n\]*\n" { set x [expr $x+1] }
174 -re "^ +\[0-9\]+ 004c E72F0000\[^\n\]*\n" { set x [expr $x+1] }
175 -re "^ +\[0-9\]+ 0050 EF2F0000\[^\n\]*\n" { set x [expr $x+1] }
176 -re "^ +\[0-9\]+ 0054 6531\[^\n\]*\n" { set x [expr $x+1] }
178 timeout { perror "timeout\n"; break }
183 # This was intended to do any cleanup necessary. It kinda looks like it
184 # isn't needed, but just in case, please keep it in for now.
187 # Did we find what we were looking for? If not, flunk it.
188 if [expr $x==23] then { pass $testname } else { fail $testname }
192 set testname "jumps.s: jumps operations"
195 gas_start "jumps.s" "-al"
197 # Instead of having a variable for each match string just increment the
198 # total number of matches seen. That's simpler when testing large numbers
199 # of instructions (as these tests to).
202 -re "^ +\[0-9\]+ 0000 802F0000\[^\n\]*\n" { set x [expr $x+1] }
203 -re "^ +\[0-9\]+ 0004 6500\[^\n\]*\n" { set x [expr $x+1] }
204 -re "^ +\[0-9\]+ 0006 BF07FAFF\[^\n\]*\n" { set x [expr $x+1] }
206 timeout { perror "timeout\n"; break }
211 # This was intended to do any cleanup necessary. It kinda looks like it
212 # isn't needed, but just in case, please keep it in for now.
215 # Did we find what we were looking for? If not, flunk it.
216 if [expr $x==3] then { pass $testname } else { fail $testname }
220 set testname "logical.s: logical operations"
223 gas_start "logical.s" "-al"
225 # Instead of having a variable for each match string just increment the
226 # total number of matches seen. That's simpler when testing large numbers
227 # of instructions (as these tests to).
230 -re "^ +\[0-9\]+ 0000 4531\[^\n\]*\n" { set x [expr $x+1] }
231 -re "^ +\[0-9\]+ 0002 C5360700\[^\n\]*\n" { set x [expr $x+1] }
232 -re "^ +\[0-9\]+ 0006 2530\[^\n\]*\n" { set x [expr $x+1] }
233 -re "^ +\[0-9\]+ 0008 0531\[^\n\]*\n" { set x [expr $x+1] }
234 -re "^ +\[0-9\]+ 000a 85360700\[^\n\]*\n" { set x [expr $x+1] }
235 -re "^ +\[0-9\]+ 000e 2531\[^\n\]*\n" { set x [expr $x+1] }
236 -re "^ +\[0-9\]+ 0010 A5360700\[^\n\]*\n" { set x [expr $x+1] }
238 timeout { perror "timeout\n"; break }
243 # This was intended to do any cleanup necessary. It kinda looks like it
244 # isn't needed, but just in case, please keep it in for now.
247 # Did we find what we were looking for? If not, flunk it.
248 if [expr $x==7] then { pass $testname } else { fail $testname }
252 set testname "mem.s: memory operations"
255 gas_start "mem.s" "-al"
257 # Instead of having a variable for each match string just increment the
258 # total number of matches seen. That's simpler when testing large numbers
259 # of instructions (as these tests to).
262 -re "^ +\[0-9\]+ 0000 05370500\[^\n\]*\n" { set x [expr $x+1] }
263 -re "^ +\[0-9\]+ 0004 25370400\[^\n\]*\n" { set x [expr $x+1] }
264 -re "^ +\[0-9\]+ 0008 25370500\[^\n\]*\n" { set x [expr $x+1] }
265 -re "^ +\[0-9\]+ 000c 4033\[^\n\]*\n" { set x [expr $x+1] }
266 -re "^ +\[0-9\]+ 000e 4034\[^\n\]*\n" { set x [expr $x+1] }
267 -re "^ +\[0-9\]+ 0010 4035\[^\n\]*\n" { set x [expr $x+1] }
268 -re "^ +\[0-9\]+ 0012 462F0500\[^\n\]*\n" { set x [expr $x+1] }
269 -re "^ +\[0-9\]+ 0016 662F0400\[^\n\]*\n" { set x [expr $x+1] }
270 -re "^ +\[0-9\]+ 001a 662F0500\[^\n\]*\n" { set x [expr $x+1] }
271 -re "^ +\[0-9\]+ 001e C033\[^\n\]*\n" { set x [expr $x+1] }
272 -re "^ +\[0-9\]+ 0020 C034\[^\n\]*\n" { set x [expr $x+1] }
273 -re "^ +\[0-9\]+ 0022 4135\[^\n\]*\n" { set x [expr $x+1] }
275 timeout { perror "timeout\n"; break }
280 # This was intended to do any cleanup necessary. It kinda looks like it
281 # isn't needed, but just in case, please keep it in for now.
284 # Did we find what we were looking for? If not, flunk it.
285 if [expr $x==12] then { pass $testname } else { fail $testname }
289 set testname "misc.s: misc operations"
292 gas_start "misc.s" "-al"
294 # Instead of having a variable for each match string just increment the
295 # total number of matches seen. That's simpler when testing large numbers
296 # of instructions (as these tests to).
299 -re "^ +\[0-9\]+ 0000 E0076001\[^\n\]*\n" { set x [expr $x+1] }
300 -re "^ +\[0-9\]+ 0004 E0876001\[^\n\]*\n" { set x [expr $x+1] }
301 -re "^ +\[0-9\]+ 0008 E0072001\[^\n\]*\n" { set x [expr $x+1] }
302 -re "^ +\[0-9\]+ 000c 0000\[^\n\]*\n" { set x [expr $x+1] }
303 -re "^ +\[0-9\]+ 000e E0074001\[^\n\]*\n" { set x [expr $x+1] }
304 -re "^ +\[0-9\]+ 0012 E0070001\[^\n\]*\n" { set x [expr $x+1] }
305 -re "^ +\[0-9\]+ 0016 FF070001\[^\n\]*\n" { set x [expr $x+1] }
306 -re "^ +\[0-9\]+ 001a E72F2000\[^\n\]*\n" { set x [expr $x+1] }
307 -re "^ +\[0-9\]+ 001e E53F4000\[^\n\]*\n" { set x [expr $x+1] }
309 timeout { perror "timeout\n"; break }
314 # This was intended to do any cleanup necessary. It kinda looks like it
315 # isn't needed, but just in case, please keep it in for now.
318 # Did we find what we were looking for? If not, flunk it.
319 if [expr $x==9] then { pass $testname } else { fail $testname }
323 set testname "move.s: move operations"
326 gas_start "move.s" "-al"
328 # Instead of having a variable for each match string just increment the
329 # total number of matches seen. That's simpler when testing large numbers
330 # of instructions (as these tests to).
333 -re "^ +\[0-9\]+ 0000 0530\[^\n\]*\n" { set x [expr $x+1] }
334 -re "^ +\[0-9\]+ 0002 0532\[^\n\]*\n" { set x [expr $x+1] }
335 -re "^ +\[0-9\]+ 0004 25360700\[^\n\]*\n" { set x [expr $x+1] }
336 -re "^ +\[0-9\]+ 0008 45360700\[^\n\]*\n" { set x [expr $x+1] }
338 timeout { perror "timeout\n"; break }
343 # This was intended to do any cleanup necessary. It kinda looks like it
344 # isn't needed, but just in case, please keep it in for now.
347 # Did we find what we were looking for? If not, flunk it.
348 if [expr $x==4] then { pass $testname } else { fail $testname }
352 set testname "hilo.s: hilo tests"
355 gas_start "hilo.s" "-al"
357 # Instead of having a variable for each match string just increment the
358 # total number of matches seen. That's simpler when testing large numbers
359 # of instructions (as these tests to).
362 -re "^ +\[0-9\]+ 0000 200EEFBE\[^\n\]*\n" { set x [expr $x+1] }
363 -re "^ +\[0-9\]+ 0004 410EAEDE\[^\n\]*\n" { set x [expr $x+1] }
364 -re "^ +\[0-9\]+ 0008 410EADDE\[^\n\]*\n" { set x [expr $x+1] }
366 timeout { perror "timeout\n"; break }
371 # This was intended to do any cleanup necessary. It kinda looks like it
372 # isn't needed, but just in case, please keep it in for now.
375 # Did we find what we were looking for? If not, flunk it.
376 if [expr $x==3] then { pass $testname } else { fail $testname }
380 proc do_simple_reloc_tests {} {
381 set testname "reloc.s: Test for proper relocations (part 2)"
384 if [gas_test_old "reloc.s" "" "Test for proper relocation (part 1)"] then {
385 objdump_start_no_subdir "a.out" "-r"
389 -re "^00000002\[^\n\]*R_V850_LO16\[^\n\]*\n"
390 { set x [expr $x+1] }
391 -re "^00000006\[^\n\]*R_V850_HI16_S\[^\n\]*\n"
392 { set x [expr $x+1] }
393 -re "^0000000a\[^\n\]*R_V850_HI16\[^\n\]*\n"
394 { set x [expr $x+1] }
395 -re "^0000000e\[^\n\]*R_V850_ZDA_16_16_OFFSET\[^\n\]*\n"
396 { set x [expr $x+1] }
397 -re "^00000012\[^\n\]*R_V850_TDA_16_16_OFFSET\[^\n\]*\n"
398 { set x [expr $x+1] }
399 -re "^00000016\[^\n\]*R_V850_SDA_16_16_OFFSET\[^\n\]*\n"
400 { set x [expr $x+1] }
402 timeout { perror "timeout\n"; break }
408 # This was intended to do any cleanup necessary. It kinda looks like it
409 # isn't needed, but just in case, please keep it in for now.
412 # Did we find what we were looking for? If not, flunk it.
413 if [expr $x==6] then { pass $testname } else { fail $testname }
416 if [istarget v850*-*-*] then {
417 # Test the basic instruction parser.
428 # Make sure we handle lo() hi() and hi0() correctly.
431 # Check for proper relocs on lo, hi, hi0, zdaoff, tdaoff and sdaoff
433 do_simple_reloc_tests
435 gas_test "hilo2.s" "" "" "hi/lo regression test"
436 gas_test "fepsw.s" "" "" "eqsw regression test"
438 gas_test_error "range.s" "-mwarn-signed-overflow" "Check for range error on byte load/store"
439 run_dump_test "v850e1"
440 run_dump_test "split-lo16"