2 # Copyright 1997 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 2 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 # Please email any bugs, comments, and/or additions to this file to:
19 # bug-gdb@prep.ai.mit.edu
21 # This file was written by Jeff Law. (law@cygnus.com)
27 if ![istarget "mn10200*-*-*"] {
28 verbose "Tests ignored for all but mn10200 based targets."
36 set testfile "mn10200"
37 set srcfile ${srcdir}/${subdir}/${testfile}.s
38 set binfile ${objdir}/${subdir}/${testfile}
39 if { [gdb_compile "${srcfile}" "${binfile}" executable ""] != "" } {
40 gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
48 send_gdb "x/12i add_tests\n"
63 .*$gdb_prompt $" { pass "add tests" }
64 -re "$gdb_prompt $" { fail "add tests" }
65 timeout { fail "(timeout) add tests" }
74 send_gdb "x/15i bCC_tests\n"
77 .*beq 0x\[0-9a-f]+ <bCC_tests>.*
78 .*bne 0x\[0-9a-f]+ <bCC_tests>.*
79 .*bgt 0x\[0-9a-f]+ <bCC_tests>.*
80 .*bge 0x\[0-9a-f]+ <bCC_tests>.*
81 .*ble 0x\[0-9a-f]+ <bCC_tests>.*
82 .*blt 0x\[0-9a-f]+ <bCC_tests>.*
83 .*bhi 0x\[0-9a-f]+ <bCC_tests>.*
84 .*bcc 0x\[0-9a-f]+ <bCC_tests>.*
85 .*bls 0x\[0-9a-f]+ <bCC_tests>.*
86 .*bcs 0x\[0-9a-f]+ <bCC_tests>.*
87 .*bvc 0x\[0-9a-f]+ <bCC_tests>.*
88 .*bvs 0x\[0-9a-f]+ <bCC_tests>.*
89 .*bnc 0x\[0-9a-f]+ <bCC_tests>.*
90 .*bns 0x\[0-9a-f]+ <bCC_tests>.*
91 .*bra 0x\[0-9a-f]+ <bCC_tests>.*
92 .*$gdb_prompt $" { pass "bCC tests" }
93 -re "$gdb_prompt $" { fail "bCC tests" }
94 timeout { fail "(timeout) bCC tests" }
103 send_gdb "x/14i bCCx_tests\n"
106 .*beqx 0x\[0-9a-f]+ <bCCx_tests>.*
107 .*bnex 0x\[0-9a-f]+ <bCCx_tests>.*
108 .*bgtx 0x\[0-9a-f]+ <bCCx_tests>.*
109 .*bgex 0x\[0-9a-f]+ <bCCx_tests>.*
110 .*blex 0x\[0-9a-f]+ <bCCx_tests>.*
111 .*bltx 0x\[0-9a-f]+ <bCCx_tests>.*
112 .*bhix 0x\[0-9a-f]+ <bCCx_tests>.*
113 .*bccx 0x\[0-9a-f]+ <bCCx_tests>.*
114 .*blsx 0x\[0-9a-f]+ <bCCx_tests>.*
115 .*bcsx 0x\[0-9a-f]+ <bCCx_tests>.*
116 .*bvcx 0x\[0-9a-f]+ <bCCx_tests>.*
117 .*bvsx 0x\[0-9a-f]+ <bCCx_tests>.*
118 .*bncx 0x\[0-9a-f]+ <bCCx_tests>.*
119 .*bnsx 0x\[0-9a-f]+ <bCCx_tests>.*
120 .*$gdb_prompt $" { pass "bCCx tests" }
121 -re "$gdb_prompt $" { fail "bCCx tests" }
122 timeout { fail "(timeout) bCCx tests" }
131 send_gdb "x/4 bit_tests\n"
138 .*$gdb_prompt $" { pass "bit tests" }
139 -re "$gdb_prompt $" { fail "bit tests" }
140 timeout { fail "(timeout) bit tests" }
149 send_gdb "x/9i cmp_tests\n"
161 .*$gdb_prompt $" { pass "cmp tests" }
162 -re "$gdb_prompt $" { fail "cmp tests" }
163 timeout { fail "(timeout) cmp tests" }
167 proc extend_tests { } {
172 send_gdb "x/5i extend_tests\n"
180 .*$gdb_prompt $" { pass "extend tests" }
181 -re "$gdb_prompt $" { fail "extend tests" }
182 timeout { fail "(timeout) extend tests" }
186 proc logical_tests { } {
191 send_gdb "x/11i logical_tests\n"
205 .*$gdb_prompt $" { pass "logical tests" }
206 -re "$gdb_prompt $" { fail "logical tests" }
207 timeout { fail "(timeout) logical tests" }
211 proc mov_tests_1 { } {
216 send_gdb "x/12i mov_tests_1\n"
228 .*mov \\(8,a2\\),d1.*
229 .*mov \\(256,a2\\),d1.*
230 .*mov \\(131071,a2\\),d1.*
231 .*$gdb_prompt $" { pass "mov1 tests" }
232 -re "$gdb_prompt $" { fail "mov1 tests" }
233 timeout { fail "(timeout) mov1 tests" }
237 proc mov_tests_2 { } {
242 send_gdb "x/9 mov_tests_2\n"
245 .*mov \\(d1,a1\\),d2.*
246 .*mov \\(0x8000.*\\),d1.*
247 .*mov \\(0x1ffff.*\\),d1.*
248 .*mov \\(8,a2\\),a1.*
249 .*mov \\(256,a2\\),a1.*
250 .*mov \\(131071,a2\\),a1.*
251 .*mov \\(d1,a1\\),a2.*
252 .*mov \\(0x8000.*\\),a1.*
253 .*mov \\(0x1ffff.*\\),a1.*
254 .*$gdb_prompt $" { pass "mov2 tests" }
255 -re "$gdb_prompt $" { fail "mov2 tests" }
256 timeout { fail "(timeout) mov2 tests" }
260 proc mov_tests_3 { } {
265 send_gdb "x/10 mov_tests_3\n"
269 .*mov d1,\\(32,a2\\).*
270 .*mov d1,\\(256,a2\\).*
271 .*mov d1,\\(131071,a2\\).*
272 .*mov d1,\\(d2,a2\\).*
273 .*mov d1,\\(0x80.*\\).*
274 .*mov d1,\\(0x1ffff.*\\).*
275 .*mov a1,\\(32,a2\\).*
276 .*mov a1,\\(256,a2\\).*
277 .*mov a1,\\(131071,a2\\).*
278 .*$gdb_prompt $" { pass "mov3 tests" }
279 -re "$gdb_prompt $" { fail "mov3 tests" }
280 timeout { fail "(timeout) mov3 tests" }
284 proc mov_tests_4 { } {
289 send_gdb "x/8 mov_tests_4\n"
292 .*mov a1,\\(d2,a2\\).*
293 .*mov a1,\\(0x80.*\\).*
294 .*mov a1,\\(0x1ffff.*\\).*
300 .*$gdb_prompt $" { pass "mov4 tests" }
301 -re "$gdb_prompt $" { fail "mov4 tests" }
302 timeout { fail "(timeout) mov4 tests" }
306 proc movb_tests { } {
311 send_gdb "x/12 movb_tests\n"
314 .*movb \\(8,a2\\),d1.*
315 .*movb \\(256,a2\\),d1.*
316 .*movb \\(131071,a2\\),d1.*
317 .*movb \\(d2,a2\\),d3.*
318 .*movb \\(0x1ffff.*\\),d2.*
320 .*movb d1,\\(8,a2\\).*
321 .*movb d1,\\(256,a2\\).*
322 .*movb d1,\\(131071,a2\\).*
323 .*movb d1,\\(d2,a2\\).*
324 .*movb d1,\\(0x100.*\\).*
325 .*movb d1,\\(0x1ffff.*\\).*
326 .*$gdb_prompt $" { pass "movb tests" }
327 -re "$gdb_prompt $" { fail "movb tests" }
328 timeout { fail "(timeout) movb tests" }
332 proc movbu_tests { } {
337 send_gdb "x/7 movbu_tests\n"
340 .*movbu \\(a2\\),d1.*
341 .*movbu \\(8,a2\\),d1.*
342 .*movbu \\(256,a2\\),d1.*
343 .*movbu \\(131071,a2\\),d1.*
344 .*movbu \\(d1,a1\\),d2.*
345 .*movbu \\(0x8000.*\\),d1.*
346 .*movbu \\(0x1ffff.*\\),d1.*
347 .*$gdb_prompt $" { pass "movbu tests" }
348 -re "$gdb_prompt $" { fail "movbu tests" }
349 timeout { fail "(timeout) movbu tests" }
353 proc movx_tests { } {
358 send_gdb "x/6 movx_tests\n"
361 .*movx \\(8,a2\\),d1.*
362 .*movx \\(256,a2\\),d1.*
363 .*movx \\(131071,a2\\),d1.*
364 .*movx d1,\\(8,a2\\).*
365 .*movx d1,\\(256,a2\\).*
366 .*movx d1,\\(131071,a2\\).*
367 .*$gdb_prompt $" { pass "movx tests" }
368 -re "$gdb_prompt $" { fail "movx tests" }
369 timeout { fail "(timeout) movx tests" }
373 proc muldiv_tests { } {
378 send_gdb "x/3 muldiv_tests\n"
384 .*$gdb_prompt $" { pass "muldiv tests" }
385 -re "$gdb_prompt $" { fail "muldiv tests" }
386 timeout { fail "(timeout) muldiv tests" }
390 proc misc_tests { } {
395 send_gdb "x/9 misc_tests\n"
398 .*jmp 0x\[0-9a-f]+ <main>.*
399 .*jmp 0x\[0-9a-f]+ <start>.*
401 .*jsr 0x\[0-9a-f]+ <main>.*
402 .*jsr 0x\[0-9a-f]+ <start>.*
407 .*$gdb_prompt $" { pass "misc tests" }
408 -re "$gdb_prompt $" { fail "misc tests" }
409 timeout { fail "(timeout) misc tests" }
413 proc shift_tests { } {
418 send_gdb "x/4i shift_tests\n"
425 .*$gdb_prompt $" { pass "shift tests" }
426 -re "$gdb_prompt $" { fail "shift tests" }
427 timeout { fail "(timeout) shift tests" }
436 send_gdb "x/9i sub_tests\n"
448 .*$gdb_prompt $" { pass "sub tests" }
449 -re "$gdb_prompt $" { fail "sub tests" }
450 timeout { fail "(timeout) sub tests" }
454 # Start with a fresh gdb.
458 gdb_reinitialize_dir $srcdir/$subdir