Debian Codegraph @

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

raw symbols SCIP
1 #!/usr/bin/env python
2
3 import py
4 from rpython.jit.backend.riscv.test.test_basic import JitRISCVMixin
5 from rpython.jit.metainterp.test.test_tlc import TLCTests
6 from rpython.jit.tl import tlc
7
8
9 class TestTL(JitRISCVMixin, TLCTests):
10 # for the individual tests see
11 # ====> ../../test/test_tlc.py
12
13 def test_accumulator(self):
14 path = py.path.local(tlc.__file__).dirpath('accumulator.tlc.src')
15 code = path.read()
16 res = self.exec_code(code, 20)
17 assert res == sum(range(20))
18 res = self.exec_code(code, -10)
19 assert res == 10
20
21 def test_fib(self):
22 py.test.skip("AnnotatorError")
23 path = py.path.local(tlc.__file__).dirpath('fibo.tlc.src')
24 code = path.read()
25 res = self.exec_code(code, 7)
26 assert res == 13
27 res = self.exec_code(code, 20)
28 assert res == 6765