[pypy-svn] pypy default: move this test later
antocuni
commits-noreply at bitbucket.org
Wed Feb 23 15:34:37 CET 2011
Author: Antonio Cuni <anto.cuni at gmail.com>
Branch:
Changeset: r42230:5b870186ab6f
Date: 2011-02-23 15:32 +0100
http://bitbucket.org/pypy/pypy/changeset/5b870186ab6f/
Log: move this test later
diff --git a/pypy/module/pypyjit/test_pypy_c/test_model.py b/pypy/module/pypyjit/test_pypy_c/test_model.py
--- a/pypy/module/pypyjit/test_pypy_c/test_model.py
+++ b/pypy/module/pypyjit/test_pypy_c/test_model.py
@@ -105,33 +105,6 @@
loops = log.loops_by_filename(self.filepath, is_entry_bridge='*')
assert len(loops) == 2
- def test_inlined_function(self):
- def f():
- def g(x):
- return x+1 # ID: add
- i = 0
- while i < 1003:
- i = g(i) # ID: call
- a = 0 # to make sure that JUMP_ABSOLUTE is not part of the ID
- return i
- #
- log = self.run(f)
- loop, = log.loops_by_filename(self.filepath)
- call_ops = [op.name for op in loop.ops_by_id('call')]
- assert call_ops == ['force_token'] # it does not follow inlining
- #
- add_ops = [op.name for op in loop.ops_by_id('add')]
- assert add_ops == ['int_add']
- #
- ops = [op.name for op in loop.allops()]
- assert ops == [
- # this is the actual loop
- 'int_lt', 'guard_true', 'force_token', 'int_add',
- # this is the signal checking stuff
- 'getfield_raw', 'int_sub', 'setfield_raw', 'int_lt', 'guard_false',
- 'jump'
- ]
-
def test_loops_by_id(self):
def f():
i = 0
@@ -169,6 +142,34 @@
opnames = [op.name for op in ops]
assert opnames == ['int_add']
+
+ def test_inlined_function(self):
+ def f():
+ def g(x):
+ return x+1 # ID: add
+ i = 0
+ while i < 1003:
+ i = g(i) # ID: call
+ a = 0 # to make sure that JUMP_ABSOLUTE is not part of the ID
+ return i
+ #
+ log = self.run(f)
+ loop, = log.loops_by_filename(self.filepath)
+ call_ops = [op.name for op in loop.ops_by_id('call')]
+ assert call_ops == ['force_token'] # it does not follow inlining
+ #
+ add_ops = [op.name for op in loop.ops_by_id('add')]
+ assert add_ops == ['int_add']
+ #
+ ops = [op.name for op in loop.allops()]
+ assert ops == [
+ # this is the actual loop
+ 'int_lt', 'guard_true', 'force_token', 'int_add',
+ # this is the signal checking stuff
+ 'getfield_raw', 'int_sub', 'setfield_raw', 'int_lt', 'guard_false',
+ 'jump'
+ ]
+
def test_parse_op(self):
res = LoopWithIds.parse_op(" a = int_add( b, 3 ) # foo")
assert res == ("int_add", "a", ["b", "3"])
More information about the Pypy-commit
mailing list