aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity/InlineAssembly.cpp
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2018-02-27 21:47:07 +0800
committerGitHub <noreply@github.com>2018-02-27 21:47:07 +0800
commit2abc5be7e628c18562f1df546137fcb0748ecbb2 (patch)
treec4e1ed226c84414bbc9ed971aae79ed8f81bac9c /test/libsolidity/InlineAssembly.cpp
parent6512bfbcea2fb76145b2163c9962599c2f09e0b9 (diff)
parent73c5d99bfaa4d17a97d4554a89d1005b25e62f98 (diff)
downloaddexon-solidity-2abc5be7e628c18562f1df546137fcb0748ecbb2.tar.gz
dexon-solidity-2abc5be7e628c18562f1df546137fcb0748ecbb2.tar.zst
dexon-solidity-2abc5be7e628c18562f1df546137fcb0748ecbb2.zip
Merge pull request #2541 from ethereum/asm-bitshift
Add bit shifting opcodes (EIP145)
Diffstat (limited to 'test/libsolidity/InlineAssembly.cpp')
-rw-r--r--test/libsolidity/InlineAssembly.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/libsolidity/InlineAssembly.cpp b/test/libsolidity/InlineAssembly.cpp
index 45fb54f8..ea120657 100644
--- a/test/libsolidity/InlineAssembly.cpp
+++ b/test/libsolidity/InlineAssembly.cpp
@@ -774,6 +774,20 @@ BOOST_AUTO_TEST_CASE(create2)
BOOST_CHECK(successAssemble("{ pop(create2(10, 0x123, 32, 64)) }"));
}
+BOOST_AUTO_TEST_CASE(shift)
+{
+ BOOST_CHECK(successAssemble("{ pop(shl(10, 32)) }"));
+ BOOST_CHECK(successAssemble("{ pop(shr(10, 32)) }"));
+ BOOST_CHECK(successAssemble("{ pop(sar(10, 32)) }"));
+}
+
+BOOST_AUTO_TEST_CASE(shift_constantinople_warning)
+{
+ CHECK_PARSE_WARNING("{ pop(shl(10, 32)) }", Warning, "The \"shl\" instruction is only available after the Constantinople hard fork");
+ CHECK_PARSE_WARNING("{ pop(shr(10, 32)) }", Warning, "The \"shr\" instruction is only available after the Constantinople hard fork");
+ CHECK_PARSE_WARNING("{ pop(sar(10, 32)) }", Warning, "The \"sar\" instruction is only available after the Constantinople hard fork");
+}
+
BOOST_AUTO_TEST_CASE(jump_warning)
{
CHECK_PARSE_WARNING("{ 1 jump }", Warning, "Jump instructions");