2014-12-30 20:56:00 -05:00
|
|
|
USING: accessors arrays assocs combinators compiler.cfg.registers
|
2015-03-19 13:03:49 -04:00
|
|
|
compiler.cfg.stacks compiler.cfg.stacks.local kernel literals namespaces
|
|
|
|
tools.test ;
|
|
|
|
IN: compiler.cfg.stacks.tests
|
2014-12-30 20:56:00 -05:00
|
|
|
|
2015-03-19 13:03:49 -04:00
|
|
|
: test-init ( -- )
|
2015-03-26 10:19:00 -04:00
|
|
|
reset-vreg-counter begin-stack-analysis begin-local-analysis
|
|
|
|
H{ } clone replace-mapping set ;
|
2015-03-19 13:03:49 -04:00
|
|
|
|
|
|
|
{
|
|
|
|
H{ { D 1 4 } { D 2 3 } { D 0 5 } }
|
|
|
|
{ { 0 0 } { 0 0 } }
|
|
|
|
} [
|
|
|
|
test-init
|
|
|
|
{ 3 4 5 } ds-loc store-vregs
|
|
|
|
replace-mapping get
|
|
|
|
height-state get
|
2014-12-30 20:56:00 -05:00
|
|
|
] unit-test
|
2015-03-24 10:23:58 -04:00
|
|
|
|
|
|
|
! load-vregs
|
|
|
|
{
|
|
|
|
{ 1 2 3 4 5 6 7 8 }
|
|
|
|
} [
|
|
|
|
test-init 8 ds-loc load-vregs
|
|
|
|
] unit-test
|
|
|
|
|
|
|
|
! 2inputs
|
|
|
|
{
|
|
|
|
1
|
|
|
|
2
|
|
|
|
{ { -2 -2 } { 0 0 } }
|
|
|
|
} [
|
|
|
|
test-init 2inputs height-state get
|
|
|
|
] unit-test
|