[pypy-svn] pypy jit-str_in_preamble: additional passing test

hakanardo commits-noreply at bitbucket.org
Sat Mar 26 10:15:24 CET 2011


Author: Hakan Ardo <hakan at debian.org>
Branch: jit-str_in_preamble
Changeset: r42959:0b1c95002df7
Date: 2011-03-26 09:51 +0100
http://bitbucket.org/pypy/pypy/changeset/0b1c95002df7/

Log:	additional passing test

diff --git a/pypy/jit/metainterp/test/test_optimizeopt.py b/pypy/jit/metainterp/test/test_optimizeopt.py
--- a/pypy/jit/metainterp/test/test_optimizeopt.py
+++ b/pypy/jit/metainterp/test/test_optimizeopt.py
@@ -5558,6 +5558,30 @@
         """
         self.optimize_strunicode_loop_extradescrs(ops, expected, preamble)
 
+    def test_str_equal_nonconst(self):
+        ops = """
+        [i1, i2]
+        p1 = newstr(1)
+        strsetitem(p1, 0, i1)
+        p2 = newstr(1)
+        strsetitem(p1, 0, i2)
+        i0 = call(0, p1, p2, descr=strequaldescr)
+        escape(i0)
+        jump(i1)
+        """
+        preamble = """
+        [i1, i2]
+        i0 = int_eq(i1, i2)     # ord('x')
+        escape(i0)
+        jump(i1, i2, i0)
+        """
+        expected = """
+        [i1, i2, i0]
+        escape(i0)
+        jump(i1, i2, i0)
+        """
+        self.optimize_strunicode_loop_extradescrs(ops, expected, preamble)
+
     def test_str_equal_chars2(self):
         ops = """
         [i1, i2]


More information about the Pypy-commit mailing list