[pypy-commit] pypy ppc-jit-backend: Fixed bug in test_load_and_store.

hager noreply at buildbot.pypy.org
Thu Aug 18 18:31:34 CEST 2011


Author: hager <sven.hager at uni-duesseldorf.de>
Branch: ppc-jit-backend
Changeset: r46611:08368f0b50e4
Date: 2011-08-18 18:33 +0200
http://bitbucket.org/pypy/pypy/changeset/08368f0b50e4/

Log:	Fixed bug in test_load_and_store.

diff --git a/pypy/jit/backend/ppc/ppcgen/test/test_ppc.py b/pypy/jit/backend/ppc/ppcgen/test/test_ppc.py
--- a/pypy/jit/backend/ppc/ppcgen/test/test_ppc.py
+++ b/pypy/jit/backend/ppc/ppcgen/test/test_ppc.py
@@ -6,6 +6,7 @@
 from pypy.jit.backend.ppc.ppcgen.regname import *
 from pypy.jit.backend.ppc.ppcgen import form, pystructs
 from pypy.jit.backend.detect_cpu import autodetect_main_model
+from pypy.jit.backend.ppc.ppcgen.arch import WORD
 
 from pypy.rpython.lltypesystem import lltype, rffi
 from pypy.rpython.annlowlevel import llhelper
@@ -256,8 +257,14 @@
         a = PPCBuilder()
         word1 = 1000
         word2 = 2000
+        p = lltype.malloc(rffi.CArray(lltype.Signed), 2, flavor="raw")
+
         a.load_word(10, word1)
         a.load_word(11, word2)
+
+        a.load_word(8, rffi.cast(lltype.Signed, p))
+        a.load_word(9, rffi.cast(lltype.Signed, p) + WORD)
+
         a.stw(10, 8, 0)
         a.stw(11, 9, 0)
         a.lwz(4, 8, 0)
@@ -266,6 +273,7 @@
         a.blr()
         f = a.assemble()
         assert f() == word1 + word2
+        lltype.free(p, flavor="raw")
 
     def test_load_from(self):
         a = PPCBuilder()


More information about the pypy-commit mailing list