Author: Richard Plangger <planri...@gmail.com>
Branch: s390x-backend
Changeset: r82155:9638a3d105fa
Date: 2016-02-11 09:15 +0100
http://bitbucket.org/pypy/pypy/changeset/9638a3d105fa/

Log:    added assert, fixed test (big endian issue with unions)

diff --git a/pypy/module/test_lib_pypy/ctypes_tests/test_unions.py 
b/pypy/module/test_lib_pypy/ctypes_tests/test_unions.py
--- a/pypy/module/test_lib_pypy/ctypes_tests/test_unions.py
+++ b/pypy/module/test_lib_pypy/ctypes_tests/test_unions.py
@@ -1,4 +1,4 @@
-
+import sys
 from ctypes import *
 from support import BaseCTypesTestChecker
 
@@ -8,8 +8,11 @@
             _fields_ = [('x', c_char), ('y', c_int)]
 
         stuff = Stuff()
-        stuff.y = ord('x')
-        assert stuff.x == 'x'
+        stuff.y = ord('x') | (ord('z') << 24)
+        if sys.byteorder == 'little':
+            assert stuff.x == 'x'
+        else:
+            assert stuff.x == 'z'
 
     def test_union_of_structures(self):
         class Stuff(Structure):
diff --git a/rpython/jit/backend/zarch/regalloc.py 
b/rpython/jit/backend/zarch/regalloc.py
--- a/rpython/jit/backend/zarch/regalloc.py
+++ b/rpython/jit/backend/zarch/regalloc.py
@@ -90,6 +90,7 @@
                 tmp = TempVar()
                 self.temp_boxes.append(tmp)
                 reg = self.force_allocate_reg(tmp)
+                assert poolloc.displace > 0
                 self.assembler.mc.LD(reg, poolloc)
                 return reg
             return poolloc
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to