]> gitweb.factorcode.org Git - factor.git/blob - basis/compiler/cfg/alias-analysis/alias-analysis-tests.factor
Alias analysis
[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 }
16         T{ ##replace f V int-regs 1 D 0 }
17     }
18 ] [
19     {
20         T{ ##peek f V int-regs 1 D 1 }
21         T{ ##replace f V int-regs 1 D 0 }
22         T{ ##replace f V int-regs 1 D 1 }
23     } alias-analysis
24 ] unit-test
25
26 [
27     {
28         T{ ##peek f V int-regs 1 D 1 }
29         T{ ##copy f V int-regs 2 V int-regs 1 }
30         T{ ##replace f V int-regs 2 D 0 }
31     }
32 ] [
33     {
34         T{ ##peek f V int-regs 1 D 1 }
35         T{ ##copy f V int-regs 2 V int-regs 1 }
36         T{ ##replace f V int-regs 2 D 0 }
37         T{ ##replace f V int-regs 2 D 1 }
38     } alias-analysis
39 ] unit-test
40
41 [
42     {
43         T{ ##peek f V int-regs 1 D 1 }
44         T{ ##peek f V int-regs 2 D 0 }
45         T{ ##copy f V int-regs 3 V int-regs 2 }
46         T{ ##copy f V int-regs 4 V int-regs 1 }
47     }
48 ] [
49     {
50         T{ ##peek f V int-regs 1 D 1 }
51         T{ ##peek f V int-regs 2 D 0 }
52         T{ ##copy f V int-regs 3 V int-regs 2 }
53         T{ ##copy f V int-regs 4 V int-regs 1 }
54         T{ ##replace f V int-regs 3 D 0 }
55         T{ ##replace f V int-regs 4 D 1 }
56     } alias-analysis
57 ] unit-test
58
59 [
60     {
61         T{ ##peek f V int-regs 1 D 1 f }
62         T{ ##peek f V int-regs 2 D 2 f }
63         T{ ##replace f V int-regs 1 D 0 f }
64     }
65 ] [
66     {
67         T{ ##peek f V int-regs 1 D 1 f }
68         T{ ##peek f V int-regs 2 D 2 f }
69         T{ ##replace f V int-regs 2 D 0 f }
70         T{ ##replace f V int-regs 1 D 0 f }
71     } alias-analysis
72 ] unit-test
73
74 [
75     {
76         T{ ##peek f V int-regs 1 D 1 f }
77         T{ ##copy f V int-regs 3 V int-regs 1 f }
78     }
79 ] [
80     {
81         T{ ##peek f V int-regs 1 D 1 f }
82         T{ ##replace f V int-regs 1 D 1 f }
83         T{ ##peek f V int-regs 3 D 1 f }
84         T{ ##replace f V int-regs 4 D 1 f }
85     } alias-analysis
86 ] unit-test
87
88 [
89     {
90         T{ ##peek f V int-regs 1 D 1 f }
91         T{ ##peek f V int-regs 2 D 0 f }
92     }
93 ] [
94     {
95         T{ ##peek f V int-regs 1 D 1 f }
96         T{ ##peek f V int-regs 2 D 0 f }
97         T{ ##replace f V int-regs 1 D 0 f }
98         T{ ##replace f V int-regs 2 D 1 f }
99         T{ ##replace f V int-regs 2 D 0 f }
100         T{ ##replace f V int-regs 1 D 1 f }
101     } alias-analysis
102 ] unit-test
103
104 [
105     {
106         T{ ##peek f V int-regs 1 D 1 f }
107         T{ ##peek f V int-regs 2 D 0 f }
108         T{ ##copy f V int-regs 3 V int-regs 2 f }
109         T{ ##copy f V int-regs 4 V int-regs 1 f }
110     }
111 ] [
112     {
113         T{ ##peek f V int-regs 1 D 1 f }
114         T{ ##peek f V int-regs 2 D 0 f }
115         T{ ##replace f V int-regs 1 D 0 f }
116         T{ ##replace f V int-regs 2 D 1 f }
117         T{ ##peek f V int-regs 3 D 1 f }
118         T{ ##peek f V int-regs 4 D 0 f }
119         T{ ##replace f V int-regs 3 D 0 f }
120         T{ ##replace f V int-regs 4 D 1 f }
121     } alias-analysis
122 ] unit-test