Armin Rigo avatar Armin Rigo committed 87406b9

Fix test_compile_asmlen on 32 bits too.

Comments (0)

Files changed (2)


         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)


     # for the individual tests see
     # ====> ../../test/
-    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())
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.