]> gitweb.factorcode.org Git - factor.git/blobdiff - basis/compiler/tree/propagation/propagation-tests.factor
Merge branch 'master' of git://factorcode.org/git/factor into propagation
[factor.git] / basis / compiler / tree / propagation / propagation-tests.factor
index 07024f7e0d04b2eb6e785b534d93d4df2f6a5d12..d083b39b5bc98d14c4224d60fdabc0b7cb9ecada 100644 (file)
@@ -1015,3 +1015,22 @@ UNION: ?fixnum fixnum POSTPONE: f ;
 [ ] [ "IN: compiler.tree.propagation.tests TUPLE: foo baz bar ;" eval( -- ) ] unit-test
 
 [ 3 ] [ "USE: kernel IN: compiler.tree.propagation.tests 2 3 foo boa baz" eval( -- x ) ] unit-test
+
+! Non-zero displacement for <displaced-alien> restricts the output type
+[ t ] [
+    [ { byte-array } declare <displaced-alien> ] final-classes
+    first byte-array alien class-or class=
+] unit-test
+
+[ V{ alien } ] [
+    [ { alien } declare <displaced-alien> ] final-classes
+] unit-test
+
+[ t ] [
+    [ { POSTPONE: f } declare <displaced-alien> ] final-classes
+    first \ f alien class-or class=
+] unit-test
+
+[ V{ alien } ] [
+    [ { byte-array } declare [ 10 bitand 2 + ] dip <displaced-alien> ] final-classes
+] unit-test