Add llvm_cbuilder tests
This commit is contained in:
parent
d795000176
commit
a52db30af8
14 changed files with 5 additions and 1 deletions
17
llvm_cbuilder/tests/test_cstr_collide.py
Normal file
17
llvm_cbuilder/tests/test_cstr_collide.py
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
from llvm.core import *
|
||||
from llvm_cbuilder import *
|
||||
from llvm_cbuilder import shortnames as C
|
||||
|
||||
import unittest
|
||||
|
||||
class TestCstrCollide(unittest.TestCase):
|
||||
def test_same_string(self):
|
||||
mod = Module.new(__name__)
|
||||
cb = CBuilder.new_function(mod, 'test_cstr_collide', C.void, [])
|
||||
|
||||
a = cb.constant_string("hello")
|
||||
b = cb.constant_string("hello")
|
||||
self.assertEqual(a.value, b.value)
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
Loading…
Add table
Add a link
Reference in a new issue