factor/basis/compiler/cfg/stacks/stacks-tests.factor

35 lines
674 B
Factor
Raw Normal View History

2014-12-30 20:56:00 -05:00
USING: accessors arrays assocs combinators compiler.cfg.registers
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
: test-init ( -- )
reset-vreg-counter begin-stack-analysis begin-local-analysis
H{ } clone replace-mapping set ;
{
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