2 # Copyright 1997, 2007, 2008, 2009 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, see <http://www.gnu.org/licenses/>.
17 # This file was written by Jeff Law. (law@cygnus.com)
23 if ![istarget "mn10300*-*-*"] {
24 verbose "Tests ignored for all but mn10300 based targets."
32 set testfile "mn10300"
33 set srcfile ${srcdir}/${subdir}/${testfile}.s
34 set binfile ${objdir}/${subdir}/${testfile}
35 if { [gdb_compile "${srcfile}" "${binfile}" executable ""] != "" } {
45 send_gdb "x/14i add_tests\n"
62 .*$gdb_prompt $" { pass "add tests" }
63 -re "$gdb_prompt $" { fail "add tests" }
64 timeout { fail "(timeout) add tests" }
73 send_gdb "x/15i bCC_tests\n"
76 .*beq 0x\[0-9a-f]+ <bCC_tests>.*
77 .*bne 0x\[0-9a-f]+ <bCC_tests>.*
78 .*bgt 0x\[0-9a-f]+ <bCC_tests>.*
79 .*bge 0x\[0-9a-f]+ <bCC_tests>.*
80 .*ble 0x\[0-9a-f]+ <bCC_tests>.*
81 .*blt 0x\[0-9a-f]+ <bCC_tests>.*
82 .*bhi 0x\[0-9a-f]+ <bCC_tests>.*
83 .*bcc 0x\[0-9a-f]+ <bCC_tests>.*
84 .*bls 0x\[0-9a-f]+ <bCC_tests>.*
85 .*bcs 0x\[0-9a-f]+ <bCC_tests>.*
86 .*bvc 0x\[0-9a-f]+ <bCC_tests>.*
87 .*bvs 0x\[0-9a-f]+ <bCC_tests>.*
88 .*bnc 0x\[0-9a-f]+ <bCC_tests>.*
89 .*bns 0x\[0-9a-f]+ <bCC_tests>.*
90 .*bra 0x\[0-9a-f]+ <bCC_tests>.*
91 .*$gdb_prompt $" { pass "bCC tests" }
92 -re "$gdb_prompt $" { fail "bCC tests" }
93 timeout { fail "(timeout) bCC tests" }
102 send_gdb "x/11i bit_tests\n"
108 .*btst 64,\\(8,a1\\).*
109 .*btst 64,\\(0x1ffff\\).*
111 .*bset 64,\\(8,a1\\).*
112 .*bset 64,\\(0x1ffff\\).*
114 .*bclr 64,\\(8,a1\\).*
115 .*bclr 64,\\(0x1ffff\\).*
116 .*$gdb_prompt $" { pass "bit tests" }
117 -re "$gdb_prompt $" { fail "bit tests" }
118 timeout { fail "(timeout) bit tests" }
127 send_gdb "x/10i cmp_tests\n"
140 .*$gdb_prompt $" { pass "cmp tests" }
141 -re "$gdb_prompt $" { fail "cmp tests" }
142 timeout { fail "(timeout) cmp tests" }
146 proc extend_tests { } {
151 send_gdb "x/5i extend_tests\n"
159 .*$gdb_prompt $" { pass "extend tests" }
160 -re "$gdb_prompt $" { fail "extend tests" }
161 timeout { fail "(timeout) extend tests" }
165 proc extended_tests { } {
170 send_gdb "x/13i extended_tests\n"
186 .*$gdb_prompt $" { pass "extended tests" }
187 -re "$gdb_prompt $" { fail "extended tests" }
188 timeout { fail "(timeout) extended tests" }
192 proc logical_tests { } {
197 send_gdb "x/14i logical_tests\n"
214 .*$gdb_prompt $" { pass "logical tests" }
215 -re "$gdb_prompt $" { fail "logical tests" }
216 timeout { fail "(timeout) logical tests" }
220 proc loop_tests { } {
225 send_gdb "x/12i loop_tests\n"
240 .*$gdb_prompt $" { pass "loop tests" }
241 -re "$gdb_prompt $" { fail "loop tests" }
242 timeout { fail "(timeout) loop tests" }
246 proc mov_tests_1 { } {
251 send_gdb "x/16i mov_tests_1\n"
264 .*mov \\(8,a2\\),d1.*
265 .*mov \\(256,a2\\),d1.*
266 .*mov \\(131071,a2\\),d1.*
267 .*mov \\(8,sp\\),d1.*
268 .*mov \\(256,sp\\),d1.*
270 .*$gdb_prompt $" { pass "mov1 tests" }
271 -re "$gdb_prompt $" { fail "mov1 tests" }
272 timeout { fail "(timeout) mov1 tests" }
276 proc mov_tests_2 { } {
281 send_gdb "x/15i mov_tests_2\n"
284 .*mov \\(131071,sp\\),d1.*
285 .*mov \\(d1,a1\\),d2.*
286 .*mov \\(0x8000.*\\),d1.*
287 .*mov \\(0x1ffff.*\\),d1.*
289 .*mov \\(8,a2\\),a1.*
290 .*mov \\(256,a2\\),a1.*
291 .*mov \\(131071,a2\\),a1.*
292 .*mov \\(8,sp\\),a1.*
293 .*mov \\(256,sp\\),a1.*
294 .*mov \\(131071,sp\\),a1.*
295 .*mov \\(d1,a1\\),a2.*
296 .*mov \\(0x8000.*\\),a1.*
297 .*mov \\(0x1ffff.*\\),a1.*
298 .*mov \\(32,a1\\),sp.*
299 .*$gdb_prompt $" { pass "mov2 tests" }
300 -re "$gdb_prompt $" { fail "mov2 tests" }
301 timeout { fail "(timeout) mov2 tests" }
305 proc mov_tests_3 { } {
310 send_gdb "x/15i mov_tests_3\n"
314 .*mov d1,\\(32,a2\\).*
315 .*mov d1,\\(256,a2\\).*
316 .*mov d1,\\(131071,a2\\).*
317 .*mov d1,\\(32,sp\\).*
318 .*mov d1,\\(32768,sp\\).*
319 .*mov d1,\\(131071,sp\\).*
320 .*mov d1,\\(d2,a2\\).*
321 .*mov d1,\\(0x80.*\\).*
322 .*mov d1,\\(0x1ffff.*\\).*
324 .*mov a1,\\(32,a2\\).*
325 .*mov a1,\\(256,a2\\).*
326 .*mov a1,\\(131071,a2\\).*
327 .*mov a1,\\(32,sp\\).*
328 .*$gdb_prompt $" { pass "mov3 tests" }
329 -re "$gdb_prompt $" { fail "mov3 tests" }
330 timeout { fail "(timeout) mov3 tests" }
334 proc mov_tests_4 { } {
339 send_gdb "x/12i mov_tests_4\n"
342 .*mov a1,\\(32768,sp\\).*
343 .*mov a1,\\(131071,sp\\).*
344 .*mov a1,\\(d2,a2\\).*
345 .*mov a1,\\(0x80.*\\).*
346 .*mov a1,\\(0x1ffff.*\\).*
347 .*mov sp,\\(32,a1\\).*
354 .*$gdb_prompt $" { pass "mov4 tests" }
355 -re "$gdb_prompt $" { fail "mov4 tests" }
356 timeout { fail "(timeout) mov4 tests" }
360 proc movbu_tests { } {
365 send_gdb "x/20i movbu_tests\n"
368 .*movbu \\(a2\\),d1.*
369 .*movbu \\(8,a2\\),d1.*
370 .*movbu \\(256,a2\\),d1.*
371 .*movbu \\(131071,a2\\),d1.*
372 .*movbu \\(8,sp\\),d1.*
373 .*movbu \\(256,sp\\),d1.*
374 .*movbu \\(131071,sp\\),d1.*
375 .*movbu \\(d1,a1\\),d2.*
376 .*movbu \\(0x8000.*\\),d1.*
377 .*movbu \\(0x1ffff.*\\),d1.*
378 .*movbu d1,\\(a2\\).*
379 .*movbu d1,\\(32,a2\\).*
380 .*movbu d1,\\(256,a2\\).*
381 .*movbu d1,\\(131071,a2\\).*
382 .*movbu d1,\\(32,sp\\).*
383 .*movbu d1,\\(32768,sp\\).*
384 .*movbu d1,\\(131071,sp\\).*
385 .*movbu d1,\\(d2,a2\\).*
386 .*movbu d1,\\(0x80.*\\).*
387 .*movbu d1,\\(0x1ffff.*\\).*
388 .*$gdb_prompt $" { pass "movbu tests" }
389 -re "$gdb_prompt $" { fail "movbu tests" }
390 timeout { fail "(timeout) movbu tests" }
394 proc movhu_tests { } {
399 send_gdb "x/20i movhu_tests\n"
402 .*movhu \\(a2\\),d1.*
403 .*movhu \\(8,a2\\),d1.*
404 .*movhu \\(256,a2\\),d1.*
405 .*movhu \\(131071,a2\\),d1.*
406 .*movhu \\(8,sp\\),d1.*
407 .*movhu \\(256,sp\\),d1.*
408 .*movhu \\(131071,sp\\),d1.*
409 .*movhu \\(d1,a1\\),d2.*
410 .*movhu \\(0x8000.*\\),d1.*
411 .*movhu \\(0x1ffff.*\\),d1.*
412 .*movhu d1,\\(a2\\).*
413 .*movhu d1,\\(32,a2\\).*
414 .*movhu d1,\\(256,a2\\).*
415 .*movhu d1,\\(131071,a2\\).*
416 .*movhu d1,\\(32,sp\\).*
417 .*movhu d1,\\(32768,sp\\).*
418 .*movhu d1,\\(131071,sp\\).*
419 .*movhu d1,\\(d2,a2\\).*
420 .*movhu d1,\\(0x80.*\\).*
421 .*movhu d1,\\(0x1ffff.*\\).*
422 .*$gdb_prompt $" { pass "movhu tests" }
423 -re "$gdb_prompt $" { fail "movhu tests" }
424 timeout { fail "(timeout) movhu tests" }
428 proc movm_tests { } {
433 send_gdb "x/4i movm_tests\n"
436 .*movm \\(sp\\),.a2,a3..*
437 .*movm \\(sp\\),.d2,d3,a2,a3,other..*
438 .*movm .a2,a3.,\\(sp\\).*
439 .*movm .d2,d3,a2,a3,other.,\\(sp\\).*
440 .*$gdb_prompt $" { pass "movm tests" }
441 -re "$gdb_prompt $" { fail "movm tests" }
442 timeout { fail "(timeout) movm tests" }
446 proc muldiv_tests { } {
451 send_gdb "x/4i muldiv_tests\n"
458 .*$gdb_prompt $" { pass "muldiv tests" }
459 -re "$gdb_prompt $" { fail "muldiv tests" }
460 timeout { fail "(timeout) muldiv tests" }
464 proc other_tests { } {
469 send_gdb "x/19i other_tests\n"
477 .*jmp 0x\[0-9a-f]+ <main>.*
478 .*jmp 0x\[0-9a-f]+ <start>.*
479 .*call 0x\[0-9a-f]+ <main>,.a2,a3.,9.*
480 .*call 0x\[0-9a-f]+ <start>,.a2,a3.,32.*
482 .*calls 0x\[0-9a-f]+ <main>.*
483 .*calls 0x\[0-9a-f]+ <start>.*
491 .*$gdb_prompt $" { pass "other tests" }
492 -re "$gdb_prompt $" { fail "other tests" }
493 timeout { fail "(timeout) other tests" }
497 proc shift_tests { } {
502 send_gdb "x/9i shift_tests\n"
514 .*$gdb_prompt $" { pass "shift tests" }
515 -re "$gdb_prompt $" { fail "shift tests" }
516 timeout { fail "(timeout) shift tests" }
525 send_gdb "x/7i sub_tests\n"
535 .*$gdb_prompt $" { pass "sub tests" }
536 -re "$gdb_prompt $" { fail "sub tests" }
537 timeout { fail "(timeout) sub tests" }
541 # Start with a fresh gdb.
545 gdb_reinitialize_dir $srcdir/$subdir