This is the mail archive of the gdb-cvs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] sim: avr: start a basic testsuite


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=eca5fe422e2650fcb6a551af11bcf8de181f97e9

commit eca5fe422e2650fcb6a551af11bcf8de181f97e9
Author: Mike Frysinger <vapier@gentoo.org>
Date:   Sat Mar 28 04:28:46 2015 -0400

    sim: avr: start a basic testsuite
    
    Just enough to know the sim isn't totally broken.

Diff:
---
 sim/ChangeLog                       |  5 +++++
 sim/configure                       |  1 +
 sim/configure.tgt                   |  1 +
 sim/testsuite/ChangeLog             |  4 ++++
 sim/testsuite/configure             |  1 +
 sim/testsuite/sim/avr/ChangeLog     |  3 +++
 sim/testsuite/sim/avr/allinsn.exp   | 15 ++++++++++++++
 sim/testsuite/sim/avr/pass.s        |  7 +++++++
 sim/testsuite/sim/avr/testutils.inc | 41 +++++++++++++++++++++++++++++++++++++
 9 files changed, 78 insertions(+)

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]