summaryrefslogtreecommitdiff
path: root/tests/tst-mpu-ops-runner.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tests/tst-mpu-ops-runner.sh')
-rwxr-xr-xtests/tst-mpu-ops-runner.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/tst-mpu-ops-runner.sh b/tests/tst-mpu-ops-runner.sh
new file mode 100755
index 0000000..32bad1d
--- /dev/null
+++ b/tests/tst-mpu-ops-runner.sh
@@ -0,0 +1,9 @@
+#!/bin/sh
+set -eu
+: "${CPU_AS:?}" "${CPU_LD:?}" "${CPU_RUN:?}" "${TEST_SRCDIR:?}"
+base="${TMPDIR:-/tmp}/libcpu-mpu-ops-$$"
+trap 'rm -f "$base.s" "$base.o" "$base.melf"' EXIT HUP INT TERM
+"$CPU_AS" -o "$base.o" "$TEST_SRCDIR/fixtures/mpu-ops.s" >/dev/null
+"$CPU_LD" --stack-size=512 -o "$base.melf" "$base.o" >/dev/null
+out=`"$CPU_RUN" --int-reg=r64@0x00020 "$base.melf"`
+test "x$out" = "x42"