aboutsummaryrefslogtreecommitdiff
path: root/tests/registers
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2017-08-30 21:37:53 +0200
committerKarel Kočí <cynerd@email.cz>2017-08-30 21:42:02 +0200
commit9cf92379d5fcf0076c25dae0935daab446c992cd (patch)
treedd09a2e996db1e5a8117f01bec76f1e93eaca6e1 /tests/registers
downloadqtmips-9cf92379d5fcf0076c25dae0935daab446c992cd.tar.gz
qtmips-9cf92379d5fcf0076c25dae0935daab446c992cd.tar.bz2
qtmips-9cf92379d5fcf0076c25dae0935daab446c992cd.zip
Initial commit
Adding work done so far.
Diffstat (limited to 'tests/registers')
-rw-r--r--tests/registers/Makefile5
-rw-r--r--tests/registers/registers.S8
-rwxr-xr-xtests/registers/test.sh15
3 files changed, 28 insertions, 0 deletions
diff --git a/tests/registers/Makefile b/tests/registers/Makefile
new file mode 100644
index 0000000..4b5ebdc
--- /dev/null
+++ b/tests/registers/Makefile
@@ -0,0 +1,5 @@
+include ../test.mk
+
+SRC_registers = registers.S
+
+$(eval $(call MIPS_ELF,registers))
diff --git a/tests/registers/registers.S b/tests/registers/registers.S
new file mode 100644
index 0000000..64ff5ac
--- /dev/null
+++ b/tests/registers/registers.S
@@ -0,0 +1,8 @@
+.text
+.globl _start
+
+_start:
+ j main
+
+main:
+ addi $1, $0, 6
diff --git a/tests/registers/test.sh b/tests/registers/test.sh
new file mode 100755
index 0000000..2ace7cd
--- /dev/null
+++ b/tests/registers/test.sh
@@ -0,0 +1,15 @@
+#!/bin/sh
+TEST_NAME="registers"
+
+# Load common test shell functions
+. "$(dirname "$0")/../test.sh"
+
+# Build cli binary
+qtmips_make sub-qtmips_cli
+
+# Compile mips binary
+mips_make_test
+
+# Run test
+qtmips_run qtmips_cli/qtmips_cli "$TEST_DIR/registers" \
+ || echo_fail "Test $TEST_NAME failed!"