Author: Antonio Cuni <[email protected]>
Branch:
Changeset: r44808:366141b2d493
Date: 2011-06-07 16:52 +0200
http://bitbucket.org/pypy/pypy/changeset/366141b2d493/
Log: this test belongs to test_instance (more or less)
diff --git a/pypy/module/pypyjit/test_pypy_c/test_instance.py
b/pypy/module/pypyjit/test_pypy_c/test_instance.py
--- a/pypy/module/pypyjit/test_pypy_c/test_instance.py
+++ b/pypy/module/pypyjit/test_pypy_c/test_instance.py
@@ -181,3 +181,22 @@
i12 = int_add_ovf(i5, i7)
guard_no_overflow(descr=...)
""")
+
+ def test_id_compare_optimization(self):
+ def main():
+ class A(object):
+ pass
+ #
+ i = 0
+ a = A()
+ while i < 300:
+ new_a = A()
+ if new_a != a: # ID: compare
+ pass
+ i += 1
+ return i
+ #
+ log = self.run(main, [])
+ loop, = log.loops_by_filename(self.filepath)
+ assert loop.match_by_id("compare", "") # optimized away
+
diff --git a/pypy/module/pypyjit/test_pypy_c/test_pypy_c_new.py
b/pypy/module/pypyjit/test_pypy_c/test_pypy_c_new.py
--- a/pypy/module/pypyjit/test_pypy_c/test_pypy_c_new.py
+++ b/pypy/module/pypyjit/test_pypy_c/test_pypy_c_new.py
@@ -277,24 +277,6 @@
assert log.result == 300 * (-10 % -20)
assert log.jit_summary.tracing_no == 1
- def test_id_compare_optimization(self):
- def main():
- class A(object):
- pass
- #
- i = 0
- a = A()
- while i < 300:
- new_a = A()
- if new_a != a: # ID: compare
- pass
- i += 1
- return i
- #
- log = self.run(main, [])
- loop, = log.loops_by_filename(self.filepath)
- assert loop.match_by_id("compare", "") # optimized away
-
def test_overflow_checking(self):
"""
This test only checks that we get the expected result, not that any
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit