mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-11-26 03:24:41 +08:00
sim: avr: start a basic testsuite
Just enough to know the sim isn't totally broken.
This commit is contained in:
parent
510d27512c
commit
eca5fe422e
@ -1,3 +1,8 @@
|
||||
2015-03-28 Mike Frysinger <vapier@gentoo.org>
|
||||
|
||||
* configure: Regenerate.
|
||||
* configure.tgt (avr*-*-*): Set sim_testsuite=yes.
|
||||
|
||||
2015-03-28 James Bowman <james.bowman@ftdichip.com>
|
||||
|
||||
* configure.tgt: Add FT32 entry.
|
||||
|
1
sim/configure
vendored
1
sim/configure
vendored
@ -3642,6 +3642,7 @@ subdirs="$subdirs arm"
|
||||
subdirs="$subdirs avr"
|
||||
|
||||
|
||||
sim_testsuite=yes
|
||||
;;
|
||||
bfin-*-*)
|
||||
|
||||
|
@ -22,6 +22,7 @@ case "${target}" in
|
||||
;;
|
||||
avr*-*-*)
|
||||
SIM_ARCH(avr)
|
||||
sim_testsuite=yes
|
||||
;;
|
||||
bfin-*-*)
|
||||
SIM_ARCH(bfin)
|
||||
|
@ -1,3 +1,7 @@
|
||||
2015-03-28 Mike Frysinger <vapier@gentoo.org>
|
||||
|
||||
* configure: Regenerate.
|
||||
|
||||
2015-03-28 James Bowman <james.bowman@ftdichip.com>
|
||||
|
||||
* configure: Regenerate.
|
||||
|
1
sim/testsuite/configure
vendored
1
sim/testsuite/configure
vendored
@ -1829,6 +1829,7 @@ case "${target}" in
|
||||
;;
|
||||
avr*-*-*)
|
||||
sim_arch=avr
|
||||
sim_testsuite=yes
|
||||
;;
|
||||
bfin-*-*)
|
||||
sim_arch=bfin
|
||||
|
3
sim/testsuite/sim/avr/ChangeLog
Normal file
3
sim/testsuite/sim/avr/ChangeLog
Normal file
@ -0,0 +1,3 @@
|
||||
2015-03-28 Mike Frysinger <vapier@gentoo.org>
|
||||
|
||||
* pass.s, allinsn.exp, testutils.inc: New files.
|
15
sim/testsuite/sim/avr/allinsn.exp
Normal file
15
sim/testsuite/sim/avr/allinsn.exp
Normal file
@ -0,0 +1,15 @@
|
||||
# avr simulator testsuite
|
||||
|
||||
if [istarget avr-*] {
|
||||
# all machines
|
||||
set all_machs "avr"
|
||||
|
||||
foreach src [lsort [glob -nocomplain $srcdir/$subdir/*.s]] {
|
||||
# If we're only testing specific files and this isn't one of them,
|
||||
# skip it.
|
||||
if ![runtest_file_p $runtests $src] {
|
||||
continue
|
||||
}
|
||||
run_sim_test $src $all_machs
|
||||
}
|
||||
}
|
7
sim/testsuite/sim/avr/pass.s
Normal file
7
sim/testsuite/sim/avr/pass.s
Normal file
@ -0,0 +1,7 @@
|
||||
# check that the sim doesn't die immediately.
|
||||
# mach: avr
|
||||
|
||||
.include "testutils.inc"
|
||||
|
||||
start
|
||||
pass
|
41
sim/testsuite/sim/avr/testutils.inc
Normal file
41
sim/testsuite/sim/avr/testutils.inc
Normal file
@ -0,0 +1,41 @@
|
||||
# MACRO: outc
|
||||
# Write byte to stdout
|
||||
.macro outc ch
|
||||
ldi r16, \ch
|
||||
out 0x32, r16
|
||||
.endm
|
||||
|
||||
# MACRO: exit
|
||||
.macro exit nr
|
||||
ldi r16, \nr
|
||||
out 0x2f, r16
|
||||
.endm
|
||||
|
||||
# MACRO: pass
|
||||
# Write 'pass' to stdout and quit
|
||||
.macro pass
|
||||
outc 'p'
|
||||
outc 'a'
|
||||
outc 's'
|
||||
outc 's'
|
||||
outc '\n'
|
||||
exit 0
|
||||
.endm
|
||||
|
||||
# MACRO: fail
|
||||
# Write 'fail' to stdout and quit
|
||||
.macro fail
|
||||
outc 'f'
|
||||
outc 'a'
|
||||
outc 'i'
|
||||
outc 'l'
|
||||
outc '\n'
|
||||
exit 1
|
||||
.endm
|
||||
|
||||
# MACRO: start
|
||||
# All assembler tests should start with a call to "start"
|
||||
.macro start
|
||||
.text
|
||||
__start:
|
||||
.endm
|
Loading…
Reference in New Issue
Block a user