Add easier atomic api
This commit is contained in:
parent
fb72ab5c8d
commit
4d763680f6
2 changed files with 40 additions and 0 deletions
|
|
@ -62,6 +62,7 @@ class TestAtomic(unittest.TestCase):
|
|||
inst = bldr.atomic_rmw('xchg', ptr, val, ordering)
|
||||
self.assertEqual(ordering, str(inst).split(' ')[-1])
|
||||
|
||||
|
||||
for op in test_these_atomic_op:
|
||||
inst = bldr.atomic_rmw(op, ptr, val, ordering)
|
||||
self.assertEqual(op, str(inst).strip().split(' ')[3])
|
||||
|
|
@ -70,5 +71,10 @@ class TestAtomic(unittest.TestCase):
|
|||
self.assertEqual('singlethread', str(inst).strip().split(' ')[-2])
|
||||
|
||||
|
||||
for op in test_these_atomic_op:
|
||||
atomic_op = getattr(bldr, 'atomic_%s' % op)
|
||||
inst = atomic_op(ptr, val, ordering)
|
||||
self.assertEqual(op, str(inst).strip().split(' ')[3])
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue