[pypy-svn] r66166 - in pypy/branch/pyjitpl5/pypy/jit: backend/x86/test tl
arigo at codespeak.net
arigo at codespeak.net
Fri Jul 10 19:15:38 CEST 2009
Author: arigo
Date: Fri Jul 10 19:15:36 2009
New Revision: 66166
Modified:
pypy/branch/pyjitpl5/pypy/jit/backend/x86/test/test_zrpy_tl.py
pypy/branch/pyjitpl5/pypy/jit/tl/tlc.py
Log:
Fix test_zrpy_tl, tediously. I blame fijal for leaving around a test
that has always been failing -- I could not find a single revision in
which it passed. Indeed, the amount of effort required to fix it seems
to show that such a revision never existed. Additional hint: the second
"assert res == 13" is bogus, as fib(5) == 5.
Modified: pypy/branch/pyjitpl5/pypy/jit/backend/x86/test/test_zrpy_tl.py
==============================================================================
--- pypy/branch/pyjitpl5/pypy/jit/backend/x86/test/test_zrpy_tl.py (original)
+++ pypy/branch/pyjitpl5/pypy/jit/backend/x86/test/test_zrpy_tl.py Fri Jul 10 19:15:36 2009
@@ -10,8 +10,9 @@
pass
class TestTLC(Jit386Mixin):
- def _get_interp(self, bytecode, pool):
+ def _get_interp(self, bytecode_, pool_):
def interp(inputarg):
+ bytecode, pool = tlc.non_constant(bytecode_, pool_)
args = [tlc.IntObj(inputarg)]
obj = tlc.interp_eval(bytecode, 0, args, pool)
return obj.int_o()
@@ -28,6 +29,3 @@
code = path.read()
res = self.exec_code(code, 20)
assert res == 6765
- res = self.exec_code(code, 5)
- assert res == 13
-
Modified: pypy/branch/pyjitpl5/pypy/jit/tl/tlc.py
==============================================================================
--- pypy/branch/pyjitpl5/pypy/jit/tl/tlc.py (original)
+++ pypy/branch/pyjitpl5/pypy/jit/tl/tlc.py Fri Jul 10 19:15:36 2009
@@ -454,6 +454,17 @@
interp_without_call, interp_eval_without_call = make_interp(supports_call = False)
interp_nonjit , interp_eval_nonjit = make_interp(supports_call = True, jitted=False)
+def non_constant(bytecode, pool):
+ from pypy.rlib.nonconst import NonConstant
+ if NonConstant(False):
+ pool = ConstantPool()
+ pool.add_string("foo")
+ pool.add_string("bazz")
+ pool.add_classdescr(["a", "bc"], [("foo", 3), ("y", 5)])
+ return "123", pool
+ else:
+ return bytecode, pool
+
if __name__ == '__main__':
import sys
from pypy.jit.tl.test.test_tl import FACTORIAL_SOURCE
More information about the Pypy-commit
mailing list