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