[pypy-svn] r68088 - pypy/branch/floats-via-sse2/pypy/jit/backend/test

fijal at codespeak.net fijal at codespeak.net
Thu Oct 1 11:47:28 CEST 2009


Author: fijal
Date: Thu Oct  1 11:47:28 2009
New Revision: 68088

Modified:
   pypy/branch/floats-via-sse2/pypy/jit/backend/test/runner_test.py
Log:
Actually run those only if cpu supports floats


Modified: pypy/branch/floats-via-sse2/pypy/jit/backend/test/runner_test.py
==============================================================================
--- pypy/branch/floats-via-sse2/pypy/jit/backend/test/runner_test.py	(original)
+++ pypy/branch/floats-via-sse2/pypy/jit/backend/test/runner_test.py	Thu Oct  1 11:47:28 2009
@@ -961,19 +961,20 @@
             descr_B)
         assert isinstance(x, BoxPtr)
         assert x.getref(lltype.Ptr(A)) == a
-        C = lltype.GcArray(lltype.Float)
-        c = lltype.malloc(C, 6)
-        c[3] = 3.5
-        descr_C = cpu.arraydescrof(C)
-        x = cpu.do_getarrayitem_gc(
-            BoxPtr(lltype.cast_opaque_ptr(llmemory.GCREF, c)), BoxInt(3),
-            descr_C)
-        assert isinstance(x, BoxFloat)
-        assert x.getfloat() == 3.5
-        cpu.do_setarrayitem_gc(
-            BoxPtr(lltype.cast_opaque_ptr(llmemory.GCREF, c)), BoxInt(4),
-            BoxFloat(4.5), descr_C)
-        assert c[4] == 4.5
+        if self.cpu.supports_floats:
+            C = lltype.GcArray(lltype.Float)
+            c = lltype.malloc(C, 6)
+            c[3] = 3.5
+            descr_C = cpu.arraydescrof(C)
+            x = cpu.do_getarrayitem_gc(
+                BoxPtr(lltype.cast_opaque_ptr(llmemory.GCREF, c)), BoxInt(3),
+                descr_C)
+            assert isinstance(x, BoxFloat)
+            assert x.getfloat() == 3.5
+            cpu.do_setarrayitem_gc(
+                BoxPtr(lltype.cast_opaque_ptr(llmemory.GCREF, c)), BoxInt(4),
+                BoxFloat(4.5), descr_C)
+            assert c[4] == 4.5
         #
         s = rstr.mallocstr(6)
         x = cpu.do_strlen(
@@ -985,7 +986,8 @@
             BoxPtr(lltype.cast_opaque_ptr(llmemory.GCREF, s)), BoxInt(3))
         assert x.value == ord('X')
         #
-        S = lltype.GcStruct('S', ('x', lltype.Char), ('y', lltype.Ptr(A)))
+        S = lltype.GcStruct('S', ('x', lltype.Char), ('y', lltype.Ptr(A)),
+                            ('z', lltype.Float))
         descrfld_x = cpu.fielddescrof(S, 'x')
         s = lltype.malloc(S)
         s.x = 'Z'



More information about the Pypy-commit mailing list