[pypy-svn] r65471 - pypy/branch/pyjitpl5-experiments/pypy/jit/metainterp/test
benjamin at codespeak.net
benjamin at codespeak.net
Thu May 28 00:50:33 CEST 2009
Author: benjamin
Date: Thu May 28 00:50:32 2009
New Revision: 65471
Modified:
pypy/branch/pyjitpl5-experiments/pypy/jit/metainterp/test/test_optimize2.py
Log:
drill more int operations for constant folding
Modified: pypy/branch/pyjitpl5-experiments/pypy/jit/metainterp/test/test_optimize2.py
==============================================================================
--- pypy/branch/pyjitpl5-experiments/pypy/jit/metainterp/test/test_optimize2.py (original)
+++ pypy/branch/pyjitpl5-experiments/pypy/jit/metainterp/test/test_optimize2.py Thu May 28 00:50:32 2009
@@ -3,7 +3,7 @@
from pypy.rpython.ootypesystem import ootype
from pypy.rpython.lltypesystem.rclass import OBJECT, OBJECT_VTABLE
-from pypy.jit.metainterp.resoperation import rop, ResOperation
+from pypy.jit.metainterp.resoperation import rop, ResOperation, opname
from pypy.jit.metainterp.history import ConstAddr, BoxPtr, TreeLoop,\
ConstInt, BoxInt, BoxObj, ConstObj
from pypy.jit.backend.llgraph import runner
@@ -131,13 +131,18 @@
equaloplists(optimized, self.parse(expected).operations)
def test_basic_constant_folding(self):
- pre_op = """
- []
- i1 = int_add(3, 2)
- """
- expected = "[]"
- self.assert_equal(self.optimize(pre_op), expected)
-
+ for op in range(rop.INT_ADD, rop._COMPARISON_FIRST):
+ try:
+ op = opname[op]
+ except KeyError:
+ continue
+ pre_op = """
+ []
+ i1 = %s(3, 2)
+ """ % op.lower()
+ expected = "[]"
+ self.assert_equal(self.optimize(pre_op), expected)
+
def test_remove_guard_class(self):
pre_op = """
[p0]
More information about the Pypy-commit
mailing list