Add some integration tests and runner

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
2020-02-25 13:48:03 -05:00
parent 145739aee2
commit 362590292a
6 changed files with 199 additions and 0 deletions

38
tests/test_add.asm Normal file
View File

@@ -0,0 +1,38 @@
.section data $0x0 {
number: .u8 $10
main:
; Test addition
mov %status, $1
add %r0, $1
cmpeq %r0, $1
jz end
; Test addition from a register
mov %status, $2
add %r0, %r0
cmpeq %r0, $2
jz end
; Test addition from a u8 location
mov %status, $3
add %r0, (number)u8
cmpeq %r0, $12
jz end
; Test addition overflow
mov %status, $4
add %r0, $0xFFFFFFFFFFFFFFFF
cmpeq %r0, $11
jz end
mov %status, $0
end:
halt
.export main
}
.meta {
entry: main
}