test that struct-arrays and struct construction optimize down

db4
Joe Groff 2009-08-26 21:38:00 -05:00
parent 4bf4cacc4b
commit ecd0bdbd58
1 changed files with 13 additions and 1 deletions

View File

@ -4,7 +4,8 @@ alien.structs.fields alien.syntax ascii classes.struct combinators
destructors io.encodings.utf8 io.pathnames io.streams.string destructors io.encodings.utf8 io.pathnames io.streams.string
kernel libc literals math multiline namespaces prettyprint kernel libc literals math multiline namespaces prettyprint
prettyprint.config see sequences specialized-arrays.ushort prettyprint.config see sequences specialized-arrays.ushort
system tools.test combinators.short-circuit ; system tools.test compiler.tree.debugger struct-arrays
classes.tuple.private ;
IN: classes.struct.tests IN: classes.struct.tests
<< <<
@ -178,3 +179,14 @@ STRUCT: struct-test-array-slots
[ y>> [ 8 3 ] dip set-nth ] [ y>> [ 8 3 ] dip set-nth ]
[ y>> ushort-array{ 2 3 5 8 11 13 } sequence= ] bi [ y>> ushort-array{ 2 3 5 8 11 13 } sequence= ] bi
] unit-test ] unit-test
STRUCT: struct-test-optimization
{ x int } { y int } ;
[ t ] [ [ struct-test-optimization memory>struct y>> ] { memory>struct y>> } inlined? ] unit-test
[ t ] [
[ 3 struct-test-optimization <direct-struct-array> third y>> ]
{ <tuple> <tuple-boa> memory>struct y>> } inlined?
] unit-test
[ f ] [ [ memory>struct y>> ] { memory>struct y>> } inlined? ] unit-test