[pypy-svn] r78702 - pypy/branch/jit-unroll-loops/pypy/module/pypyjit/test

hakanardo at codespeak.net hakanardo at codespeak.net
Thu Nov 4 18:40:16 CET 2010


Author: hakanardo
Date: Thu Nov  4 18:40:14 2010
New Revision: 78702

Modified:
   pypy/branch/jit-unroll-loops/pypy/module/pypyjit/test/test_pypy_c.py
Log:
fixed test

Modified: pypy/branch/jit-unroll-loops/pypy/module/pypyjit/test/test_pypy_c.py
==============================================================================
--- pypy/branch/jit-unroll-loops/pypy/module/pypyjit/test/test_pypy_c.py	(original)
+++ pypy/branch/jit-unroll-loops/pypy/module/pypyjit/test/test_pypy_c.py	Thu Nov  4 18:40:14 2010
@@ -519,19 +519,30 @@
                     s += g(n)[i]
                 return s
         ''', 143, ([1000], 1000 * 999 / 2))
-        bytecode, = self.get_by_bytecode("BINARY_SUBSCR")
+        bytecode, = self.get_by_bytecode("BINARY_SUBSCR", True)
         assert bytecode.get_opnames("guard") == [
             "guard_false",   # check that the index is >= 0
             "guard_false",   # check that the index is lower than the current length
             ]
-        bytecode, _ = self.get_by_bytecode("FOR_ITER") # second bytecode is the end of the loop
+        bytecode, _ = self.get_by_bytecode("FOR_ITER", True) # second bytecode is the end of the loop
         assert bytecode.get_opnames("guard") == [
+            "guard_value",
             "guard_class",   # check the class of the iterator
             "guard_nonnull", # check that the iterator is not finished
             "guard_isnull",  # check that the range list is not forced
             "guard_false",   # check that the index is lower than the current length
             ]
- 
+
+        bytecode, = self.get_by_bytecode("BINARY_SUBSCR")
+        assert bytecode.get_opnames("guard") == [
+            "guard_false",   # check that the index is >= 0
+            "guard_false",   # check that the index is lower than the current length
+            ]
+        bytecode, _ = self.get_by_bytecode("FOR_ITER") # second bytecode is the end of the loop
+        assert bytecode.get_opnames("guard") == [
+            "guard_false",   # check that the index is lower than the current length
+            ]
+
     def test_exception_inside_loop_1(self):
         py.test.skip("exceptions: in-progress")
         self.run_source('''



More information about the Pypy-commit mailing list