aboutsummaryrefslogtreecommitdiffstats
path: root/test/libevmasm
diff options
context:
space:
mode:
authorNicolás Venturo <nicolas.venturo@gmail.com>2018-06-15 01:29:42 +0800
committerNicolás Venturo <nicolas.venturo@gmail.com>2018-06-15 22:27:39 +0800
commit172e208c6aa70956389ce7efb90b64ac32140588 (patch)
tree515665335cd23ee51fb6c1c8e81e9bd2aaf4af85 /test/libevmasm
parentdc5cd3e1e7db933493fe1b0dc12e5ecdf2a50ed7 (diff)
downloaddexon-solidity-172e208c6aa70956389ce7efb90b64ac32140588.tar.gz
dexon-solidity-172e208c6aa70956389ce7efb90b64ac32140588.tar.zst
dexon-solidity-172e208c6aa70956389ce7efb90b64ac32140588.zip
Add TruthyAnd Peephole optimization
Diffstat (limited to 'test/libevmasm')
-rw-r--r--test/libevmasm/Optimiser.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/libevmasm/Optimiser.cpp b/test/libevmasm/Optimiser.cpp
index 4b399a14..8e4946c3 100644
--- a/test/libevmasm/Optimiser.cpp
+++ b/test/libevmasm/Optimiser.cpp
@@ -967,6 +967,18 @@ BOOST_AUTO_TEST_CASE(peephole_swap_comparison)
}
}
+BOOST_AUTO_TEST_CASE(peephole_truthy_and)
+{
+ AssemblyItems items{
+ u256(0),
+ Instruction::NOT,
+ Instruction::AND
+ };
+ PeepholeOptimiser peepOpt(items);
+ BOOST_REQUIRE(peepOpt.optimise());
+ BOOST_CHECK(items.empty());
+}
+
BOOST_AUTO_TEST_CASE(jumpdest_removal)
{
AssemblyItems items{