Fix a lots of bugs in the newbinding to pass all the tests.

NOTE: debug info has not been implemented yet.
This commit is contained in:
Siu Kwan Lam 2013-02-13 15:09:26 -06:00
commit a09394cacd
32 changed files with 2419 additions and 546 deletions

16
test/malloc.py Normal file
View file

@ -0,0 +1,16 @@
from llvm.core import *
def test():
m = Module.new('sdf')
f = m.add_function(Type.function(Type.void(), []), 'foo')
bb = f.append_basic_block('entry')
b = Builder.new(bb)
alloc = b.malloc(Type.int(), 'ha')
inst = b.free(alloc)
alloc = b.malloc_array(Type.int(), Constant.int(Type.int(), 10), 'hee')
inst = b.free(alloc)
b.ret_void()
print m
if __name__ == '__main__':
test()