[pypy-commit] pypy regalloc-playground: move two tests to make them run by the x86 test file too
cfbolz
pypy.commits at gmail.com
Fri Sep 1 13:45:22 EDT 2017
Author: Carl Friedrich Bolz-Tereick <cfbolz at gmx.de>
Branch: regalloc-playground
Changeset: r92302:3162799170f9
Date: 2017-09-01 19:42 +0200
http://bitbucket.org/pypy/pypy/changeset/3162799170f9/
Log: move two tests to make them run by the x86 test file too
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
@@ -336,6 +336,35 @@
'guard_true': 2,
'jump': 1})
+ def test_conditional_call_append(self):
+ jitdriver = JitDriver(greens = [], reds = 'auto')
+
+ def f(n):
+ l = []
+ while n > 0:
+ jitdriver.jit_merge_point()
+ l.append(n)
+ n -= 1
+ return len(l)
+
+ res = self.meta_interp(f, [10])
+ assert res == 10
+ self.check_resops(call=0, cond_call=2)
+
+ def test_conditional_call_pop(self):
+ jitdriver = JitDriver(greens = [], reds = 'auto')
+
+ def f(n):
+ l = range(n)
+ while n > 0:
+ jitdriver.jit_merge_point()
+ l.pop()
+ n -= 1
+ return len(l)
+
+ res = self.meta_interp(f, [10])
+ assert res == 0
+ self.check_resops(call=0, cond_call=2)
class TestLLtype(ListTests, LLJitMixin):
def test_listops_dont_invalidate_caches(self):
@@ -366,36 +395,6 @@
# itself
self.check_resops(getfield_gc_i=2, getfield_gc_r=5)
- def test_conditional_call_append(self):
- jitdriver = JitDriver(greens = [], reds = 'auto')
-
- def f(n):
- l = []
- while n > 0:
- jitdriver.jit_merge_point()
- l.append(n)
- n -= 1
- return len(l)
-
- res = self.meta_interp(f, [10])
- assert res == 10
- self.check_resops(call=0, cond_call=2)
-
- def test_conditional_call_pop(self):
- jitdriver = JitDriver(greens = [], reds = 'auto')
-
- def f(n):
- l = range(n)
- while n > 0:
- jitdriver.jit_merge_point()
- l.pop()
- n -= 1
- return len(l)
-
- res = self.meta_interp(f, [10])
- assert res == 0
- self.check_resops(call=0, cond_call=2)
-
def test_zero_init_resizable(self):
def f(n):
l = [0] * n
More information about the pypy-commit
mailing list