[pypy-commit] pypy errno-again: fix tests

arigo noreply at buildbot.pypy.org
Fri Jan 16 11:56:57 CET 2015


Author: Armin Rigo <arigo at tunes.org>
Branch: errno-again
Changeset: r75376:5288382f2748
Date: 2015-01-16 11:54 +0100
http://bitbucket.org/pypy/pypy/changeset/5288382f2748/

Log:	fix tests

diff --git a/rpython/jit/backend/test/runner_test.py b/rpython/jit/backend/test/runner_test.py
--- a/rpython/jit/backend/test/runner_test.py
+++ b/rpython/jit/backend/test/runner_test.py
@@ -20,6 +20,7 @@
 from rpython.rlib.rarithmetic import intmask, is_valid_int
 from rpython.jit.backend.detect_cpu import autodetect
 from rpython.jit.backend.llsupport import jitframe
+from rpython.jit.backend.llsupport.llmodel import AbstractLLCPU
 
 
 IS_32_BIT = sys.maxint < 2**32
@@ -2924,6 +2925,8 @@
         from rpython.rlib.libffi import types
         from rpython.jit.backend.llsupport import llerrno
         #
+        if not isinstance(self.cpu, AbstractLLCPU):
+            py.test.skip("not on LLGraph")
         eci = ExternalCompilationInfo(
             separate_module_sources=['''
                 #include <errno.h>
@@ -2965,6 +2968,8 @@
         from rpython.rlib.libffi import types
         from rpython.jit.backend.llsupport import llerrno
         #
+        if not isinstance(self.cpu, AbstractLLCPU):
+            py.test.skip("not on LLGraph")
         eci = ExternalCompilationInfo(
             separate_module_sources=[r'''
                 #include <stdio.h>
@@ -3333,8 +3338,6 @@
         assert not called
 
     def test_assembler_call_propagate_exc(self):
-        from rpython.jit.backend.llsupport.llmodel import AbstractLLCPU
-
         if not isinstance(self.cpu, AbstractLLCPU):
             py.test.skip("llgraph can't fake exceptions well enough, give up")
 
@@ -3869,7 +3872,6 @@
         assert res.value == iexpected
 
     def test_free_loop_and_bridges(self):
-        from rpython.jit.backend.llsupport.llmodel import AbstractLLCPU
         if not isinstance(self.cpu, AbstractLLCPU):
             py.test.skip("not a subclass of llmodel.AbstractLLCPU")
         if hasattr(self.cpu, 'setup_once'):
@@ -4009,7 +4011,6 @@
                 assert got == expected
 
     def test_compile_asmlen(self):
-        from rpython.jit.backend.llsupport.llmodel import AbstractLLCPU
         if not isinstance(self.cpu, AbstractLLCPU):
             py.test.skip("pointless test on non-asm")
         from rpython.jit.backend.tool.viewcode import machine_code_dump, ObjdumpNotFound
@@ -4451,7 +4452,6 @@
         self.cpu.compile_loop(loop.inputargs, loop.operations, looptoken)
         frame = self.cpu.execute_token(looptoken, 0, 0, 3)
         assert self.cpu.get_latest_descr(frame) is guarddescr
-        from rpython.jit.backend.llsupport.llmodel import AbstractLLCPU
 
         if not isinstance(self.cpu, AbstractLLCPU):
             py.test.skip("pointless test on non-asm")
@@ -4558,8 +4558,6 @@
         assert res.getint() == struct.unpack("I", struct.pack("f", 12.5))[0]
 
     def test_zero_ptr_field(self):
-        from rpython.jit.backend.llsupport.llmodel import AbstractLLCPU
-
         if not isinstance(self.cpu, AbstractLLCPU):
             py.test.skip("llgraph can't do zero_ptr_field")
         T = lltype.GcStruct('T')
@@ -4583,8 +4581,6 @@
         assert not s.x
 
     def test_zero_ptr_field_2(self):
-        from rpython.jit.backend.llsupport.llmodel import AbstractLLCPU
-
         if not isinstance(self.cpu, AbstractLLCPU):
             py.test.skip("llgraph does not do zero_ptr_field")
 
@@ -4608,8 +4604,6 @@
         assert s.y == -4398176
 
     def test_zero_array(self):
-        from rpython.jit.backend.llsupport.llmodel import AbstractLLCPU
-
         if not isinstance(self.cpu, AbstractLLCPU):
             py.test.skip("llgraph does not do zero_array")
 
diff --git a/rpython/jit/backend/x86/test/test_runner.py b/rpython/jit/backend/x86/test/test_runner.py
--- a/rpython/jit/backend/x86/test/test_runner.py
+++ b/rpython/jit/backend/x86/test/test_runner.py
@@ -478,28 +478,29 @@
             i6 = BoxInt()
             c = ConstInt(-1)
             faildescr = BasicFailDescr(1)
+            cz = ConstInt(0)
             # we must call it repeatedly: if the stack pointer gets increased
             # by 40 bytes by the STDCALL call, and if we don't expect it,
             # then we are going to get our stack emptied unexpectedly by
             # several repeated calls
             ops = [
             ResOperation(rop.CALL_RELEASE_GIL,
-                         [funcbox, i1, c, c, c, c, c, c, c, c, i2],
+                         [cz, funcbox, i1, c, c, c, c, c, c, c, c, i2],
                          i3, descr=calldescr),
             ResOperation(rop.GUARD_NOT_FORCED, [], None, descr=faildescr),
 
             ResOperation(rop.CALL_RELEASE_GIL,
-                         [funcbox, i1, c, c, c, c, c, c, c, c, i2],
+                         [cz, funcbox, i1, c, c, c, c, c, c, c, c, i2],
                          i4, descr=calldescr),
             ResOperation(rop.GUARD_NOT_FORCED, [], None, descr=faildescr),
 
             ResOperation(rop.CALL_RELEASE_GIL,
-                         [funcbox, i1, c, c, c, c, c, c, c, c, i2],
+                         [cz, funcbox, i1, c, c, c, c, c, c, c, c, i2],
                          i5, descr=calldescr),
             ResOperation(rop.GUARD_NOT_FORCED, [], None, descr=faildescr),
 
             ResOperation(rop.CALL_RELEASE_GIL,
-                         [funcbox, i1, c, c, c, c, c, c, c, c, i2],
+                         [cz, funcbox, i1, c, c, c, c, c, c, c, c, i2],
                          i6, descr=calldescr),
             ResOperation(rop.GUARD_NOT_FORCED, [], None, descr=faildescr),
 


More information about the pypy-commit mailing list