Commits

Armin Rigo  committed 87406b9

Fix test_compile_asmlen on 32 bits too.

  • Participants
  • Parent commits 24de52d
  • Branches better-jit-hooks

Comments (0)

Files changed (2)

File pypy/jit/backend/test/runner_test.py

         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]
         # 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)
 
 

File pypy/jit/backend/x86/test/test_runner.py

     # 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())