]> gitweb.factorcode.org Git - factor.git/blob - basis/compiler/cfg/two-operand/two-operand-tests.factor
Merge branch 'dcn'
[factor.git] / basis / compiler / cfg / two-operand / two-operand-tests.factor
1 IN: compiler.cfg.two-operand.tests
2 USING: compiler.cfg.two-operand compiler.cfg.instructions
3 compiler.cfg.registers cpu.architecture namespaces tools.test ;
4
5 3 vreg-counter set-global
6
7 [
8     V{
9         T{ ##copy f V int-regs 1 V int-regs 2 }
10         T{ ##sub f V int-regs 1 V int-regs 1 V int-regs 3 }
11     }
12 ] [
13     {
14         T{ ##sub f V int-regs 1 V int-regs 2 V int-regs 3 }
15     } (convert-two-operand)
16 ] unit-test
17
18 [
19     V{
20         T{ ##sub f V int-regs 1 V int-regs 1 V int-regs 2 }
21     }
22 ] [
23     {
24         T{ ##sub f V int-regs 1 V int-regs 1 V int-regs 2 }
25     } (convert-two-operand)
26 ] unit-test
27
28 [
29     V{
30         T{ ##copy f V int-regs 4 V int-regs 2 }
31         T{ ##sub f V int-regs 4 V int-regs 4 V int-regs 1 }
32         T{ ##copy f V int-regs 1 V int-regs 4 }
33     }
34 ] [
35     {
36         T{ ##sub f V int-regs 1 V int-regs 2 V int-regs 1 }
37     } (convert-two-operand)
38 ] unit-test
39
40 ! This should never come up after coalescing
41 [
42     V{
43         T{ ##fixnum-add f V int-regs 2 V int-regs 4 V int-regs 2 }
44     } (convert-two-operand)
45 ] must-fail