Reorganize and cleanup tests
This commit is contained in:
parent
ea452bd33c
commit
fac1bc782d
36 changed files with 1780 additions and 1592 deletions
33
llvm/tests/test_attr.py
Normal file
33
llvm/tests/test_attr.py
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
import unittest
|
||||
try:
|
||||
from StringIO import StringIO
|
||||
except ImportError:
|
||||
from io import StringIO
|
||||
|
||||
from llvm.core import Module
|
||||
from .support import TestCase, tests
|
||||
|
||||
class TestAttr(TestCase):
|
||||
def make_module(self):
|
||||
test_module = """
|
||||
define void @sum(i32*, i32*) {
|
||||
entry:
|
||||
ret void
|
||||
}
|
||||
"""
|
||||
buf = StringIO(test_module)
|
||||
return Module.from_assembly(buf)
|
||||
|
||||
def test_align(self):
|
||||
m = self.make_module()
|
||||
f = m.get_function_named('sum')
|
||||
f.args[0].alignment = 16
|
||||
self.assert_("align 16" in str(f))
|
||||
self.assertEqual(f.args[0].alignment, 16)
|
||||
|
||||
tests.append(TestAttr)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue