[pypy-svn] r37611 - pypy/dist/pypy/jit/hintannotator/test
cfbolz at codespeak.net
cfbolz at codespeak.net
Tue Jan 30 16:56:51 CET 2007
Author: cfbolz
Date: Tue Jan 30 16:56:50 2007
New Revision: 37611
Modified:
pypy/dist/pypy/jit/hintannotator/test/test_annotator.py
Log:
cast_pointer does not seem to propagate frozenness
Modified: pypy/dist/pypy/jit/hintannotator/test/test_annotator.py
==============================================================================
--- pypy/dist/pypy/jit/hintannotator/test/test_annotator.py (original)
+++ pypy/dist/pypy/jit/hintannotator/test/test_annotator.py Tue Jan 30 16:56:50 2007
@@ -702,3 +702,32 @@
hs = hannotate(f, [Base], policy=P_OOPSPEC_NOVIRTUAL)
assert hs.is_green()
+
+
+def test_cast_pointer_keeps_deepfreeze():
+ py.test.skip("does not work")
+
+ class A(object):
+ pass
+ class B(A):
+ pass
+
+ def getinstance(n):
+ if n:
+ return A()
+ else:
+ return B()
+
+ def ll_function(n):
+ a = getinstance(n)
+ a = hint(a, promote=True)
+ a = hint(a, deepfreeze=True)
+
+ if isinstance(a, B):
+ return a
+ return None
+
+ hs = hannotate(ll_function, [int], policy=P_NOVIRTUAL)
+ assert hs.deepfrozen
+
+
More information about the Pypy-commit
mailing list