]> gitweb.factorcode.org Git - factor.git/blob - basis/compiler/cfg/alias-analysis/alias-analysis-tests.factor
Various improvements
[factor.git] / basis / compiler / cfg / alias-analysis / alias-analysis-tests.factor
1 USING: compiler.cfg.instructions compiler.cfg.registers
2 compiler.cfg.alias-analysis cpu.architecture tools.test
3 kernel ;
4 IN: compiler.cfg.alias-analysis.tests
5
6 [ ] [
7     {
8         T{ ##load-indirect f V int-regs 1 "hello" }
9         T{ ##slot-imm f V int-regs 0 V int-regs 1 0 3 }
10     } alias-analysis drop
11 ] unit-test
12
13 [
14     {
15         T{ ##peek f V int-regs 1 D 1 f }
16         T{ ##peek f V int-regs 2 D 2 f }
17         T{ ##replace f V int-regs 1 D 0 f }
18     }
19 ] [
20     {
21         T{ ##peek f V int-regs 1 D 1 f }
22         T{ ##peek f V int-regs 2 D 2 f }
23         T{ ##replace f V int-regs 2 D 0 f }
24         T{ ##replace f V int-regs 1 D 0 f }
25     } alias-analysis
26 ] unit-test
27
28 [
29     {
30         T{ ##peek f V int-regs 1 D 1 f }
31         T{ ##peek f V int-regs 2 D 0 f }
32         T{ ##copy f V int-regs 3 V int-regs 2 f }
33         T{ ##copy f V int-regs 4 V int-regs 1 f }
34         T{ ##replace f V int-regs 3 D 0 f }
35         T{ ##replace f V int-regs 4 D 1 f }
36     }
37 ] [
38     {
39         T{ ##peek f V int-regs 1 D 1 f }
40         T{ ##peek f V int-regs 2 D 0 f }
41         T{ ##replace f V int-regs 1 D 0 f }
42         T{ ##replace f V int-regs 2 D 1 f }
43         T{ ##peek f V int-regs 3 D 1 f }
44         T{ ##peek f V int-regs 4 D 0 f }
45         T{ ##replace f V int-regs 3 D 0 f }
46         T{ ##replace f V int-regs 4 D 1 f }
47     } alias-analysis
48 ] unit-test