[pypy-commit] pypy ppc-jit-backend: add test to show that the temporay location in emit_unicodesetitem is really needed.

hager noreply at buildbot.pypy.org
Tue Feb 14 10:50:28 CET 2012


Author: hager <sven.hager at uni-duesseldorf.de>
Branch: ppc-jit-backend
Changeset: r52438:ec29f1a1aa90
Date: 2012-02-13 20:19 +0100
http://bitbucket.org/pypy/pypy/changeset/ec29f1a1aa90/

Log:	add test to show that the temporay location in emit_unicodesetitem
	is really needed. For some reason, it still fails.

diff --git a/pypy/jit/backend/ppc/test/test_runner.py b/pypy/jit/backend/ppc/test/test_runner.py
--- a/pypy/jit/backend/ppc/test/test_runner.py
+++ b/pypy/jit/backend/ppc/test/test_runner.py
@@ -11,6 +11,7 @@
                                          ConstObj, BoxFloat, ConstFloat)
 from pypy.rpython.lltypesystem import lltype, llmemory, rstr, rffi, rclass
 from pypy.jit.codewriter.effectinfo import EffectInfo
+from pypy.jit.metainterp.resoperation import ResOperation, rop
 import py
 
 class FakeStats(object):
@@ -93,3 +94,36 @@
         for i in range(numargs):
             assert self.cpu.get_latest_value_int(i) == i + 1
 
+    def test_unicodesetitem_really_needs_temploc(self):
+        py.test.xfail("problems with longevity")
+        u_box = self.alloc_unicode(u"abcdefg")
+        
+        i0 = BoxInt()
+        i1 = BoxInt()
+        i2 = BoxInt()
+        i3 = BoxInt()
+        i4 = BoxInt()
+        i5 = BoxInt()
+        i6 = BoxInt()
+        i7 = BoxInt()
+        i8 = BoxInt()
+        i9 = BoxInt()
+
+        inputargs = [i0,i1,i2,i3,i4,i5,i6,i7,i8,i9]
+        looptoken = JitCellToken()
+        targettoken = TargetToken()
+        faildescr = BasicFailDescr(1)
+
+        operations = [
+            ResOperation(rop.LABEL, inputargs, None, descr=targettoken),
+            ResOperation(rop.UNICODESETITEM, 
+                         [u_box, BoxInt(4), BoxInt(123)], None),
+            ResOperation(rop.FINISH, inputargs, None, descr=faildescr)
+            ]
+
+        args = [(i + 1) for i in range(10)]
+        self.cpu.compile_loop(inputargs, operations, looptoken)
+        fail = self.cpu.execute_token(looptoken, *args)
+        assert fail.identifier == 1
+        for i in range(10):
+            assert self.cpu.get_latest_value_int(i) == args[i]


More information about the pypy-commit mailing list