Author: David Schneider <[email protected]>
Branch:
Changeset: r56601:f6ff4a97724f
Date: 2012-08-06 13:24 +0000
http://bitbucket.org/pypy/pypy/changeset/f6ff4a97724f/
Log: add a backend test for int_force_ge_zero
diff --git a/pypy/jit/backend/test/runner_test.py
b/pypy/jit/backend/test/runner_test.py
--- a/pypy/jit/backend/test/runner_test.py
+++ b/pypy/jit/backend/test/runner_test.py
@@ -3206,6 +3206,20 @@
res = self.cpu.get_latest_value_int(0)
assert res == -10
+ def test_int_force_ge_zero(self):
+ ops = """
+ [i0]
+ i1 = int_force_ge_zero(i0) # but forced to be in a register
+ finish(i1, descr=1)
+ """
+ loop = parse(ops, self.cpu, namespace=locals())
+ descr = loop.operations[-1].getdescr()
+ looptoken = JitCellToken()
+ self.cpu.compile_loop(loop.inputargs, loop.operations, looptoken)
+ for inp, outp in [(2,2), (-3, 0)]:
+ self.cpu.execute_token(looptoken, inp)
+ assert outp == self.cpu.get_latest_value_int(0)
+
def test_compile_asmlen(self):
from pypy.jit.backend.llsupport.llmodel import AbstractLLCPU
if not isinstance(self.cpu, AbstractLLCPU):
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit