| 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.zarch.test.support import JitZARCHMixin |
| 6 |
from rpython.jit.backend.detect_cpu import getcpuclass |
| 7 |
|
| 8 |
CPU = getcpuclass() |
| 9 |
|
| 10 |
class TestBasic(JitZARCHMixin, test_ajit.BaseLLtypeTests): |
| 11 |
|
| 12 |
|
| 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 |
| 26 |
return n |
| 27 |
res = self.meta_interp(f, [31], enable_opts='') |
| 28 |
assert res == -4 |
| 29 |
|
| 30 |
def test_r_dict(self): |
| 31 |
|
| 32 |
|
| 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') |