diff options
| author | Andrew Chambers <[email protected]> | 2021-10-17 14:57:04 +1300 |
|---|---|---|
| committer | Andrew Chambers <[email protected]> | 2021-10-17 14:57:04 +1300 |
| commit | 5405a8654b7474d45b0b3f34f83a375a3a418f46 (patch) | |
| tree | 401f78506f5d3c0855e3298dec25ac6091234a36 /test | |
| parent | 12df58b9451fcb463e318ed1723a5f963c656bc6 (diff) | |
Implement simple jump relaxing.
Diffstat (limited to 'test')
| -rw-r--r-- | test/test.sh | 13 |
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" |
