1 # Copyright (C) 2000 Free Software Foundation, Inc.
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; either version 2 of the License, or
6 # (at your option) any later version.
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
13 # You should have received a copy of the GNU General Public License
14 # along with this program; if not, write to the Free Software
15 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 # Please email any bugs, comments, and/or additions to this file to:
18 # bug-gdb@prep.ai.mit.edu
20 # This file was written by Kazu Hirata. (kazu@hxi.com)
26 if ![istarget "h8300*-*-*"] {
27 verbose "Tests ignored for all but h8300s based targets."
35 set srcfile ${srcdir}/${subdir}/${testfile}.s
36 set binfile ${objdir}/${subdir}/${testfile}
37 if { [gdb_compile "${srcfile}" "${binfile}" executable {debug additional_flags=-ms}] != "" } {
42 proc all_set_machine_h8300s { } {
47 send_gdb "set machine h8300s\n"
49 -re "$gdb_prompt $" {}
53 proc all_movb_tests { } {
58 send_gdb "x/9i movb_tests\n"
64 .*mov.b\t@\\(0x1234:16,er0\\),r2l.*
65 .*mov.b\t@\\(0x12345678:32,er0\\),r2h.*
66 .*mov.b\t@er0\\+,r3l.*
67 .*mov.b\t@0x12:8,r3h.*
68 .*mov.b\t@0x1234:16,r4l.*
69 .*mov.b\t@0x12345678:32,r4h.*
70 .*$gdb_prompt $" { pass "movb_tests" }
71 -re "$gdb_prompt $" { fail "movb_tests" }
72 timeout { fail "(timeout) movb_tests" }
76 proc all_movw_tests { } {
81 send_gdb "x/8i movw_tests\n"
87 .*mov.w\t@\\(0x1234:16,er0\\),r3.*
88 .*mov.w\t@\\(0x12345678:32,er0\\),r4.*
90 .*mov.w\t@0x1234:16,r6.*
91 .*mov.w\t@0x12345678:32,r7.*
92 .*$gdb_prompt $" { pass "movw_tests" }
93 -re "$gdb_prompt $" { fail "movw_tests" }
94 timeout { fail "(timeout) movw_tests" }
98 proc all_movl_tests { } {
103 send_gdb "x/8i movl_tests\n"
107 .*mov.l\t#0x12345678,er1.*
109 .*mov.l\t@\\(0x1234:16,er0\\),er3.*
110 .*mov.l\t@\\(0x12345678:32,er0\\),er4.*
111 .*mov.l\t@er0\\+,er5.*
112 .*mov.l\t@0x1234:16,er6.*
113 .*mov.l\t@0x12345678:32,er7.*
114 .*$gdb_prompt $" { pass "movl_tests" }
115 -re "$gdb_prompt $" { fail "movl_tests" }
116 timeout { fail "(timeout) movl_tests" }
120 proc all_ldm_stm_tests { } {
125 send_gdb "x/6i ldm_stm_tests\n"
128 .*ldm.l\t@sp\\+,er0-er1.*
129 .*ldm.l\t@sp\\+,er0-er2.*
130 .*ldm.l\t@sp\\+,er0-er3.*
131 .*stm.l\ter0\\-er1,@-sp.*
132 .*stm.l\ter0\\-er2,@-sp.*
133 .*stm.l\ter0\\-er3,@-sp.*
134 .*$gdb_prompt $" { pass "ldm_stm_tests" }
135 -re "$gdb_prompt $" { fail "ldm_stm_tests" }
136 timeout { fail "(timeout) ldm_stm_tests" }
140 proc all_movfpe_movtpe_tests { } {
145 send_gdb "x/2i movfpe_movtpe_tests\n"
148 .*movfpe\t@0x1234:16,r2l.*
149 .*movtpe\tr2l,@0x1234:16.*
150 .*$gdb_prompt $" { pass "movfpe_movtpe_tests" }
151 -re "$gdb_prompt $" { fail "movfpe_movtpe_tests" }
152 timeout { fail "(timeout) movfpe_movtpe_tests" }
156 proc all_add_sub_addx_subx_tests { } {
161 send_gdb "x/15i add_sub_addx_subx_tests\n"
166 .*add.w\t#0x1234,r2.*
168 .*add.l\t#0x12345678,er5.*
171 .*sub.w\t#0x1234,r2.*
173 .*sub.l\t#0x12345678,er5.*
179 .*$gdb_prompt $" { pass "add_sub_addx_subx_tests" }
180 -re "$gdb_prompt $" { fail "add_sub_addx_subx_tests" }
181 timeout { fail "(timeout) add_sub_addx_subx_tests" }
185 proc all_inc_dec_adds_subs_tests { } {
190 send_gdb "x/16i inc_dec_adds_subs_tests\n"
194 .*inc.w\t#(0x|)1,r4.*
195 .*inc.w\t#(0x|)2,r3.*
196 .*inc.l\t#(0x|)1,er2.*
197 .*inc.l\t#(0x|)2,er1.*
199 .*dec.w\t#(0x|)1,r4.*
200 .*dec.w\t#(0x|)2,r3.*
201 .*dec.l\t#(0x|)1,er2.*
202 .*dec.l\t#(0x|)2,er1.*
203 .*adds\t#(0x|)1,er7.*
204 .*adds\t#(0x|)2,er6.*
205 .*adds\t#(0x|)4,er5.*
206 .*subs\t#(0x|)1,er7.*
207 .*subs\t#(0x|)2,er6.*
208 .*subs\t#(0x|)4,er5.*
209 .*$gdb_prompt $" { pass "inc_dec_adds_subs_tests" }
210 -re "$gdb_prompt $" { fail "inc_dec_adds_subs_tests" }
211 timeout { fail "(timeout) inc_dec_adds_subs_tests" }
215 proc all_daa_das_tests { } {
220 send_gdb "x/2i daa_das_tests\n"
225 .*$gdb_prompt $" { pass "daa_das_tests" }
226 -re "$gdb_prompt $" { fail "daa_das_tests" }
227 timeout { fail "(timeout) daa_das_tests" }
231 proc all_mul_div_tests { } {
236 send_gdb "x/8i mul_div_tests\n"
247 .*$gdb_prompt $" { pass "mul_div_tests" }
248 -re "$gdb_prompt $" { fail "mul_div_tests" }
249 timeout { fail "(timeout) mul_div_tests" }
253 proc all_cmp_tests { } {
258 send_gdb "x/8i cmp_tests\n"
263 .*cmp.w\t#0x1234,r2.*
265 .*cmp.l\t#0x12345678,er4.*
267 .*$gdb_prompt $" { pass "cmp_tests" }
268 -re "$gdb_prompt $" { fail "cmp_tests" }
269 timeout { fail "(timeout) cmp_tests" }
273 proc all_neg_tests { } {
278 send_gdb "x/3i neg_tests\n"
284 .*$gdb_prompt $" { pass "neg_tests" }
285 -re "$gdb_prompt $" { fail "neg_tests" }
286 timeout { fail "(timeout) neg_tests" }
290 proc all_ext_tests { } {
295 send_gdb "x/4i ext_tests\n"
302 .*$gdb_prompt $" { pass "ext_tests" }
303 -re "$gdb_prompt $" { fail "ext_tests" }
304 timeout { fail "(timeout) ext_tests" }
308 proc all_tas_mac_tests { } {
313 send_gdb "x/7i tas_mac_tests\n"
317 .*mac\t@er1\\+,@er2\\+.*
323 .*$gdb_prompt $" { pass "tas_mac_tests" }
324 -re "$gdb_prompt $" { fail "tas_mac_tests" }
325 timeout { fail "(timeout) tas_mac_tests" }
329 proc all_logic_operations_tests { } {
334 send_gdb "x/21i logic_operations_tests\n"
339 .*and.w\t#0x1234,r0.*
341 .*and.l\t#0x12345678,er0.*
347 .*or.l\t#0x12345678,er0.*
349 .*xor(.b|)\t#0x12,r0l.*
350 .*xor(.b|)\tr1l,r2h.*
351 .*xor.w\t#0x1234,r0.*
353 .*xor.l\t#0x12345678,er0.*
358 .*$gdb_prompt $" { pass "logic_operations_tests" }
359 -re "$gdb_prompt $" { fail "logic_operations_tests" }
360 timeout { fail "(timeout) logic_operations_tests" }
364 proc all_sha_shl_tests { } {
369 send_gdb "x/12i sha_shl_tests\n"
384 .*$gdb_prompt $" { pass "sha_shl_tests" }
385 -re "$gdb_prompt $" { fail "sha_shl_tests" }
386 timeout { fail "(timeout) sha_shl_tests" }
390 proc all_rot_rotx_tests { } {
395 send_gdb "x/12i rot_rotx_tests\n"
410 .*$gdb_prompt $" { pass "rot_rotx_tests" }
411 -re "$gdb_prompt $" { fail "rot_rotx_tests" }
412 timeout { fail "(timeout) rot_rotx_tests" }
416 proc all_bset_bclr_tests { } {
421 send_gdb "x/20i bset_bclr_tests\n"
426 .*bset\t#0x5,@0x12:8.*
427 .*bset\t#0x4,@0x1234:16.*
428 .*bset\t#0x3,@0x12345678:32.*
431 .*bset\tr5l,@0x12:8.*
432 .*bset\tr4l,@0x1234:16.*
433 .*bset\tr3l,@0x12345678:32.*
436 .*bclr\t#0x5,@0x12:8.*
437 .*bclr\t#0x4,@0x1234:16.*
438 .*bclr\t#0x3,@0x12345678:32.*
441 .*bclr\tr5h,@0x12:8.*
442 .*bclr\tr4h,@0x1234:16.*
443 .*bclr\tr3h,@0x12345678:32.*
444 .*$gdb_prompt $" { pass "bset_bclr_tests" }
445 -re "$gdb_prompt $" { fail "bset_bclr_tests" }
446 timeout { fail "(timeout) bset_bclr_tests" }
450 proc all_bnot_btst_tests { } {
455 send_gdb "x/20i bnot_btst_tests\n"
460 .*bnot\t#0x5,@0x12:8.*
461 .*bnot\t#0x4,@0x1234:16.*
462 .*bnot\t#0x3,@0x12345678:32.*
465 .*bnot\tr5l,@0x12:8.*
466 .*bnot\tr4l,@0x1234:16.*
467 .*bnot\tr3l,@0x12345678:32.*
470 .*btst\t#0x5,@0x12:8.*
471 .*btst\t#0x4,@0x1234:16.*
472 .*btst\t#0x3,@0x12345678:32.*
475 .*btst\tr5h,@0x12:8.*
476 .*btst\tr4h,@0x1234:16.*
477 .*btst\tr3h,@0x12345678:32.*
478 .*$gdb_prompt $" { pass "bnot_btst_tests" }
479 -re "$gdb_prompt $" { fail "bnot_btst_tests" }
480 timeout { fail "(timeout) bnot_btst_tests" }
484 proc all_band_bor_bxor_tests { } {
489 send_gdb "x/15i band_bor_bxor_tests\n"
494 .*band\t#0x5,@0x12:8.*
495 .*band\t#0x4,@0x1234:16.*
496 .*band\t#0x3,@0x12345678:32.*
499 .*bor\t#0x5,@0x12:8.*
500 .*bor\t#0x4,@0x1234:16.*
501 .*bor\t#0x3,@0x12345678:32.*
504 .*bxor\t#0x5,@0x12:8.*
505 .*bxor\t#0x4,@0x1234:16.*
506 .*bxor\t#0x3,@0x12345678:32.*
507 .*$gdb_prompt $" { pass "band_bor_bxor_tests" }
508 -re "$gdb_prompt $" { fail "band_bor_bxor_tests" }
509 timeout { fail "(timeout) band_bor_bxor_tests" }
513 proc all_bld_bst_tests { } {
518 send_gdb "x/20i bld_bst_tests\n"
523 .*bld\t#0x5,@0x12:8.*
524 .*bld\t#0x4,@0x1234:16.*
525 .*bld\t#0x3,@0x12345678:32.*
528 .*bild\t#0x5,@0x12:8.*
529 .*bild\t#0x4,@0x1234:16.*
530 .*bild\t#0x3,@0x12345678:32.*
533 .*bst\t#0x5,@0x12:8.*
534 .*bst\t#0x4,@0x1234:16.*
535 .*bst\t#0x3,@0x12345678:32.*
538 .*bist\t#0x5,@0x12:8.*
539 .*bist\t#0x4,@0x1234:16.*
540 .*bist\t#0x3,@0x12345678:32.*
541 .*$gdb_prompt $" { pass "bld_bst_tests" }
542 -re "$gdb_prompt $" { fail "bld_bst_tests" }
543 timeout { fail "(timeout) bld_bst_tests" }
547 proc all_branch_tests { } {
552 send_gdb "x/25i branch_tests\n"
555 .*bra\t(branch_tests|.-2 ).*
556 .*brn\t(branch_tests|.-4 ).*
557 .*bhi\t(branch_tests|.-6 ).*
558 .*bls\t(branch_tests|.-8 ).*
559 .*bcc\t(branch_tests|.-10 ).*
560 .*bcs\t(branch_tests|.-12 ).*
561 .*bne\t(branch_tests|.-14 ).*
562 .*beq\t(branch_tests|.-16 ).*
563 .*bvc\t(branch_tests|.-18 ).*
564 .*bvs\t(branch_tests|.-20 ).*
565 .*bpl\t(branch_tests|.-22 ).*
566 .*bmi\t(branch_tests|.-24 ).*
567 .*bge\t(branch_tests|.-26 ).*
568 .*blt\t(branch_tests|.-28 ).*
569 .*bgt\t(branch_tests|.-30 ).*
570 .*ble\t(branch_tests|.-32 ).*
572 .*jmp\t@(branch_tests|0x).*
573 .*jmp\t@@0 \\((0x|)0\\).*
574 .*bsr\t(branch_tests|.-42 ).*
575 .*bsr\t(branch_tests|.-46 ).*
577 .*jsr\t@(branch_tests|0x).*
578 .*jsr\t@@0 \\((0x|)0\\).*
580 .*$gdb_prompt $" { pass "branch_tests" }
581 -re "$gdb_prompt $" { fail "branch_tests" }
582 timeout { fail "(timeout) branch_tests" }
586 proc all_system_control_tests { } {
591 send_gdb "x/40i system_control_tests\n"
600 .*ldc\t@\\(0x1234:16,er0\\),ccr.*
601 .*ldc\t@\\(0x12345678:32,er0\\),ccr.*
603 .*ldc\t@0x1234:16,ccr.*
604 .*ldc\t@0x12345678:32,ccr.*
607 .*stc\tccr,@\\(0x1234:16,er0\\).*
608 .*stc\tccr,@\\(0x12345678:32,er0\\).*
610 .*stc\tccr,@0x1234:16.*
611 .*stc\tccr,@0x12345678:32.*
618 .*ldc\t@\\(0x1234:16,er0\\),exr.*
619 .*ldc\t@\\(0x12345678:32,er0\\),exr.*
621 .*ldc\t@0x1234:16,exr.*
622 .*ldc\t@0x12345678:32,exr.*
625 .*stc\texr,@\\(0x1234:16,er0\\).*
626 .*stc\texr,@\\(0x12345678:32,er0\\).*
628 .*stc\texr,@0x1234:16.*
629 .*stc\texr,@0x12345678:32.*
634 .*$gdb_prompt $" { pass "system_control_tests" }
635 -re "$gdb_prompt $" { fail "system_control_tests" }
636 timeout { fail "(timeout) system_control_tests" }
640 proc all_block_data_transfer_tests { } {
645 send_gdb "x/2i block_data_transfer_tests\n"
650 .*$gdb_prompt $" { pass "block_data_transfer_tests" }
651 -re "$gdb_prompt $" { fail "block_data_transfer_tests" }
652 timeout { fail "(timeout) block_data_transfer_tests" }
658 gdb_reinitialize_dir $srcdir/$subdir
659 all_set_machine_h8300s
667 all_movfpe_movtpe_tests
669 # Arithmetic operations
670 all_add_sub_addx_subx_tests
671 all_inc_dec_adds_subs_tests
680 all_logic_operations_tests
689 all_band_bor_bxor_tests
696 all_system_control_tests
698 # Block data transfer
699 all_block_data_transfer_tests