Debian Codegraph @

rpython/jit/backend/aarch64/test/test_recursive.py

raw symbols SCIP
1
2 import py
3 from rpython.jit.metainterp.test.test_recursive import RecursiveTests
4 from rpython.jit.backend.aarch64.test.test_basic import JitAarch64Mixin
5 from rpython.jit.backend.llsupport.codemap import unpack_traceback
6
7 class TestRecursive(JitAarch64Mixin, RecursiveTests):
8 # for the individual tests see
9 # ====> ../../../metainterp/test/test_recursive.py
10 def check_get_unique_id(self, codemaps):
11 py.test.skip("later")
12 assert len(codemaps) == 3
13 # we want to create a map of differences, so unpacking the tracebacks
14 # byte by byte
15 codemaps.sort(lambda a, b: cmp(a[1], b[1]))
16 # biggest is the big loop, smallest is the bridge
17 def get_ranges(c):
18 ranges = []
19 prev_traceback = None
20 for b in range(c[0], c[0] + c[1]):
21 tb = unpack_traceback(b)
22 if tb != prev_traceback:
23 ranges.append(tb)
24 prev_traceback = tb
25 return ranges
26 assert get_ranges(codemaps[2]) == [[4], [4, 2], [4]]
27 assert get_ranges(codemaps[1]) == [[2]]
28 assert get_ranges(codemaps[0]) == [[2], []]