Author: Carl Friedrich Bolz-Tereick <[email protected]>
Branch:
Changeset: r96675:f48749310466
Date: 2019-05-25 00:33 +0200
http://bitbucket.org/pypy/pypy/changeset/f48749310466/
Log: stop running this record_exact_class test in the backends. it's
failing for unrelated reasons, and it's a frontend test anywa test
in the backends.
diff --git a/rpython/jit/metainterp/test/test_ajit.py
b/rpython/jit/metainterp/test/test_ajit.py
--- a/rpython/jit/metainterp/test/test_ajit.py
+++ b/rpython/jit/metainterp/test/test_ajit.py
@@ -3989,55 +3989,6 @@
# here it works again
self.check_operations_history(guard_class=0, record_exact_class=1)
- def test_record_exact_class_nonconst(self):
- class Base(object):
- def f(self):
- raise NotImplementedError
- def g(self):
- raise NotImplementedError
- class A(Base):
- def f(self):
- return self.a
- def g(self):
- return self.a + 1
- class B(Base):
- def f(self):
- return self.b
- def g(self):
- return self.b + 1
- class C(B):
- def f(self):
- self.c += 1
- return self.c
- def g(self):
- return self.c + 1
- @dont_look_inside
- def make(x):
- if x > 0:
- a = A()
- a.a = x + 1
- elif x < 0:
- a = B()
- a.b = -x
- else:
- a = C()
- a.c = 10
- return a, type(a)
- def f(x):
- a, cls = make(x)
- record_exact_class(a, cls)
- if x > 0:
- z = a.f()
- elif x < 0:
- z = a.f()
- else:
- z = a.f()
- return z + a.g()
- res1 = f(6)
- res2 = self.interp_operations(f, [6])
- assert res1 == res2
- self.check_operations_history(guard_class=1, record_exact_class=0)
-
def test_generator(self):
def g(n):
yield n+1
@@ -4889,3 +4840,52 @@
res = self.meta_interp(f, [0])
assert res == f(0)
+
+ def test_record_exact_class_nonconst(self):
+ class Base(object):
+ def f(self):
+ raise NotImplementedError
+ def g(self):
+ raise NotImplementedError
+ class A(Base):
+ def f(self):
+ return self.a
+ def g(self):
+ return self.a + 1
+ class B(Base):
+ def f(self):
+ return self.b
+ def g(self):
+ return self.b + 1
+ class C(B):
+ def f(self):
+ self.c += 1
+ return self.c
+ def g(self):
+ return self.c + 1
+ @dont_look_inside
+ def make(x):
+ if x > 0:
+ a = A()
+ a.a = x + 1
+ elif x < 0:
+ a = B()
+ a.b = -x
+ else:
+ a = C()
+ a.c = 10
+ return a, type(a)
+ def f(x):
+ a, cls = make(x)
+ record_exact_class(a, cls)
+ if x > 0:
+ z = a.f()
+ elif x < 0:
+ z = a.f()
+ else:
+ z = a.f()
+ return z + a.g()
+ res1 = f(6)
+ res2 = self.interp_operations(f, [6])
+ assert res1 == res2
+ self.check_operations_history(guard_class=1, record_exact_class=0)
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit