[pypy-svn] pypy default: (alex, arigo, fijal) Failing test case reproducing twisted.something.leftarrow
fijal
commits-noreply at bitbucket.org
Tue Mar 15 19:57:58 CET 2011
Author: Maciej Fijalkowski <fijall at gmail.com>
Branch:
Changeset: r42681:f7b5e6b21197
Date: 2011-03-15 14:57 -0400
http://bitbucket.org/pypy/pypy/changeset/f7b5e6b21197/
Log: (alex, arigo, fijal) Failing test case reproducing
twisted.something.leftarrow fail. Hooray
diff --git a/pypy/jit/metainterp/test/test_virtual.py b/pypy/jit/metainterp/test/test_virtual.py
--- a/pypy/jit/metainterp/test/test_virtual.py
+++ b/pypy/jit/metainterp/test/test_virtual.py
@@ -843,6 +843,29 @@
assert self.meta_interp(f, []) == 10
self.check_loops(new_array=0)
+ def test_virtual_streq_bug(self):
+ mydriver = JitDriver(reds = ['i', 's', 'a'], greens = [])
+
+ class A(object):
+ def __init__(self, state):
+ self.state = state
+
+ def f():
+ i = 0
+ s = 0
+ a = A("data")
+ while i < 10:
+ mydriver.jit_merge_point(i=i, a=a, s=s)
+ if i > 1:
+ if a.state == 'data':
+ a.state = 'escaped'
+ else:
+ s += 1
+ i += 1
+ return s
+
+ res = self.meta_interp(f, [], repeat=7)
+ assert res == f()
# ____________________________________________________________
# Run 1: all the tests instantiate a real RPython class
More information about the Pypy-commit
mailing list