1 # Copyright (C) 2000, 2007, 2008, 2009, 2010, 2011
2 # 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 Kazu Hirata. (kazu@hxi.com)
23 if ![istarget "h8300*-*-*"] {
24 verbose "Tests ignored for all but h8300s based targets."
30 set srcfile ${srcdir}/${subdir}/${testfile}.s
31 set binfile ${objdir}/${subdir}/${testfile}
32 if { [gdb_compile "${srcfile}" "${binfile}" executable {debug additional_flags=-ms}] != "" } {
37 proc all_set_machine_h8300s { } {
42 send_gdb "set machine h8300s\n"
44 -re "$gdb_prompt $" {}
48 proc all_movb_tests { } {
53 send_gdb "x/9i movb_tests\n"
59 .*mov.b\t@\\(0x1234:16,er0\\),r2l.*
60 .*mov.b\t@\\(0x12345678:32,er0\\),r2h.*
61 .*mov.b\t@er0\\+,r3l.*
62 .*mov.b\t@0x12:8,r3h.*
63 .*mov.b\t@0x1234:16,r4l.*
64 .*mov.b\t@0x12345678:32,r4h.*
65 .*$gdb_prompt $" { pass "movb_tests" }
66 -re "$gdb_prompt $" { fail "movb_tests" }
67 timeout { fail "(timeout) movb_tests" }
71 proc all_movw_tests { } {
76 send_gdb "x/8i movw_tests\n"
82 .*mov.w\t@\\(0x1234:16,er0\\),r3.*
83 .*mov.w\t@\\(0x12345678:32,er0\\),r4.*
85 .*mov.w\t@0x1234:16,r6.*
86 .*mov.w\t@0x12345678:32,r7.*
87 .*$gdb_prompt $" { pass "movw_tests" }
88 -re "$gdb_prompt $" { fail "movw_tests" }
89 timeout { fail "(timeout) movw_tests" }
93 proc all_movl_tests { } {
98 send_gdb "x/8i movl_tests\n"
102 .*mov.l\t#0x12345678,er1.*
104 .*mov.l\t@\\(0x1234:16,er0\\),er3.*
105 .*mov.l\t@\\(0x12345678:32,er0\\),er4.*
106 .*mov.l\t@er0\\+,er5.*
107 .*mov.l\t@0x1234:16,er6.*
108 .*mov.l\t@0x12345678:32,er7.*
109 .*$gdb_prompt $" { pass "movl_tests" }
110 -re "$gdb_prompt $" { fail "movl_tests" }
111 timeout { fail "(timeout) movl_tests" }
115 proc all_ldm_stm_tests { } {
120 send_gdb "x/6i ldm_stm_tests\n"
123 .*ldm.l\t@sp\\+,er0-er1.*
124 .*ldm.l\t@sp\\+,er0-er2.*
125 .*ldm.l\t@sp\\+,er0-er3.*
126 .*stm.l\ter0\\-er1,@-sp.*
127 .*stm.l\ter0\\-er2,@-sp.*
128 .*stm.l\ter0\\-er3,@-sp.*
129 .*$gdb_prompt $" { pass "ldm_stm_tests" }
130 -re "$gdb_prompt $" { fail "ldm_stm_tests" }
131 timeout { fail "(timeout) ldm_stm_tests" }
135 proc all_movfpe_movtpe_tests { } {
140 send_gdb "x/2i movfpe_movtpe_tests\n"
143 .*movfpe\t@0x1234:16,r2l.*
144 .*movtpe\tr2l,@0x1234:16.*
145 .*$gdb_prompt $" { pass "movfpe_movtpe_tests" }
146 -re "$gdb_prompt $" { fail "movfpe_movtpe_tests" }
147 timeout { fail "(timeout) movfpe_movtpe_tests" }
151 proc all_add_sub_addx_subx_tests { } {
156 send_gdb "x/15i add_sub_addx_subx_tests\n"
161 .*add.w\t#0x1234,r2.*
163 .*add.l\t#0x12345678,er5.*
166 .*sub.w\t#0x1234,r2.*
168 .*sub.l\t#0x12345678,er5.*
174 .*$gdb_prompt $" { pass "add_sub_addx_subx_tests" }
175 -re "$gdb_prompt $" { fail "add_sub_addx_subx_tests" }
176 timeout { fail "(timeout) add_sub_addx_subx_tests" }
180 proc all_inc_dec_adds_subs_tests { } {
185 send_gdb "x/16i inc_dec_adds_subs_tests\n"
189 .*inc.w\t#(0x|)1,r4.*
190 .*inc.w\t#(0x|)2,r3.*
191 .*inc.l\t#(0x|)1,er2.*
192 .*inc.l\t#(0x|)2,er1.*
194 .*dec.w\t#(0x|)1,r4.*
195 .*dec.w\t#(0x|)2,r3.*
196 .*dec.l\t#(0x|)1,er2.*
197 .*dec.l\t#(0x|)2,er1.*
198 .*adds\t#(0x|)1,er7.*
199 .*adds\t#(0x|)2,er6.*
200 .*adds\t#(0x|)4,er5.*
201 .*subs\t#(0x|)1,er7.*
202 .*subs\t#(0x|)2,er6.*
203 .*subs\t#(0x|)4,er5.*
204 .*$gdb_prompt $" { pass "inc_dec_adds_subs_tests" }
205 -re "$gdb_prompt $" { fail "inc_dec_adds_subs_tests" }
206 timeout { fail "(timeout) inc_dec_adds_subs_tests" }
210 proc all_daa_das_tests { } {
215 send_gdb "x/2i daa_das_tests\n"
220 .*$gdb_prompt $" { pass "daa_das_tests" }
221 -re "$gdb_prompt $" { fail "daa_das_tests" }
222 timeout { fail "(timeout) daa_das_tests" }
226 proc all_mul_div_tests { } {
231 send_gdb "x/8i mul_div_tests\n"
242 .*$gdb_prompt $" { pass "mul_div_tests" }
243 -re "$gdb_prompt $" { fail "mul_div_tests" }
244 timeout { fail "(timeout) mul_div_tests" }
248 proc all_cmp_tests { } {
253 send_gdb "x/8i cmp_tests\n"
258 .*cmp.w\t#0x1234,r2.*
260 .*cmp.l\t#0x12345678,er4.*
262 .*$gdb_prompt $" { pass "cmp_tests" }
263 -re "$gdb_prompt $" { fail "cmp_tests" }
264 timeout { fail "(timeout) cmp_tests" }
268 proc all_neg_tests { } {
273 send_gdb "x/3i neg_tests\n"
279 .*$gdb_prompt $" { pass "neg_tests" }
280 -re "$gdb_prompt $" { fail "neg_tests" }
281 timeout { fail "(timeout) neg_tests" }
285 proc all_ext_tests { } {
290 send_gdb "x/4i ext_tests\n"
297 .*$gdb_prompt $" { pass "ext_tests" }
298 -re "$gdb_prompt $" { fail "ext_tests" }
299 timeout { fail "(timeout) ext_tests" }
303 proc all_tas_mac_tests { } {
308 send_gdb "x/7i tas_mac_tests\n"
312 .*mac\t@er1\\+,@er2\\+.*
318 .*$gdb_prompt $" { pass "tas_mac_tests" }
319 -re "$gdb_prompt $" { fail "tas_mac_tests" }
320 timeout { fail "(timeout) tas_mac_tests" }
324 proc all_logic_operations_tests { } {
329 send_gdb "x/21i logic_operations_tests\n"
334 .*and.w\t#0x1234,r0.*
336 .*and.l\t#0x12345678,er0.*
342 .*or.l\t#0x12345678,er0.*
344 .*xor(.b|)\t#0x12,r0l.*
345 .*xor(.b|)\tr1l,r2h.*
346 .*xor.w\t#0x1234,r0.*
348 .*xor.l\t#0x12345678,er0.*
353 .*$gdb_prompt $" { pass "logic_operations_tests" }
354 -re "$gdb_prompt $" { fail "logic_operations_tests" }
355 timeout { fail "(timeout) logic_operations_tests" }
359 proc all_sha_shl_tests { } {
364 send_gdb "x/12i sha_shl_tests\n"
379 .*$gdb_prompt $" { pass "sha_shl_tests" }
380 -re "$gdb_prompt $" { fail "sha_shl_tests" }
381 timeout { fail "(timeout) sha_shl_tests" }
385 proc all_rot_rotx_tests { } {
390 send_gdb "x/12i rot_rotx_tests\n"
405 .*$gdb_prompt $" { pass "rot_rotx_tests" }
406 -re "$gdb_prompt $" { fail "rot_rotx_tests" }
407 timeout { fail "(timeout) rot_rotx_tests" }
411 proc all_bset_bclr_tests { } {
416 send_gdb "x/20i bset_bclr_tests\n"
421 .*bset\t#0x5,@0x12:8.*
422 .*bset\t#0x4,@0x1234:16.*
423 .*bset\t#0x3,@0x12345678:32.*
426 .*bset\tr5l,@0x12:8.*
427 .*bset\tr4l,@0x1234:16.*
428 .*bset\tr3l,@0x12345678:32.*
431 .*bclr\t#0x5,@0x12:8.*
432 .*bclr\t#0x4,@0x1234:16.*
433 .*bclr\t#0x3,@0x12345678:32.*
436 .*bclr\tr5h,@0x12:8.*
437 .*bclr\tr4h,@0x1234:16.*
438 .*bclr\tr3h,@0x12345678:32.*
439 .*$gdb_prompt $" { pass "bset_bclr_tests" }
440 -re "$gdb_prompt $" { fail "bset_bclr_tests" }
441 timeout { fail "(timeout) bset_bclr_tests" }
445 proc all_bnot_btst_tests { } {
450 send_gdb "x/20i bnot_btst_tests\n"
455 .*bnot\t#0x5,@0x12:8.*
456 .*bnot\t#0x4,@0x1234:16.*
457 .*bnot\t#0x3,@0x12345678:32.*
460 .*bnot\tr5l,@0x12:8.*
461 .*bnot\tr4l,@0x1234:16.*
462 .*bnot\tr3l,@0x12345678:32.*
465 .*btst\t#0x5,@0x12:8.*
466 .*btst\t#0x4,@0x1234:16.*
467 .*btst\t#0x3,@0x12345678:32.*
470 .*btst\tr5h,@0x12:8.*
471 .*btst\tr4h,@0x1234:16.*
472 .*btst\tr3h,@0x12345678:32.*
473 .*$gdb_prompt $" { pass "bnot_btst_tests" }
474 -re "$gdb_prompt $" { fail "bnot_btst_tests" }
475 timeout { fail "(timeout) bnot_btst_tests" }
479 proc all_band_bor_bxor_tests { } {
484 send_gdb "x/15i band_bor_bxor_tests\n"
489 .*band\t#0x5,@0x12:8.*
490 .*band\t#0x4,@0x1234:16.*
491 .*band\t#0x3,@0x12345678:32.*
494 .*bor\t#0x5,@0x12:8.*
495 .*bor\t#0x4,@0x1234:16.*
496 .*bor\t#0x3,@0x12345678:32.*
499 .*bxor\t#0x5,@0x12:8.*
500 .*bxor\t#0x4,@0x1234:16.*
501 .*bxor\t#0x3,@0x12345678:32.*
502 .*$gdb_prompt $" { pass "band_bor_bxor_tests" }
503 -re "$gdb_prompt $" { fail "band_bor_bxor_tests" }
504 timeout { fail "(timeout) band_bor_bxor_tests" }
508 proc all_bld_bst_tests { } {
513 send_gdb "x/20i bld_bst_tests\n"
518 .*bld\t#0x5,@0x12:8.*
519 .*bld\t#0x4,@0x1234:16.*
520 .*bld\t#0x3,@0x12345678:32.*
523 .*bild\t#0x5,@0x12:8.*
524 .*bild\t#0x4,@0x1234:16.*
525 .*bild\t#0x3,@0x12345678:32.*
528 .*bst\t#0x5,@0x12:8.*
529 .*bst\t#0x4,@0x1234:16.*
530 .*bst\t#0x3,@0x12345678:32.*
533 .*bist\t#0x5,@0x12:8.*
534 .*bist\t#0x4,@0x1234:16.*
535 .*bist\t#0x3,@0x12345678:32.*
536 .*$gdb_prompt $" { pass "bld_bst_tests" }
537 -re "$gdb_prompt $" { fail "bld_bst_tests" }
538 timeout { fail "(timeout) bld_bst_tests" }
542 proc all_branch_tests { } {
547 send_gdb "x/25i branch_tests\n"
550 .*bra\t(branch_tests|.-2 ).*
551 .*brn\t(branch_tests|.-4 ).*
552 .*bhi\t(branch_tests|.-6 ).*
553 .*bls\t(branch_tests|.-8 ).*
554 .*bcc\t(branch_tests|.-10 ).*
555 .*bcs\t(branch_tests|.-12 ).*
556 .*bne\t(branch_tests|.-14 ).*
557 .*beq\t(branch_tests|.-16 ).*
558 .*bvc\t(branch_tests|.-18 ).*
559 .*bvs\t(branch_tests|.-20 ).*
560 .*bpl\t(branch_tests|.-22 ).*
561 .*bmi\t(branch_tests|.-24 ).*
562 .*bge\t(branch_tests|.-26 ).*
563 .*blt\t(branch_tests|.-28 ).*
564 .*bgt\t(branch_tests|.-30 ).*
565 .*ble\t(branch_tests|.-32 ).*
567 .*jmp\t@(branch_tests|0x).*
568 .*jmp\t@@0 \\((0x|)0\\).*
569 .*bsr\t(branch_tests|.-42 ).*
570 .*bsr\t(branch_tests|.-46 ).*
572 .*jsr\t@(branch_tests|0x).*
573 .*jsr\t@@0 \\((0x|)0\\).*
575 .*$gdb_prompt $" { pass "branch_tests" }
576 -re "$gdb_prompt $" { fail "branch_tests" }
577 timeout { fail "(timeout) branch_tests" }
581 proc all_system_control_tests { } {
586 send_gdb "x/40i system_control_tests\n"
595 .*ldc\t@\\(0x1234:16,er0\\),ccr.*
596 .*ldc\t@\\(0x12345678:32,er0\\),ccr.*
598 .*ldc\t@0x1234:16,ccr.*
599 .*ldc\t@0x12345678:32,ccr.*
602 .*stc\tccr,@\\(0x1234:16,er0\\).*
603 .*stc\tccr,@\\(0x12345678:32,er0\\).*
605 .*stc\tccr,@0x1234:16.*
606 .*stc\tccr,@0x12345678:32.*
613 .*ldc\t@\\(0x1234:16,er0\\),exr.*
614 .*ldc\t@\\(0x12345678:32,er0\\),exr.*
616 .*ldc\t@0x1234:16,exr.*
617 .*ldc\t@0x12345678:32,exr.*
620 .*stc\texr,@\\(0x1234:16,er0\\).*
621 .*stc\texr,@\\(0x12345678:32,er0\\).*
623 .*stc\texr,@0x1234:16.*
624 .*stc\texr,@0x12345678:32.*
629 .*$gdb_prompt $" { pass "system_control_tests" }
630 -re "$gdb_prompt $" { fail "system_control_tests" }
631 timeout { fail "(timeout) system_control_tests" }
635 proc all_block_data_transfer_tests { } {
640 send_gdb "x/2i block_data_transfer_tests\n"
645 .*$gdb_prompt $" { pass "block_data_transfer_tests" }
646 -re "$gdb_prompt $" { fail "block_data_transfer_tests" }
647 timeout { fail "(timeout) block_data_transfer_tests" }
653 gdb_reinitialize_dir $srcdir/$subdir
654 all_set_machine_h8300s
662 all_movfpe_movtpe_tests
664 # Arithmetic operations
665 all_add_sub_addx_subx_tests
666 all_inc_dec_adds_subs_tests
675 all_logic_operations_tests
684 all_band_bor_bxor_tests
691 all_system_control_tests
693 # Block data transfer
694 all_block_data_transfer_tests