Commit 5b0796b7 authored by Jayke Meijer's avatar Jayke Meijer

Added unittest for movA-B replacement (should do nothing).

parent ef830506
......@@ -16,4 +16,16 @@ class TestOptimize(unittest.TestCase):
S('command', 'move', '$regA', '$regA'),
bar])
optimize_global(block)
self.assertEquals(block.statements, [foo, bar])
self.assertEquals(block.statements, [foo, bar])
def test_optimize_global_movab(self):
foo = S('command', 'foo')
move = S('command', 'move', '$regA', '$regB')
bar = S('command', 'baz')
block = B([foo, \
move,
bar])
optimize_global(block)
self.assertEquals(block.statements, [foo, move, bar])
def
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment