aboutsummaryrefslogtreecommitdiff
path: root/sim/testsuite
diff options
context:
space:
mode:
Diffstat (limited to 'sim/testsuite')
-rw-r--r--sim/testsuite/ChangeLog5
-rwxr-xr-xsim/testsuite/configure3
-rw-r--r--sim/testsuite/sim/aarch64/ChangeLog3
-rw-r--r--sim/testsuite/sim/aarch64/allinsn.exp15
-rw-r--r--sim/testsuite/sim/aarch64/pass.s7
-rw-r--r--sim/testsuite/sim/aarch64/testutils.inc72
6 files changed, 105 insertions, 0 deletions
diff --git a/sim/testsuite/ChangeLog b/sim/testsuite/ChangeLog
index e6525a9..f790420 100644
--- a/sim/testsuite/ChangeLog
+++ b/sim/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2015-11-24 Nick Clifton <nickc@redhat.com>
+
+ * configure: Regenerate.
+ * sim/aarch64: New directory.
+
2015-11-14 Mike Frysinger <vapier@gentoo.org>
* lib/sim-defs.exp (slurp_options): Pull in global subdir/srcdir.
diff --git a/sim/testsuite/configure b/sim/testsuite/configure
index c5980fe..287245b 100755
--- a/sim/testsuite/configure
+++ b/sim/testsuite/configure
@@ -1827,6 +1827,9 @@ sim_common=yes
sim_igen=no
sim_arch=
case "${target}" in
+ aarch64*-*-*)
+ sim_arch=aarch64
+ ;;
arm*-*-*)
sim_arch=arm
;;
diff --git a/sim/testsuite/sim/aarch64/ChangeLog b/sim/testsuite/sim/aarch64/ChangeLog
new file mode 100644
index 0000000..8aacf49
--- /dev/null
+++ b/sim/testsuite/sim/aarch64/ChangeLog
@@ -0,0 +1,3 @@
+2015-11-24 Nick Clifton <nickc@redhat.com>
+
+ * pass.s, allinsn.exp, testutils.inc: New files.
diff --git a/sim/testsuite/sim/aarch64/allinsn.exp b/sim/testsuite/sim/aarch64/allinsn.exp
new file mode 100644
index 0000000..54d6478
--- /dev/null
+++ b/sim/testsuite/sim/aarch64/allinsn.exp
@@ -0,0 +1,15 @@
+# AArch64 simulator testsuite
+
+if [istarget aarch64*-*] {
+ # all machines
+ set all_machs "aarch64"
+
+ 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/aarch64/pass.s b/sim/testsuite/sim/aarch64/pass.s
new file mode 100644
index 0000000..7ce7de5
--- /dev/null
+++ b/sim/testsuite/sim/aarch64/pass.s
@@ -0,0 +1,7 @@
+# check that the sim doesn't die immediately.
+# mach: aarch64
+
+.include "testutils.inc"
+
+ start
+ pass
diff --git a/sim/testsuite/sim/aarch64/testutils.inc b/sim/testsuite/sim/aarch64/testutils.inc
new file mode 100644
index 0000000..c8897aa
--- /dev/null
+++ b/sim/testsuite/sim/aarch64/testutils.inc
@@ -0,0 +1,72 @@
+# MACRO: exit
+# Terminates execution.
+ .macro exit nr
+
+ stp x29, x30, [sp,#-32]!
+ mov x4, #0x26
+ mov x7, #\nr
+ mov x29, sp
+ movk x4, #0x2, lsl #16
+ add x1, x29, #0x10
+ str x4, [x29,#16]
+ str x7, [x29,#24]
+ mov w0, #0x18
+ hlt #0xf000
+
+ .endm
+
+# MACRO: swiwrite
+# Writes the string in X1 to stdout
+ .macro swiwrite len
+
+ stp x29, x30, [sp,#-48]!
+ mov x0, #1
+ mov x2, #\len
+ mov x29, sp
+ str x0, [x29,#24]
+ str x1, [x29,#32]
+ str x2, [x29,#40]
+ mov w0, #0x5
+ add x1, x29, #0x18
+ hlt #0xf000
+ ldp x29, x30, [sp],#48
+ ret
+
+ .endm
+
+# MACRO: pass
+# Write 'pass' to stdout and quit
+ .macro pass
+
+ adrp x1, .Lpass
+ add x1, x1, :lo12:.Lpass
+
+ swiwrite 5
+ exit 0
+
+ .data
+.Lpass:
+ .asciz "pass\n"
+ .endm
+
+# MACRO: fail
+# Write 'fail' to stdout and quit
+ .macro fail
+
+ adrp x1, .Lfail
+ add x1, x1, :lo12:.Lfail
+ swiwrite 5
+ exit 0
+
+ .data
+.Lfail:
+ .asciz "fail\n"
+ .endm
+
+# MACRO: start
+# All assembler tests should start with a call to "start"
+ .macro start
+ .text
+.global _start
+_start:
+ .endm