Reorganize and cleanup tests
This commit is contained in:
parent
ea452bd33c
commit
fac1bc782d
36 changed files with 1780 additions and 1592 deletions
26
llvm/tests/test_cmp.py
Normal file
26
llvm/tests/test_cmp.py
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
import unittest
|
||||
from llvm.core import (Module, Type, Builder, Constant)
|
||||
import llvm.core as lc
|
||||
from .support import TestCase, tests
|
||||
|
||||
class TestCmp(TestCase):
|
||||
def test_arg_attr(self):
|
||||
m = Module.new('oifjda')
|
||||
fnty = Type.function(Type.void(), [Type.int()])
|
||||
func = m.add_function(fnty, 'foo')
|
||||
bb = func.append_basic_block('')
|
||||
bldr = Builder.new(bb)
|
||||
|
||||
cmpinst = bldr.icmp(lc.ICMP_ULE, func.args[0],
|
||||
Constant.int(Type.int(), 123))
|
||||
self.assertTrue(repr(cmpinst.predicate).startswith('ICMP_ULE'))
|
||||
self.assertEqual(cmpinst.predicate, lc.ICMP_ULE)
|
||||
bldr.ret_void()
|
||||
|
||||
func.verify()
|
||||
|
||||
tests.append(TestCmp)
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue