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 "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 ""] != "" } {
40 gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
48 send_gdb "x/14i add_tests\n"
65 .*$gdb_prompt $" { pass "add tests" }
66 -re "$gdb_prompt $" { fail "add tests" }
67 timeout { fail "(timeout) add tests" }
76 send_gdb "x/15i bCC_tests\n"
79 .*beq 0x\[0-9a-f]+ <bCC_tests>.*
80 .*bne 0x\[0-9a-f]+ <bCC_tests>.*
81 .*bgt 0x\[0-9a-f]+ <bCC_tests>.*
82 .*bge 0x\[0-9a-f]+ <bCC_tests>.*
83 .*ble 0x\[0-9a-f]+ <bCC_tests>.*
84 .*blt 0x\[0-9a-f]+ <bCC_tests>.*
85 .*bhi 0x\[0-9a-f]+ <bCC_tests>.*
86 .*bcc 0x\[0-9a-f]+ <bCC_tests>.*
87 .*bls 0x\[0-9a-f]+ <bCC_tests>.*
88 .*bcs 0x\[0-9a-f]+ <bCC_tests>.*
89 .*bvc 0x\[0-9a-f]+ <bCC_tests>.*
90 .*bvs 0x\[0-9a-f]+ <bCC_tests>.*
91 .*bnc 0x\[0-9a-f]+ <bCC_tests>.*
92 .*bns 0x\[0-9a-f]+ <bCC_tests>.*
93 .*bra 0x\[0-9a-f]+ <bCC_tests>.*
94 .*$gdb_prompt $" { pass "bCC tests" }
95 -re "$gdb_prompt $" { fail "bCC tests" }
96 timeout { fail "(timeout) bCC tests" }
105 send_gdb "x/11i bit_tests\n"
111 .*btst 64,\\(8,a1\\).*
112 .*btst 64,\\(0x1ffff\\).*
114 .*bset 64,\\(8,a1\\).*
115 .*bset 64,\\(0x1ffff\\).*
117 .*bclr 64,\\(8,a1\\).*
118 .*bclr 64,\\(0x1ffff\\).*
119 .*$gdb_prompt $" { pass "bit tests" }
120 -re "$gdb_prompt $" { fail "bit tests" }
121 timeout { fail "(timeout) bit tests" }
130 send_gdb "x/10i cmp_tests\n"
143 .*$gdb_prompt $" { pass "cmp tests" }
144 -re "$gdb_prompt $" { fail "cmp tests" }
145 timeout { fail "(timeout) cmp tests" }
149 proc extend_tests { } {
154 send_gdb "x/5i extend_tests\n"
162 .*$gdb_prompt $" { pass "extend tests" }
163 -re "$gdb_prompt $" { fail "extend tests" }
164 timeout { fail "(timeout) extend tests" }
168 proc extended_tests { } {
173 send_gdb "x/13i extended_tests\n"
189 .*$gdb_prompt $" { pass "extended tests" }
190 -re "$gdb_prompt $" { fail "extended tests" }
191 timeout { fail "(timeout) extended tests" }
195 proc logical_tests { } {
200 send_gdb "x/14i logical_tests\n"
217 .*$gdb_prompt $" { pass "logical tests" }
218 -re "$gdb_prompt $" { fail "logical tests" }
219 timeout { fail "(timeout) logical tests" }
223 proc loop_tests { } {
228 send_gdb "x/12i loop_tests\n"
243 .*$gdb_prompt $" { pass "loop tests" }
244 -re "$gdb_prompt $" { fail "loop tests" }
245 timeout { fail "(timeout) loop tests" }
249 proc mov_tests_1 { } {
254 send_gdb "x/16i mov_tests_1\n"
267 .*mov \\(8,a2\\),d1.*
268 .*mov \\(256,a2\\),d1.*
269 .*mov \\(131071,a2\\),d1.*
270 .*mov \\(8,sp\\),d1.*
271 .*mov \\(256,sp\\),d1.*
273 .*$gdb_prompt $" { pass "mov1 tests" }
274 -re "$gdb_prompt $" { fail "mov1 tests" }
275 timeout { fail "(timeout) mov1 tests" }
279 proc mov_tests_2 { } {
284 send_gdb "x/15i mov_tests_2\n"
287 .*mov \\(131071,sp\\),d1.*
288 .*mov \\(d1,a1\\),d2.*
289 .*mov \\(0x8000.*\\),d1.*
290 .*mov \\(0x1ffff.*\\),d1.*
292 .*mov \\(8,a2\\),a1.*
293 .*mov \\(256,a2\\),a1.*
294 .*mov \\(131071,a2\\),a1.*
295 .*mov \\(8,sp\\),a1.*
296 .*mov \\(256,sp\\),a1.*
297 .*mov \\(131071,sp\\),a1.*
298 .*mov \\(d1,a1\\),a2.*
299 .*mov \\(0x8000.*\\),a1.*
300 .*mov \\(0x1ffff.*\\),a1.*
301 .*mov \\(32,a1\\),sp.*
302 .*$gdb_prompt $" { pass "mov2 tests" }
303 -re "$gdb_prompt $" { fail "mov2 tests" }
304 timeout { fail "(timeout) mov2 tests" }
308 proc mov_tests_3 { } {
313 send_gdb "x/15i mov_tests_3\n"
317 .*mov d1,\\(32,a2\\).*
318 .*mov d1,\\(256,a2\\).*
319 .*mov d1,\\(131071,a2\\).*
320 .*mov d1,\\(32,sp\\).*
321 .*mov d1,\\(32768,sp\\).*
322 .*mov d1,\\(131071,sp\\).*
323 .*mov d1,\\(d2,a2\\).*
324 .*mov d1,\\(0x80.*\\).*
325 .*mov d1,\\(0x1ffff.*\\).*
327 .*mov a1,\\(32,a2\\).*
328 .*mov a1,\\(256,a2\\).*
329 .*mov a1,\\(131071,a2\\).*
330 .*mov a1,\\(32,sp\\).*
331 .*$gdb_prompt $" { pass "mov3 tests" }
332 -re "$gdb_prompt $" { fail "mov3 tests" }
333 timeout { fail "(timeout) mov3 tests" }
337 proc mov_tests_4 { } {
342 send_gdb "x/12i mov_tests_4\n"
345 .*mov a1,\\(32768,sp\\).*
346 .*mov a1,\\(131071,sp\\).*
347 .*mov a1,\\(d2,a2\\).*
348 .*mov a1,\\(0x80.*\\).*
349 .*mov a1,\\(0x1ffff.*\\).*
350 .*mov sp,\\(32,a1\\).*
357 .*$gdb_prompt $" { pass "mov4 tests" }
358 -re "$gdb_prompt $" { fail "mov4 tests" }
359 timeout { fail "(timeout) mov4 tests" }
363 proc movbu_tests { } {
368 send_gdb "x/20i movbu_tests\n"
371 .*movbu \\(a2\\),d1.*
372 .*movbu \\(8,a2\\),d1.*
373 .*movbu \\(256,a2\\),d1.*
374 .*movbu \\(131071,a2\\),d1.*
375 .*movbu \\(8,sp\\),d1.*
376 .*movbu \\(256,sp\\),d1.*
377 .*movbu \\(131071,sp\\),d1.*
378 .*movbu \\(d1,a1\\),d2.*
379 .*movbu \\(0x8000.*\\),d1.*
380 .*movbu \\(0x1ffff.*\\),d1.*
381 .*movbu d1,\\(a2\\).*
382 .*movbu d1,\\(32,a2\\).*
383 .*movbu d1,\\(256,a2\\).*
384 .*movbu d1,\\(131071,a2\\).*
385 .*movbu d1,\\(32,sp\\).*
386 .*movbu d1,\\(32768,sp\\).*
387 .*movbu d1,\\(131071,sp\\).*
388 .*movbu d1,\\(d2,a2\\).*
389 .*movbu d1,\\(0x80.*\\).*
390 .*movbu d1,\\(0x1ffff.*\\).*
391 .*$gdb_prompt $" { pass "movbu tests" }
392 -re "$gdb_prompt $" { fail "movbu tests" }
393 timeout { fail "(timeout) movbu tests" }
397 proc movhu_tests { } {
402 send_gdb "x/20i movhu_tests\n"
405 .*movhu \\(a2\\),d1.*
406 .*movhu \\(8,a2\\),d1.*
407 .*movhu \\(256,a2\\),d1.*
408 .*movhu \\(131071,a2\\),d1.*
409 .*movhu \\(8,sp\\),d1.*
410 .*movhu \\(256,sp\\),d1.*
411 .*movhu \\(131071,sp\\),d1.*
412 .*movhu \\(d1,a1\\),d2.*
413 .*movhu \\(0x8000.*\\),d1.*
414 .*movhu \\(0x1ffff.*\\),d1.*
415 .*movhu d1,\\(a2\\).*
416 .*movhu d1,\\(32,a2\\).*
417 .*movhu d1,\\(256,a2\\).*
418 .*movhu d1,\\(131071,a2\\).*
419 .*movhu d1,\\(32,sp\\).*
420 .*movhu d1,\\(32768,sp\\).*
421 .*movhu d1,\\(131071,sp\\).*
422 .*movhu d1,\\(d2,a2\\).*
423 .*movhu d1,\\(0x80.*\\).*
424 .*movhu d1,\\(0x1ffff.*\\).*
425 .*$gdb_prompt $" { pass "movhu tests" }
426 -re "$gdb_prompt $" { fail "movhu tests" }
427 timeout { fail "(timeout) movhu tests" }
431 proc movm_tests { } {
436 send_gdb "x/4i movm_tests\n"
439 .*movm \\(sp\\),.a2,a3..*
440 .*movm \\(sp\\),.d2,d3,a2,a3,other..*
441 .*movm .a2,a3.,\\(sp\\).*
442 .*movm .d2,d3,a2,a3,other.,\\(sp\\).*
443 .*$gdb_prompt $" { pass "movm tests" }
444 -re "$gdb_prompt $" { fail "movm tests" }
445 timeout { fail "(timeout) movm tests" }
449 proc muldiv_tests { } {
454 send_gdb "x/4i muldiv_tests\n"
461 .*$gdb_prompt $" { pass "muldiv tests" }
462 -re "$gdb_prompt $" { fail "muldiv tests" }
463 timeout { fail "(timeout) muldiv tests" }
467 proc other_tests { } {
472 send_gdb "x/19i other_tests\n"
480 .*jmp 0x\[0-9a-f]+ <main>.*
481 .*jmp 0x\[0-9a-f]+ <start>.*
482 .*call 0x\[0-9a-f]+ <main>,.a2,a3.,9.*
483 .*call 0x\[0-9a-f]+ <start>,.a2,a3.,32.*
485 .*calls 0x\[0-9a-f]+ <main>.*
486 .*calls 0x\[0-9a-f]+ <start>.*
494 .*$gdb_prompt $" { pass "other tests" }
495 -re "$gdb_prompt $" { fail "other tests" }
496 timeout { fail "(timeout) other tests" }
500 proc shift_tests { } {
505 send_gdb "x/9i shift_tests\n"
517 .*$gdb_prompt $" { pass "shift tests" }
518 -re "$gdb_prompt $" { fail "shift tests" }
519 timeout { fail "(timeout) shift tests" }
528 send_gdb "x/7i sub_tests\n"
538 .*$gdb_prompt $" { pass "sub tests" }
539 -re "$gdb_prompt $" { fail "sub tests" }
540 timeout { fail "(timeout) sub tests" }
544 # Start with a fresh gdb.
548 gdb_reinitialize_dir $srcdir/$subdir