aboutsummaryrefslogtreecommitdiffstats
path: root/test/libjulia
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2018-02-10 02:00:16 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2018-02-13 06:47:04 +0800
commit1e09d6ba7b7117d5139472cc2c4af6d7f3ae91e9 (patch)
tree07ff4a013e30f614514a194d75f010ce97149ab5 /test/libjulia
parent037b97ef4a53c30f2800777a88d754a898bccc2b (diff)
downloaddexon-solidity-1e09d6ba7b7117d5139472cc2c4af6d7f3ae91e9.tar.gz
dexon-solidity-1e09d6ba7b7117d5139472cc2c4af6d7f3ae91e9.tar.zst
dexon-solidity-1e09d6ba7b7117d5139472cc2c4af6d7f3ae91e9.zip
Test for Mod-And rule.
Diffstat (limited to 'test/libjulia')
-rw-r--r--test/libjulia/Simplifier.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/libjulia/Simplifier.cpp b/test/libjulia/Simplifier.cpp
index b48d45c8..4d4e8d53 100644
--- a/test/libjulia/Simplifier.cpp
+++ b/test/libjulia/Simplifier.cpp
@@ -127,4 +127,16 @@ BOOST_AUTO_TEST_CASE(inside_for)
);
}
+BOOST_AUTO_TEST_CASE(mod_and)
+{
+ CHECK(
+ "{ mstore(0, mod(calldataload(0), exp(2, 8))) }",
+ "{ mstore(0, and(calldataload(0), 255)) }"
+ );
+ CHECK(
+ "{ mstore(0, mod(calldataload(0), exp(2, 255))) }",
+ "{ mstore(0, and(calldataload(0), 0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff)) }"
+ );
+}
+
BOOST_AUTO_TEST_SUITE_END()