aboutsummaryrefslogtreecommitdiff
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
parent510d27512cb053e8a9f8c622a5f86840be8c21ac (diff)
downloadgdb-eca5fe422e2650fcb6a551af11bcf8de181f97e9.zip
gdb-eca5fe422e2650fcb6a551af11bcf8de181f97e9.tar.gz
gdb-eca5fe422e2650fcb6a551af11bcf8de181f97e9.tar.bz2
sim: avr: start a basic testsuite
Just enough to know the sim isn't totally broken.
-rw-r--r--sim/ChangeLog5
-rwxr-xr-xsim/configure1
-rw-r--r--sim/configure.tgt1
-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
9 files changed, 78 insertions, 0 deletions
diff --git a/sim/ChangeLog b/sim/ChangeLog
index 8b7fcb3..e3b0e66 100644
--- a/sim/ChangeLog
+++ b/sim/ChangeLog
@@ -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.
diff --git a/sim/configure b/sim/configure
index 740042a..a40c7fd 100755
--- a/sim/configure
+++ b/sim/configure
@@ -3642,6 +3642,7 @@ subdirs="$subdirs arm"
subdirs="$subdirs avr"
+ sim_testsuite=yes
;;
bfin-*-*)
diff --git a/sim/configure.tgt b/sim/configure.tgt
index 026b81f..ce46d3f 100644
--- a/sim/configure.tgt
+++ b/sim/configure.tgt
@@ -22,6 +22,7 @@ case "${target}" in
;;
avr*-*-*)
SIM_ARCH(avr)
+ sim_testsuite=yes
;;
bfin-*-*)
SIM_ARCH(bfin)
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