]> gitweb.factorcode.org Git - factor.git/blob - basis/compiler/cfg/ssa/destruction/destruction-tests.factor
compiler.cfg.ssa.destruction.coalescing: new vocab to refactor and
[factor.git] / basis / compiler / cfg / ssa / destruction / destruction-tests.factor
1 USING: alien.syntax compiler.cfg.instructions compiler.cfg.registers
2 compiler.cfg.ssa.destruction compiler.cfg.ssa.destruction.leaders
3 compiler.cfg.ssa.destruction.private compiler.cfg.utilities
4 cpu.architecture cpu.x86.assembler.operands kernel make namespaces
5 sequences tools.test ;
6 IN: compiler.cfg.ssa.destruction.tests
7
8 ! cleanup-insn
9 {
10     V{ T{ ##copy { src 45 } { dst 47 } { rep double-2-rep } } }
11 } [
12     H{ { 45 45 } { 46 45 } { 47 47 } { 100 47 } } leader-map set
13     ! how can the leader of a vreg have a different representation
14     ! than the vreg itself?
15     H{
16         { 45 double-2-rep }
17         { 46 double-rep }
18         { 47 double-rep }
19         { 100 double-rep }
20     } representations set
21     T{ ##parallel-copy { values V{ { 100 46 } } } }
22     [ cleanup-insn ] V{ } make
23 ] unit-test
24
25 { V{ } } [
26     T{ ##parallel-copy { values V{ } } }
27     [ cleanup-insn ] V{ } make
28 ] unit-test
29
30 ! destruct-ssa
31 { } [
32     H{ { 36 23 } { 23 23 } } leader-map set
33     H{ { 36 int-rep } { 37 tagged-rep } } representations set
34     V{
35         T{ ##alien-invoke
36            { reg-inputs V{ { 56 int-rep RDI } } }
37            { stack-inputs V{ } }
38            { reg-outputs { { 36 int-rep RAX } } }
39            { dead-outputs { } }
40            { cleanup 0 }
41            { stack-size 0 }
42            { symbols "g_quark_to_string" }
43            { dll DLL" libglib-2.0.so" }
44            { gc-map T{ gc-map { scrub-d { } } { scrub-r { } } } }
45            { insn# 14 }
46         }
47         T{ ##call-gc { gc-map T{ gc-map { scrub-d { } } { scrub-r { } } } } }
48         T{ ##box-alien
49            { dst 37 }
50            { src 36 }
51            { temp 11 }
52            { insn# 18 }
53         }
54     } 0 insns>block block>cfg destruct-ssa
55 ] unit-test