compiler.cfg: clean up ##phi literals in tests

db4
Slava Pestov 2010-04-30 18:40:34 -04:00
parent ffd1844d52
commit df86d1341f
6 changed files with 23 additions and 48 deletions

View File

@ -11,8 +11,8 @@ FROM: alien.c-types => int ;
IN: compiler.cfg.builder.tests IN: compiler.cfg.builder.tests
! Just ensure that various CFGs build correctly. ! Just ensure that various CFGs build correctly.
: unit-test-cfg ( quot -- ) : unit-test-builder ( quot -- )
'[ _ test-cfg [ [ optimize-cfg check-cfg ] with-cfg ] each ] [ ] swap unit-test ; '[ _ test-builder [ [ optimize-cfg check-cfg ] with-cfg ] each ] [ ] swap unit-test ;
: blahblah ( nodes -- ? ) : blahblah ( nodes -- ? )
{ fixnum } declare [ { fixnum } declare [
@ -105,7 +105,7 @@ IN: compiler.cfg.builder.tests
set-string-nth-fast set-string-nth-fast
] ]
} [ } [
unit-test-cfg unit-test-builder
] each ] each
: test-1 ( -- ) test-1 ; : test-1 ( -- ) test-1 ;
@ -116,7 +116,7 @@ IN: compiler.cfg.builder.tests
test-1 test-1
test-2 test-2
test-3 test-3
} [ unit-test-cfg ] each } [ unit-test-builder ] each
{ {
byte-array byte-array
@ -134,8 +134,8 @@ IN: compiler.cfg.builder.tests
alien-float alien-float
alien-double alien-double
} [| word | } [| word |
{ class } word '[ _ declare 10 _ execute ] unit-test-cfg { class } word '[ _ declare 10 _ execute ] unit-test-builder
{ class fixnum } word '[ _ declare _ execute ] unit-test-cfg { class fixnum } word '[ _ declare _ execute ] unit-test-builder
] each ] each
{ {
@ -146,22 +146,22 @@ IN: compiler.cfg.builder.tests
set-alien-unsigned-2 set-alien-unsigned-2
set-alien-unsigned-4 set-alien-unsigned-4
} [| word | } [| word |
{ fixnum class } word '[ _ declare 10 _ execute ] unit-test-cfg { fixnum class } word '[ _ declare 10 _ execute ] unit-test-builder
{ fixnum class fixnum } word '[ _ declare _ execute ] unit-test-cfg { fixnum class fixnum } word '[ _ declare _ execute ] unit-test-builder
] each ] each
{ float class } \ set-alien-float '[ _ declare 10 _ execute ] unit-test-cfg { float class } \ set-alien-float '[ _ declare 10 _ execute ] unit-test-builder
{ float class fixnum } \ set-alien-float '[ _ declare _ execute ] unit-test-cfg { float class fixnum } \ set-alien-float '[ _ declare _ execute ] unit-test-builder
{ float class } \ set-alien-double '[ _ declare 10 _ execute ] unit-test-cfg { float class } \ set-alien-double '[ _ declare 10 _ execute ] unit-test-builder
{ float class fixnum } \ set-alien-double '[ _ declare _ execute ] unit-test-cfg { float class fixnum } \ set-alien-double '[ _ declare _ execute ] unit-test-builder
{ pinned-c-ptr class } \ set-alien-cell '[ _ declare 10 _ execute ] unit-test-cfg { pinned-c-ptr class } \ set-alien-cell '[ _ declare 10 _ execute ] unit-test-builder
{ pinned-c-ptr class fixnum } \ set-alien-cell '[ _ declare _ execute ] unit-test-cfg { pinned-c-ptr class fixnum } \ set-alien-cell '[ _ declare _ execute ] unit-test-builder
] each ] each
: count-insns ( quot insn-check -- ? ) : count-insns ( quot insn-check -- ? )
[ test-mr [ instructions>> ] map ] dip [ test-regs [ instructions>> ] map ] dip
'[ _ count ] map-sum ; inline '[ _ count ] map-sum ; inline
: contains-insn? ( quot insn-check -- ? ) : contains-insn? ( quot insn-check -- ? )

View File

