summaryrefslogtreecommitdiff
path: root/tests/tst-runner.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tests/tst-runner.sh')
-rwxr-xr-xtests/tst-runner.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/tst-runner.sh b/tests/tst-runner.sh
new file mode 100755
index 0000000..54343b1
--- /dev/null
+++ b/tests/tst-runner.sh
@@ -0,0 +1,17 @@
+#!/bin/sh
+set -eu
+: "${CPU_AS:?}" "${CPU_LD:?}" "${CPU_RUN:?}" "${TEST_SRCDIR:?}"
+base="${TMPDIR:-/tmp}/libcpu-radd-pi-$$"
+trap 'rm -f "$base.o" "$base.melf"' EXIT HUP INT TERM
+"$CPU_AS" -o "$base.o" "$TEST_SRCDIR/fixtures/radd-pi.s" >/dev/null
+"$CPU_LD" --stack-size=512 -o "$base.melf" "$base.o" >/dev/null
+out=`"$CPU_RUN" --digits=60 --real-reg=r4096@0x00400 "$base.melf"`
+case "$out" in
+ 5.14159265358979323846264338327950288419716939937510582097*) ;;
+ *) echo "unexpected register result: $out" >&2; exit 1 ;;
+esac
+out=`"$CPU_RUN" --digits=60 --real-data=4096@16 "$base.melf"`
+case "$out" in
+ 5.14159265358979323846264338327950288419716939937510582097*) ;;
+ *) echo "unexpected DATA result: $out" >&2; exit 1 ;;
+esac