diff --git a/basis/compiler/tree/propagation/inlining/inlining-tests.factor b/basis/compiler/tree/propagation/inlining/inlining-tests.factor index 16dd94dede..6be283d763 100644 --- a/basis/compiler/tree/propagation/inlining/inlining-tests.factor +++ b/basis/compiler/tree/propagation/inlining/inlining-tests.factor @@ -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 ; IN: compiler.tree.propagation.inlining.tests @@ -6,3 +6,8 @@ IN: compiler.tree.propagation.inlining.tests [ >bignum 10 mod ] build-tree propagate fourth dup word>> do-inlining ] unit-test + +! never-inline-word? +{ t } [ + \ + props>> "default-method" of never-inline-word? +] unit-test diff --git a/basis/compiler/tree/propagation/nodes/nodes-tests.factor b/basis/compiler/tree/propagation/nodes/nodes-tests.factor new file mode 100644 index 0000000000..3b5b38dacc --- /dev/null +++ b/basis/compiler/tree/propagation/nodes/nodes-tests.factor @@ -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 diff --git a/basis/compiler/tree/propagation/recursive/recursive-tests.factor b/basis/compiler/tree/propagation/recursive/recursive-tests.factor index 2f004e5011..94f1e04cfd 100644 --- a/basis/compiler/tree/propagation/recursive/recursive-tests.factor +++ b/basis/compiler/tree/propagation/recursive/recursive-tests.factor @@ -1,7 +1,10 @@ -USING: tools.test compiler.tree.propagation.recursive -math.intervals kernel math literals layouts ; +USING: accessors tools.test compiler.tree compiler.tree.builder +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 +! generalize-counter-interval { T{ interval f { 0 t } { 1/0. t } } } [ T{ interval f { 1 t } { 1 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 } } fixnum generalize-counter-interval ] 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 diff --git a/basis/compiler/tree/tree-tests.factor b/basis/compiler/tree/tree-tests.factor new file mode 100644 index 0000000000..b8a8c7573e --- /dev/null +++ b/basis/compiler/tree/tree-tests.factor @@ -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