aboutsummaryrefslogtreecommitdiff
path: root/sim/testsuite/avr
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2021-01-05 22:09:57 -0500
committerMike Frysinger <vapier@gentoo.org>2021-01-15 19:18:34 -0500
commit1368b914e93a3af332f787d3d41c106d11bb90da (patch)
tree9893ccae5d2d8cbf2ce855e09d6b8f30b56a21bc /sim/testsuite/avr
parente403a898b5893337baea73bcb001ece74042f351 (diff)
downloadbinutils-1368b914e93a3af332f787d3d41c106d11bb90da.zip
binutils-1368b914e93a3af332f787d3d41c106d11bb90da.tar.gz
binutils-1368b914e93a3af332f787d3d41c106d11bb90da.tar.bz2
sim: testsuite: flatten tree
Now that all port tests live under testsuite/sim/*/, and none live in testsuite/ directly, flatten the structure by moving all of the dirs under testsuite/sim/ to testsuite/ directly. We need to stop passing --tool to dejagnu so that it searches all dirs and not just ones that start with "sim". Since we have no other dirs in this tree, and no plans to add any, should be fine.
Diffstat (limited to 'sim/testsuite/avr')
-rw-r--r--sim/testsuite/avr/ChangeLog7
-rw-r--r--sim/testsuite/avr/allinsn.exp15
-rw-r--r--sim/testsuite/avr/pass.s7
-rw-r--r--sim/testsuite/avr/testutils.inc42
4 files changed, 71 insertions, 0 deletions
diff --git a/sim/testsuite/avr/ChangeLog b/sim/testsuite/avr/ChangeLog
new file mode 100644
index 0000000..8c1bde2
--- /dev/null
+++ b/sim/testsuite/avr/ChangeLog
@@ -0,0 +1,7 @@
+2015-03-29 Mike Frysinger <vapier@gentoo.org>
+
+ * testutils.inc (start): Change to _start and add global markings.
+
+2015-03-28 Mike Frysinger <vapier@gentoo.org>
+
+ * pass.s, allinsn.exp, testutils.inc: New files.
diff --git a/sim/testsuite/avr/allinsn.exp b/sim/testsuite/avr/allinsn.exp
new file mode 100644
index 0000000..584a93d
--- /dev/null
+++ b/sim/testsuite/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/avr/pass.s b/sim/testsuite/avr/pass.s
new file mode 100644
index 0000000..fbcc485
--- /dev/null
+++ b/sim/testsuite/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/avr/testutils.inc b/sim/testsuite/avr/testutils.inc
new file mode 100644
index 0000000..baad45d
--- /dev/null
+++ b/sim/testsuite/avr/testutils.inc
@@ -0,0 +1,42 @@
+# 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
+.global _start
+_start:
+ .endm