|
|
@@ -13,15 +13,18 @@ class TestOptimizeAdvanced(unittest.TestCase):
|
|
|
|
|
|
def test_eliminate_common_subexpressions(self):
|
|
|
pass
|
|
|
-
|
|
|
- def test_copy_propagation_true(self):
|
|
|
+
|
|
|
+ def test_fold_constants(self):
|
|
|
+ pass
|
|
|
+
|
|
|
+ def test_copy_propagation_true(self):
|
|
|
print "testing true"
|
|
|
block = B([self.foo,
|
|
|
S('command', 'move', '$1', '$2'),
|
|
|
self.foo,
|
|
|
S('command', 'addu', '$3', '$1', '$4'),
|
|
|
self.bar])
|
|
|
-
|
|
|
+
|
|
|
copy_propagation(block)
|
|
|
self.assertEqual(block.statements, [self.foo,
|
|
|
S('command', 'move', '$1', '$2'),
|
|
|
@@ -29,7 +32,7 @@ class TestOptimizeAdvanced(unittest.TestCase):
|
|
|
S('command', 'addu', '$3', '$2', '$4'),
|
|
|
self.bar])
|
|
|
print "Test true succesfull"
|
|
|
-
|
|
|
+
|
|
|
# def test_copy_propagation_false(self):
|
|
|
# print "Testing false"
|
|
|
# arguments = [self.foo,
|