This commit is contained in:
Kartik Agaram 2019-02-01 23:51:58 -08:00
parent 0ad068dd1d
commit 77aa333c3c
2 changed files with 66 additions and 2 deletions

Binary file not shown.

View File

@ -779,8 +779,6 @@ test-emit-hex-multiple-byte:
81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32 # add to ESP
# . end
c3/return
# . end
c3/return
test-emit-hex-zero-pad:
# setup
@ -842,4 +840,70 @@ test-emit-hex-zero-pad:
# . end
c3/return
test-emit-hex-negative:
# setup
# . clear-stream(_test-stream)
# . . push args
68/push _test-stream/imm32
# . . call
e8/call clear-stream/disp32
# . . discard args
81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP
# . clear-stream(_test-buffered-file+4)
# . . push args
b8/copy-to-EAX _test-buffered-file/imm32
05/add-to-EAX 4/imm32
50/push-EAX
# . . call
e8/call clear-stream/disp32
# . . discard args
81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP
# emit-hex(_test-buffered-file, -1, 2)
# . . push args
68/push 2/imm32
68/push -1/imm32
68/push _test-buffered-file/imm32
# . . call
e8/call emit-hex/disp32
# . . discard args
81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32 # add to ESP
# flush(_test-buffered-file)
# . . push args
68/push _test-buffered-file/imm32
# . . call
e8/call flush/disp32
# . . discard args
81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP
# check(_test-stream->data == 'ff ff ')
# . check-ints-equal(_test-stream->data[0..3], 'ff f', msg)
# . . push args
68/push "F - test-emit-hex-negative/1"/imm32
68/push 0x66206666/imm32
# . . push *_test-stream->data
b8/copy-to-EAX _test-stream/imm32
ff 6/subop/push 1/mod/*+disp8 0/rm32/EAX . . . . 0xc/disp8 . # push *(EAX+12)
# . . call
e8/call check-ints-equal/disp32
# . . discard args
81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32 # add to ESP
# . check-ints-equal(_test-stream->data[4..7], 'f ', msg)
# . . push args
68/push "F - test-emit-hex-negative/2"/imm32
68/push 0x2066/imm32
# . . push *_test-stream->data
b8/copy-to-EAX _test-stream/imm32
ff 6/subop/push 1/mod/*+disp8 0/rm32/EAX . . . . 0x10/disp8 . # push *(EAX+16)
# . . call
e8/call check-ints-equal/disp32
# . . discard args
81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32 # add to ESP
# . end
c3/return
== data
_test-slice-negative-two:
2d/- 32/2
_test-slice-negative-two-end:
# . . vim:nowrap:textwidth=0