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}] != "" } {
38 gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
41 proc all_set_machine_h8300s { } {
46 send_gdb "set machine h8300s\n"
48 -re "$gdb_prompt $" {}
52 proc all_movb_tests { } {
57 send_gdb "x/9i movb_tests\n"
63 .*mov.b\t@\\(0x1234:16,er0\\),r2l.*
64 .*mov.b\t@\\(0x12345678:32,er0\\),r2h.*
65 .*mov.b\t@er0\\+,r3l.*
66 .*mov.b\t@0x12:8,r3h.*
67 .*mov.b\t@0x1234:16,r4l.*
68 .*mov.b\t@0x12345678:32,r4h.*
69 .*$gdb_prompt $" { pass "movb_tests" }
70 -re "$gdb_prompt $" { fail "movb_tests" }
71 timeout { fail "(timeout) movb_tests" }
75 proc all_movw_tests { } {
80 send_gdb "x/8i movw_tests\n"
86 .*mov.w\t@\\(0x1234:16,er0\\),r3.*
87 .*mov.w\t@\\(0x12345678:32,er0\\),r4.*
89 .*mov.w\t@0x1234:16,r6.*
90 .*mov.w\t@0x12345678:32,r7.*
91 .*$gdb_prompt $" { pass "movw_tests" }
92 -re "$gdb_prompt $" { fail "movw_tests" }
93 timeout { fail "(timeout) movw_tests" }
97 proc all_movl_tests { } {
102 send_gdb "x/8i movl_tests\n"
106 .*mov.l\t#0x12345678,er1.*
108 .*mov.l\t@\\(0x1234:16,er0\\),er3.*
109 .*mov.l\t@\\(0x12345678:32,er0\\),er4.*
110 .*mov.l\t@er0\\+,er5.*
111 .*mov.l\t@0x1234:16,er6.*
112 .*mov.l\t@0x12345678:32,er7.*
113 .*$gdb_prompt $" { pass "movl_tests" }
114 -re "$gdb_prompt $" { fail "movl_tests" }
115 timeout { fail "(timeout) movl_tests" }
119 proc all_ldm_stm_tests { } {
124 send_gdb "x/6i ldm_stm_tests\n"
127 .*ldm.l\t@sp\\+,er0-er1.*
128 .*ldm.l\t@sp\\+,er0-er2.*
129 .*ldm.l\t@sp\\+,er0-er3.*
130 .*stm.l\ter0\\-er1,@-sp.*
131 .*stm.l\ter0\\-er2,@-sp.*
132 .*stm.l\ter0\\-er3,@-sp.*
133 .*$gdb_prompt $" { pass "ldm_stm_tests" }
134 -re "$gdb_prompt $" { fail "ldm_stm_tests" }
135 timeout { fail "(timeout) ldm_stm_tests" }
139 proc all_movfpe_movtpe_tests { } {
144 send_gdb "x/2i movfpe_movtpe_tests\n"
147 .*movfpe\t@0x1234:16,r2l.*
148 .*movtpe\tr2l,@0x1234:16.*
149 .*$gdb_prompt $" { pass "movfpe_movtpe_tests" }
150 -re "$gdb_prompt $" { fail "movfpe_movtpe_tests" }
151 timeout { fail "(timeout) movfpe_movtpe_tests" }
155 proc all_add_sub_addx_subx_tests { } {
160 send_gdb "x/15i add_sub_addx_subx_tests\n"
165 .*add.w\t#0x1234,r2.*
167 .*add.l\t#0x12345678,er5.*
170 .*sub.w\t#0x1234,r2.*
172 .*sub.l\t#0x12345678,er5.*
178 .*$gdb_prompt $" { pass "add_sub_addx_subx_tests" }
179 -re "$gdb_prompt $" { fail "add_sub_addx_subx_tests" }
180 timeout { fail "(timeout) add_sub_addx_subx_tests" }
184 proc all_inc_dec_adds_subs_tests { } {
189 send_gdb "x/16i inc_dec_adds_subs_tests\n"
193 .*inc.w\t#(0x|)1,r4.*
194 .*inc.w\t#(0x|)2,r3.*
195 .*inc.l\t#(0x|)1,er2.*
196 .*inc.l\t#(0x|)2,er1.*
198 .*dec.w\t#(0x|)1,r4.*
199 .*dec.w\t#(0x|)2,r3.*
200 .*dec.l\t#(0x|)1,er2.*
201 .*dec.l\t#(0x|)2,er1.*
202 .*adds\t#(0x|)1,er7.*
203 .*adds\t#(0x|)2,er6.*
204 .*adds\t#(0x|)4,er5.*
205 .*subs\t#(0x|)1,er7.*
206 .*subs\t#(0x|)2,er6.*
207 .*subs\t#(0x|)4,er5.*
208 .*$gdb_prompt $" { pass "inc_dec_adds_subs_tests" }
209 -re "$gdb_prompt $" { fail "inc_dec_adds_subs_tests" }
210 timeout { fail "(timeout) inc_dec_adds_subs_tests" }
214 proc all_daa_das_tests { } {
219 send_gdb "x/2i daa_das_tests\n"
224 .*$gdb_prompt $" { pass "daa_das_tests" }
225 -re "$gdb_prompt $" { fail "daa_das_tests" }
226 timeout { fail "(timeout) daa_das_tests" }
230 proc all_mul_div_tests { } {
235 send_gdb "x/8i mul_div_tests\n"
246 .*$gdb_prompt $" { pass "mul_div_tests" }
247 -re "$gdb_prompt $" { fail "mul_div_tests" }
248 timeout { fail "(timeout) mul_div_tests" }
252 proc all_cmp_tests { } {
257 send_gdb "x/8i cmp_tests\n"
262 .*cmp.w\t#0x1234,r2.*
264 .*cmp.l\t#0x12345678,er4.*
266 .*$gdb_prompt $" { pass "cmp_tests" }
267 -re "$gdb_prompt $" { fail "cmp_tests" }
268 timeout { fail "(timeout) cmp_tests" }
272 proc all_neg_tests { } {
277 send_gdb "x/3i neg_tests\n"
283 .*$gdb_prompt $" { pass "neg_tests" }
284 -re "$gdb_prompt $" { fail "neg_tests" }
285 timeout { fail "(timeout) neg_tests" }
289 proc all_ext_tests { } {
294 send_gdb "x/4i ext_tests\n"
301 .*$gdb_prompt $" { pass "ext_tests" }
302 -re "$gdb_prompt $" { fail "ext_tests" }
303 timeout { fail "(timeout) ext_tests" }
307 proc all_tas_mac_tests { } {
312 send_gdb "x/7i tas_mac_tests\n"
316 .*mac\t@er1\\+,@er2\\+.*
322 .*$gdb_prompt $" { pass "tas_mac_tests" }
323 -re "$gdb_prompt $" { fail "tas_mac_tests" }
324 timeout { fail "(timeout) tas_mac_tests" }
328 proc all_logic_operations_tests { } {
333 send_gdb "x/21i logic_operations_tests\n"
338 .*and.w\t#0x1234,r0.*
340 .*and.l\t#0x12345678,er0.*
346 .*or.l\t#0x12345678,er0.*
348 .*xor(.b|)\t#0x12,r0l.*
349 .*xor(.b|)\tr1l,r2h.*
350 .*xor.w\t#0x1234,r0.*
352 .*xor.l\t#0x12345678,er0.*
357 .*$gdb_prompt $" { pass "logic_operations_tests" }
358 -re "$gdb_prompt $" { fail "logic_operations_tests" }
359 timeout { fail "(timeout) logic_operations_tests" }
363 proc all_sha_shl_tests { } {
368 send_gdb "x/12i sha_shl_tests\n"
383 .*$gdb_prompt $" { pass "sha_shl_tests" }
384 -re "$gdb_prompt $" { fail "sha_shl_tests" }
385 timeout { fail "(timeout) sha_shl_tests" }
389 proc all_rot_rotx_tests { } {
394 send_gdb "x/12i rot_rotx_tests\n"
409 .*$gdb_prompt $" { pass "rot_rotx_tests" }
410 -re "$gdb_prompt $" { fail "rot_rotx_tests" }
411 timeout { fail "(timeout) rot_rotx_tests" }
415 proc all_bset_bclr_tests { } {
420 send_gdb "x/20i bset_bclr_tests\n"
425 .*bset\t#0x5,@0x12:8.*
426 .*bset\t#0x4,@0x1234:16.*
427 .*bset\t#0x3,@0x12345678:32.*
430 .*bset\tr5l,@0x12:8.*
431 .*bset\tr4l,@0x1234:16.*
432 .*bset\tr3l,@0x12345678:32.*
435 .*bclr\t#0x5,@0x12:8.*
436 .*bclr\t#0x4,@0x1234:16.*
437 .*bclr\t#0x3,@0x12345678:32.*
440 .*bclr\tr5h,@0x12:8.*
441 .*bclr\tr4h,@0x1234:16.*
442 .*bclr\tr3h,@0x12345678:32.*
443 .*$gdb_prompt $" { pass "bset_bclr_tests" }
444 -re "$gdb_prompt $" { fail "bset_bclr_tests" }
445 timeout { fail "(timeout) bset_bclr_tests" }
449 proc all_bnot_btst_tests { } {
454 send_gdb "x/20i bnot_btst_tests\n"
459 .*bnot\t#0x5,@0x12:8.*
460 .*bnot\t#0x4,@0x1234:16.*
461 .*bnot\t#0x3,@0x12345678:32.*
464 .*bnot\tr5l,@0x12:8.*
465 .*bnot\tr4l,@0x1234:16.*
466 .*bnot\tr3l,@0x12345678:32.*
469 .*btst\t#0x5,@0x12:8.*
470 .*btst\t#0x4,@0x1234:16.*
471 .*btst\t#0x3,@0x12345678:32.*
474 .*btst\tr5h,@0x12:8.*
475 .*btst\tr4h,@0x1234:16.*
476 .*btst\tr3h,@0x12345678:32.*
477 .*$gdb_prompt $" { pass "bnot_btst_tests" }
478 -re "$gdb_prompt $" { fail "bnot_btst_tests" }
479 timeout { fail "(timeout) bnot_btst_tests" }
483 proc all_band_bor_bxor_tests { } {
488 send_gdb "x/15i band_bor_bxor_tests\n"
493 .*band\t#0x5,@0x12:8.*
494 .*band\t#0x4,@0x1234:16.*
495 .*band\t#0x3,@0x12345678:32.*
498 .*bor\t#0x5,@0x12:8.*
499 .*bor\t#0x4,@0x1234:16.*
500 .*bor\t#0x3,@0x12345678:32.*
503 .*bxor\t#0x5,@0x12:8.*
504 .*bxor\t#0x4,@0x1234:16.*
505 .*bxor\t#0x3,@0x12345678:32.*
506 .*$gdb_prompt $" { pass "band_bor_bxor_tests" }
507 -re "$gdb_prompt $" { fail "band_bor_bxor_tests" }
508 timeout { fail "(timeout) band_bor_bxor_tests" }
512 proc all_bld_bst_tests { } {
517 send_gdb "x/20i bld_bst_tests\n"
522 .*bld\t#0x5,@0x12:8.*
523 .*bld\t#0x4,@0x1234:16.*
524 .*bld\t#0x3,@0x12345678:32.*
527 .*bild\t#0x5,@0x12:8.*
528 .*bild\t#0x4,@0x1234:16.*
529 .*bild\t#0x3,@0x12345678:32.*
532 .*bst\t#0x5,@0x12:8.*
533 .*bst\t#0x4,@0x1234:16.*
534 .*bst\t#0x3,@0x12345678:32.*
537 .*bist\t#0x5,@0x12:8.*
538 .*bist\t#0x4,@0x1234:16.*
539 .*bist\t#0x3,@0x12345678:32.*
540 .*$gdb_prompt $" { pass "bld_bst_tests" }
541 -re "$gdb_prompt $" { fail "bld_bst_tests" }
542 timeout { fail "(timeout) bld_bst_tests" }
546 proc all_branch_tests { } {
551 send_gdb "x/25i branch_tests\n"
554 .*bra\t(branch_tests|.-2 ).*
555 .*brn\t(branch_tests|.-4 ).*
556 .*bhi\t(branch_tests|.-6 ).*
557 .*bls\t(branch_tests|.-8 ).*
558 .*bcc\t(branch_tests|.-10 ).*
559 .*bcs\t(branch_tests|.-12 ).*
560 .*bne\t(branch_tests|.-14 ).*
561 .*beq\t(branch_tests|.-16 ).*
562 .*bvc\t(branch_tests|.-18 ).*
563 .*bvs\t(branch_tests|.-20 ).*
564 .*bpl\t(branch_tests|.-22 ).*
565 .*bmi\t(branch_tests|.-24 ).*
566 .*bge\t(branch_tests|.-26 ).*
567 .*blt\t(branch_tests|.-28 ).*
568 .*bgt\t(branch_tests|.-30 ).*
569 .*ble\t(branch_tests|.-32 ).*
571 .*jmp\t@(branch_tests|0x).*
572 .*jmp\t@@0 \\((0x|)0\\).*
573 .*bsr\t(branch_tests|.-42 ).*
574 .*bsr\t(branch_tests|.-46 ).*
576 .*jsr\t@(branch_tests|0x).*
577 .*jsr\t@@0 \\((0x|)0\\).*
579 .*$gdb_prompt $" { pass "branch_tests" }
580 -re "$gdb_prompt $" { fail "branch_tests" }
581 timeout { fail "(timeout) branch_tests" }
585 proc all_system_control_tests { } {
590 send_gdb "x/40i system_control_tests\n"
599 .*ldc\t@\\(0x1234:16,er0\\),ccr.*
600 .*ldc\t@\\(0x12345678:32,er0\\),ccr.*
602 .*ldc\t@0x1234:16,ccr.*
603 .*ldc\t@0x12345678:32,ccr.*
606 .*stc\tccr,@\\(0x1234:16,er0\\).*
607 .*stc\tccr,@\\(0x12345678:32,er0\\).*
609 .*stc\tccr,@0x1234:16.*
610 .*stc\tccr,@0x12345678:32.*
617 .*ldc\t@\\(0x1234:16,er0\\),exr.*
618 .*ldc\t@\\(0x12345678:32,er0\\),exr.*
620 .*ldc\t@0x1234:16,exr.*
621 .*ldc\t@0x12345678:32,exr.*
624 .*stc\texr,@\\(0x1234:16,er0\\).*
625 .*stc\texr,@\\(0x12345678:32,er0\\).*
627 .*stc\texr,@0x1234:16.*
628 .*stc\texr,@0x12345678:32.*
633 .*$gdb_prompt $" { pass "system_control_tests" }
634 -re "$gdb_prompt $" { fail "system_control_tests" }
635 timeout { fail "(timeout) system_control_tests" }
639 proc all_block_data_transfer_tests { } {
644 send_gdb "x/2i block_data_transfer_tests\n"
649 .*$gdb_prompt $" { pass "block_data_transfer_tests" }
650 -re "$gdb_prompt $" { fail "block_data_transfer_tests" }
651 timeout { fail "(timeout) block_data_transfer_tests" }
657 gdb_reinitialize_dir $srcdir/$subdir
658 all_set_machine_h8300s
666 all_movfpe_movtpe_tests
668 # Arithmetic operations
669 all_add_sub_addx_subx_tests
670 all_inc_dec_adds_subs_tests
679 all_logic_operations_tests
688 all_band_bor_bxor_tests
695 all_system_control_tests
697 # Block data transfer
698 all_block_data_transfer_tests