Пример #1
0
        public void LciLiveAtCopy()
        {
            Build(new LiveCopyMock().Procedure, new FakeArchitecture());
            var lci = new LiveCopyInserter(proc, ssaIds);

            var reg   = ssaIds.Where(s => s.Identifier.Name == "reg").Single();
            var reg_5 = ssaIds.Where(s => s.Identifier.Name == "reg_2").Single();
            var reg_6 = ssaIds.Where(s => s.Identifier.Name == "reg_3").Single();

            Assert.AreEqual("reg_2 = PHI(reg, reg_3)", reg_5.DefStatement.Instruction.ToString());
            Assert.IsTrue(lci.IsLiveOut(reg.Identifier, reg_5.DefStatement));
        }
Пример #2
0
        public void LciLiveAtCopy()
        {
            Build(new LiveCopyMock().Procedure, new FakeArchitecture());
            var lci = new LiveCopyInserter(ssa);

            var reg   = ssaIds.Where(s => s.Identifier.Name == "reg").Single();
            var reg_3 = ssaIds.Where(s => s.Identifier.Name == "reg_3").Single();
            var reg_4 = ssaIds.Where(s => s.Identifier.Name == "reg_4").Single();

            ssa.Dump(true);
            Assert.AreEqual("reg_4 = PHI((reg, l1), (reg_3, l2))", reg_4.DefStatement.Instruction.ToString());
            Assert.IsTrue(lci.IsLiveOut(reg.Identifier, reg_4.DefStatement));
        }