diff options
| author | Andrew Chambers <[email protected]> | 2021-10-17 18:08:14 +1300 |
|---|---|---|
| committer | Andrew Chambers <[email protected]> | 2021-10-17 18:08:14 +1300 |
| commit | 8464df80ace17b3decc59c4752bf1f4de9dccae8 (patch) | |
| tree | db62cd75918c2f466313d1171fb8573975baa3d4 /test/test.sh | |
| parent | fccfcc2043e56306935dff29e66c414fd6c0a6d0 (diff) | |
| parent | bcaa994f61c57ca5c5446a4ead7015dd1ead95db (diff) | |
Merge branch 'master' of github.com:andrewchambers/minias
Diffstat (limited to 'test/test.sh')
| -rw-r--r-- | test/test.sh | 38 |
1 files changed, 24 insertions, 14 deletions
diff --git a/test/test.sh b/test/test.sh index 7ee3855..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-)" @@ -30,6 +30,18 @@ t () { echo -n "." } +# Various regression tests first. +t "xchgq %r13, %rax" +t "movl \$1000, %r8d" +t "movb %sil, (%rdi)" +t "movsbq (%rax), %rbx" +t "movq $-4132994306676758123, %rcx" +t "mov \$17293822569102704639, %rax" +t "callq *%rax" +t "callq *%r10" +t "movb %r11b, (%rsi, %r12, 1)" + + for r in rax r10 do for x in xmm0 xmm13 @@ -41,19 +53,6 @@ do done done -t "movl \$1000, %r8d" - -t "movb %sil, (%rdi)" - -t "movsbq (%rax), %rbx" - -t "movq $-4132994306676758123, %rcx" -t "mov \$17293822569102704639, %rax" - -t "callq *%rax" -t "callq *%r10" - -t "movb %r11b, (%rsi, %r12, 1)" t "cvttsd2si %xmm1, %rax" t "cvttsd2si %xmm10, %rax" @@ -153,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" |
