This commit is contained in:
Kartik Agaram 2019-11-29 01:27:39 -08:00
parent cc253a74a2
commit 8d5437838b
17 changed files with 43 additions and 43 deletions

View File

@ -175,7 +175,7 @@ test-compare-inequal-strings-equal-lengths:
c3/return
# helper for later tests
check-string-equal: # s : (address string), expected : (address string), msg : (address string)
check-strings-equal: # s : (address string), expected : (address string), msg : (address string)
# . prologue
55/push-ebp
89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp
@ -198,7 +198,7 @@ check-string-equal: # s : (address string), expected : (address string), msg :
e8/call check-ints-equal/disp32
# . . discard args
81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp
$check-string-equal:end:
$check-strings-equal:end:
# . restore registers
58/pop-to-eax
# . epilogue
@ -207,18 +207,18 @@ $check-string-equal:end:
c3/return
# test the helper
test-check-string-equal:
# check-string-equal?("Abc", "Abc")
test-check-strings-equal:
# check-strings-equal?("Abc", "Abc")
# . . push args
68/push "Abc"/imm32
68/push "Abc"/imm32
# . . call
e8/call check-string-equal/disp32
e8/call check-strings-equal/disp32
# . . discard args
81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp
# check-ints-equal(eax, 1, msg)
# . . push args
68/push "F - test-check-string-equal"/imm32
68/push "F - test-check-strings-equal"/imm32
68/push 0/imm32/false
50/push-eax
# . . call

View File

