public void Ucfg_Block_Without_Terminator_IsInvalid() { var ucfg = new UCFG { Entries = { "0" }, BasicBlocks = { new BasicBlock { Id = "0" }, // no Jump or Ret }, }; UcfgGenerator.IsValid(ucfg).Should().BeFalse(); }
public void Ucfg_Block_With_Missing_Jump_Destinations_IsInvalid() { var ucfg = new UCFG { Entries = { "0" }, BasicBlocks = { new BasicBlock { Id = "0", Jump = new Jump{ Destinations ={ "1" } }, // There is no such block }, }, }; UcfgGenerator.IsValid(ucfg).Should().BeFalse(); }
public void Ucfg_Block_With_Jump_IsValid() { var ucfg = new UCFG { Entries = { "0" }, BasicBlocks = { new BasicBlock { Id = "0", Jump = new Jump{ Destinations ={ "0" } }, }, }, }; UcfgGenerator.IsValid(ucfg).Should().BeTrue(); }
public void Ucfg_Block_With_Ret_IsValid() { var ucfg = new UCFG { Entries = { "0" }, BasicBlocks = { new BasicBlock { Id = "0", Ret = new Return { ReturnedExpression = new Expression{ Var = new Variable{ Name = "a" } } }, }, }, }; UcfgGenerator.IsValid(ucfg).Should().BeTrue(); }