本文整理汇总了Python中pypy.translator.interactive.Translation.compile_llvm方法的典型用法代码示例。如果您正苦于以下问题:Python Translation.compile_llvm方法的具体用法?Python Translation.compile_llvm怎么用?Python Translation.compile_llvm使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pypy.translator.interactive.Translation
的用法示例。
在下文中一共展示了Translation.compile_llvm方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_tagged_boehm
# 需要导入模块: from pypy.translator.interactive import Translation [as 别名]
# 或者: from pypy.translator.interactive.Translation import compile_llvm [as 别名]
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: test_tagged_boehm
# 需要导入模块: from pypy.translator.interactive import Translation [as 别名]
# 或者: from pypy.translator.interactive.Translation import compile_llvm [as 别名]
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')
示例3: test_computed_int_symbolic
# 需要导入模块: from pypy.translator.interactive import Translation [as 别名]
# 或者: from pypy.translator.interactive.Translation import compile_llvm [as 别名]
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