old-cross-binutils/gdb/testsuite/gdb.disasm/h8300s.exp

695 lines
15 KiB
Text
Raw Normal View History

2011-01-01 15:34:07 +00:00
# Copyright (C) 2000, 2007, 2008, 2009, 2010, 2011
# Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# This file was written by Kazu Hirata. (kazu@hxi.com)
if $tracelevel then {
strace $tracelevel
}
if ![istarget "h8300*-*-*"] {
verbose "Tests ignored for all but h8300s based targets."
return
}
set testfile "h8300s"
set srcfile ${srcdir}/${subdir}/${testfile}.s
set binfile ${objdir}/${subdir}/${testfile}
if { [gdb_compile "${srcfile}" "${binfile}" executable {debug additional_flags=-ms}] != "" } {
* gdb.arch/altivec-abi.exp: Replace gdb_suppress_entire_file with untested followed by return combination. * gdb.arch/altivec-regs.exp: Likewise. * gdb.arch/e500-abi.exp: Likewise. * gdb.arch/e500-regs.exp: Likewise. * gdb.arch/gdb1291.exp: Likewise. * gdb.arch/gdb1431.exp: Likewise. * gdb.arch/gdb1558.exp: Likewise. * gdb.arch/i386-prologue.exp: Likewise. * gdb.arch/i386-unwind.exp: Likewise. * gdb.asm/asm-source.exp: Likewise. * gdb.base/a2-run.exp: Likewise. * gdb.base/advance.exp: Likewise. * gdb.base/all-bin.exp: Likewise. * gdb.base/annota1.exp: Likewise. * gdb.base/annota3.exp: Likewise. * gdb.base/args.exp: Likewise. * gdb.base/arithmet.exp: Likewise. * gdb.base/assign.exp: Likewise. * gdb.base/async.exp: Likewise. * gdb.base/attach.exp: Likewise. * gdb.base/bang.exp: Likewise. * gdb.base/bigcore.exp: Likewise. * gdb.base/bitfields.exp: Likewise. * gdb.base/bitfields2.exp: Likewise. * gdb.base/break.exp: Likewise. * gdb.base/call-sc.exp: Likewise. * gdb.base/call-strs.exp: Likewise. * gdb.base/callfuncs.exp: Likewise. * gdb.base/checkpoint.exp: Likewise. * gdb.base/chng-syms.exp: Likewise. * gdb.base/code-expr.exp: Likewise. * gdb.base/commands.exp: Likewise. * gdb.base/completion.exp: Likewise. * gdb.base/cond-expr.exp: Likewise. * gdb.base/condbreak.exp: Likewise. * gdb.base/consecutive.exp: Likewise. * gdb.base/constvars.exp: Likewise. * gdb.base/corefile.exp: Likewise. * gdb.base/cvexpr.exp: Likewise. * gdb.base/dbx.exp: Likewise. * gdb.base/define.exp: Likewise. * gdb.base/detach.exp: Likewise. * gdb.base/display.exp: Likewise. * gdb.base/dump.exp: Likewise. * gdb.base/ena-dis-br.exp: Likewise. * gdb.base/ending-run.exp: Likewise. * gdb.base/environ.exp: Likewise. * gdb.base/eval-skip.exp: Likewise. * gdb.base/exprs.exp: Likewise. * gdb.base/fileio.exp: Likewise. * gdb.base/finish.exp: Likewise. * gdb.base/float.exp: Likewise. * gdb.base/foll-exec.exp: Likewise. * gdb.base/foll-fork.exp: Likewise. * gdb.base/foll-vfork.exp: Likewise. * gdb.base/freebpcmd.exp: Likewise. * gdb.base/funcargs.exp: Likewise. * gdb.base/gcore.exp: Likewise. * gdb.base/gdb1090.exp: Likewise. * gdb.base/gdb1250.exp: Likewise. * gdb.base/huge.exp: Likewise. * gdb.base/info-proc.exp: Likewise. * gdb.base/interrupt.exp: Likewise. * gdb.base/jump.exp: Likewise. * gdb.base/langs.exp: Likewise. * gdb.base/lineinc.exp: Likewise. * gdb.base/list.exp: Likewise. * gdb.base/logical.exp: Likewise. * gdb.base/long_long.exp: Likewise. * gdb.base/macscp.exp: Likewise. * gdb.base/maint.exp: Likewise. * gdb.base/mips_pro.exp: Likewise. * gdb.base/miscexprs.exp: Likewise. * gdb.base/multi-forks.exp: Likewise. * gdb.base/opaque.exp: Likewise. * gdb.base/overlays.exp: Likewise. * gdb.base/pc-fp.exp: Likewise. * gdb.base/pointers.exp: Likewise. * gdb.base/printcmds.exp: Likewise. * gdb.base/psymtab.exp: Likewise. * gdb.base/ptype.exp: Likewise. * gdb.base/recurse.exp: Likewise. * gdb.base/relational.exp: Likewise. * gdb.base/relocate.exp: Likewise. * gdb.base/remote.exp: Likewise. * gdb.base/reread.exp: Likewise. * gdb.base/restore.exp: Likewise. * gdb.base/return.exp: Likewise. * gdb.base/return2.exp: Likewise. * gdb.base/scope.exp: Likewise. * gdb.base/sect-cmd.exp: Likewise. * gdb.base/sep.exp: Likewise. * gdb.base/sepdebug.exp: Likewise. * gdb.base/setshow.exp: Likewise. * gdb.base/setvar.exp: Likewise. * gdb.base/sigall.exp: Likewise. * gdb.base/sigbpt.exp: Likewise. * gdb.base/signals.exp: Likewise. * gdb.base/signull.exp: Likewise. * gdb.base/sizeof.exp: Likewise. * gdb.base/solib.exp: Likewise. * gdb.base/step-line.exp: Likewise. * gdb.base/step-test.exp: Likewise. * gdb.base/structs.exp: Likewise. * gdb.base/structs2.exp: Likewise. * gdb.base/term.exp: Likewise. * gdb.base/twice.exp: Likewise. * gdb.base/until.exp: Likewise. * gdb.base/varargs.exp: Likewise. * gdb.base/volatile.exp: Likewise. * gdb.base/watchpoint.exp: Likewise. * gdb.base/whatis-exp.exp: Likewise. * gdb.base/whatis.exp: Likewise. * gdb.cp/ambiguous.exp: Likewise. * gdb.cp/annota2.exp: Likewise. * gdb.cp/annota3.exp: Likewise. * gdb.cp/bool.exp: Likewise. * gdb.cp/breakpoint.exp: Likewise. * gdb.cp/casts.exp: Likewise. * gdb.cp/class2.exp: Likewise. * gdb.cp/classes.exp: Likewise. * gdb.cp/cplusfuncs.exp: Likewise. * gdb.cp/ctti.exp: Likewise. * gdb.cp/derivation.exp: Likewise. * gdb.cp/exception.exp: Likewise. * gdb.cp/gdb1355.exp: Likewise. * gdb.cp/hang.exp: Likewise. * gdb.cp/inherit.exp: Likewise. * gdb.cp/local.exp: Likewise. * gdb.cp/m-data.exp: Likewise. * gdb.cp/m-static.exp: Likewise. * gdb.cp/member-ptr.exp: Likewise. * gdb.cp/method.exp: Likewise. * gdb.cp/misc.exp: Likewise. * gdb.cp/namespace.exp: Likewise. * gdb.cp/overload.exp: Likewise. * gdb.cp/ovldbreak.exp: Likewise. * gdb.cp/pr-1023.exp: Likewise. * gdb.cp/pr-1210.exp: Likewise. * gdb.cp/pr-574.exp: Likewise. * gdb.cp/printmethod.exp: Likewise. * gdb.cp/psmang.exp: Likewise. * gdb.cp/ref-params.exp: Likewise. * gdb.cp/ref-types.exp: Likewise. * gdb.cp/rtti.exp: Likewise. * gdb.cp/templates.exp: Likewise. * gdb.cp/try_catch.exp: Likewise. * gdb.cp/userdef.exp: Likewise. * gdb.cp/virtfunc.exp: Likewise. * gdb.disasm/am33.exp: Likewise. * gdb.disasm/h8300s.exp: Likewise. * gdb.disasm/mn10300.exp: Likewise. * gdb.disasm/sh3.exp: Likewise. * gdb.disasm/t01_mov.exp: Likewise. * gdb.disasm/t02_mova.exp: Likewise. * gdb.disasm/t03_add.exp: Likewise. * gdb.disasm/t04_sub.exp: Likewise. * gdb.disasm/t05_cmp.exp: Likewise. * gdb.disasm/t06_ari2.exp: Likewise. * gdb.disasm/t07_ari3.exp: Likewise. * gdb.disasm/t08_or.exp: Likewise. * gdb.disasm/t09_xor.exp: Likewise. * gdb.disasm/t10_and.exp: Likewise. * gdb.disasm/t11_logs.exp: Likewise. * gdb.disasm/t12_bit.exp: Likewise. * gdb.disasm/t13_otr.exp: Likewise. * gdb.hp/gdb.aCC/optimize.exp: Likewise. * gdb.hp/gdb.aCC/watch-cmd.exp: Likewise. * gdb.hp/gdb.base-hp/callfwmall.exp: Likewise. * gdb.hp/gdb.base-hp/dollar.exp: Likewise. * gdb.hp/gdb.base-hp/hwwatchbus.exp: Likewise. * gdb.hp/gdb.base-hp/pxdb.exp: Likewise. * gdb.hp/gdb.base-hp/reg-pa64.exp: Likewise. * gdb.hp/gdb.base-hp/reg.exp: Likewise. * gdb.hp/gdb.base-hp/sized-enum.exp: Likewise. * gdb.hp/gdb.compat/xdb1.exp: Likewise. * gdb.hp/gdb.compat/xdb3.exp: Likewise. * gdb.hp/gdb.objdbg/objdbg01.exp: Likewise. * gdb.hp/gdb.objdbg/objdbg02.exp: Likewise. * gdb.hp/gdb.objdbg/objdbg03.exp: Likewise. * gdb.hp/gdb.objdbg/objdbg04.exp: Likewise. * gdb.mi/gdb701.exp: Likewise. * gdb.mi/gdb792.exp: Likewise. * gdb.mi/mi-basics.exp: Likewise. * gdb.mi/mi-break.exp: Likewise. * gdb.mi/mi-cli.exp: Likewise. * gdb.mi/mi-console.exp: Likewise. * gdb.mi/mi-disassemble.exp: Likewise. * gdb.mi/mi-eval.exp: Likewise. * gdb.mi/mi-file.exp: Likewise. * gdb.mi/mi-read-memory.exp: Likewise. * gdb.mi/mi-regs.exp: Likewise. * gdb.mi/mi-return.exp: Likewise. * gdb.mi/mi-simplerun.exp: Likewise. * gdb.mi/mi-stack.exp: Likewise. * gdb.mi/mi-stepi.exp: Likewise. * gdb.mi/mi-syn-frame.exp: Likewise. * gdb.mi/mi-until.exp: Likewise. * gdb.mi/mi-var-block.exp: Likewise. * gdb.mi/mi-var-child.exp: Likewise. * gdb.mi/mi-var-cmd.exp: Likewise. * gdb.mi/mi-var-display.exp: Likewise. * gdb.mi/mi-watch.exp: Likewise. * gdb.mi/mi2-basics.exp: Likewise. * gdb.mi/mi2-break.exp: Likewise. * gdb.mi/mi2-cli.exp: Likewise. * gdb.mi/mi2-console.exp: Likewise. * gdb.mi/mi2-disassemble.exp: Likewise. * gdb.mi/mi2-eval.exp: Likewise. * gdb.mi/mi2-file.exp: Likewise. * gdb.mi/mi2-read-memory.exp: Likewise. * gdb.mi/mi2-regs.exp: Likewise. * gdb.mi/mi2-return.exp: Likewise. * gdb.mi/mi2-simplerun.exp: Likewise. * gdb.mi/mi2-stack.exp: Likewise. * gdb.mi/mi2-stepi.exp: Likewise. * gdb.mi/mi2-syn-frame.exp: Likewise. * gdb.mi/mi2-until.exp: Likewise. * gdb.mi/mi2-var-block.exp: Likewise. * gdb.mi/mi2-var-child.exp: Likewise. * gdb.mi/mi2-var-cmd.exp: Likewise. * gdb.mi/mi2-var-display.exp: Likewise. * gdb.mi/mi2-watch.exp: Likewise. * gdb.stabs/exclfwd.exp: Likewise. * gdb.stabs/weird.exp: Likewise. * gdb.threads/gcore-thread.exp: Likewise. * gdb.trace/actions.exp: Likewise. * gdb.trace/backtrace.exp: Likewise. * gdb.trace/circ.exp: Likewise. * gdb.trace/collection.exp: Likewise. * gdb.trace/deltrace.exp: Likewise. * gdb.trace/infotrace.exp: Likewise. * gdb.trace/limits.exp: Likewise. * gdb.trace/packetlen.exp: Likewise. * gdb.trace/passc-dyn.exp: Likewise. * gdb.trace/passcount.exp: Likewise. * gdb.trace/report.exp: Likewise. * gdb.trace/save-trace.exp: Likewise. * gdb.trace/tfind.exp: Likewise. * gdb.trace/tracecmd.exp: Likewise. * gdb.trace/while-dyn.exp: Likewise. * gdb.trace/while-stepping.exp: Likewise.
2006-08-10 05:27:22 +00:00
untested h8300s.exp
return -1
}
proc all_set_machine_h8300s { } {
global gdb_prompt
global hex
global decimal
send_gdb "set machine h8300s\n"
gdb_expect {
-re "$gdb_prompt $" {}
}
}
proc all_movb_tests { } {
global gdb_prompt
global hex
global decimal
send_gdb "x/9i movb_tests\n"
gdb_expect {
-re "
.*mov.b\tr0l,r0h.*
.*mov.b\t#0x12,r1l.*
.*mov.b\t@er0,r1h.*
.*mov.b\t@\\(0x1234:16,er0\\),r2l.*
.*mov.b\t@\\(0x12345678:32,er0\\),r2h.*
.*mov.b\t@er0\\+,r3l.*
.*mov.b\t@0x12:8,r3h.*
.*mov.b\t@0x1234:16,r4l.*
.*mov.b\t@0x12345678:32,r4h.*
.*$gdb_prompt $" { pass "movb_tests" }
-re "$gdb_prompt $" { fail "movb_tests" }
timeout { fail "(timeout) movb_tests" }
}
}
proc all_movw_tests { } {
global gdb_prompt
global hex
global decimal
send_gdb "x/8i movw_tests\n"
gdb_expect {
-re "
.*mov.w\te0,r0.*
.*mov.w\t#0x1234,r1.*
.*mov.w\t@er0,r2.*
.*mov.w\t@\\(0x1234:16,er0\\),r3.*
.*mov.w\t@\\(0x12345678:32,er0\\),r4.*
.*mov.w\t@er0\\+,r5.*
.*mov.w\t@0x1234:16,r6.*
.*mov.w\t@0x12345678:32,r7.*
.*$gdb_prompt $" { pass "movw_tests" }
-re "$gdb_prompt $" { fail "movw_tests" }
timeout { fail "(timeout) movw_tests" }
}
}
proc all_movl_tests { } {
global gdb_prompt
global hex
global decimal
send_gdb "x/8i movl_tests\n"
gdb_expect {
-re "
.*mov.l\ter0,er1.*
.*mov.l\t#0x12345678,er1.*
.*mov.l\t@er0,er2.*
.*mov.l\t@\\(0x1234:16,er0\\),er3.*
.*mov.l\t@\\(0x12345678:32,er0\\),er4.*
.*mov.l\t@er0\\+,er5.*
.*mov.l\t@0x1234:16,er6.*
.*mov.l\t@0x12345678:32,er7.*
.*$gdb_prompt $" { pass "movl_tests" }
-re "$gdb_prompt $" { fail "movl_tests" }
timeout { fail "(timeout) movl_tests" }
}
}
proc all_ldm_stm_tests { } {
global gdb_prompt
global hex
global decimal
send_gdb "x/6i ldm_stm_tests\n"
gdb_expect {
-re "
.*ldm.l\t@sp\\+,er0-er1.*
.*ldm.l\t@sp\\+,er0-er2.*
.*ldm.l\t@sp\\+,er0-er3.*
.*stm.l\ter0\\-er1,@-sp.*
.*stm.l\ter0\\-er2,@-sp.*
.*stm.l\ter0\\-er3,@-sp.*
.*$gdb_prompt $" { pass "ldm_stm_tests" }
-re "$gdb_prompt $" { fail "ldm_stm_tests" }
timeout { fail "(timeout) ldm_stm_tests" }
}
}
proc all_movfpe_movtpe_tests { } {
global gdb_prompt
global hex
global decimal
send_gdb "x/2i movfpe_movtpe_tests\n"
gdb_expect {
-re "
.*movfpe\t@0x1234:16,r2l.*
.*movtpe\tr2l,@0x1234:16.*
.*$gdb_prompt $" { pass "movfpe_movtpe_tests" }
-re "$gdb_prompt $" { fail "movfpe_movtpe_tests" }
timeout { fail "(timeout) movfpe_movtpe_tests" }
}
}
proc all_add_sub_addx_subx_tests { } {
global gdb_prompt
global hex
global decimal
send_gdb "x/15i add_sub_addx_subx_tests\n"
gdb_expect {
-re "
.*add.b\t#0x12,r0l.*
.*add.b\tr1l,r1h.*
.*add.w\t#0x1234,r2.*
.*add.w\tr3,r4.*
.*add.l\t#0x12345678,er5.*
.*add.l\ter6,er7.*
.*sub.b\tr1l,r1h.*
.*sub.w\t#0x1234,r2.*
.*sub.w\tr3,r4.*
.*sub.l\t#0x12345678,er5.*
.*sub.l\ter6,er7.*
.*addx\t#0x12,r0l.*
.*addx\tr1l,r1h.*
.*subx\t#0x12,r0l.*
.*subx\tr1l,r1h.*
.*$gdb_prompt $" { pass "add_sub_addx_subx_tests" }
-re "$gdb_prompt $" { fail "add_sub_addx_subx_tests" }
timeout { fail "(timeout) add_sub_addx_subx_tests" }
}
}
proc all_inc_dec_adds_subs_tests { } {
global gdb_prompt
global hex
global decimal
send_gdb "x/16i inc_dec_adds_subs_tests\n"
gdb_expect {
-re "
.*inc(.b|)\tr0l.*
.*inc.w\t#(0x|)1,r4.*
.*inc.w\t#(0x|)2,r3.*
.*inc.l\t#(0x|)1,er2.*
.*inc.l\t#(0x|)2,er1.*
.*dec.b\tr0l.*
.*dec.w\t#(0x|)1,r4.*
.*dec.w\t#(0x|)2,r3.*
.*dec.l\t#(0x|)1,er2.*
.*dec.l\t#(0x|)2,er1.*
.*adds\t#(0x|)1,er7.*
.*adds\t#(0x|)2,er6.*
.*adds\t#(0x|)4,er5.*
.*subs\t#(0x|)1,er7.*
.*subs\t#(0x|)2,er6.*
.*subs\t#(0x|)4,er5.*
.*$gdb_prompt $" { pass "inc_dec_adds_subs_tests" }
-re "$gdb_prompt $" { fail "inc_dec_adds_subs_tests" }
timeout { fail "(timeout) inc_dec_adds_subs_tests" }
}
}
proc all_daa_das_tests { } {
global gdb_prompt
global hex
global decimal
send_gdb "x/2i daa_das_tests\n"
gdb_expect {
-re "
.*daa\tr0l.*
.*das\tr0h.*
.*$gdb_prompt $" { pass "daa_das_tests" }
-re "$gdb_prompt $" { fail "daa_das_tests" }
timeout { fail "(timeout) daa_das_tests" }
}
}
proc all_mul_div_tests { } {
global gdb_prompt
global hex
global decimal
send_gdb "x/8i mul_div_tests\n"
gdb_expect {
-re "
.*mulxs.b\tr0l,r1.*
.*mulxs.w\tr2,er3.*
.*mulxu.b\tr0l,e1.*
.*mulxu.w\te2,er3.*
.*divxs.b\tr0l,r1.*
.*divxs.w\tr2,er3.*
.*divxu.b\tr0l,e1.*
.*divxu.w\te2,er3.*
.*$gdb_prompt $" { pass "mul_div_tests" }
-re "$gdb_prompt $" { fail "mul_div_tests" }
timeout { fail "(timeout) mul_div_tests" }
}
}
proc all_cmp_tests { } {
global gdb_prompt
global hex
global decimal
send_gdb "x/8i cmp_tests\n"
gdb_expect {
-re "
.*cmp.b\t#0x12,r0l.*
.*cmp.b\tr1l,r1h.*
.*cmp.w\t#0x1234,r2.*
.*cmp.w\tr3,e3.*
.*cmp.l\t#0x12345678,er4.*
.*cmp.l\ter5,er6.*
.*$gdb_prompt $" { pass "cmp_tests" }
-re "$gdb_prompt $" { fail "cmp_tests" }
timeout { fail "(timeout) cmp_tests" }
}
}
proc all_neg_tests { } {
global gdb_prompt
global hex
global decimal
send_gdb "x/3i neg_tests\n"
gdb_expect {
-re "
.*neg.b\tr0l.*
.*neg.w\tr2.*
.*neg.l\ter3.*
.*$gdb_prompt $" { pass "neg_tests" }
-re "$gdb_prompt $" { fail "neg_tests" }
timeout { fail "(timeout) neg_tests" }
}
}
proc all_ext_tests { } {
global gdb_prompt
global hex
global decimal
send_gdb "x/4i ext_tests\n"
gdb_expect {
-re "
.*exts.w\tr0.*
.*exts.l\ter1.*
.*extu.w\tr2.*
.*extu.l\ter3.*
.*$gdb_prompt $" { pass "ext_tests" }
-re "$gdb_prompt $" { fail "ext_tests" }
timeout { fail "(timeout) ext_tests" }
}
}
proc all_tas_mac_tests { } {
global gdb_prompt
global hex
global decimal
send_gdb "x/7i tas_mac_tests\n"
gdb_expect {
-re "
.*tas\t@er0.*
.*mac\t@er1\\+,@er2\\+.*
.*clrmac.*
.*ldmac\ter4,mach.*
.*ldmac\ter5,macl.*
.*stmac\tmach,er6.*
.*stmac\tmacl,er7.*
.*$gdb_prompt $" { pass "tas_mac_tests" }
-re "$gdb_prompt $" { fail "tas_mac_tests" }
timeout { fail "(timeout) tas_mac_tests" }
}
}
proc all_logic_operations_tests { } {
global gdb_prompt
global hex
global decimal
send_gdb "x/21i logic_operations_tests\n"
gdb_expect {
-re "
.*and.b\t#0x12,r0l.*
.*and.b\tr1l,r2h.*
.*and.w\t#0x1234,r0.*
.*and.w\tr1,r2.*
.*and.l\t#0x12345678,er0.*
.*and.l\ter1,er2.*
.*or.b\t#0x12,r0l.*
.*or.b\tr1l,r2h.*
.*or.w\t#0x1234,r0.*
.*or.w\tr1,r2.*
.*or.l\t#0x12345678,er0.*
.*or.l\ter1,er2.*
.*xor(.b|)\t#0x12,r0l.*
.*xor(.b|)\tr1l,r2h.*
.*xor.w\t#0x1234,r0.*
.*xor.w\tr1,r2.*
.*xor.l\t#0x12345678,er0.*
.*xor.l\ter1,er2.*
.*not.b\tr0l.*
.*not.w\tr1.*
.*not.l\ter2.*
.*$gdb_prompt $" { pass "logic_operations_tests" }
-re "$gdb_prompt $" { fail "logic_operations_tests" }
timeout { fail "(timeout) logic_operations_tests" }
}
}
proc all_sha_shl_tests { } {
global gdb_prompt
global hex
global decimal
send_gdb "x/12i sha_shl_tests\n"
gdb_expect {
-re "
.*shal(.b|)\tr0l.*
.*shal(.w|)\tr1.*
.*shal(.l|)\ter2.*
.*shar(.b|)\tr3l.*
.*shar(.w|)\tr4.*
.*shar(.l|)\ter5.*
.*shll(.b|)\tr0l.*
.*shll(.w|)\tr1.*
.*shll(.l|)\ter2.*
.*shlr(.b|)\tr3l.*
.*shlr(.w|)\tr4.*
.*shlr(.l|)\ter5.*
.*$gdb_prompt $" { pass "sha_shl_tests" }
-re "$gdb_prompt $" { fail "sha_shl_tests" }
timeout { fail "(timeout) sha_shl_tests" }
}
}
proc all_rot_rotx_tests { } {
global gdb_prompt
global hex
global decimal
send_gdb "x/12i rot_rotx_tests\n"
gdb_expect {
-re "
.*rotl(.b|)\tr0l.*
.*rotl(.w|)\tr1.*
.*rotl(.l|)\ter2.*
.*rotr(.b|)\tr3l.*
.*rotr(.w|)\tr4.*
.*rotr(.l|)\ter5.*
.*rotxl(.b|)\tr0l.*
.*rotxl(.w|)\tr1.*
.*rotxl(.l|)\ter2.*
.*rotxr(.b|)\tr3l.*
.*rotxr(.w|)\tr4.*
.*rotxr(.l|)\ter5.*
.*$gdb_prompt $" { pass "rot_rotx_tests" }
-re "$gdb_prompt $" { fail "rot_rotx_tests" }
timeout { fail "(timeout) rot_rotx_tests" }
}
}
proc all_bset_bclr_tests { } {
global gdb_prompt
global hex
global decimal
send_gdb "x/20i bset_bclr_tests\n"
gdb_expect {
-re "
.*bset\t#0x7,r0l.*
.*bset\t#0x6,@er1.*
.*bset\t#0x5,@0x12:8.*
.*bset\t#0x4,@0x1234:16.*
.*bset\t#0x3,@0x12345678:32.*
.*bset\tr7l,r0h.*
.*bset\tr6l,@er1.*
.*bset\tr5l,@0x12:8.*
.*bset\tr4l,@0x1234:16.*
.*bset\tr3l,@0x12345678:32.*
.*bclr\t#0x7,r0l.*
.*bclr\t#0x6,@er1.*
.*bclr\t#0x5,@0x12:8.*
.*bclr\t#0x4,@0x1234:16.*
.*bclr\t#0x3,@0x12345678:32.*
.*bclr\tr7h,r0h.*
.*bclr\tr6h,@er1.*
.*bclr\tr5h,@0x12:8.*
.*bclr\tr4h,@0x1234:16.*
.*bclr\tr3h,@0x12345678:32.*
.*$gdb_prompt $" { pass "bset_bclr_tests" }
-re "$gdb_prompt $" { fail "bset_bclr_tests" }
timeout { fail "(timeout) bset_bclr_tests" }
}
}
proc all_bnot_btst_tests { } {
global gdb_prompt
global hex
global decimal
send_gdb "x/20i bnot_btst_tests\n"
gdb_expect {
-re "
.*bnot\t#0x7,r0l.*
.*bnot\t#0x6,@er1.*
.*bnot\t#0x5,@0x12:8.*
.*bnot\t#0x4,@0x1234:16.*
.*bnot\t#0x3,@0x12345678:32.*
.*bnot\tr7l,r0h.*
.*bnot\tr6l,@er1.*
.*bnot\tr5l,@0x12:8.*
.*bnot\tr4l,@0x1234:16.*
.*bnot\tr3l,@0x12345678:32.*
.*btst\t#0x7,r0l.*
.*btst\t#0x6,@er1.*
.*btst\t#0x5,@0x12:8.*
.*btst\t#0x4,@0x1234:16.*
.*btst\t#0x3,@0x12345678:32.*
.*btst\tr7h,r0h.*
.*btst\tr6h,@er1.*
.*btst\tr5h,@0x12:8.*
.*btst\tr4h,@0x1234:16.*
.*btst\tr3h,@0x12345678:32.*
.*$gdb_prompt $" { pass "bnot_btst_tests" }
-re "$gdb_prompt $" { fail "bnot_btst_tests" }
timeout { fail "(timeout) bnot_btst_tests" }
}
}
proc all_band_bor_bxor_tests { } {
global gdb_prompt
global hex
global decimal
send_gdb "x/15i band_bor_bxor_tests\n"
gdb_expect {
-re "
.*band\t#0x7,r0l.*
.*band\t#0x6,@er1.*
.*band\t#0x5,@0x12:8.*
.*band\t#0x4,@0x1234:16.*
.*band\t#0x3,@0x12345678:32.*
.*bor\t#0x7,r0l.*
.*bor\t#0x6,@er1.*
.*bor\t#0x5,@0x12:8.*
.*bor\t#0x4,@0x1234:16.*
.*bor\t#0x3,@0x12345678:32.*
.*bxor\t#0x7,r0l.*
.*bxor\t#0x6,@er1.*
.*bxor\t#0x5,@0x12:8.*
.*bxor\t#0x4,@0x1234:16.*
.*bxor\t#0x3,@0x12345678:32.*
.*$gdb_prompt $" { pass "band_bor_bxor_tests" }
-re "$gdb_prompt $" { fail "band_bor_bxor_tests" }
timeout { fail "(timeout) band_bor_bxor_tests" }
}
}
proc all_bld_bst_tests { } {
global gdb_prompt
global hex
global decimal
send_gdb "x/20i bld_bst_tests\n"
gdb_expect {
-re "
.*bld\t#0x7,r0l.*
.*bld\t#0x6,@er1.*
.*bld\t#0x5,@0x12:8.*
.*bld\t#0x4,@0x1234:16.*
.*bld\t#0x3,@0x12345678:32.*
.*bild\t#0x7,r0l.*
.*bild\t#0x6,@er1.*
.*bild\t#0x5,@0x12:8.*
.*bild\t#0x4,@0x1234:16.*
.*bild\t#0x3,@0x12345678:32.*
.*bst\t#0x7,r0l.*
.*bst\t#0x6,@er1.*
.*bst\t#0x5,@0x12:8.*
.*bst\t#0x4,@0x1234:16.*
.*bst\t#0x3,@0x12345678:32.*
.*bist\t#0x7,r0l.*
.*bist\t#0x6,@er1.*
.*bist\t#0x5,@0x12:8.*
.*bist\t#0x4,@0x1234:16.*
.*bist\t#0x3,@0x12345678:32.*
.*$gdb_prompt $" { pass "bld_bst_tests" }
-re "$gdb_prompt $" { fail "bld_bst_tests" }
timeout { fail "(timeout) bld_bst_tests" }
}
}
proc all_branch_tests { } {
global gdb_prompt
global hex
global decimal
send_gdb "x/25i branch_tests\n"
gdb_expect {
-re "
.*bra\t(branch_tests|.-2 ).*
.*brn\t(branch_tests|.-4 ).*
.*bhi\t(branch_tests|.-6 ).*
.*bls\t(branch_tests|.-8 ).*
.*bcc\t(branch_tests|.-10 ).*
.*bcs\t(branch_tests|.-12 ).*
.*bne\t(branch_tests|.-14 ).*
.*beq\t(branch_tests|.-16 ).*
.*bvc\t(branch_tests|.-18 ).*
.*bvs\t(branch_tests|.-20 ).*
.*bpl\t(branch_tests|.-22 ).*
.*bmi\t(branch_tests|.-24 ).*
.*bge\t(branch_tests|.-26 ).*
.*blt\t(branch_tests|.-28 ).*
.*bgt\t(branch_tests|.-30 ).*
.*ble\t(branch_tests|.-32 ).*
.*jmp\t@er0.*
.*jmp\t@(branch_tests|0x).*
.*jmp\t@@0 \\((0x|)0\\).*
.*bsr\t(branch_tests|.-42 ).*
.*bsr\t(branch_tests|.-46 ).*
.*jsr\t@er0.*
.*jsr\t@(branch_tests|0x).*
.*jsr\t@@0 \\((0x|)0\\).*
.*rts.*
.*$gdb_prompt $" { pass "branch_tests" }
-re "$gdb_prompt $" { fail "branch_tests" }
timeout { fail "(timeout) branch_tests" }
}
}
proc all_system_control_tests { } {
global gdb_prompt
global hex
global decimal
send_gdb "x/40i system_control_tests\n"
gdb_expect {
-re "
.*trapa\t#0x2.*
.*rte.*
.*sleep.*
.*ldc\t#0x12,ccr*.
.*ldc\tr3l,ccr.*
.*ldc\t@er0,ccr.*
.*ldc\t@\\(0x1234:16,er0\\),ccr.*
.*ldc\t@\\(0x12345678:32,er0\\),ccr.*
.*ldc\t@er1\\+,ccr.*
.*ldc\t@0x1234:16,ccr.*
.*ldc\t@0x12345678:32,ccr.*
.*stc\tccr,r3l.*
.*stc\tccr,@er0.*
.*stc\tccr,@\\(0x1234:16,er0\\).*
.*stc\tccr,@\\(0x12345678:32,er0\\).*
.*stc\tccr,@\\-er1.*
.*stc\tccr,@0x1234:16.*
.*stc\tccr,@0x12345678:32.*
.*andc\t#0x12,ccr.*
.*orc\t#0x34,ccr.*
.*xorc\t#0x56,ccr.*
.*ldc\t#0x12,exr*.
.*ldc\tr3l,exr.*
.*ldc\t@er0,exr.*
.*ldc\t@\\(0x1234:16,er0\\),exr.*
.*ldc\t@\\(0x12345678:32,er0\\),exr.*
.*ldc\t@er1\\+,exr.*
.*ldc\t@0x1234:16,exr.*
.*ldc\t@0x12345678:32,exr.*
.*stc\texr,r3l.*
.*stc\texr,@er0.*
.*stc\texr,@\\(0x1234:16,er0\\).*
.*stc\texr,@\\(0x12345678:32,er0\\).*
.*stc\texr,@\\-er1.*
.*stc\texr,@0x1234:16.*
.*stc\texr,@0x12345678:32.*
.*andc\t#0x12,exr.*
.*orc\t#0x34,exr.*
.*xorc\t#0x56,exr.*
.*nop.*
.*$gdb_prompt $" { pass "system_control_tests" }
-re "$gdb_prompt $" { fail "system_control_tests" }
timeout { fail "(timeout) system_control_tests" }
}
}
proc all_block_data_transfer_tests { } {
global gdb_prompt
global hex
global decimal
send_gdb "x/2i block_data_transfer_tests\n"
gdb_expect {
-re "
.*eepmov.b.*
.*eepmov.w.*
.*$gdb_prompt $" { pass "block_data_transfer_tests" }
-re "$gdb_prompt $" { fail "block_data_transfer_tests" }
timeout { fail "(timeout) block_data_transfer_tests" }
}
}
gdb_exit
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
all_set_machine_h8300s
gdb_load $binfile
# Data transfer
all_movb_tests
all_movw_tests
all_movl_tests
all_ldm_stm_tests
all_movfpe_movtpe_tests
# Arithmetic operations
all_add_sub_addx_subx_tests
all_inc_dec_adds_subs_tests
all_daa_das_tests
all_mul_div_tests
all_cmp_tests
all_neg_tests
all_ext_tests
all_tas_mac_tests
# Logic operations
all_logic_operations_tests
# Shift
all_sha_shl_tests
all_rot_rotx_tests
# Bit manipulation
all_bset_bclr_tests
all_bnot_btst_tests
all_band_bor_bxor_tests
all_bld_bst_tests
# Branch
all_branch_tests
# System control
all_system_control_tests
# Block data transfer
all_block_data_transfer_tests