Updated more tests to use unittest.
This commit is contained in:
parent
9bbeee519b
commit
a9370d933d
5 changed files with 245 additions and 170 deletions
|
|
@ -1,21 +1,27 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
from llvm.core import *
|
||||
import llvm._core
|
||||
|
||||
m = Module.new('a')
|
||||
ti = Type.int()
|
||||
tf = Type.function(ti, [ti, ti])
|
||||
import unittest
|
||||
|
||||
f = m.add_function(tf, "func1")
|
||||
class TestIssue10(unittest.TestCase):
|
||||
def test_issue10(self):
|
||||
m = Module.new('a')
|
||||
ti = Type.int()
|
||||
tf = Type.function(ti, [ti, ti])
|
||||
|
||||
bb = f.append_basic_block('entry')
|
||||
f = m.add_function(tf, "func1")
|
||||
|
||||
b = Builder.new(bb)
|
||||
bb = f.append_basic_block('entry')
|
||||
|
||||
# There are no instructions in bb. Positioning of the
|
||||
# builder at beginning (or end) should succeed (trivially).
|
||||
b = Builder.new(bb)
|
||||
|
||||
b.position_at_end(bb)
|
||||
b.position_at_beginning(bb)
|
||||
# There are no instructions in bb. Positioning of the
|
||||
# builder at beginning (or end) should succeed (trivially).
|
||||
|
||||
b.position_at_end(bb)
|
||||
b.position_at_beginning(bb)
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue