aboutsummaryrefslogtreecommitdiffstats
path: root/test/libevmasm/Optimiser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/libevmasm/Optimiser.cpp')
-rw-r--r--test/libevmasm/Optimiser.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/libevmasm/Optimiser.cpp b/test/libevmasm/Optimiser.cpp
index 9dc49581..0ab95b08 100644
--- a/test/libevmasm/Optimiser.cpp
+++ b/test/libevmasm/Optimiser.cpp
@@ -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{