Debian Codegraph @

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

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