Debian Codegraph @

rpython/jit/tl/test/test_tlr.py

raw symbols SCIP
1 import py
2 from rpython.jit.tl import tlr
3
4 from rpython.translator.c.test import test_boehm
5
6
7 class TestTLR(test_boehm.AbstractGCTestClass):
8
9 def test_square(self):
10 assert tlr.interpret(tlr.SQUARE, 1) == 1
11 assert tlr.interpret(tlr.SQUARE, 7) == 49
12 assert tlr.interpret(tlr.SQUARE, 9) == 81
13
14 def test_translate(self):
15 py.test.skip("?")
16 def driver():
17 bench = Benchmark()
18 while 1:
19 res = tlr.interpret(tlr.SQUARE, 1764)
20 if bench.stop():
21 break
22 return res
23
24 fn = self.getcompiled(driver, [])
25 res = fn()
26 assert res == 1764 * 1764