2 # Copyright 1997, 2007, 2008, 2009, 2010 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."
30 set testfile "mn10300"
31 set srcfile ${srcdir}/${subdir}/${testfile}.s
32 set binfile ${objdir}/${subdir}/${testfile}
33 if { [gdb_compile "${srcfile}" "${binfile}" executable ""] != "" } {
43 send_gdb "x/14i add_tests\n"
60 .*$gdb_prompt $" { pass "add tests" }
61 -re "$gdb_prompt $" { fail "add tests" }
62 timeout { fail "(timeout) add tests" }
71 send_gdb "x/15i bCC_tests\n"
74 .*beq 0x\[0-9a-f]+ <bCC_tests>.*
75 .*bne 0x\[0-9a-f]+ <bCC_tests>.*
76 .*bgt 0x\[0-9a-f]+ <bCC_tests>.*
77 .*bge 0x\[0-9a-f]+ <bCC_tests>.*
78 .*ble 0x\[0-9a-f]+ <bCC_tests>.*
79 .*blt 0x\[0-9a-f]+ <bCC_tests>.*
80 .*bhi 0x\[0-9a-f]+ <bCC_tests>.*
81 .*bcc 0x\[0-9a-f]+ <bCC_tests>.*
82 .*bls 0x\[0-9a-f]+ <bCC_tests>.*
83 .*bcs 0x\[0-9a-f]+ <bCC_tests>.*
84 .*bvc 0x\[0-9a-f]+ <bCC_tests>.*
85 .*bvs 0x\[0-9a-f]+ <bCC_tests>.*
86 .*bnc 0x\[0-9a-f]+ <bCC_tests>.*
87 .*bns 0x\[0-9a-f]+ <bCC_tests>.*
88 .*bra 0x\[0-9a-f]+ <bCC_tests>.*
89 .*$gdb_prompt $" { pass "bCC tests" }
90 -re "$gdb_prompt $" { fail "bCC tests" }
91 timeout { fail "(timeout) bCC tests" }
100 send_gdb "x/11i bit_tests\n"
106 .*btst 64,\\(8,a1\\).*
107 .*btst 64,\\(0x1ffff\\).*
109 .*bset 64,\\(8,a1\\).*
110 .*bset 64,\\(0x1ffff\\).*
112 .*bclr 64,\\(8,a1\\).*
113 .*bclr 64,\\(0x1ffff\\).*
114 .*$gdb_prompt $" { pass "bit tests" }
115 -re "$gdb_prompt $" { fail "bit tests" }
116 timeout { fail "(timeout) bit tests" }
125 send_gdb "x/10i cmp_tests\n"
138 .*$gdb_prompt $" { pass "cmp tests" }
139 -re "$gdb_prompt $" { fail "cmp tests" }
140 timeout { fail "(timeout) cmp tests" }
144 proc extend_tests { } {
149 send_gdb "x/5i extend_tests\n"
157 .*$gdb_prompt $" { pass "extend tests" }
158 -re "$gdb_prompt $" { fail "extend tests" }
159 timeout { fail "(timeout) extend tests" }
163 proc extended_tests { } {
168 send_gdb "x/13i extended_tests\n"
184 .*$gdb_prompt $" { pass "extended tests" }
185 -re "$gdb_prompt $" { fail "extended tests" }
186 timeout { fail "(timeout) extended tests" }
190 proc logical_tests { } {
195 send_gdb "x/14i logical_tests\n"
212 .*$gdb_prompt $" { pass "logical tests" }
213 -re "$gdb_prompt $" { fail "logical tests" }
214 timeout { fail "(timeout) logical tests" }
218 proc loop_tests { } {
223 send_gdb "x/12i loop_tests\n"
238 .*$gdb_prompt $" { pass "loop tests" }
239 -re "$gdb_prompt $" { fail "loop tests" }
240 timeout { fail "(timeout) loop tests" }
244 proc mov_tests_1 { } {
249 send_gdb "x/16i mov_tests_1\n"
262 .*mov \\(8,a2\\),d1.*
263 .*mov \\(256,a2\\),d1.*
264 .*mov \\(131071,a2\\),d1.*
265 .*mov \\(8,sp\\),d1.*
266 .*mov \\(256,sp\\),d1.*
268 .*$gdb_prompt $" { pass "mov1 tests" }
269 -re "$gdb_prompt $" { fail "mov1 tests" }
270 timeout { fail "(timeout) mov1 tests" }
274 proc mov_tests_2 { } {
279 send_gdb "x/15i mov_tests_2\n"
282 .*mov \\(131071,sp\\),d1.*
283 .*mov \\(d1,a1\\),d2.*
284 .*mov \\(0x8000.*\\),d1.*
285 .*mov \\(0x1ffff.*\\),d1.*
287 .*mov \\(8,a2\\),a1.*
288 .*mov \\(256,a2\\),a1.*
289 .*mov \\(131071,a2\\),a1.*
290 .*mov \\(8,sp\\),a1.*
291 .*mov \\(256,sp\\),a1.*
292 .*mov \\(131071,sp\\),a1.*
293 .*mov \\(d1,a1\\),a2.*
294 .*mov \\(0x8000.*\\),a1.*
295 .*mov \\(0x1ffff.*\\),a1.*
296 .*mov \\(32,a1\\),sp.*
297 .*$gdb_prompt $" { pass "mov2 tests" }
298 -re "$gdb_prompt $" { fail "mov2 tests" }
299 timeout { fail "(timeout) mov2 tests" }
303 proc mov_tests_3 { } {
308 send_gdb "x/15i mov_tests_3\n"
312 .*mov d1,\\(32,a2\\).*
313 .*mov d1,\\(256,a2\\).*
314 .*mov d1,\\(131071,a2\\).*
315 .*mov d1,\\(32,sp\\).*
316 .*mov d1,\\(32768,sp\\).*
317 .*mov d1,\\(131071,sp\\).*
318 .*mov d1,\\(d2,a2\\).*
319 .*mov d1,\\(0x80.*\\).*
320 .*mov d1,\\(0x1ffff.*\\).*
322 .*mov a1,\\(32,a2\\).*
323 .*mov a1,\\(256,a2\\).*
324 .*mov a1,\\(131071,a2\\).*
325 .*mov a1,\\(32,sp\\).*
326 .*$gdb_prompt $" { pass "mov3 tests" }
327 -re "$gdb_prompt $" { fail "mov3 tests" }
328 timeout { fail "(timeout) mov3 tests" }
332 proc mov_tests_4 { } {
337 send_gdb "x/12i mov_tests_4\n"
340 .*mov a1,\\(32768,sp\\).*
341 .*mov a1,\\(131071,sp\\).*
342 .*mov a1,\\(d2,a2\\).*
343 .*mov a1,\\(0x80.*\\).*
344 .*mov a1,\\(0x1ffff.*\\).*
345 .*mov sp,\\(32,a1\\).*
352 .*$gdb_prompt $" { pass "mov4 tests" }
353 -re "$gdb_prompt $" { fail "mov4 tests" }
354 timeout { fail "(timeout) mov4 tests" }
358 proc movbu_tests { } {
363 send_gdb "x/20i movbu_tests\n"
366 .*movbu \\(a2\\),d1.*
367 .*movbu \\(8,a2\\),d1.*
368 .*movbu \\(256,a2\\),d1.*
369 .*movbu \\(131071,a2\\),d1.*
370 .*movbu \\(8,sp\\),d1.*
371 .*movbu \\(256,sp\\),d1.*
372 .*movbu \\(131071,sp\\),d1.*
373 .*movbu \\(d1,a1\\),d2.*
374 .*movbu \\(0x8000.*\\),d1.*
375 .*movbu \\(0x1ffff.*\\),d1.*
376 .*movbu d1,\\(a2\\).*
377 .*movbu d1,\\(32,a2\\).*
378 .*movbu d1,\\(256,a2\\).*
379 .*movbu d1,\\(131071,a2\\).*
380 .*movbu d1,\\(32,sp\\).*
381 .*movbu d1,\\(32768,sp\\).*
382 .*movbu d1,\\(131071,sp\\).*
383 .*movbu d1,\\(d2,a2\\).*
384 .*movbu d1,\\(0x80.*\\).*
385 .*movbu d1,\\(0x1ffff.*\\).*
386 .*$gdb_prompt $" { pass "movbu tests" }
387 -re "$gdb_prompt $" { fail "movbu tests" }
388 timeout { fail "(timeout) movbu tests" }
392 proc movhu_tests { } {
397 send_gdb "x/20i movhu_tests\n"
400 .*movhu \\(a2\\),d1.*
401 .*movhu \\(8,a2\\),d1.*
402 .*movhu \\(256,a2\\),d1.*
403 .*movhu \\(131071,a2\\),d1.*
404 .*movhu \\(8,sp\\),d1.*
405 .*movhu \\(256,sp\\),d1.*
406 .*movhu \\(131071,sp\\),d1.*
407 .*movhu \\(d1,a1\\),d2.*
408 .*movhu \\(0x8000.*\\),d1.*
409 .*movhu \\(0x1ffff.*\\),d1.*
410 .*movhu d1,\\(a2\\).*
411 .*movhu d1,\\(32,a2\\).*
412 .*movhu d1,\\(256,a2\\).*
413 .*movhu d1,\\(131071,a2\\).*
414 .*movhu d1,\\(32,sp\\).*
415 .*movhu d1,\\(32768,sp\\).*
416 .*movhu d1,\\(131071,sp\\).*
417 .*movhu d1,\\(d2,a2\\).*
418 .*movhu d1,\\(0x80.*\\).*
419 .*movhu d1,\\(0x1ffff.*\\).*
420 .*$gdb_prompt $" { pass "movhu tests" }
421 -re "$gdb_prompt $" { fail "movhu tests" }
422 timeout { fail "(timeout) movhu tests" }
426 proc movm_tests { } {
431 send_gdb "x/4i movm_tests\n"
434 .*movm \\(sp\\),.a2,a3..*
435 .*movm \\(sp\\),.d2,d3,a2,a3,other..*
436 .*movm .a2,a3.,\\(sp\\).*
437 .*movm .d2,d3,a2,a3,other.,\\(sp\\).*
438 .*$gdb_prompt $" { pass "movm tests" }
439 -re "$gdb_prompt $" { fail "movm tests" }
440 timeout { fail "(timeout) movm tests" }
444 proc muldiv_tests { } {
449 send_gdb "x/4i muldiv_tests\n"
456 .*$gdb_prompt $" { pass "muldiv tests" }
457 -re "$gdb_prompt $" { fail "muldiv tests" }
458 timeout { fail "(timeout) muldiv tests" }
462 proc other_tests { } {
467 send_gdb "x/19i other_tests\n"
475 .*jmp 0x\[0-9a-f]+ <main>.*
476 .*jmp 0x\[0-9a-f]+ <start>.*
477 .*call 0x\[0-9a-f]+ <main>,.a2,a3.,9.*
478 .*call 0x\[0-9a-f]+ <start>,.a2,a3.,32.*
480 .*calls 0x\[0-9a-f]+ <main>.*
481 .*calls 0x\[0-9a-f]+ <start>.*
489 .*$gdb_prompt $" { pass "other tests" }
490 -re "$gdb_prompt $" { fail "other tests" }
491 timeout { fail "(timeout) other tests" }
495 proc shift_tests { } {
500 send_gdb "x/9i shift_tests\n"
512 .*$gdb_prompt $" { pass "shift tests" }
513 -re "$gdb_prompt $" { fail "shift tests" }
514 timeout { fail "(timeout) shift tests" }
523 send_gdb "x/7i sub_tests\n"
533 .*$gdb_prompt $" { pass "sub tests" }
534 -re "$gdb_prompt $" { fail "sub tests" }
535 timeout { fail "(timeout) sub tests" }
539 # Start with a fresh gdb.
543 gdb_reinitialize_dir $srcdir/$subdir