Author: Armin Rigo <ar...@tunes.org> Branch: Changeset: r73896:48ee7cfde056 Date: 2014-10-10 19:39 +0200 http://bitbucket.org/pypy/pypy/changeset/48ee7cfde056/
Log: Fix the test diff --git a/rpython/jit/metainterp/test/test_tracingopts.py b/rpython/jit/metainterp/test/test_tracingopts.py --- a/rpython/jit/metainterp/test/test_tracingopts.py +++ b/rpython/jit/metainterp/test/test_tracingopts.py @@ -333,11 +333,25 @@ a[-1] = n x1 = a[-1] a[n - n - 1] = n + 1 - return a[-1] + x1 + return a[-1] + x1 + 1000 * a[2] res = self.interp_operations(fn, [7]) assert res == 7 + 7 + 1 self.check_operations_history(setarrayitem_gc=2, - setfield_gc=0) + setfield_gc=2, call=0) + + def test_list_caching_negative_nonzero_init(self): + def fn(n): + a = [42] * n + if n > 1000: + a.append(0) + a[-1] = n + x1 = a[-1] + a[n - n - 1] = n + 1 + return a[-1] + x1 + 1000 * a[2] + res = self.interp_operations(fn, [7]) + assert res == 7 + 7 + 1 + 42000 + self.check_operations_history(setarrayitem_gc=2, + setfield_gc=0, call=1) def test_virtualizable_with_array_heap_cache(self): myjitdriver = jit.JitDriver(greens = [], reds = ['n', 'x', 'i', 'frame'], _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit