aboutsummaryrefslogtreecommitdiff
path: root/sim/testsuite
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2015-03-28 04:28:46 -0400
committerMike Frysinger <vapier@gentoo.org>2015-03-28 04:28:46 -0400
commiteca5fe422e2650fcb6a551af11bcf8de181f97e9 (patch)
treef2d40af58a2e0022555a0156c8542188e2873989 /sim/testsuite
parent510d27512cb053e8a9f8c622a5f86840be8c21ac (diff)
downloadbinutils-eca5fe422e2650fcb6a551af11bcf8de181f97e9.zip
binutils-eca5fe422e2650fcb6a551af11bcf8de181f97e9.tar.gz
binutils-eca5fe422e2650fcb6a551af11bcf8de181f97e9.tar.bz2
sim: avr: start a basic testsuite
Just enough to know the sim isn't totally broken.
Diffstat (limited to 'sim/testsuite')
-rw-r--r--sim/testsuite/ChangeLog4
-rwxr-xr-xsim/testsuite/configure1
-rw-r--r--sim/testsuite/sim/avr/ChangeLog3
-rw-r--r--sim/testsuite/sim/avr/allinsn.exp15
-rw-r--r--sim/testsuite/sim/avr/pass.s7
-rw-r--r--sim/testsuite/sim/avr/testutils.inc41
6 files changed, 71 insertions, 0 deletions
diff --git a/sim/testsuite/ChangeLog b/sim/testsuite/ChangeLog
index 7580586..6b04339 100644
--- a/sim/testsuite/ChangeLog
+++ b/sim/testsuite/ChangeLog
@@ -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.
diff --git a/sim/testsuite/configure b/sim/testsuite/configure
index 1dcaa41..7b91f41 100755
--- a/sim/testsuite/configure
+++ b/sim/testsuite/configure
@@ -1829,6 +1829,7 @@ case "${target}" in
;;
avr*-*-*)
sim_arch=avr
+ sim_testsuite=yes
;;
bfin-*-*)
sim_arch=bfin
diff --git a/sim/testsuite/sim/avr/ChangeLog b/sim/testsuite/sim/avr/ChangeLog
new file mode 100644
index 0000000..a5e9c9c
--- /dev/null
+++ b/sim/testsuite/sim/avr/ChangeLog
@@ -0,0 +1,3 @@
+2015-03-28 Mike Frysinger <vapier@gentoo.org>
+
+ * pass.s, allinsn.exp, testutils.inc: New files.
diff --git a/sim/testsuite/sim/avr/allinsn.exp b/sim/testsuite/sim/avr/allinsn.exp
new file mode 100644
index 0000000..584a93d
--- /dev/null
+++ b/sim/testsuite/sim/avr/allinsn.exp
@@ -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
+ }
+}
diff --git a/sim/testsuite/sim/avr/pass.s b/sim/testsuite/sim/avr/pass.s
new file mode 100644
index 0000000..fbcc485
--- /dev/null
+++ b/sim/testsuite/sim/avr/pass.s
@@ -0,0 +1,7 @@
+# check that the sim doesn't die immediately.
+# mach: avr
+
+.include "testutils.inc"
+
+ start
+ pass
diff --git a/sim/testsuite/sim/avr/testutils.inc b/sim/testsuite/sim/avr/testutils.inc
new file mode 100644
index 0000000..95a14fc
--- /dev/null
+++ b/sim/testsuite/sim/avr/testutils.inc
@@ -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