aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAndrew Chambers <[email protected]>2021-10-17 14:57:04 +1300
committerAndrew Chambers <[email protected]>2021-10-17 14:57:04 +1300
commit5405a8654b7474d45b0b3f34f83a375a3a418f46 (patch)
tree401f78506f5d3c0855e3298dec25ac6091234a36 /test
parent12df58b9451fcb463e318ed1723a5f963c656bc6 (diff)
Implement simple jump relaxing.
Diffstat (limited to 'test')
-rw-r--r--test/test.sh13
1 files changed, 12 insertions, 1 deletions
diff --git a/test/test.sh b/test/test.sh
index f1015a4..7b0e41c 100644
--- a/test/test.sh
+++ b/test/test.sh
@@ -8,7 +8,7 @@ tmpb="$(mktemp)"
trap "rm -f \"$tmps\" \"$tmpo\" \"$tmpb\"" EXIT
t () {
- echo "$1" > "$tmps"
+ echo -e "$1" > "$tmps"
clang -Wno-everything -c -x assembler "$tmps" -o "$tmpo"
objcopy -j ".text" -O binary "$tmpo" "$tmpb"
want="$(xxd -ps "$tmpb" | head -n 1 | cut -d ' ' -f 2-)"
@@ -152,6 +152,17 @@ conditioncodes="
o p pe po s z
"
+for fill in 0 1 129
+do
+ t "l:\n .fill $fill, 1, 0x00 \njmp l"
+ t "jmp l\n .fill $fill, 1, 0x00 \nl:"
+ for cc in $conditioncodes
+ do
+ t "l:\n .fill $fill, 1, 0x00 \nj${cc} l"
+ t "j${cc} l\n .fill $fill, 1, 0x00 \nl:"
+ done
+done
+
for cc in $conditioncodes
do
t "set${cc} %al"