Beispiel #1
0
def run_render_text_outline():
    f = StringIO()
    render_text(p, emit=f.write, inline=False, intermediate_names=["llvm"])
    src = f.getvalue()
    assert 'def foo(a, b):' in src
    assert "====llvm====" in src
    assert '%0 = load a' in src
Beispiel #2
0
def run_render_text_inline():
    f = StringIO()
    render_text(p, emit=f.write, intermediate_names=["llvm"])
    src = f.getvalue()
    assert 'def foo(a, b):' in src
    assert '____llvm____' in src
    assert '%0 = load a' in src
Beispiel #3
0
def run_render_text_outline():
    f = StringIO()
    render_text(p, emit=f.write, inline=False, intermediate_names=["llvm"])
    src = f.getvalue()
    assert 'def foo(a, b):' in src
    assert "====llvm====" in src
    assert '%0 = load a' in src
Beispiel #4
0
def run_render_text_inline():
    f = StringIO()
    render_text(p, emit=f.write, intermediate_names=["llvm"])
    src = f.getvalue()
    assert 'def foo(a, b):' in src
    assert '____llvm____' in src
    assert '%0 = load a' in src
Beispiel #5
0
def run_render_text():
    f = StringIO()
    render_text(p, emit=f.write)
    src = f.getvalue()
    assert 'def foo(a, b):' in src, src
    assert 'print a * b' in src
    assert 'return a - b' in src
    assert 'double' in src
Beispiel #6
0
def run_render_text():
    f = StringIO()
    render_text(p, emit=f.write)
    src = f.getvalue()
    assert 'def foo(a, b):' in src, src
    assert 'print a * b' in src
    assert 'return a - b' in src
    assert 'double' in src