Author: Armin Rigo <ar...@tunes.org> Branch: Changeset: r85039:940435e5feac Date: 2016-06-08 20:15 +0200 http://bitbucket.org/pypy/pypy/changeset/940435e5feac/
Log: Another passing test diff --git a/rpython/jit/metainterp/test/test_ajit.py b/rpython/jit/metainterp/test/test_ajit.py --- a/rpython/jit/metainterp/test/test_ajit.py +++ b/rpython/jit/metainterp/test/test_ajit.py @@ -1007,6 +1007,23 @@ assert res == expected # all the correction code should be dead now, xxx test that + def test_int_c_div_by_constant(self): + from rpython.rlib.rarithmetic import int_c_div + myjitdriver = JitDriver(greens = ['k'], reds = ['i', 't']) + def f(i, k): + t = 0 + while i < 100: + myjitdriver.can_enter_jit(i=i, t=t, k=k) + myjitdriver.jit_merge_point(i=i, t=t, k=k) + t += int_c_div(i, k) + i += 1 + return t + expected = sum([i // 10 for i in range(51, 100)]) + assert f(-50, 10) == expected + res = self.meta_interp(f, [-50, 10]) + assert res == expected + self.check_resops(call=0, uint_mul_high=2) + def test_float(self): myjitdriver = JitDriver(greens = [], reds = ['x', 'y', 'res']) def f(x, y): _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit