2 # Copyright 1997, 2007-2012 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)
19 if ![istarget "mn10300*-*-*"] {
20 verbose "Tests ignored for all but mn10300 based targets."
26 set testfile "mn10300"
27 set srcfile ${srcdir}/${subdir}/${testfile}.s
28 set binfile ${objdir}/${subdir}/${testfile}
29 if { [gdb_compile "${srcfile}" "${binfile}" executable ""] != "" } {
39 send_gdb "x/14i add_tests\n"
56 .*$gdb_prompt $" { pass "add tests" }
57 -re "$gdb_prompt $" { fail "add tests" }
58 timeout { fail "(timeout) add tests" }
67 send_gdb "x/15i bCC_tests\n"
70 .*beq 0x\[0-9a-f]+ <bCC_tests>.*
71 .*bne 0x\[0-9a-f]+ <bCC_tests>.*
72 .*bgt 0x\[0-9a-f]+ <bCC_tests>.*
73 .*bge 0x\[0-9a-f]+ <bCC_tests>.*
74 .*ble 0x\[0-9a-f]+ <bCC_tests>.*
75 .*blt 0x\[0-9a-f]+ <bCC_tests>.*
76 .*bhi 0x\[0-9a-f]+ <bCC_tests>.*
77 .*bcc 0x\[0-9a-f]+ <bCC_tests>.*
78 .*bls 0x\[0-9a-f]+ <bCC_tests>.*
79 .*bcs 0x\[0-9a-f]+ <bCC_tests>.*
80 .*bvc 0x\[0-9a-f]+ <bCC_tests>.*
81 .*bvs 0x\[0-9a-f]+ <bCC_tests>.*
82 .*bnc 0x\[0-9a-f]+ <bCC_tests>.*
83 .*bns 0x\[0-9a-f]+ <bCC_tests>.*
84 .*bra 0x\[0-9a-f]+ <bCC_tests>.*
85 .*$gdb_prompt $" { pass "bCC tests" }
86 -re "$gdb_prompt $" { fail "bCC tests" }
87 timeout { fail "(timeout) bCC tests" }
96 send_gdb "x/11i bit_tests\n"
102 .*btst 64,\\(8,a1\\).*
103 .*btst 64,\\(0x1ffff\\).*
105 .*bset 64,\\(8,a1\\).*
106 .*bset 64,\\(0x1ffff\\).*
108 .*bclr 64,\\(8,a1\\).*
109 .*bclr 64,\\(0x1ffff\\).*
110 .*$gdb_prompt $" { pass "bit tests" }
111 -re "$gdb_prompt $" { fail "bit tests" }
112 timeout { fail "(timeout) bit tests" }
121 send_gdb "x/10i cmp_tests\n"
134 .*$gdb_prompt $" { pass "cmp tests" }
135 -re "$gdb_prompt $" { fail "cmp tests" }
136 timeout { fail "(timeout) cmp tests" }
140 proc extend_tests { } {
145 send_gdb "x/5i extend_tests\n"
153 .*$gdb_prompt $" { pass "extend tests" }
154 -re "$gdb_prompt $" { fail "extend tests" }
155 timeout { fail "(timeout) extend tests" }
159 proc extended_tests { } {
164 send_gdb "x/13i extended_tests\n"
180 .*$gdb_prompt $" { pass "extended tests" }
181 -re "$gdb_prompt $" { fail "extended tests" }
182 timeout { fail "(timeout) extended tests" }
186 proc logical_tests { } {
191 send_gdb "x/14i logical_tests\n"
208 .*$gdb_prompt $" { pass "logical tests" }
209 -re "$gdb_prompt $" { fail "logical tests" }
210 timeout { fail "(timeout) logical tests" }
214 proc loop_tests { } {
219 send_gdb "x/12i loop_tests\n"
234 .*$gdb_prompt $" { pass "loop tests" }
235 -re "$gdb_prompt $" { fail "loop tests" }
236 timeout { fail "(timeout) loop tests" }
240 proc mov_tests_1 { } {
245 send_gdb "x/16i mov_tests_1\n"
258 .*mov \\(8,a2\\),d1.*
259 .*mov \\(256,a2\\),d1.*
260 .*mov \\(131071,a2\\),d1.*
261 .*mov \\(8,sp\\),d1.*
262 .*mov \\(256,sp\\),d1.*
264 .*$gdb_prompt $" { pass "mov1 tests" }
265 -re "$gdb_prompt $" { fail "mov1 tests" }
266 timeout { fail "(timeout) mov1 tests" }
270 proc mov_tests_2 { } {
275 send_gdb "x/15i mov_tests_2\n"
278 .*mov \\(131071,sp\\),d1.*
279 .*mov \\(d1,a1\\),d2.*
280 .*mov \\(0x8000.*\\),d1.*
281 .*mov \\(0x1ffff.*\\),d1.*
283 .*mov \\(8,a2\\),a1.*
284 .*mov \\(256,a2\\),a1.*
285 .*mov \\(131071,a2\\),a1.*
286 .*mov \\(8,sp\\),a1.*
287 .*mov \\(256,sp\\),a1.*
288 .*mov \\(131071,sp\\),a1.*
289 .*mov \\(d1,a1\\),a2.*
290 .*mov \\(0x8000.*\\),a1.*
291 .*mov \\(0x1ffff.*\\),a1.*
292 .*mov \\(32,a1\\),sp.*
293 .*$gdb_prompt $" { pass "mov2 tests" }
294 -re "$gdb_prompt $" { fail "mov2 tests" }
295 timeout { fail "(timeout) mov2 tests" }
299 proc mov_tests_3 { } {
304 send_gdb "x/15i mov_tests_3\n"
308 .*mov d1,\\(32,a2\\).*
309 .*mov d1,\\(256,a2\\).*
310 .*mov d1,\\(131071,a2\\).*
311 .*mov d1,\\(32,sp\\).*
312 .*mov d1,\\(32768,sp\\).*
313 .*mov d1,\\(131071,sp\\).*
314 .*mov d1,\\(d2,a2\\).*
315 .*mov d1,\\(0x80.*\\).*
316 .*mov d1,\\(0x1ffff.*\\).*
318 .*mov a1,\\(32,a2\\).*
319 .*mov a1,\\(256,a2\\).*
320 .*mov a1,\\(131071,a2\\).*
321 .*mov a1,\\(32,sp\\).*
322 .*$gdb_prompt $" { pass "mov3 tests" }
323 -re "$gdb_prompt $" { fail "mov3 tests" }
324 timeout { fail "(timeout) mov3 tests" }
328 proc mov_tests_4 { } {
333 send_gdb "x/12i mov_tests_4\n"
336 .*mov a1,\\(32768,sp\\).*
337 .*mov a1,\\(131071,sp\\).*
338 .*mov a1,\\(d2,a2\\).*
339 .*mov a1,\\(0x80.*\\).*
340 .*mov a1,\\(0x1ffff.*\\).*
341 .*mov sp,\\(32,a1\\).*
348 .*$gdb_prompt $" { pass "mov4 tests" }
349 -re "$gdb_prompt $" { fail "mov4 tests" }
350 timeout { fail "(timeout) mov4 tests" }
354 proc movbu_tests { } {
359 send_gdb "x/20i movbu_tests\n"
362 .*movbu \\(a2\\),d1.*
363 .*movbu \\(8,a2\\),d1.*
364 .*movbu \\(256,a2\\),d1.*
365 .*movbu \\(131071,a2\\),d1.*
366 .*movbu \\(8,sp\\),d1.*
367 .*movbu \\(256,sp\\),d1.*
368 .*movbu \\(131071,sp\\),d1.*
369 .*movbu \\(d1,a1\\),d2.*
370 .*movbu \\(0x8000.*\\),d1.*
371 .*movbu \\(0x1ffff.*\\),d1.*
372 .*movbu d1,\\(a2\\).*
373 .*movbu d1,\\(32,a2\\).*
374 .*movbu d1,\\(256,a2\\).*
375 .*movbu d1,\\(131071,a2\\).*
376 .*movbu d1,\\(32,sp\\).*
377 .*movbu d1,\\(32768,sp\\).*
378 .*movbu d1,\\(131071,sp\\).*
379 .*movbu d1,\\(d2,a2\\).*
380 .*movbu d1,\\(0x80.*\\).*
381 .*movbu d1,\\(0x1ffff.*\\).*
382 .*$gdb_prompt $" { pass "movbu tests" }
383 -re "$gdb_prompt $" { fail "movbu tests" }
384 timeout { fail "(timeout) movbu tests" }
388 proc movhu_tests { } {
393 send_gdb "x/20i movhu_tests\n"
396 .*movhu \\(a2\\),d1.*
397 .*movhu \\(8,a2\\),d1.*
398 .*movhu \\(256,a2\\),d1.*
399 .*movhu \\(131071,a2\\),d1.*
400 .*movhu \\(8,sp\\),d1.*
401 .*movhu \\(256,sp\\),d1.*
402 .*movhu \\(131071,sp\\),d1.*
403 .*movhu \\(d1,a1\\),d2.*
404 .*movhu \\(0x8000.*\\),d1.*
405 .*movhu \\(0x1ffff.*\\),d1.*
406 .*movhu d1,\\(a2\\).*
407 .*movhu d1,\\(32,a2\\).*
408 .*movhu d1,\\(256,a2\\).*
409 .*movhu d1,\\(131071,a2\\).*
410 .*movhu d1,\\(32,sp\\).*
411 .*movhu d1,\\(32768,sp\\).*
412 .*movhu d1,\\(131071,sp\\).*
413 .*movhu d1,\\(d2,a2\\).*
414 .*movhu d1,\\(0x80.*\\).*
415 .*movhu d1,\\(0x1ffff.*\\).*
416 .*$gdb_prompt $" { pass "movhu tests" }
417 -re "$gdb_prompt $" { fail "movhu tests" }
418 timeout { fail "(timeout) movhu tests" }
422 proc movm_tests { } {
427 send_gdb "x/4i movm_tests\n"
430 .*movm \\(sp\\),.a2,a3..*
431 .*movm \\(sp\\),.d2,d3,a2,a3,other..*
432 .*movm .a2,a3.,\\(sp\\).*
433 .*movm .d2,d3,a2,a3,other.,\\(sp\\).*
434 .*$gdb_prompt $" { pass "movm tests" }
435 -re "$gdb_prompt $" { fail "movm tests" }
436 timeout { fail "(timeout) movm tests" }
440 proc muldiv_tests { } {
445 send_gdb "x/4i muldiv_tests\n"
452 .*$gdb_prompt $" { pass "muldiv tests" }
453 -re "$gdb_prompt $" { fail "muldiv tests" }
454 timeout { fail "(timeout) muldiv tests" }
458 proc other_tests { } {
463 send_gdb "x/19i other_tests\n"
471 .*jmp 0x\[0-9a-f]+ <main>.*
472 .*jmp 0x\[0-9a-f]+ <start>.*
473 .*call 0x\[0-9a-f]+ <main>,.a2,a3.,9.*
474 .*call 0x\[0-9a-f]+ <start>,.a2,a3.,32.*
476 .*calls 0x\[0-9a-f]+ <main>.*
477 .*calls 0x\[0-9a-f]+ <start>.*
485 .*$gdb_prompt $" { pass "other tests" }
486 -re "$gdb_prompt $" { fail "other tests" }
487 timeout { fail "(timeout) other tests" }
491 proc shift_tests { } {
496 send_gdb "x/9i shift_tests\n"
508 .*$gdb_prompt $" { pass "shift tests" }
509 -re "$gdb_prompt $" { fail "shift tests" }
510 timeout { fail "(timeout) shift tests" }
519 send_gdb "x/7i sub_tests\n"
529 .*$gdb_prompt $" { pass "sub tests" }
530 -re "$gdb_prompt $" { fail "sub tests" }
531 timeout { fail "(timeout) sub tests" }
535 # Start with a fresh gdb.
539 gdb_reinitialize_dir $srcdir/$subdir