@ -184,14 +184,11 @@ V{
} 2 test-bb } 2 test-bb
V{ V{
T{ ##phi f 3 } T{ ##phi f 3 H{ { 1 1 } { 2 2 } } }
T{ ##allot f 1 64 byte-array } T{ ##allot f 1 64 byte-array }
T{ ##branch } T{ ##branch }
} 3 test-bb } 3 test-bb
1 get 1 2array
2 get 2 2array 2array 3 get instructions>> first (>>inputs)
0 { 1 2 } edges 0 { 1 2 } edges
1 3 edge 1 3 edge
2 3 edge 2 3 edge

View File

@ -24,14 +24,10 @@ V{
} 3 test-bb } 3 test-bb
V{ V{
T{ ##phi f 2 } T{ ##phi f 2 H{ { 2 0 } { 3 1 } } }
T{ ##branch } T{ ##branch }
} 4 test-bb } 4 test-bb
2 get 0 2array
3 get 1 2array 2array
4 get instructions>> first (>>inputs)
V{ V{
T{ ##branch } T{ ##branch }
} 5 test-bb } 5 test-bb

View File

@ -26,16 +26,13 @@ V{
} 2 test-bb } 2 test-bb
V{ V{
T{ ##phi f 3 } T{ ##phi f 3 H{ { 1 0 } { 2 1 } } }
} 3 test-bb } 3 test-bb
0 { 1 2 } edges 0 { 1 2 } edges
1 3 edge 1 3 edge
2 3 edge 2 3 edge
1 get 0 2array
2 get 1 2array 2array 3 get instructions>> first (>>inputs)
[ ] [ test-scc ] unit-test [ ] [ test-scc ] unit-test
[ t ] [ 0 vreg>scc 1 vreg>scc = ] unit-test [ t ] [ 0 vreg>scc 1 vreg>scc = ] unit-test

View File

@ -251,7 +251,7 @@ V{
} 2 test-bb } 2 test-bb
V{ V{
T{ ##phi f 3 } T{ ##phi f 3 H{ { 1 1 } { 2 2 } } }
T{ ##replace f 3 D 0 } T{ ##replace f 3 D 0 }
T{ ##branch } T{ ##branch }
} 3 test-bb } 3 test-bb
@ -261,9 +261,6 @@ V{
T{ ##return } T{ ##return }
} 4 test-bb } 4 test-bb
1 get 1 2array
2 get 2 2array 2array 3 get instructions>> first (>>inputs)
0 { 1 2 } edges 0 { 1 2 } edges
1 3 edge 1 3 edge
2 3 edge 2 3 edge
@ -298,7 +295,7 @@ V{
} 2 test-bb } 2 test-bb
V{ V{
T{ ##phi f 4 } T{ ##phi f 4 H{ { 1 2 } { 2 3 } } }
T{ ##replace f 4 D 0 } T{ ##replace f 4 D 0 }
T{ ##branch } T{ ##branch }
} 3 test-bb } 3 test-bb
@ -308,9 +305,6 @@ V{
T{ ##return } T{ ##return }
} 4 test-bb } 4 test-bb
1 get 2 2array
2 get 3 2array 2array 3 get instructions>> first (>>inputs)
0 { 1 2 } edges 0 { 1 2 } edges
1 3 edge 1 3 edge
2 3 edge 2 3 edge
@ -371,7 +365,7 @@ cpu x86.32? [
} 3 test-bb } 3 test-bb
V{ V{
T{ ##phi f 4 } T{ ##phi f 4 H{ { 2 2 } { 3 3 } } }
T{ ##peek f 5 D 0 } T{ ##peek f 5 D 0 }
T{ ##add-float f 6 4 5 } T{ ##add-float f 6 4 5 }
T{ ##replace f 6 D 0 } T{ ##replace f 6 D 0 }
@ -385,9 +379,6 @@ cpu x86.32? [
test-diamond test-diamond
4 5 edge 4 5 edge
2 get 2 2array
3 get 3 2array 2array 4 get instructions>> first (>>inputs)
[ ] [ test-representations ] unit-test [ ] [ test-representations ] unit-test
[ t ] [ 2 get instructions>> first ##load-double? ] unit-test [ t ] [ 2 get instructions>> first ##load-double? ] unit-test

View File

@ -2302,14 +2302,11 @@ V{
} 3 test-bb } 3 test-bb
V{ V{
T{ ##phi f 3 } T{ ##phi f 3 H{ { 2 1 } { 3 2 } } }
T{ ##replace f 3 D 0 } T{ ##replace f 3 D 0 }
T{ ##return } T{ ##return }
} 4 test-bb } 4 test-bb
2 get 1 2array
3 get 2 2array 2array 4 get instructions>> first (>>inputs)
test-diamond test-diamond
[ ] [ [ ] [
@ -2341,7 +2338,7 @@ V{
} 2 test-bb } 2 test-bb
V{ V{
T{ ##phi f 3 V{ } } T{ ##phi f 3 H{ { 1 1 } { 2 0 } } }
T{ ##branch } T{ ##branch }
} 3 test-bb } 3 test-bb
@ -2350,9 +2347,6 @@ V{
T{ ##return } T{ ##return }
} 4 test-bb } 4 test-bb
1 get 1 2array
2 get 0 2array 2array 3 get instructions>> first (>>inputs)
test-diamond test-diamond
[ ] [ [ ] [