[pypy-svn] r67794 - in pypy/branch/execute-star-args-jit/pypy/jit/backend: test x86/test

arigo at codespeak.net arigo at codespeak.net
Sat Sep 19 12:42:37 CEST 2009


Author: arigo
Date: Sat Sep 19 12:42:36 2009
New Revision: 67794

Modified:
   pypy/branch/execute-star-args-jit/pypy/jit/backend/test/test_random.py
   pypy/branch/execute-star-args-jit/pypy/jit/backend/x86/test/test_runner.py
Log:
Two test fixes.


Modified: pypy/branch/execute-star-args-jit/pypy/jit/backend/test/test_random.py
==============================================================================
--- pypy/branch/execute-star-args-jit/pypy/jit/backend/test/test_random.py	(original)
+++ pypy/branch/execute-star-args-jit/pypy/jit/backend/test/test_random.py	Sat Sep 19 12:42:36 2009
@@ -5,7 +5,7 @@
 from pypy.jit.metainterp.history import TreeLoop, BoxInt, ConstInt
 from pypy.jit.metainterp.history import BoxPtr, ConstPtr, ConstAddr
 from pypy.jit.metainterp.resoperation import ResOperation, rop
-from pypy.jit.metainterp.executor import execute
+from pypy.jit.metainterp.executor import execute_nonspec
 from pypy.jit.metainterp.resoperation import opname
 
 class PleaseRewriteMe(Exception):
@@ -32,7 +32,7 @@
         return fork
 
     def do(self, opnum, argboxes, descr=None):
-        v_result = execute(self.cpu, opnum, argboxes, descr)
+        v_result = execute_nonspec(self.cpu, opnum, argboxes, descr)
         if isinstance(v_result, ConstInt):
             v_result = BoxInt(v_result.value)
         self.loop.operations.append(ResOperation(opnum, argboxes, v_result,

Modified: pypy/branch/execute-star-args-jit/pypy/jit/backend/x86/test/test_runner.py
==============================================================================
--- pypy/branch/execute-star-args-jit/pypy/jit/backend/x86/test/test_runner.py	(original)
+++ pypy/branch/execute-star-args-jit/pypy/jit/backend/x86/test/test_runner.py	Sat Sep 19 12:42:36 2009
@@ -336,9 +336,9 @@
                     r = self.cpu.execute_operations(loop)
                     result = self.cpu.get_latest_value_int(0)
                     if guard == rop.GUARD_FALSE:
-                        assert result == execute(self.cpu, op, [b]).value
+                        assert result == execute(self.cpu, op, None, b).value
                     else:
-                        assert result != execute(self.cpu, op, [b]).value
+                        assert result != execute(self.cpu, op, None, b).value
                     
 
     def test_stuff_followed_by_guard(self):
@@ -378,10 +378,11 @@
                         self.cpu.set_future_value_int(i, box.value)
                     r = self.cpu.execute_operations(loop)
                     result = self.cpu.get_latest_value_int(0)
+                    expected = execute(self.cpu, op, None, a, b).value
                     if guard == rop.GUARD_FALSE:
-                        assert result == execute(self.cpu, op, (a, b)).value
+                        assert result == expected
                     else:
-                        assert result != execute(self.cpu, op, (a, b)).value
+                        assert result != expected
 
     def test_overflow_mc(self):
         from pypy.jit.backend.x86.assembler import MachineCodeBlockWrapper
@@ -404,6 +405,7 @@
             loop.operations = ops
             loop.inputargs = [base_v]
             self.cpu.compile_operations(loop)
+            assert self.cpu.assembler.mc != old_mc   # overflowed
             self.cpu.set_future_value_int(0, base_v.value)
             op = self.cpu.execute_operations(loop)
             assert self.cpu.get_latest_value_int(0) == 1024



More information about the Pypy-commit mailing list