[pypy-svn] pypy default: Modify one test to allow for the better peephole optimization

arigo commits-noreply at bitbucket.org
Sat Feb 12 22:26:39 CET 2011


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r41858:5c5ac2449970
Date: 2011-02-12 22:00 +0100
http://bitbucket.org/pypy/pypy/changeset/5c5ac2449970/

Log:	Modify one test to allow for the better peephole optimization
	performed by pypy.

diff --git a/lib-python/2.7.0/test/test_peepholer.py b/lib-python/modified-2.7.0/test/test_peepholer.py
copy from lib-python/2.7.0/test/test_peepholer.py
copy to lib-python/modified-2.7.0/test/test_peepholer.py
--- a/lib-python/2.7.0/test/test_peepholer.py
+++ b/lib-python/modified-2.7.0/test/test_peepholer.py
@@ -67,10 +67,13 @@
             self.assertIn(elem, asm)
 
     def test_pack_unpack(self):
+        # On PyPy, "a, b = ..." is even more optimized, by removing
+        # the ROT_TWO.  But the ROT_TWO is not removed if assigning
+        # to more complex expressions, so check that.
         for line, elem in (
             ('a, = a,', 'LOAD_CONST',),
-            ('a, b = a, b', 'ROT_TWO',),
-            ('a, b, c = a, b, c', 'ROT_THREE',),
+            ('a[1], b = a, b', 'ROT_TWO',),
+            ('a, b[2], c = a, b, c', 'ROT_THREE',),
             ):
             asm = dis_single(line)
             self.assertIn(elem, asm)


More information about the Pypy-commit mailing list