[pypy-commit] pypy better-jit-hooks: Fix test_compile_asmlen on 32 bits too.

arigo noreply at buildbot.pypy.org
Wed Jan 11 19:12:03 CET 2012


Author: Armin Rigo <arigo at tunes.org>
Branch: better-jit-hooks
Changeset: r51243:87406b9ca67a
Date: 2012-01-11 19:11 +0100
http://bitbucket.org/pypy/pypy/changeset/87406b9ca67a/

Log:	Fix test_compile_asmlen on 32 bits too.

diff --git a/pypy/jit/backend/test/runner_test.py b/pypy/jit/backend/test/runner_test.py
--- a/pypy/jit/backend/test/runner_test.py
+++ b/pypy/jit/backend/test/runner_test.py
@@ -2985,7 +2985,8 @@
         from pypy.jit.backend.x86.tool.viewcode import machine_code_dump
         import ctypes
         ops = """
-        [i0]
+        [i2]
+        i0 = same_as(i2)    # but forced to be in a register
         label(i0, descr=1)
         i1 = int_add(i0, i0)
         guard_true(i1, descr=faildesr) [i1]
@@ -3013,18 +3014,17 @@
         # we don't quite know if borders are correct
 
         def checkops(mc, ops):
+            assert len(mc) == len(ops)
             for i in range(len(mc)):
                 assert mc[i].split("\t")[-1].startswith(ops[i])
             
         data = ctypes.string_at(info.asmaddr, info.asmlen)
         mc = list(machine_code_dump(data, info.asmaddr, cpuname))
         lines = [line for line in mc if line.count('\t') == 2]
-        assert len(lines) == 4
         checkops(lines, self.add_loop_instructions)
         data = ctypes.string_at(bridge_info.asmaddr, bridge_info.asmlen)
         mc = list(machine_code_dump(data, bridge_info.asmaddr, cpuname))
         lines = [line for line in mc if line.count('\t') == 2]
-        assert len(lines) == 3
         checkops(lines, self.bridge_loop_instructions)
 
 
diff --git a/pypy/jit/backend/x86/test/test_runner.py b/pypy/jit/backend/x86/test/test_runner.py
--- a/pypy/jit/backend/x86/test/test_runner.py
+++ b/pypy/jit/backend/x86/test/test_runner.py
@@ -33,8 +33,12 @@
     # for the individual tests see
     # ====> ../../test/runner_test.py
 
-    add_loop_instructions = ['add', 'test', 'je', 'jmp']
-    bridge_loop_instructions = ['lea', 'mov', 'jmp']
+    add_loop_instructions = ['mov', 'add', 'test', 'je', 'jmp']
+    if WORD == 4:
+        bridge_loop_instructions = ['lea', 'jmp']
+    else:
+        # the 'mov' is part of the 'jmp' so far
+        bridge_loop_instructions = ['lea', 'mov', 'jmp']
 
     def setup_method(self, meth):
         self.cpu = CPU(rtyper=None, stats=FakeStats())


More information about the pypy-commit mailing list