Debian Codegraph @

rpython/jit/backend/arm/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.backend.arm.test.support import JitARMMixin
5 from rpython.jit.backend.detect_cpu import getcpuclass
6
7 CPU = getcpuclass()
8
9 class TestBasic(JitARMMixin, test_ajit.BaseLLtypeTests):
10 # for the individual tests see
11 # ====> ../../../metainterp/test/test_ajit.py
12 def test_bug(self):
13 jitdriver = JitDriver(greens = [], reds = ['n'])
14 class X(object):
15 pass
16 def f(n):
17 while n > -100:
18 jitdriver.can_enter_jit(n=n)
19 jitdriver.jit_merge_point(n=n)
20 x = X()
21 x.arg = 5
22 if n <= 0: break
23 n -= x.arg
24 x.arg = 6 # prevents 'x.arg' from being annotated as constant
25 return n
26 res = self.meta_interp(f, [31], enable_opts='')
27 assert res == -4
28
29 def test_r_dict(self):
30 # a Struct that belongs to the hash table is not seen as being
31 # included in the larger Array
32 py.test.skip("issue with ll2ctypes")
33
34 def test_free_object(self):
35 py.test.skip("issue of freeing, probably with ll2ctypes")
36
37
38 if not CPU.supports_longlong:
39 for k in dir(test_ajit.BaseLLtypeTests):
40 if k.find('longlong') < 0:
41 continue
42 locals()[k] = lambda self: py.test.skip('requires longlong support')
43
44 if not CPU.supports_floats:
45 for k in ('test_float', 'test_residual_external_call'):
46 locals()[k] = lambda self: py.test.skip('requires float support')