[pypy-svn] r61867 - pypy/branch/pyjitpl5/pypy/jit/metainterp/test

fijal at codespeak.net fijal at codespeak.net
Sat Feb 14 10:42:27 CET 2009


Author: fijal
Date: Sat Feb 14 10:42:25 2009
New Revision: 61867

Modified:
   pypy/branch/pyjitpl5/pypy/jit/metainterp/test/test_dlist.py
Log:
A test that fails for mysterious reasons to me, seems jit-unrelated


Modified: pypy/branch/pyjitpl5/pypy/jit/metainterp/test/test_dlist.py
==============================================================================
--- pypy/branch/pyjitpl5/pypy/jit/metainterp/test/test_dlist.py	(original)
+++ pypy/branch/pyjitpl5/pypy/jit/metainterp/test/test_dlist.py	Sat Feb 14 10:42:25 2009
@@ -36,7 +36,33 @@
 
         res = self.meta_interp(f, [10])
         assert res == f(10)
+        self.check_loops(setitem=2, getitem=1)
+
+    def test_list_indexerror(self):
+        # this is an example where IndexError is raised before
+        # even getting to the JIT
+        py.test.skip("I suspect bug somewhere outside of the JIT")
+        myjitdriver = JitDriver(greens = [], reds = ['n', 'l'])
+        def f(n):
+            l = [0]
+            while n > 0:
+                myjitdriver.can_enter_jit(n=n, l=l)
+                myjitdriver.jit_merge_point(n=n, l=l)
+                l[n] = n
+                n -= 1
+            return l[3]
+
+        def g(n):
+            try:
+                f(n)
+                return 0
+            except IndexError:
+                return 42
+
+        res = self.meta_interp(g, [10])
+        assert res == 42
         self.check_loops(setitem=2)
+        
 
 class TestLLtype(ListTests, LLJitMixin):
     pass



More information about the Pypy-commit mailing list