2009-08-02 18:04:07 -04:00
|
|
|
! Copyright (C) 2009 Daniel Ehrenberg.
|
|
|
|
! See http://factorcode.org/license.txt for BSD license.
|
|
|
|
USING: kernel tools.test accessors vectors sequences namespaces
|
2014-11-07 13:02:14 -05:00
|
|
|
arrays compiler.cfg.def-use compiler.cfg compiler.cfg.debugger
|
|
|
|
compiler.cfg.instructions compiler.cfg.registers compiler.cfg.utilities
|
|
|
|
cpu.architecture ;
|
2009-08-13 20:21:44 -04:00
|
|
|
IN: compiler.cfg.def-use.tests
|
2009-08-02 18:04:07 -04:00
|
|
|
|
2015-04-22 06:59:23 -04:00
|
|
|
! compute-insns
|
|
|
|
{
|
2015-08-13 18:23:10 -04:00
|
|
|
T{ ##peek f 123 D: 0 f }
|
2015-04-22 06:59:23 -04:00
|
|
|
} [
|
2015-08-13 18:23:10 -04:00
|
|
|
{ T{ ##peek f 123 D: 0 } } 0 insns>block block>cfg compute-insns
|
2015-04-22 06:59:23 -04:00
|
|
|
123 insn-of
|
|
|
|
] unit-test
|
|
|
|
|
2009-08-02 18:04:07 -04:00
|
|
|
V{
|
2015-08-13 18:23:10 -04:00
|
|
|
T{ ##peek f 0 D: 0 }
|
|
|
|
T{ ##peek f 1 D: 0 }
|
|
|
|
T{ ##peek f 2 D: 0 }
|
2009-08-02 18:04:07 -04:00
|
|
|
} 1 test-bb
|
|
|
|
V{
|
2015-08-13 18:23:10 -04:00
|
|
|
T{ ##replace f 2 D: 0 }
|
2009-08-02 18:04:07 -04:00
|
|
|
} 2 test-bb
|
2009-08-02 20:12:32 -04:00
|
|
|
1 2 edge
|
2009-08-02 18:04:07 -04:00
|
|
|
V{
|
2015-08-13 18:23:10 -04:00
|
|
|
T{ ##replace f 0 D: 0 }
|
2009-08-02 18:04:07 -04:00
|
|
|
} 3 test-bb
|
2009-08-02 20:12:32 -04:00
|
|
|
2 3 edge
|
2009-08-02 18:04:07 -04:00
|
|
|
V{ } 4 test-bb
|
|
|
|
V{ } 5 test-bb
|
2009-08-02 20:12:32 -04:00
|
|
|
3 { 4 5 } edges
|
|
|
|
V{
|
2009-08-08 05:02:18 -04:00
|
|
|
T{ ##phi f 2 H{ { 2 0 } { 3 1 } } }
|
2009-08-02 20:12:32 -04:00
|
|
|
} 6 test-bb
|
|
|
|
4 6 edge
|
|
|
|
5 6 edge
|
2009-08-02 18:04:07 -04:00
|
|
|
|
2014-11-07 13:02:14 -05:00
|
|
|
1 get block>cfg 0 set
|
2015-07-03 12:39:59 -04:00
|
|
|
{ } [ 0 get compute-defs ] unit-test
|