[pypy-svn] r25360 - pypy/branch/explicit-exceptions/translator/backendopt/test
mwh at codespeak.net
mwh at codespeak.net
Wed Apr 5 13:13:19 CEST 2006
Author: mwh
Date: Wed Apr 5 13:13:15 2006
New Revision: 25360
Modified:
pypy/branch/explicit-exceptions/translator/backendopt/test/test_inline.py
Log:
merging of http://codespeak.net/svn/pypy/dist/pypy/translator/backendopt/test/test_inline.py
revisions 24785 to 25354:
------------------------------------------------------------------------
r25305 | pedronis | 2006-04-04 17:43:06 +0200 (Tue, 04 Apr 2006) | 3 lines
case were the current keepalive insertion by inlining is insufficient.
------------------------------------------------------------------------
Modified: pypy/branch/explicit-exceptions/translator/backendopt/test/test_inline.py
==============================================================================
--- pypy/branch/explicit-exceptions/translator/backendopt/test/test_inline.py (original)
+++ pypy/branch/explicit-exceptions/translator/backendopt/test/test_inline.py Wed Apr 5 13:13:15 2006
@@ -427,3 +427,24 @@
return 1
assert x4() == 1
py.test.raises(CannotInline, check_inline, x3, x4, [])
+
+def test_keepalive_hard_case():
+ py.test.skip("fix this :(")
+ from pypy.rpython.lltypesystem import lltype
+ Y = lltype.Struct('y', ('n', lltype.Signed))
+ X = lltype.GcStruct('x', ('y', Y))
+ def g(x):
+ if x:
+ return 3
+ else:
+ return 4
+ def f():
+ x = lltype.malloc(X)
+ x.y.n = 2
+ y = x.y
+ z1 = g(y.n)
+ z = y.n
+ return z+z1
+ eval_func = check_inline(g, f, [])
+ res = eval_func([])
+ assert res == 5
More information about the Pypy-commit
mailing list