Debian Codegraph @

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

raw symbols SCIP
1 import py
2 from rpython.jit.metainterp.test import test_ajit
3 from rpython.rlib.jit import JitDriver
4 from rpython.jit.metainterp.test.support import LLJitMixin
5 from rpython.jit.backend.detect_cpu import getcpuclass
6
7 class JitAarch64Mixin(LLJitMixin):
8 CPUClass = getcpuclass()
9 # we have to disable unroll
10 enable_opts = "intbounds:rewrite:virtualize:string:earlyforce:pure:heap"
11 basic = False
12
13 def check_jumps(self, maxcount):
14 pass
15
16 class TestBasic(JitAarch64Mixin, test_ajit.BaseLLtypeTests):
17 # for the individual tests see
18 # ====> ../../../metainterp/test/test_ajit.py
19 def test_bug(self):
20 jitdriver = JitDriver(greens = [], reds = ['n'])
21 class X(object):
22 pass
23 def f(n):
24 while n > -100:
25 jitdriver.can_enter_jit(n=n)
26 jitdriver.jit_merge_point(n=n)
27 x = X()
28 x.arg = 5
29 if n <= 0: break
30 n -= x.arg
31 x.arg = 6 # prevents 'x.arg' from being annotated as constant
32 return n
33 res = self.meta_interp(f, [31], enable_opts='')
34 assert res == -4
35
36 def test_r_dict(self):
37 # a Struct that belongs to the hash table is not seen as being
38 # included in the larger Array
39 py.test.skip("issue with ll2ctypes")
40
41 def test_free_object(self):
42 py.test.skip("issue of freeing, probably with ll2ctypes")