|
|
@@ -63,3 +63,49 @@ class TestLiveness(unittest.TestCase):
|
|
|
self.assertEqual(b2.live_out, set(['b', 'd']))
|
|
|
self.assertEqual(b3.live_in, set(['b', 'd']))
|
|
|
self.assertEqual(b3.live_out, set())
|
|
|
+
|
|
|
+# def test_create_in_out_two(self):
|
|
|
+# s11 = S('command', 'subu', 'i', 'm', '0x00000001')
|
|
|
+# s12 = S('command', 'move', 'j', 'n')
|
|
|
+# s13 = S('command', 'move', 'a', 'u1')
|
|
|
+# s14 = S('command', 'subu', 'i', 'm', '0x00000001')
|
|
|
+# s15 = S('command', 'j', 'L1')
|
|
|
+# s16 = S('')
|
|
|
+#
|
|
|
+# s21 = S('label', 'L1')
|
|
|
+# s22 = S('command', 'addi', 'i', '0x00000001')
|
|
|
+# s23 = S('command', 'subi', 'j', '0x00000001')
|
|
|
+# s24 = S('command', 'j', 'L2')
|
|
|
+#
|
|
|
+# s31 = S('label', 'L2')
|
|
|
+# s32 = S('command', 'move', 'a', 'u2')
|
|
|
+# s33 = S('command', 'j', 'L1')
|
|
|
+
|
|
|
+# s41 = S('label', 'L3')
|
|
|
+# s42 = S('command', 'move', 'i', 'u3')
|
|
|
+# s43 = S('command', 'beq', 'g', 'd', 'L4')
|
|
|
+#
|
|
|
+# s51 = S('label', 'L4')
|
|
|
+# s52 = S('command', 'addu', 'b', 'i', 'a')
|
|
|
+#
|
|
|
+# b1, b2, b3, b4 = find_basic_blocks([s11, s12, s13, s14, s15, s21, s22,\
|
|
|
+# s31, s32, s33, s41, s42, s43, s51])
|
|
|
+
|
|
|
+# generate_flow_graph([b1, b2, b3, b4, b5])
|
|
|
+# create_in_out([b1, b2, b3, b4, b5])
|
|
|
+#
|
|
|
+#
|
|
|
+
|
|
|
+ #self.assertEqual(b1.)
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|