Fix some tests broken by optimized? rename.

db4
John Benediktsson 2015-07-15 11:47:03 -07:00
parent b065d6172d
commit 8a3c5c2634
9 changed files with 27 additions and 23 deletions

View File

@ -201,7 +201,7 @@ TUPLE: my-tuple ;
{ tuple vector } 3 slot { word } declare { tuple vector } 3 slot { word } declare
dup 1 slot 0 fixnum-bitand { [ ] } dispatch ; dup 1 slot 0 fixnum-bitand { [ ] } dispatch ;
[ t ] [ \ dispatch-alignment-regression optimized? ] unit-test [ t ] [ \ dispatch-alignment-regression word-optimized? ] unit-test
[ vector ] [ dispatch-alignment-regression ] unit-test [ vector ] [ dispatch-alignment-regression ] unit-test

View File

@ -12,7 +12,7 @@ IN: compiler.tests.optimizer
GENERIC: xyz ( obj -- obj ) GENERIC: xyz ( obj -- obj )
M: array xyz xyz ; M: array xyz xyz ;
[ t ] [ M\ array xyz optimized? ] unit-test [ t ] [ M\ array xyz word-optimized? ] unit-test
! Test predicate inlining ! Test predicate inlining
: pred-test-1 ( a -- b c ) : pred-test-1 ( a -- b c )
@ -97,7 +97,7 @@ TUPLE: pred-test ;
! regression ! regression
GENERIC: void-generic ( obj -- * ) GENERIC: void-generic ( obj -- * )
: breakage ( -- * ) "hi" void-generic ; : breakage ( -- * ) "hi" void-generic ;
[ t ] [ \ breakage optimized? ] unit-test [ t ] [ \ breakage word-optimized? ] unit-test
[ breakage ] must-fail [ breakage ] must-fail
! regression ! regression
@ -122,7 +122,7 @@ GENERIC: void-generic ( obj -- * )
! compiling <tuple> with a non-literal class failed ! compiling <tuple> with a non-literal class failed
: <tuple>-regression ( class -- tuple ) <tuple> ; : <tuple>-regression ( class -- tuple ) <tuple> ;
[ t ] [ \ <tuple>-regression optimized? ] unit-test [ t ] [ \ <tuple>-regression word-optimized? ] unit-test
! regression ! regression
: constant-fold-2 ( -- value ) f ; foldable : constant-fold-2 ( -- value ) f ; foldable
@ -203,7 +203,7 @@ M: number detect-number ;
: node-successor-f-bug ( x -- * ) : node-successor-f-bug ( x -- * )
[ 3 throw ] [ empty-compound ] compose [ 3 throw ] if ; [ 3 throw ] [ empty-compound ] compose [ 3 throw ] if ;
[ t ] [ \ node-successor-f-bug optimized? ] unit-test [ t ] [ \ node-successor-f-bug word-optimized? ] unit-test
[ ] [ [ new ] build-tree optimize-tree drop ] unit-test [ ] [ [ new ] build-tree optimize-tree drop ] unit-test
@ -217,7 +217,7 @@ M: number detect-number ;
] if ] if
] if ; ] if ;
[ t ] [ \ lift-throw-tail-regression optimized? ] unit-test [ t ] [ \ lift-throw-tail-regression word-optimized? ] unit-test
[ 3 "an integer" ] [ 3 lift-throw-tail-regression ] unit-test [ 3 "an integer" ] [ 3 lift-throw-tail-regression ] unit-test
[ "hi" "a string" ] [ "hi" lift-throw-tail-regression ] unit-test [ "hi" "a string" ] [ "hi" lift-throw-tail-regression ] unit-test
@ -248,7 +248,7 @@ HINTS: recursive-inline-hang array ;
: recursive-inline-hang-1 ( -- a ) : recursive-inline-hang-1 ( -- a )
{ } recursive-inline-hang ; { } recursive-inline-hang ;
[ t ] [ \ recursive-inline-hang-1 optimized? ] unit-test [ t ] [ \ recursive-inline-hang-1 word-optimized? ] unit-test
DEFER: recursive-inline-hang-3 DEFER: recursive-inline-hang-3
@ -302,7 +302,7 @@ PREDICATE: list < improper-list
dup "a" get { array-capacity } declare >= dup "a" get { array-capacity } declare >=
[ dup "b" get { array-capacity } declare >= [ 3 ] [ 4 ] if ] [ 5 ] if ; [ dup "b" get { array-capacity } declare >= [ 3 ] [ 4 ] if ] [ 5 ] if ;
[ t ] [ \ interval-inference-bug optimized? ] unit-test [ t ] [ \ interval-inference-bug word-optimized? ] unit-test
[ ] [ 1 "a" set 2 "b" set ] unit-test [ ] [ 1 "a" set 2 "b" set ] unit-test
[ 2 3 ] [ 2 interval-inference-bug ] unit-test [ 2 3 ] [ 2 interval-inference-bug ] unit-test
@ -364,7 +364,7 @@ DEFER: loop-bbb
: broken-declaration ( -- ) \ + declare ; : broken-declaration ( -- ) \ + declare ;
[ f ] [ \ broken-declaration optimized? ] unit-test [ f ] [ \ broken-declaration word-optimized? ] unit-test
[ ] [ [ \ broken-declaration forget ] with-compilation-unit ] unit-test [ ] [ [ \ broken-declaration forget ] with-compilation-unit ] unit-test

View File

@ -22,5 +22,5 @@ pipeline = "hello" => [[ ast>pipeline-expr ]]
USE: tools.test USE: tools.test
[ t ] [ \ expr optimized? ] unit-test [ t ] [ \ expr word-optimized? ] unit-test
[ t ] [ \ ast>pipeline-expr optimized? ] unit-test [ t ] [ \ ast>pipeline-expr word-optimized? ] unit-test

View File

@ -17,7 +17,7 @@ M: empty-mixin sheeple drop "wake up" ; inline
"definition-dependencies" word-prop member-eq? ; "definition-dependencies" word-prop member-eq? ;
[ "sheeple" ] [ sheeple-test ] unit-test [ "sheeple" ] [ sheeple-test ] unit-test
[ t ] [ \ sheeple-test optimized? ] unit-test [ t ] [ \ sheeple-test word-optimized? ] unit-test
[ t ] [ object \ sheeple lookup-method \ sheeple-test compiled-use? ] unit-test [ t ] [ object \ sheeple lookup-method \ sheeple-test compiled-use? ] unit-test
[ f ] [ empty-mixin \ sheeple lookup-method \ sheeple-test compiled-use? ] unit-test [ f ] [ empty-mixin \ sheeple lookup-method \ sheeple-test compiled-use? ] unit-test
@ -30,6 +30,6 @@ M: empty-mixin sheeple drop "wake up" ; inline
[ ] [ [ array empty-mixin remove-mixin-instance ] with-compilation-unit ] unit-test [ ] [ [ array empty-mixin remove-mixin-instance ] with-compilation-unit ] unit-test
[ "sheeple" ] [ sheeple-test ] unit-test [ "sheeple" ] [ sheeple-test ] unit-test
[ t ] [ \ sheeple-test optimized? ] unit-test [ t ] [ \ sheeple-test word-optimized? ] unit-test
[ t ] [ object \ sheeple lookup-method \ sheeple-test compiled-use? ] unit-test [ t ] [ object \ sheeple lookup-method \ sheeple-test compiled-use? ] unit-test
[ f ] [ empty-mixin \ sheeple lookup-method \ sheeple-test compiled-use? ] unit-test [ f ] [ empty-mixin \ sheeple lookup-method \ sheeple-test compiled-use? ] unit-test

View File

@ -236,7 +236,11 @@ M: f single-combination-test-2 single-combination-test-4 ;
10 [ 10 [
[ "compiler.tests.foo" forget-vocab ] with-compilation-unit [ "compiler.tests.foo" forget-vocab ] with-compilation-unit
[ t ] [ [ t ] [
"USING: prettyprint words accessors ; IN: compiler.tests.foo : (recursive) ( -- ) (recursive) (recursive) ; inline recursive : recursive ( -- ) (recursive) ; \\ (recursive) optimized?" eval( -- obj ) "USING: prettyprint words accessors ;
IN: compiler.tests.foo
: (recursive) ( -- ) (recursive) (recursive) ; inline recursive
: recursive ( -- ) (recursive) ;
\\ (recursive) word-optimized?" eval( -- obj )
] unit-test ] unit-test
] times ] times

