Author: Armin Rigo <ar...@tunes.org> Branch: Changeset: r69453:0e9883e7f2f9 Date: 2014-02-26 09:24 +0100 http://bitbucket.org/pypy/pypy/changeset/0e9883e7f2f9/
Log: Two new tests that pass after 1e265793f593. diff --git a/rpython/jit/metainterp/test/test_list.py b/rpython/jit/metainterp/test/test_list.py --- a/rpython/jit/metainterp/test/test_list.py +++ b/rpython/jit/metainterp/test/test_list.py @@ -287,6 +287,48 @@ assert res == 5 self.check_resops(call=0) + def test_list_mul_virtual(self): + class Foo: + def __init__(self, l): + self.l = l + l[0] = self + + myjitdriver = JitDriver(greens = [], reds = ['y']) + def f(y): + while y > 0: + myjitdriver.jit_merge_point(y=y) + Foo([None] * 5) + y -= 1 + return 42 + + self.meta_interp(f, [5]) + self.check_resops({'int_sub': 2, + 'int_gt': 2, + 'guard_true': 2, + 'jump': 1}) + + def test_list_mul_unsigned_virtual(self): + from rpython.rlib.rarithmetic import r_uint + + class Foo: + def __init__(self, l): + self.l = l + l[0] = self + + myjitdriver = JitDriver(greens = [], reds = ['y']) + def f(y): + while y > 0: + myjitdriver.jit_merge_point(y=y) + Foo([None] * r_uint(5)) + y -= 1 + return 42 + + self.meta_interp(f, [5]) + self.check_resops({'int_sub': 2, + 'int_gt': 2, + 'guard_true': 2, + 'jump': 1}) + class TestLLtype(ListTests, LLJitMixin): def test_listops_dont_invalidate_caches(self): _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit