aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAndrew Chambers <[email protected]>2021-10-10 16:58:01 +1300
committerAndrew Chambers <[email protected]>2021-10-10 16:58:01 +1300
commitd6f46d0e72aefed61e2887ce1d6f4601b48648fb (patch)
tree15f34f0575baa8f202810b97b7f54eb9ae486164 /test
parent54da6cf3b5a2ee14705857bb988af67378d4be2c (diff)
Add cmp and jcc.
Diffstat (limited to 'test')
-rw-r--r--test/test.sh30
1 files changed, 15 insertions, 15 deletions
diff --git a/test/test.sh b/test/test.sh
index ecc4624..6126d1c 100644
--- a/test/test.sh
+++ b/test/test.sh
@@ -32,18 +32,18 @@ t () {
for op in sal sar shl shr
do
-t "${op} \$3, %rax"
-t "${op} %cl, %rax"
-t "${op} \$3, %eax"
-t "${op} %cl, %eax"
-t "${op} \$3, %ax"
-t "${op} %cl, %ax"
-t "${op}w \$3, (%rax)"
-t "${op}w %cl, (%rax)"
-t "${op}l \$3, (%rax)"
-t "${op}l %cl, (%rax)"
-t "${op}q \$3, (%rax)"
-t "${op}q %cl, (%rax)"
+ t "${op} \$3, %rax"
+ t "${op} %cl, %rax"
+ t "${op} \$3, %eax"
+ t "${op} %cl, %eax"
+ t "${op} \$3, %ax"
+ t "${op} %cl, %ax"
+ t "${op}w \$3, (%rax)"
+ t "${op}w %cl, (%rax)"
+ t "${op}l \$3, (%rax)"
+ t "${op}l %cl, (%rax)"
+ t "${op}q \$3, (%rax)"
+ t "${op}q %cl, (%rax)"
done
t "div %rax"
@@ -114,7 +114,7 @@ for r in a b
t "leaw (%r${r}x), %${r}x"
done
-for op in mov add and or sub xor
+for op in mov add and cmp or sub xor
do
# rip relative
t "${op}b \$127, (%rip)"
@@ -170,8 +170,8 @@ t () {
clang "$tmpo" -o "$tmpb"
if !"$tmpb" 1>&2 2>/dev/null
then
- echo "$t failed"
- exit 1
+ echo "$t failed"
+ exit 1
fi
echo -n "."
}