View File

@ -49,7 +49,7 @@ IN: compiler.tests.spilling
[ 2.0 2.0 2.0 2.0 2.0 2.0 2.0 2.0 2.0 2.0 2.0 2.0 2.0 2.0 2.0 2.0 2.0 2.0 2.0 2.0 2.0 2.0 2.0 2.0 2.0 2.0 2.0 2.0 2.0 2.0 2.0 2.0 2.0 2.0 2.0 2.0 2.0 2.0 ] [ 2.0 2.0 2.0 2.0 2.0 2.0 2.0 2.0 2.0 2.0 2.0 2.0 2.0 2.0 2.0 2.0 2.0 2.0 2.0 2.0 2.0 2.0 2.0 2.0 2.0 2.0 2.0 2.0 2.0 2.0 2.0 2.0 2.0 2.0 2.0 2.0 2.0 2.0 ]
[ 1.0 float-spill-bug ] unit-test [ 1.0 float-spill-bug ] unit-test
[ t ] [ \ float-spill-bug optimized? ] unit-test [ t ] [ \ float-spill-bug word-optimized? ] unit-test
: float-fixnum-spill-bug ( object -- object object object object object object object object object object object object object object object object object object object object object object object object object object object object object object object object object object object object object object object object object object object object object object object object object object object object object object object object object object object object object object object object object object object object object object object object object object object object ) : float-fixnum-spill-bug ( object -- object object object object object object object object object object object object object object object object object object object object object object object object object object object object object object object object object object object object object object object object object object object object object object object object object object object object object object object object object object object object object object object object object object object object object object object object object object object object )
{ {
@ -134,7 +134,7 @@ IN: compiler.tests.spilling
[ 2.0 2 2.0 2 2.0 2 2.0 2 2.0 2 2.0 2 2.0 2 2.0 2 2.0 2 2.0 2 2.0 2 2.0 2 2.0 2 2.0 2 2.0 2 2.0 2 2.0 2 2.0 2 2.0 2 2.0 2 2.0 2 2.0 2 2.0 2 2.0 2 2.0 2 2.0 2 2.0 2 2.0 2 2.0 2 2.0 2 2.0 2 2.0 2 2.0 2 2.0 2 2.0 2 2.0 2 2.0 2 2.0 2 ] [ 2.0 2 2.0 2 2.0 2 2.0 2 2.0 2 2.0 2 2.0 2 2.0 2 2.0 2 2.0 2 2.0 2 2.0 2 2.0 2 2.0 2 2.0 2 2.0 2 2.0 2 2.0 2 2.0 2 2.0 2 2.0 2 2.0 2 2.0 2 2.0 2 2.0 2 2.0 2 2.0 2 2.0 2 2.0 2 2.0 2 2.0 2 2.0 2 2.0 2 2.0 2 2.0 2 2.0 2 2.0 2 2.0 2 ]
[ 1.0 float-fixnum-spill-bug ] unit-test [ 1.0 float-fixnum-spill-bug ] unit-test
[ t ] [ \ float-fixnum-spill-bug optimized? ] unit-test [ t ] [ \ float-fixnum-spill-bug word-optimized? ] unit-test
: resolve-spill-bug ( a b -- c ) : resolve-spill-bug ( a b -- c )
[ 1 fixnum+fast ] bi@ dup 10 fixnum< [ [ 1 fixnum+fast ] bi@ dup 10 fixnum< [
@ -161,7 +161,7 @@ IN: compiler.tests.spilling
16 narray 16 narray
] if ; ] if ;
[ t ] [ \ resolve-spill-bug optimized? ] unit-test [ t ] [ \ resolve-spill-bug word-optimized? ] unit-test
[ 4 ] [ 1 1 resolve-spill-bug ] unit-test [ 4 ] [ 1 1 resolve-spill-bug ] unit-test

View File

@ -488,7 +488,7 @@ M: integer ed's-bug neg ;
:: ed's-test-case ( a -- b ) :: ed's-test-case ( a -- b )
{ [ a ed's-bug ] } && ; { [ a ed's-bug ] } && ;
{ t } [ \ ed's-test-case optimized? ] unit-test { t } [ \ ed's-test-case word-optimized? ] unit-test
! multiple bind ! multiple bind
{ 3 1 2 } [ [let 1 2 3 :> ( a b c ) c a b ] ] unit-test { 3 1 2 } [ [let 1 2 3 :> ( a b c ) c a b ] ] unit-test

View File

@ -118,7 +118,7 @@ IN: tools.walker.tests
\ breakpoint-test don't-step-into \ breakpoint-test don't-step-into
{ f } [ \ breakpoint-test optimized? ] unit-test { f } [ \ breakpoint-test word-optimized? ] unit-test
{ { 3 } } [ [ breakpoint-test ] test-walker ] unit-test { { 3 } } [ [ breakpoint-test ] test-walker ] unit-test

View File

@ -16,12 +16,12 @@ IN: combinators.tests
: compile-execute(-test-1 ( a b -- c ) \ + execute( a b -- c ) ; : compile-execute(-test-1 ( a b -- c ) \ + execute( a b -- c ) ;
{ t } [ \ compile-execute(-test-1 optimized? ] unit-test { t } [ \ compile-execute(-test-1 word-optimized? ] unit-test
{ 4 } [ 1 3 compile-execute(-test-1 ] unit-test { 4 } [ 1 3 compile-execute(-test-1 ] unit-test
: compile-execute(-test-2 ( a b w -- c ) execute( a b -- c ) ; : compile-execute(-test-2 ( a b w -- c ) execute( a b -- c ) ;
{ t } [ \ compile-execute(-test-2 optimized? ] unit-test { t } [ \ compile-execute(-test-2 word-optimized? ] unit-test
{ 4 } [ 1 3 \ + compile-execute(-test-2 ] unit-test { 4 } [ 1 3 \ + compile-execute(-test-2 ] unit-test
{ 5 } [ 1 4 \ + compile-execute(-test-2 ] unit-test { 5 } [ 1 4 \ + compile-execute(-test-2 ] unit-test
{ -3 } [ 1 4 \ - compile-execute(-test-2 ] unit-test { -3 } [ 1 4 \ - compile-execute(-test-2 ] unit-test
@ -29,7 +29,7 @@ IN: combinators.tests
: compile-call(-test-1 ( a b q -- c ) call( a b -- c ) ; : compile-call(-test-1 ( a b q -- c ) call( a b -- c ) ;
{ t } [ \ compile-call(-test-1 optimized? ] unit-test { t } [ \ compile-call(-test-1 word-optimized? ] unit-test
{ 4 } [ 1 3 [ + ] compile-call(-test-1 ] unit-test { 4 } [ 1 3 [ + ] compile-call(-test-1 ] unit-test
{ 7 } [ 1 3 2 [ * + ] curry compile-call(-test-1 ] unit-test { 7 } [ 1 3 2 [ * + ] curry compile-call(-test-1 ] unit-test
{ 7 } [ 1 3 [ 2 * ] [ + ] compose compile-call(-test-1 ] unit-test { 7 } [ 1 3 [ 2 * ] [ + ] compose compile-call(-test-1 ] unit-test
@ -256,7 +256,7 @@ DEFER: corner-case-1
<< \ corner-case-1 2 [ + ] curry 1array [ case ] curry ( a -- b ) define-declared >> << \ corner-case-1 2 [ + ] curry 1array [ case ] curry ( a -- b ) define-declared >>
{ t } [ \ corner-case-1 optimized? ] unit-test { t } [ \ corner-case-1 word-optimized? ] unit-test
{ 4 } [ 2 corner-case-1 ] unit-test { 4 } [ 2 corner-case-1 ] unit-test
{ 4 } [ 2 \ corner-case-1 def>> call ] unit-test { 4 } [ 2 \ corner-case-1 def>> call ] unit-test