Add a binemit test command.

This makes it possible to write file tests that verify the binary
encoding of machine code.
This commit is contained in:
Jakob Stoklund Olesen
2017-03-28 15:43:41 -07:00
parent ca2b1c79d7
commit 36eb39a1f8
4 changed files with 144 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
; Binary emission of 32-bit code.
test binemit
isa riscv
function int32() {
ebb0:
[-,%x5] v1 = iconst.i32 1
[-,%x6] v2 = iconst.i32 2
[R#0c,%x7] v10 = iadd v1, v2 ; bin: 006283b3
[R#200c,%x8] v11 = isub v1, v2 ; bin: 40628433
[R#10c] v12 = imul v1, v2
return
}