[pypy-svn] r79103 - pypy/branch/jit-starargs/pypy/module/pypyjit/test

cfbolz at codespeak.net cfbolz at codespeak.net
Mon Nov 15 15:14:50 CET 2010


Author: cfbolz
Date: Mon Nov 15 15:14:48 2010
New Revision: 79103

Modified:
   pypy/branch/jit-starargs/pypy/module/pypyjit/test/test_pypy_c.py
Log:
yet another case


Modified: pypy/branch/jit-starargs/pypy/module/pypyjit/test/test_pypy_c.py
==============================================================================
--- pypy/branch/jit-starargs/pypy/module/pypyjit/test/test_pypy_c.py	(original)
+++ pypy/branch/jit-starargs/pypy/module/pypyjit/test/test_pypy_c.py	Mon Nov 15 15:14:48 2010
@@ -388,25 +388,32 @@
 
             def g(*args):
                 return len(args)
+            def h(a, b, c):
+                return c
 
             def main(x):
                 s = 0
                 for i in range(x):
                     l = [i, x, 2]
                     s += g(*l)
+                    s += h(*l)
                     s += g(i, x, 2)
                 return s
-        ''', 100000, ([100], 600),
-                    ([1000], 6000),
-                    ([10000], 60000),
-                    ([100000], 600000))
+        ''', 100000, ([100], 800),
+                    ([1000], 8000),
+                    ([10000], 80000),
+                    ([100000], 800000))
         assert len(self.loops) == 1
-        op, = self.get_by_bytecode("CALL_FUNCTION_VAR")
-        assert len(op.get_opnames("new")) == 0
-        assert len(op.get_opnames("call_may_force")) == 0
-        oplen, op, oplen = self.get_by_bytecode("CALL_FUNCTION")
-        assert len(op.get_opnames("new")) == 0
-        assert len(op.get_opnames("call_may_force")) == 0
+        ops = self.get_by_bytecode("CALL_FUNCTION_VAR")
+        assert len(ops) == 2
+        for op in ops:
+            assert len(op.get_opnames("new")) == 0
+            assert len(op.get_opnames("call_may_force")) == 0
+
+        ops = self.get_by_bytecode("CALL_FUNCTION")
+        for op in ops:
+            assert len(op.get_opnames("new")) == 0
+            assert len(op.get_opnames("call_may_force")) == 0
 
     def test_virtual_instance(self):
         self.run_source('''



More information about the Pypy-commit mailing list