示例#1
0
def test_tagged_boehm():
    py.test.skip("broken as test need rffi")
    t = Translation(entry_point, standalone=True, gc='boehm')
    try:
        exename = t.compile_llvm()
    finally:
        if conftest.option.view:
            t.view()
    g = os.popen(exename, 'r')
    data = g.read()
    g.close()
    assert data.rstrip().endswith('ALL OK')
示例#2
0
def test_tagged_boehm():
    py.test.skip("broken as test need rffi")
    t = Translation(entry_point, standalone=True, gc='boehm')
    try:
        exename = t.compile_llvm()
    finally:
        if conftest.option.view:
            t.view()
    g = os.popen(exename, 'r')
    data = g.read()
    g.close()
    assert data.rstrip().endswith('ALL OK')
示例#3
0
def test_tagged_boehm():
    runtest.llvm_test()
    runtest.gcc3_test()
    t = Translation(entry_point, standalone=True, gc='boehm')
    try:
        exename = t.compile_llvm()
    finally:
        if conftest.option.view:
            t.view()
    g = os.popen(exename, 'r')
    data = g.read()
    g.close()
    assert data.rstrip().endswith('ALL OK')
示例#4
0
def test_computed_int_symbolic():
    llvm_test()
    too_early = True
    def compute_fn():
        assert not too_early
        return 7
    k = ComputedIntSymbolic(compute_fn)
    def f():
        return k*6

    t = Translation(f)
    t.rtype()
    if conftest.option.view:
        t.view()
    too_early = False
    fn = t.compile_llvm()
    res = fn()
    assert res == 42
示例#5
0
def test_computed_int_symbolic():
    py.test.skip("XXX compile_llvm() fails to link")
    too_early = True

    def compute_fn():
        assert not too_early
        return 7

    k = ComputedIntSymbolic(compute_fn)

    def f():
        return k * 6

    t = Translation(f)
    t.rtype()
    if conftest.option.view:
        t.view()
    too_early = False
    fn = t.compile_llvm()
    res = fn()
    assert res == 42