[pypy-svn] r44421 - in pypy/dist/pypy: objspace/flow translator/backendopt/test

antocuni at codespeak.net antocuni at codespeak.net
Fri Jun 22 11:35:35 CEST 2007


Author: antocuni
Date: Fri Jun 22 11:35:34 2007
New Revision: 44421

Modified:
   pypy/dist/pypy/objspace/flow/model.py
   pypy/dist/pypy/translator/backendopt/test/test_inline.py
Log:
add another check to checkgraph and the corresponding failing test



Modified: pypy/dist/pypy/objspace/flow/model.py
==============================================================================
--- pypy/dist/pypy/objspace/flow/model.py	(original)
+++ pypy/dist/pypy/objspace/flow/model.py	Fri Jun 22 11:35:34 2007
@@ -663,6 +663,9 @@
             for link in block.exits:
                 assert len(link.args) == len(link.target.inputargs)
                 assert link.prevblock is block
+                for linkv, inputv in zip(link.args, link.target.inputargs):
+                    if hasattr(linkv, 'concretetype') and hasattr(inputv, 'concretetype'):
+                        assert linkv.concretetype == inputv.concretetype
                 exc_link = link in exc_links
                 if exc_link:
                     for v in [link.last_exception, link.last_exc_value]:

Modified: pypy/dist/pypy/translator/backendopt/test/test_inline.py
==============================================================================
--- pypy/dist/pypy/translator/backendopt/test/test_inline.py	(original)
+++ pypy/dist/pypy/translator/backendopt/test/test_inline.py	Fri Jun 22 11:35:34 2007
@@ -638,6 +638,28 @@
         res = eval_func([True, 42])
         assert res == expected
 
+    def test_oosend_inherited(self):
+        py.test.skip('fixme, this prevents pypy-cli from being built')
+        class A:
+            def bar(self, x):
+                return x
+        class B(A):
+            def foo(self, x):
+                return self.bar(x)
+        class C(A):
+            pass
+        def fn(x):
+            if x:
+                b_obj = B()
+                return b_obj.foo(x)
+            else:
+                c_obj = C()
+                return c_obj.bar(x)
+        eval_func, t = self.check_auto_inlining(fn, [int], checkvirtual=True)
+        expected = fn(42)
+        res = eval_func([42])
+        assert res == expected
+
     def test_classattr(self):
         class A:
             attr = 666



More information about the Pypy-commit mailing list