aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAndrew Chambers <[email protected]>2021-10-09 18:22:43 +1300
committerAndrew Chambers <[email protected]>2021-10-09 18:22:43 +1300
commita439d4004379cc73dd6b2bf330130733396f9d61 (patch)
treeb62315e59ea9f7dfaab7156ffa1ffab8ab0855e3 /test
parentf72806dec51ef5ffcf2883566b070c8508ebf30a (diff)
More tests.
Diffstat (limited to 'test')
-rw-r--r--test/test.sh40
1 files changed, 20 insertions, 20 deletions
diff --git a/test/test.sh b/test/test.sh
index 7fbd9f5..cf5660b 100644
--- a/test/test.sh
+++ b/test/test.sh
@@ -8,26 +8,6 @@ tmpb="$(mktemp --suffix .bin)"
trap "rm -f \"$tmps\" \"$tmpo\" \"$tmpb\"" EXIT
t () {
- if ! ./minias < "$1" > "$tmpo"
- then
- echo "failed to assemble: $1"
- exit 1
- fi
- clang "$tmpo" -o "$tmpb"
- if !"$tmpb" 1>&2 2>/dev/null
- then
- echo "$t failed"
- exit 1
- fi
- echo -n "."
-}
-
-for tc in $(echo test/execute/*)
-do
- t "$tc"
-done
-
-t () {
echo "$1" > "$tmps"
clang -Wno-everything -c -s "$tmps" -o "$tmpo"
objcopy -j ".text" -O binary "$tmpo" "$tmpb"
@@ -138,3 +118,23 @@ do
t "${op}q %r${r}x, %rax"
done
done
+
+t () {
+ if ! ./minias < "$1" > "$tmpo"
+ then
+ echo "failed to assemble: $1"
+ exit 1
+ fi
+ clang "$tmpo" -o "$tmpb"
+ if !"$tmpb" 1>&2 2>/dev/null
+ then
+ echo "$t failed"
+ exit 1
+ fi
+ echo -n "."
+}
+
+for tc in $(echo test/execute/*)
+do
+ t "$tc"
+done \ No newline at end of file