[pypy-commit] pypy arm-backend-2: add a backend test for int_force_ge_zero
bivab
noreply at buildbot.pypy.org
Mon Aug 6 15:26:01 CEST 2012
Author: David Schneider <david.schneider at picle.org>
Branch: arm-backend-2
Changeset: r56598:14de1ac5141d
Date: 2012-08-06 13:24 +0000
http://bitbucket.org/pypy/pypy/changeset/14de1ac5141d/
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
@@ -3418,6 +3418,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):
More information about the pypy-commit
mailing list