Author: Hakan Ardo <[email protected]>
Branch: jit-short_from_state
Changeset: r44351:3c583f1297d0
Date: 2011-05-21 14:09 +0200
http://bitbucket.org/pypy/pypy/changeset/3c583f1297d0/
Log: check both verions of the loop
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
@@ -776,19 +776,20 @@
#
log = self.run(src, [], threshold=400)
assert log.result == res
- loop, = log.loops_by_filename(self.filepath)
- le_ops = log.opnames(loop.ops_by_id('lt'))
- ge_ops = log.opnames(loop.ops_by_id('ge'))
- assert le_ops.count('int_lt') == 1
- #
- if opt_expected:
- assert ge_ops.count('int_ge') == 0
- else:
- # if this assert fails it means that the optimization was
- # applied even if we don't expect to. Check whether the
- # optimization is valid, and either fix the code or fix the
- # test :-)
- assert ge_ops.count('int_ge') == 1
+ for loop in log.loops_by_filename(self.filepath):
+ loop.print_ops()
+ le_ops = log.opnames(loop.ops_by_id('lt'))
+ ge_ops = log.opnames(loop.ops_by_id('ge'))
+ assert le_ops.count('int_lt') == 1
+ #
+ if opt_expected:
+ assert ge_ops.count('int_ge') == 0
+ else:
+ # if this assert fails it means that the optimization was
+ # applied even if we don't expect to. Check whether the
+ # optimization is valid, and either fix the code or fix the
+ # test :-)
+ assert ge_ops.count('int_ge') == 1
def test_boolrewrite_reflex(self):
"""
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit