Assume peephole optimizer was successful if number of pops increased.

This commit is contained in:
chriseth
2017-10-13 19:00:56 +02:00
parent d9bb4b44a4
commit 7c94e5462a
4 changed files with 25 additions and 3 deletions
+14
View File
@@ -841,6 +841,20 @@ BOOST_AUTO_TEST_CASE(peephole_double_push)
);
}
BOOST_AUTO_TEST_CASE(peephole_pop_calldatasize)
{
AssemblyItems items{
u256(4),
Instruction::CALLDATASIZE,
Instruction::LT,
Instruction::POP
};
PeepholeOptimiser peepOpt(items);
for (size_t i = 0; i < 3; i++)
BOOST_CHECK(peepOpt.optimise());
BOOST_CHECK(items.empty());
}
BOOST_AUTO_TEST_CASE(jumpdest_removal)
{
AssemblyItems items{