2 # Copyright 1997, 2007 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 "mn10300*-*-*"] {
28 verbose "Tests ignored for all but mn10300 based targets."
36 set testfile "mn10300"
37 set srcfile ${srcdir}/${subdir}/${testfile}.s
38 set binfile ${objdir}/${subdir}/${testfile}
39 if { [gdb_compile "${srcfile}" "${binfile}" executable ""] != "" } {
49 send_gdb "x/14i add_tests\n"
66 .*$gdb_prompt $" { pass "add tests" }
67 -re "$gdb_prompt $" { fail "add tests" }
68 timeout { fail "(timeout) add tests" }
77 send_gdb "x/15i bCC_tests\n"
80 .*beq 0x\[0-9a-f]+ <bCC_tests>.*
81 .*bne 0x\[0-9a-f]+ <bCC_tests>.*
82 .*bgt 0x\[0-9a-f]+ <bCC_tests>.*
83 .*bge 0x\[0-9a-f]+ <bCC_tests>.*
84 .*ble 0x\[0-9a-f]+ <bCC_tests>.*
85 .*blt 0x\[0-9a-f]+ <bCC_tests>.*
86 .*bhi 0x\[0-9a-f]+ <bCC_tests>.*
87 .*bcc 0x\[0-9a-f]+ <bCC_tests>.*
88 .*bls 0x\[0-9a-f]+ <bCC_tests>.*
89 .*bcs 0x\[0-9a-f]+ <bCC_tests>.*
90 .*bvc 0x\[0-9a-f]+ <bCC_tests>.*
91 .*bvs 0x\[0-9a-f]+ <bCC_tests>.*
92 .*bnc 0x\[0-9a-f]+ <bCC_tests>.*
93 .*bns 0x\[0-9a-f]+ <bCC_tests>.*
94 .*bra 0x\[0-9a-f]+ <bCC_tests>.*
95 .*$gdb_prompt $" { pass "bCC tests" }
96 -re "$gdb_prompt $" { fail "bCC tests" }
97 timeout { fail "(timeout) bCC tests" }
106 send_gdb "x/11i bit_tests\n"
112 .*btst 64,\\(8,a1\\).*
113 .*btst 64,\\(0x1ffff\\).*
115 .*bset 64,\\(8,a1\\).*
116 .*bset 64,\\(0x1ffff\\).*
118 .*bclr 64,\\(8,a1\\).*
119 .*bclr 64,\\(0x1ffff\\).*
120 .*$gdb_prompt $" { pass "bit tests" }
121 -re "$gdb_prompt $" { fail "bit tests" }
122 timeout { fail "(timeout) bit tests" }
131 send_gdb "x/10i cmp_tests\n"
144 .*$gdb_prompt $" { pass "cmp tests" }
145 -re "$gdb_prompt $" { fail "cmp tests" }
146 timeout { fail "(timeout) cmp tests" }
150 proc extend_tests { } {
155 send_gdb "x/5i extend_tests\n"
163 .*$gdb_prompt $" { pass "extend tests" }
164 -re "$gdb_prompt $" { fail "extend tests" }
165 timeout { fail "(timeout) extend tests" }
169 proc extended_tests { } {
174 send_gdb "x/13i extended_tests\n"
190 .*$gdb_prompt $" { pass "extended tests" }
191 -re "$gdb_prompt $" { fail "extended tests" }
192 timeout { fail "(timeout) extended tests" }
196 proc logical_tests { } {
201 send_gdb "x/14i logical_tests\n"
218 .*$gdb_prompt $" { pass "logical tests" }
219 -re "$gdb_prompt $" { fail "logical tests" }
220 timeout { fail "(timeout) logical tests" }
224 proc loop_tests { } {
229 send_gdb "x/12i loop_tests\n"
244 .*$gdb_prompt $" { pass "loop tests" }
245 -re "$gdb_prompt $" { fail "loop tests" }
246 timeout { fail "(timeout) loop tests" }
250 proc mov_tests_1 { } {
255 send_gdb "x/16i mov_tests_1\n"
268 .*mov \\(8,a2\\),d1.*
269 .*mov \\(256,a2\\),d1.*
270 .*mov \\(131071,a2\\),d1.*
271 .*mov \\(8,sp\\),d1.*
272 .*mov \\(256,sp\\),d1.*
274 .*$gdb_prompt $" { pass "mov1 tests" }
275 -re "$gdb_prompt $" { fail "mov1 tests" }
276 timeout { fail "(timeout) mov1 tests" }
280 proc mov_tests_2 { } {
285 send_gdb "x/15i mov_tests_2\n"
288 .*mov \\(131071,sp\\),d1.*
289 .*mov \\(d1,a1\\),d2.*
290 .*mov \\(0x8000.*\\),d1.*
291 .*mov \\(0x1ffff.*\\),d1.*
293 .*mov \\(8,a2\\),a1.*
294 .*mov \\(256,a2\\),a1.*
295 .*mov \\(131071,a2\\),a1.*
296 .*mov \\(8,sp\\),a1.*
297 .*mov \\(256,sp\\),a1.*
298 .*mov \\(131071,sp\\),a1.*
299 .*mov \\(d1,a1\\),a2.*
300 .*mov \\(0x8000.*\\),a1.*
301 .*mov \\(0x1ffff.*\\),a1.*
302 .*mov \\(32,a1\\),sp.*
303 .*$gdb_prompt $" { pass "mov2 tests" }
304 -re "$gdb_prompt $" { fail "mov2 tests" }
305 timeout { fail "(timeout) mov2 tests" }
309 proc mov_tests_3 { } {
314 send_gdb "x/15i mov_tests_3\n"
318 .*mov d1,\\(32,a2\\).*
319 .*mov d1,\\(256,a2\\).*
320 .*mov d1,\\(131071,a2\\).*
321 .*mov d1,\\(32,sp\\).*
322 .*mov d1,\\(32768,sp\\).*
323 .*mov d1,\\(131071,sp\\).*
324 .*mov d1,\\(d2,a2\\).*
325 .*mov d1,\\(0x80.*\\).*
326 .*mov d1,\\(0x1ffff.*\\).*
328 .*mov a1,\\(32,a2\\).*
329 .*mov a1,\\(256,a2\\).*
330 .*mov a1,\\(131071,a2\\).*
331 .*mov a1,\\(32,sp\\).*
332 .*$gdb_prompt $" { pass "mov3 tests" }
333 -re "$gdb_prompt $" { fail "mov3 tests" }
334 timeout { fail "(timeout) mov3 tests" }
338 proc mov_tests_4 { } {
343 send_gdb "x/12i mov_tests_4\n"
346 .*mov a1,\\(32768,sp\\).*
347 .*mov a1,\\(131071,sp\\).*
348 .*mov a1,\\(d2,a2\\).*
349 .*mov a1,\\(0x80.*\\).*
350 .*mov a1,\\(0x1ffff.*\\).*
351 .*mov sp,\\(32,a1\\).*
358 .*$gdb_prompt $" { pass "mov4 tests" }
359 -re "$gdb_prompt $" { fail "mov4 tests" }
360 timeout { fail "(timeout) mov4 tests" }
364 proc movbu_tests { } {
369 send_gdb "x/20i movbu_tests\n"
372 .*movbu \\(a2\\),d1.*
373 .*movbu \\(8,a2\\),d1.*
374 .*movbu \\(256,a2\\),d1.*
375 .*movbu \\(131071,a2\\),d1.*
376 .*movbu \\(8,sp\\),d1.*
377 .*movbu \\(256,sp\\),d1.*
378 .*movbu \\(131071,sp\\),d1.*
379 .*movbu \\(d1,a1\\),d2.*
380 .*movbu \\(0x8000.*\\),d1.*
381 .*movbu \\(0x1ffff.*\\),d1.*
382 .*movbu d1,\\(a2\\).*
383 .*movbu d1,\\(32,a2\\).*
384 .*movbu d1,\\(256,a2\\).*
385 .*movbu d1,\\(131071,a2\\).*
386 .*movbu d1,\\(32,sp\\).*
387 .*movbu d1,\\(32768,sp\\).*
388 .*movbu d1,\\(131071,sp\\).*
389 .*movbu d1,\\(d2,a2\\).*
390 .*movbu d1,\\(0x80.*\\).*
391 .*movbu d1,\\(0x1ffff.*\\).*
392 .*$gdb_prompt $" { pass "movbu tests" }
393 -re "$gdb_prompt $" { fail "movbu tests" }
394 timeout { fail "(timeout) movbu tests" }
398 proc movhu_tests { } {
403 send_gdb "x/20i movhu_tests\n"
406 .*movhu \\(a2\\),d1.*
407 .*movhu \\(8,a2\\),d1.*
408 .*movhu \\(256,a2\\),d1.*
409 .*movhu \\(131071,a2\\),d1.*
410 .*movhu \\(8,sp\\),d1.*
411 .*movhu \\(256,sp\\),d1.*
412 .*movhu \\(131071,sp\\),d1.*
413 .*movhu \\(d1,a1\\),d2.*
414 .*movhu \\(0x8000.*\\),d1.*
415 .*movhu \\(0x1ffff.*\\),d1.*
416 .*movhu d1,\\(a2\\).*
417 .*movhu d1,\\(32,a2\\).*
418 .*movhu d1,\\(256,a2\\).*
419 .*movhu d1,\\(131071,a2\\).*
420 .*movhu d1,\\(32,sp\\).*
421 .*movhu d1,\\(32768,sp\\).*
422 .*movhu d1,\\(131071,sp\\).*
423 .*movhu d1,\\(d2,a2\\).*
424 .*movhu d1,\\(0x80.*\\).*
425 .*movhu d1,\\(0x1ffff.*\\).*
426 .*$gdb_prompt $" { pass "movhu tests" }
427 -re "$gdb_prompt $" { fail "movhu tests" }
428 timeout { fail "(timeout) movhu tests" }
432 proc movm_tests { } {
437 send_gdb "x/4i movm_tests\n"
440 .*movm \\(sp\\),.a2,a3..*
441 .*movm \\(sp\\),.d2,d3,a2,a3,other..*
442 .*movm .a2,a3.,\\(sp\\).*
443 .*movm .d2,d3,a2,a3,other.,\\(sp\\).*
444 .*$gdb_prompt $" { pass "movm tests" }
445 -re "$gdb_prompt $" { fail "movm tests" }
446 timeout { fail "(timeout) movm tests" }
450 proc muldiv_tests { } {
455 send_gdb "x/4i muldiv_tests\n"
462 .*$gdb_prompt $" { pass "muldiv tests" }
463 -re "$gdb_prompt $" { fail "muldiv tests" }
464 timeout { fail "(timeout) muldiv tests" }
468 proc other_tests { } {
473 send_gdb "x/19i other_tests\n"
481 .*jmp 0x\[0-9a-f]+ <main>.*
482 .*jmp 0x\[0-9a-f]+ <start>.*
483 .*call 0x\[0-9a-f]+ <main>,.a2,a3.,9.*
484 .*call 0x\[0-9a-f]+ <start>,.a2,a3.,32.*
486 .*calls 0x\[0-9a-f]+ <main>.*
487 .*calls 0x\[0-9a-f]+ <start>.*
495 .*$gdb_prompt $" { pass "other tests" }
496 -re "$gdb_prompt $" { fail "other tests" }
497 timeout { fail "(timeout) other tests" }
501 proc shift_tests { } {
506 send_gdb "x/9i shift_tests\n"
518 .*$gdb_prompt $" { pass "shift tests" }
519 -re "$gdb_prompt $" { fail "shift tests" }
520 timeout { fail "(timeout) shift tests" }
529 send_gdb "x/7i sub_tests\n"
539 .*$gdb_prompt $" { pass "sub tests" }
540 -re "$gdb_prompt $" { fail "sub tests" }
541 timeout { fail "(timeout) sub tests" }
545 # Start with a fresh gdb.
549 gdb_reinitialize_dir $srcdir/$subdir