add invariant load
add related test
This commit is contained in:
parent
82117d899e
commit
fbb7208b85
2 changed files with 19 additions and 1 deletions
|
|
@ -23,6 +23,20 @@ class TestMetaData(unittest.TestCase):
|
|||
|
||||
self.assertIn('!nontemporal', str(loadinst))
|
||||
|
||||
def test_meta_load_invariant(self):
|
||||
module = Module.new('test_meta_load_invariant')
|
||||
func = module.add_function(Type.function(Type.void(), []),
|
||||
name='test_load_invariant')
|
||||
bldr = Builder.new(func.append_basic_block('entry'))
|
||||
addr = Constant.int(Type.int(), 0xdeadbeef)
|
||||
loadinst = bldr.load(bldr.inttoptr(addr, Type.pointer(Type.int(8))),
|
||||
invariant=True)
|
||||
|
||||
bldr.ret_void()
|
||||
module.verify()
|
||||
|
||||
self.assertIn('!invariant.load', str(loadinst))
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue