Add binding for Intrinsics.
Add support for functions that free the resource but is not a destructor.
This commit is contained in:
parent
aa5b969961
commit
11cc78d780
8 changed files with 92 additions and 4 deletions
|
|
@ -319,6 +319,16 @@ def test_constants():
|
|||
aryconst = api.ConstantArray.get(ary_int32x4, [intconst] * 4)
|
||||
assert str(aryconst.getAggregateElement(0)) == str(intconst)
|
||||
|
||||
def test_intrinsic():
|
||||
context = api.getGlobalContext()
|
||||
m = api.Module.new("modname", context)
|
||||
INTR_SIN = 1652
|
||||
floatty = api.Type.getFloatTy(context)
|
||||
fn = api.Intrinsic.getDeclaration(m, INTR_SIN, [floatty])
|
||||
assert 'llvm.sin.f32' in str(fn)
|
||||
fn.eraseFromParent()
|
||||
assert 'llvm.sin.f32' not in str(m)
|
||||
|
||||
def main():
|
||||
for name, value in globals().items():
|
||||
if name.startswith('test_') and callable(value):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue