Debian Codegraph @

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

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