2 # Copyright (C) 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 perror "Couldn't compile ${srcfile}"
49 send_gdb "x/12i add_tests\n"
64 .*$gdb_prompt $" { pass "add tests" }
65 -re "$gdb_prompt $" { fail "add tests" }
66 timeout { fail "(timeout) add tests" }
75 send_gdb "x/15i bCC_tests\n"
78 .*beq 0x\[0-9a-f]+ <bCC_tests>.*
79 .*bne 0x\[0-9a-f]+ <bCC_tests>.*
80 .*bgt 0x\[0-9a-f]+ <bCC_tests>.*
81 .*bge 0x\[0-9a-f]+ <bCC_tests>.*
82 .*ble 0x\[0-9a-f]+ <bCC_tests>.*
83 .*blt 0x\[0-9a-f]+ <bCC_tests>.*
84 .*bhi 0x\[0-9a-f]+ <bCC_tests>.*
85 .*bcc 0x\[0-9a-f]+ <bCC_tests>.*
86 .*bls 0x\[0-9a-f]+ <bCC_tests>.*
87 .*bcs 0x\[0-9a-f]+ <bCC_tests>.*
88 .*bvc 0x\[0-9a-f]+ <bCC_tests>.*
89 .*bvs 0x\[0-9a-f]+ <bCC_tests>.*
90 .*bnc 0x\[0-9a-f]+ <bCC_tests>.*
91 .*bns 0x\[0-9a-f]+ <bCC_tests>.*
92 .*bra 0x\[0-9a-f]+ <bCC_tests>.*
93 .*$gdb_prompt $" { pass "bCC tests" }
94 -re "$gdb_prompt $" { fail "bCC tests" }
95 timeout { fail "(timeout) bCC tests" }
104 send_gdb "x/14i bCCx_tests\n"
107 .*beqx 0x\[0-9a-f]+ <bCCx_tests>.*
108 .*bnex 0x\[0-9a-f]+ <bCCx_tests>.*
109 .*bgtx 0x\[0-9a-f]+ <bCCx_tests>.*
110 .*bgex 0x\[0-9a-f]+ <bCCx_tests>.*
111 .*blex 0x\[0-9a-f]+ <bCCx_tests>.*
112 .*bltx 0x\[0-9a-f]+ <bCCx_tests>.*
113 .*bhix 0x\[0-9a-f]+ <bCCx_tests>.*
114 .*bccx 0x\[0-9a-f]+ <bCCx_tests>.*
115 .*blsx 0x\[0-9a-f]+ <bCCx_tests>.*
116 .*bcsx 0x\[0-9a-f]+ <bCCx_tests>.*
117 .*bvcx 0x\[0-9a-f]+ <bCCx_tests>.*
118 .*bvsx 0x\[0-9a-f]+ <bCCx_tests>.*
119 .*bncx 0x\[0-9a-f]+ <bCCx_tests>.*
120 .*bnsx 0x\[0-9a-f]+ <bCCx_tests>.*
121 .*$gdb_prompt $" { pass "bCCx tests" }
122 -re "$gdb_prompt $" { fail "bCCx tests" }
123 timeout { fail "(timeout) bCCx tests" }
132 send_gdb "x/4 bit_tests\n"
139 .*$gdb_prompt $" { pass "bit tests" }
140 -re "$gdb_prompt $" { fail "bit tests" }
141 timeout { fail "(timeout) bit tests" }
150 send_gdb "x/9i cmp_tests\n"
162 .*$gdb_prompt $" { pass "cmp tests" }
163 -re "$gdb_prompt $" { fail "cmp tests" }
164 timeout { fail "(timeout) cmp tests" }
168 proc extend_tests { } {
173 send_gdb "x/5i extend_tests\n"
181 .*$gdb_prompt $" { pass "extend tests" }
182 -re "$gdb_prompt $" { fail "extend tests" }
183 timeout { fail "(timeout) extend tests" }
187 proc logical_tests { } {
192 send_gdb "x/11i logical_tests\n"
206 .*$gdb_prompt $" { pass "logical tests" }
207 -re "$gdb_prompt $" { fail "logical tests" }
208 timeout { fail "(timeout) logical tests" }
212 proc mov_tests_1 { } {
217 send_gdb "x/12i mov_tests_1\n"
229 .*mov \\(8,a2\\),d1.*
230 .*mov \\(256,a2\\),d1.*
231 .*mov \\(131071,a2\\),d1.*
232 .*$gdb_prompt $" { pass "mov1 tests" }
233 -re "$gdb_prompt $" { fail "mov1 tests" }
234 timeout { fail "(timeout) mov1 tests" }
238 proc mov_tests_2 { } {
243 send_gdb "x/9 mov_tests_2\n"
246 .*mov \\(d1,a1\\),d2.*
247 .*mov \\(0x8000.*\\),d1.*
248 .*mov \\(0x1ffff.*\\),d1.*
249 .*mov \\(8,a2\\),a1.*
250 .*mov \\(256,a2\\),a1.*
251 .*mov \\(131071,a2\\),a1.*
252 .*mov \\(d1,a1\\),a2.*
253 .*mov \\(0x8000.*\\),a1.*
254 .*mov \\(0x1ffff.*\\),a1.*
255 .*$gdb_prompt $" { pass "mov2 tests" }
256 -re "$gdb_prompt $" { fail "mov2 tests" }
257 timeout { fail "(timeout) mov2 tests" }
261 proc mov_tests_3 { } {
266 send_gdb "x/10 mov_tests_3\n"
270 .*mov d1,\\(32,a2\\).*
271 .*mov d1,\\(256,a2\\).*
272 .*mov d1,\\(131071,a2\\).*
273 .*mov d1,\\(d2,a2\\).*
274 .*mov d1,\\(0x80.*\\).*
275 .*mov d1,\\(0x1ffff.*\\).*
276 .*mov a1,\\(32,a2\\).*
277 .*mov a1,\\(256,a2\\).*
278 .*mov a1,\\(131071,a2\\).*
279 .*$gdb_prompt $" { pass "mov3 tests" }
280 -re "$gdb_prompt $" { fail "mov3 tests" }
281 timeout { fail "(timeout) mov3 tests" }
285 proc mov_tests_4 { } {
290 send_gdb "x/8 mov_tests_4\n"
293 .*mov a1,\\(d2,a2\\).*
294 .*mov a1,\\(0x80.*\\).*
295 .*mov a1,\\(0x1ffff.*\\).*
301 .*$gdb_prompt $" { pass "mov4 tests" }
302 -re "$gdb_prompt $" { fail "mov4 tests" }
303 timeout { fail "(timeout) mov4 tests" }
307 proc movb_tests { } {
312 send_gdb "x/12 movb_tests\n"
315 .*movb \\(8,a2\\),d1.*
316 .*movb \\(256,a2\\),d1.*
317 .*movb \\(131071,a2\\),d1.*
318 .*movb \\(d2,a2\\),d3.*
319 .*movb \\(0x1ffff.*\\),d2.*
321 .*movb d1,\\(8,a2\\).*
322 .*movb d1,\\(256,a2\\).*
323 .*movb d1,\\(131071,a2\\).*
324 .*movb d1,\\(d2,a2\\).*
325 .*movb d1,\\(0x100.*\\).*
326 .*movb d1,\\(0x1ffff.*\\).*
327 .*$gdb_prompt $" { pass "movb tests" }
328 -re "$gdb_prompt $" { fail "movb tests" }
329 timeout { fail "(timeout) movb tests" }
333 proc movbu_tests { } {
338 send_gdb "x/7 movbu_tests\n"
341 .*movbu \\(a2\\),d1.*
342 .*movbu \\(8,a2\\),d1.*
343 .*movbu \\(256,a2\\),d1.*
344 .*movbu \\(131071,a2\\),d1.*
345 .*movbu \\(d1,a1\\),d2.*
346 .*movbu \\(0x8000.*\\),d1.*
347 .*movbu \\(0x1ffff.*\\),d1.*
348 .*$gdb_prompt $" { pass "movbu tests" }
349 -re "$gdb_prompt $" { fail "movbu tests" }
350 timeout { fail "(timeout) movbu tests" }
354 proc movx_tests { } {
359 send_gdb "x/6 movx_tests\n"
362 .*movx \\(8,a2\\),d1.*
363 .*movx \\(256,a2\\),d1.*
364 .*movx \\(131071,a2\\),d1.*
365 .*movx d1,\\(8,a2\\).*
366 .*movx d1,\\(256,a2\\).*
367 .*movx d1,\\(131071,a2\\).*
368 .*$gdb_prompt $" { pass "movx tests" }
369 -re "$gdb_prompt $" { fail "movx tests" }
370 timeout { fail "(timeout) movx tests" }
374 proc muldiv_tests { } {
379 send_gdb "x/3 muldiv_tests\n"
385 .*$gdb_prompt $" { pass "muldiv tests" }
386 -re "$gdb_prompt $" { fail "muldiv tests" }
387 timeout { fail "(timeout) muldiv tests" }
391 proc misc_tests { } {
396 send_gdb "x/9 misc_tests\n"
399 .*jmp 0x\[0-9a-f]+ <main>.*
400 .*jmp 0x\[0-9a-f]+ <start>.*
402 .*jsr 0x\[0-9a-f]+ <main>.*
403 .*jsr 0x\[0-9a-f]+ <start>.*
408 .*$gdb_prompt $" { pass "misc tests" }
409 -re "$gdb_prompt $" { fail "misc tests" }
410 timeout { fail "(timeout) misc tests" }
414 proc shift_tests { } {
419 send_gdb "x/4i shift_tests\n"
426 .*$gdb_prompt $" { pass "shift tests" }
427 -re "$gdb_prompt $" { fail "shift tests" }
428 timeout { fail "(timeout) shift tests" }
437 send_gdb "x/9i sub_tests\n"
449 .*$gdb_prompt $" { pass "sub tests" }
450 -re "$gdb_prompt $" { fail "sub tests" }
451 timeout { fail "(timeout) sub tests" }
455 # Start with a fresh gdb.
459 gdb_reinitialize_dir $srcdir/$subdir