compiler.tree.*: new tests
parent
b9ce4910af
commit
ea67379751
|
@ -1,4 +1,4 @@
|
||||||
USING: accessors compiler.tree.builder compiler.tree.propagation
|
USING: accessors assocs compiler.tree.builder compiler.tree.propagation
|
||||||
compiler.tree.propagation.inlining kernel math sequences tools.test ;
|
compiler.tree.propagation.inlining kernel math sequences tools.test ;
|
||||||
IN: compiler.tree.propagation.inlining.tests
|
IN: compiler.tree.propagation.inlining.tests
|
||||||
|
|
||||||
|
@ -6,3 +6,8 @@ IN: compiler.tree.propagation.inlining.tests
|
||||||
[ >bignum 10 mod ] build-tree propagate
|
[ >bignum 10 mod ] build-tree propagate
|
||||||
fourth dup word>> do-inlining
|
fourth dup word>> do-inlining
|
||||||
] unit-test
|
] unit-test
|
||||||
|
|
||||||
|
! never-inline-word?
|
||||||
|
{ t } [
|
||||||
|
\ + props>> "default-method" of never-inline-word?
|
||||||
|
] unit-test
|
||||||
|
|
|
@ -0,0 +1,17 @@
|
||||||
|
USING: compiler.tree.propagation.copy compiler.tree.propagation.info
|
||||||
|
compiler.tree.propagation.nodes namespaces tools.test ;
|
||||||
|
IN: compiler.tree.propagation.nodes.tests
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
H{ { 1234 "hello" } }
|
||||||
|
} [
|
||||||
|
H{ { 1234 1234 } } copies set
|
||||||
|
{
|
||||||
|
H{
|
||||||
|
{ 1234 "hello" }
|
||||||
|
{ 4321 "stuff" }
|
||||||
|
}
|
||||||
|
} value-infos set
|
||||||
|
{ 1234 } extract-value-info
|
||||||
|
] unit-test
|
|
@ -1,7 +1,10 @@
|
||||||
USING: tools.test compiler.tree.propagation.recursive
|
USING: accessors tools.test compiler.tree compiler.tree.builder
|
||||||
math.intervals kernel math literals layouts ;
|
compiler.tree.optimizer compiler.tree.propagation.info
|
||||||
|
compiler.tree.propagation.recursive math.intervals kernel kernel.private
|
||||||
|
math literals layouts sequences ;
|
||||||
IN: compiler.tree.propagation.recursive.tests
|
IN: compiler.tree.propagation.recursive.tests
|
||||||
|
|
||||||
|
! generalize-counter-interval
|
||||||
{ T{ interval f { 0 t } { 1/0. t } } } [
|
{ T{ interval f { 0 t } { 1/0. t } } } [
|
||||||
T{ interval f { 1 t } { 1 t } }
|
T{ interval f { 1 t } { 1 t } }
|
||||||
T{ interval f { 0 t } { 0 t } }
|
T{ interval f { 0 t } { 0 t } }
|
||||||
|
@ -51,3 +54,20 @@ IN: compiler.tree.propagation.recursive.tests
|
||||||
T{ interval f { 2 t } { 11 t } }
|
T{ interval f { 2 t } { 11 t } }
|
||||||
fixnum generalize-counter-interval
|
fixnum generalize-counter-interval
|
||||||
] unit-test
|
] unit-test
|
||||||
|
|
||||||
|
! node-output-infos
|
||||||
|
: integer-loop ( a -- b )
|
||||||
|
{ integer } declare [ dup 0 > ] [ 1 - ] while ;
|
||||||
|
{
|
||||||
|
V{
|
||||||
|
T{ value-info-state
|
||||||
|
{ class integer }
|
||||||
|
{ interval
|
||||||
|
T{ interval { from { 1 t } } { to { 1/0. t } } }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} [
|
||||||
|
\ integer-loop build-tree optimize-tree
|
||||||
|
[ #if? ] filter second children>> first first recursive-phi-infos
|
||||||
|
] unit-test
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
USING: accessors compiler.tree kernel tools.test ;
|
||||||
|
IN: compiler.tree.tests
|
||||||
|
|
||||||
|
{
|
||||||
|
"label"
|
||||||
|
"a-child"
|
||||||
|
} [
|
||||||
|
"label" f "a-child" <#recursive>
|
||||||
|
[ label>> ] [ child>> ] bi
|
||||||
|
] unit-test
|
Loading…
Reference in New Issue