]> gitweb.factorcode.org Git - factor.git/blob - basis/compiler/cfg/representations/coalescing/coalescing-tests.factor
0edbf69627b0e17c26e8188bb78178ce809b3dac
[factor.git] / basis / compiler / cfg / representations / coalescing / coalescing-tests.factor
1 USING: arrays sequences kernel namespaces accessors compiler.cfg
2 compiler.cfg.instructions
3 compiler.cfg.registers
4 compiler.cfg.debugger
5 compiler.cfg.representations.coalescing
6 compiler.cfg.utilities
7 tools.test ;
8 IN: compiler.cfg.representations.coalescing.tests
9
10 : test-scc ( -- )
11     0 get block>cfg compute-components ;
12
13 V{
14     T{ ##prologue }
15     T{ ##branch }
16 } 0 test-bb
17
18 V{
19     T{ ##peek f 2 D 0 }
20     T{ ##load-integer f 0 0 }
21     T{ ##branch }
22 } 1 test-bb
23
24 V{
25     T{ ##load-integer f 1 0 }
26     T{ ##branch }
27 } 2 test-bb
28
29 V{
30     T{ ##phi f 3 H{ { 1 0 } { 2 1 } } }
31 } 3 test-bb
32
33 0 { 1 2 } edges
34 1 3 edge
35 2 3 edge
36
37 [ ] [ test-scc ] unit-test
38
39 [ t ] [ 0 vreg>scc 1 vreg>scc = ] unit-test
40 [ t ] [ 0 vreg>scc 3 vreg>scc = ] unit-test
41 [ f ] [ 2 vreg>scc 3 vreg>scc = ] unit-test