mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #3077 from ethereum/optimze_pops
Assume peephole optimizer was successful if number of pops increased.
This commit is contained in:
@@ -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{
|
||||
|
||||
Reference in New Issue
Block a user