@ -549,13 +549,13 @@ $test-get-or-insert:check2:
e8/call check-ints-equal/disp32
# . . discard args
81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp
# check-string-equal(*table->data, "code", msg)
# check-strings-equal(*table->data, "code", msg)
# . . push args
68/push "F - test-get-or-insert/2"/imm32
68/push "code"/imm32
ff 6/subop/push 1/mod/*+disp8 1/rm32/ecx . . . . 0xc/disp8 . # push *(ecx+12)
# . . call
e8/call check-string-equal/disp32
e8/call check-strings-equal/disp32
# . . discard args
81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp
$test-get-or-insert:second-call:
@ -590,13 +590,13 @@ $test-get-or-insert:second-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-string-equal(*table->data, "code", msg)
# check-strings-equal(*table->data, "code", msg)
# . . push args
68/push "F - test-get-or-insert/5"/imm32
68/push "code"/imm32
ff 6/subop/push 1/mod/*+disp8 1/rm32/ecx . . . . 0xc/disp8 . # push *(ecx+12)
# . . call
e8/call check-string-equal/disp32
e8/call check-strings-equal/disp32
# . . discard args
81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp
$test-get-or-insert:third-call:
@ -631,14 +631,14 @@ $test-get-or-insert:third-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-string-equal(*table->data+8, "data", msg)
# check-string-equal(*(table+20), "data", msg)
# check-strings-equal(*table->data+8, "data", msg)
# check-strings-equal(*(table+20), "data", msg)
# . . push args
68/push "F - test-get-or-insert/8"/imm32
68/push "data"/imm32
ff 6/subop/push 1/mod/*+disp8 1/rm32/ecx . . . . 0x14/disp8 . # push *(ecx+20)
# . . call
e8/call check-string-equal/disp32
e8/call check-strings-equal/disp32
# . . discard args
81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp
$test-get-or-insert:end:
@ -815,13 +815,13 @@ $test-leaky-get-or-insert-slice:check2:
e8/call check-ints-equal/disp32
# . . discard args
81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp
# check-string-equal(*table->data, "code", msg)
# check-strings-equal(*table->data, "code", msg)
# . . push args
68/push "F - test-leaky-get-or-insert-slice/2"/imm32
68/push "code"/imm32
ff 6/subop/push 1/mod/*+disp8 1/rm32/ecx . . . . 0xc/disp8 . # push *(ecx+12)
# . . call
e8/call check-string-equal/disp32
e8/call check-strings-equal/disp32
# . . discard args
81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp
$test-leaky-get-or-insert-slice:second-call:
@ -856,13 +856,13 @@ $test-leaky-get-or-insert-slice:second-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-string-equal(*table->data, "code", msg)
# check-strings-equal(*table->data, "code", msg)
# . . push args
68/push "F - test-leaky-get-or-insert-slice/5"/imm32
68/push "code"/imm32
ff 6/subop/push 1/mod/*+disp8 1/rm32/ecx . . . . 0xc/disp8 . # push *(ecx+12)
# . . call
e8/call check-string-equal/disp32
e8/call check-strings-equal/disp32
# . . discard args
81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp
$test-leaky-get-or-insert-slice:third-call:
@ -906,14 +906,14 @@ $test-leaky-get-or-insert-slice:third-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-string-equal(*table->data+8, "data", msg)
# check-string-equal(*(table+20), "data", msg)
# check-strings-equal(*table->data+8, "data", msg)
# check-strings-equal(*(table+20), "data", msg)
# . . push args
68/push "F - test-leaky-get-or-insert-slice/8"/imm32
68/push "data"/imm32
ff 6/subop/push 1/mod/*+disp8 1/rm32/ecx . . . . 0x14/disp8 . # push *(ecx+20)
# . . call
e8/call check-string-equal/disp32
e8/call check-strings-equal/disp32
# . . discard args
81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp
$test-leaky-get-or-insert-slice:end:
@ -1489,13 +1489,13 @@ $test-maybe-get:success:
e8/call check-ints-equal/disp32
# . . discard args
81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp
# check-string-equal(*table->data, "code", msg)
# check-strings-equal(*table->data, "code", msg)
# . . push args
68/push "F - test-maybe-get/2"/imm32
68/push "code"/imm32
ff 6/subop/push 1/mod/*+disp8 1/rm32/ecx . . . . 0xc/disp8 . # push *(ecx+12)
# . . call
e8/call check-string-equal/disp32
e8/call check-strings-equal/disp32
# . . discard args
81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp
$test-maybe-get:failure:
@ -1645,13 +1645,13 @@ $test-maybe-get-slice:success:
e8/call check-ints-equal/disp32
# . . discard args
81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp
# check-string-equal(*table->data, "code", msg)
# check-strings-equal(*table->data, "code", msg)
# . . push args
68/push "F - test-maybe-get-slice/2"/imm32
68/push "code"/imm32
ff 6/subop/push 1/mod/*+disp8 1/rm32/ecx . . . . 0xc/disp8 . # push *(ecx+12)
# . . call
e8/call check-string-equal/disp32
e8/call check-strings-equal/disp32
# . . discard args
81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp
$test-maybe-get-slice:failure:

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
apps/hex

Binary file not shown.

BIN
apps/mu

Binary file not shown.

View File

@ -845,12 +845,12 @@ test-function-header-with-arg:
# convert
(populate-mu-function-header _test-input-stream %ecx)
# check result
(check-string-equal *ecx "foo" "F - test-function-header-with-arg/name") # Function-name
(check-strings-equal *ecx "foo" "F - test-function-header-with-arg/name") # Function-name
# edx : (address list var) = result->inouts
8b/-> *(ecx+8) 2/r32/edx # Function-inouts
# ebx : (address var) = result->inouts->value
8b/-> *edx 3/r32/ebx # List-value
(check-string-equal *ebx "n" "F - test-function-header-with-arg/inout:0") # Var-name
(check-strings-equal *ebx "n" "F - test-function-header-with-arg/inout:0") # Var-name
(check-ints-equal *(ebx+4) 1 "F - test-function-header-with-arg/inout:0/type") # Var-type
# . epilogue
89/<- %esp 5/r32/ebp
@ -872,24 +872,24 @@ test-function-header-with-multiple-args:
# convert
(populate-mu-function-header _test-input-stream %ecx)
# check result
(check-string-equal *ecx "foo") # Function-name
(check-strings-equal *ecx "foo") # Function-name
# edx : (address list var) = result->inouts
8b/-> *(ecx+8) 2/r32/edx # Function-inouts
# ebx : (address var) = result->inouts->value
8b/-> *edx 3/r32/ebx # List-value
(check-string-equal *ebx "a" "F - test-function-header-with-multiple-args/inout:0") # Var-name
(check-strings-equal *ebx "a" "F - test-function-header-with-multiple-args/inout:0") # Var-name
(check-ints-equal *(ebx+4) 1 "F - test-function-header-with-arg/inout:0/type") # Var-type
# edx = result->inouts->next
8b/-> *(edx+4) 2/r32/edx # List-next
# ebx = result->inouts->next->value
8b/-> *edx 3/r32/ebx # List-value
(check-string-equal *ebx "b" "F - test-function-header-with-multiple-args/inout:1") # Var-name
(check-strings-equal *ebx "b" "F - test-function-header-with-multiple-args/inout:1") # Var-name
(check-ints-equal *(ebx+4) 1 "F - test-function-header-with-arg/inout:1/type") # Var-type
# edx = result->inouts->next->next
8b/-> *(edx+4) 2/r32/edx # List-next
# ebx = result->inouts->next->next->value
8b/-> *edx 3/r32/ebx # List-value
(check-string-equal *ebx "c" "F - test-function-header-with-multiple-args/inout:2") # Var-name
(check-strings-equal *ebx "c" "F - test-function-header-with-multiple-args/inout:2") # Var-name
(check-ints-equal *(ebx+4) 1 "F - test-function-header-with-arg/inout:2/type") # Var-type
# . epilogue
89/<- %esp 5/r32/ebp
@ -911,39 +911,39 @@ test-function-with-multiple-args-and-outputs:
# convert
(populate-mu-function-header _test-input-stream %ecx)
# check result
(check-string-equal *ecx "foo") # Function-name
(check-strings-equal *ecx "foo") # Function-name
# edx : (address list var) = result->inouts
8b/-> *(ecx+8) 2/r32/edx # Function-inouts
# ebx : (address var) = result->inouts->value
8b/-> *edx 3/r32/ebx # List-value
(check-string-equal *ebx "a" "F - test-function-header-with-multiple-args/inout:0") # Var-name
(check-strings-equal *ebx "a" "F - test-function-header-with-multiple-args/inout:0") # Var-name
(check-ints-equal *(ebx+4) 1 "F - test-function-header-with-arg/inout:0/type") # Var-type
# edx = result->inouts->next
8b/-> *(edx+4) 2/r32/edx # List-next
# ebx = result->inouts->next->value
8b/-> *edx 3/r32/ebx # List-value
(check-string-equal *ebx "b" "F - test-function-header-with-multiple-args/inout:1") # Var-name
(check-strings-equal *ebx "b" "F - test-function-header-with-multiple-args/inout:1") # Var-name
(check-ints-equal *(ebx+4) 1 "F - test-function-header-with-arg/inout:1/type") # Var-type
# edx = result->inouts->next->next
8b/-> *(edx+4) 2/r32/edx # List-next
# ebx = result->inouts->next->next->value
8b/-> *edx 3/r32/ebx # List-value
(check-string-equal *ebx "c" "F - test-function-header-with-multiple-args/inout:2") # Var-name
(check-strings-equal *ebx "c" "F - test-function-header-with-multiple-args/inout:2") # Var-name
(check-ints-equal *(ebx+4) 1 "F - test-function-header-with-arg/inout:2/type") # Var-type
# edx : (address list var) = result->outputs
8b/-> *(ecx+0xc) 2/r32/edx # Function-outputs
# ebx : (address var) = result->outputs->value
8b/-> *edx 3/r32/ebx # List-value
(check-string-equal *ebx "x" "F - test-function-header-with-multiple-args/output:0") # Var-name
(check-strings-equal *ebx "x" "F - test-function-header-with-multiple-args/output:0") # Var-name
(check-ints-equal *(ebx+4) 1 "F - test-function-header-with-arg/output:0/type") # Var-type
(check-string-equal *(ebx+0x10) "ecx" "F - test-function-header-with-arg/output:0/register") # Var-register
(check-strings-equal *(ebx+0x10) "ecx" "F - test-function-header-with-arg/output:0/register") # Var-register
# edx = result->outputs->next
8b/-> *(edx+4) 2/r32/edx # List-next
# ebx = result->outputs->next->value
8b/-> *edx 3/r32/ebx # List-value
(check-string-equal *ebx "y" "F - test-function-header-with-multiple-args/output:1") # Var-name
(check-strings-equal *ebx "y" "F - test-function-header-with-multiple-args/output:1") # Var-name
(check-ints-equal *(ebx+4) 1 "F - test-function-header-with-arg/output:1/type") # Var-type
(check-string-equal *(ebx+0x10) "edx" "F - test-function-header-with-arg/output:0/register") # Var-register
(check-strings-equal *(ebx+0x10) "edx" "F - test-function-header-with-arg/output:0/register") # Var-register
# . epilogue
89/<- %esp 5/r32/ebp
5d/pop-to-ebp
@ -1200,7 +1200,7 @@ test-parse-var-with-type:
#
(parse-var-with-type %ecx _test-input-stream)
8b/-> *eax 2/r32/edx # Var-name
(check-string-equal %edx "x" "F - test-var-with-type/name")
(check-strings-equal %edx "x" "F - test-var-with-type/name")
8b/-> *(eax+4) 2/r32/edx # Var-type
(check-ints-equal %edx 1 "F - test-var-with-type/type")
# . epilogue
@ -1227,9 +1227,9 @@ test-parse-var-with-type-and-register:
#
(parse-var-with-type %ecx _test-input-stream)
8b/-> *eax 2/r32/edx # Var-name
(check-string-equal %edx "x" "F - test-var-with-type-and-register/name")
(check-strings-equal %edx "x" "F - test-var-with-type-and-register/name")
8b/-> *(eax+0x10) 2/r32/edx # Var-register
(check-string-equal %edx "eax" "F - test-var-with-type-and-register/register")
(check-strings-equal %edx "eax" "F - test-var-with-type-and-register/register")
8b/-> *(eax+4) 2/r32/edx # Var-type
(check-ints-equal %edx 1 "F - test-var-with-type-and-register/type")
# . epilogue
@ -1256,9 +1256,9 @@ test-parse-var-with-trailing-characters:
#
(parse-var-with-type %ecx _test-input-stream)
8b/-> *eax 2/r32/edx # Var-name
(check-string-equal %edx "x" "F - test-var-with-trailing-characters/name")
(check-strings-equal %edx "x" "F - test-var-with-trailing-characters/name")
8b/-> *(eax+0x10) 2/r32/edx # Var-register
(check-string-equal %edx "eax" "F - test-var-with-trailing-characters/register")
(check-strings-equal %edx "eax" "F - test-var-with-trailing-characters/register")
8b/-> *(eax+4) 2/r32/edx # Var-type
(check-ints-equal %edx 1 "F - test-var-with-trailing-characters/type")
# . epilogue

BIN
apps/pack

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.