Author: Carl Friedrich Bolz <[email protected]>
Branch: guard-compatible
Changeset: r83045:25a9cbb2f43b
Date: 2016-03-14 18:48 +0100
http://bitbucket.org/pypy/pypy/changeset/25a9cbb2f43b/
Log: make sure that the test fails if grow_guard_compatible_switch does
nothing by checking that the elidable function is not called too
often
diff --git a/rpython/jit/metainterp/test/test_compatible.py
b/rpython/jit/metainterp/test/test_compatible.py
--- a/rpython/jit/metainterp/test/test_compatible.py
+++ b/rpython/jit/metainterp/test/test_compatible.py
@@ -15,8 +15,15 @@
p3 = lltype.malloc(S)
p3.x = 6
driver = jit.JitDriver(greens = [], reds = ['n', 'x'])
+
+ class A(object):
+ pass
+
+ c = A()
+ c.count = 0
@jit.elidable_compatible()
def g(s):
+ c.count += 1
return s.x
def f(n, x):
@@ -29,8 +36,11 @@
f(100, p1)
f(100, p2)
f(100, p3)
+ return c.count
- self.meta_interp(main, [])
+ x = self.meta_interp(main, [])
+
+ assert x < 25
# XXX check number of bridges
def test_exception(self):
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit