diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2018-02-27 19:09:22 +0800 |
---|---|---|
committer | Alex Beregszaszi <alex@rtfs.hu> | 2018-02-27 20:43:04 +0800 |
commit | 73c5d99bfaa4d17a97d4554a89d1005b25e62f98 (patch) | |
tree | 3b7a86a112be17c4da5b085aea69be6d829b3bf3 /test/libsolidity/InlineAssembly.cpp | |
parent | 317e017849e3ada43842c1e0268338e54c0c4d8e (diff) | |
download | dexon-solidity-73c5d99bfaa4d17a97d4554a89d1005b25e62f98.tar dexon-solidity-73c5d99bfaa4d17a97d4554a89d1005b25e62f98.tar.gz dexon-solidity-73c5d99bfaa4d17a97d4554a89d1005b25e62f98.tar.bz2 dexon-solidity-73c5d99bfaa4d17a97d4554a89d1005b25e62f98.tar.lz dexon-solidity-73c5d99bfaa4d17a97d4554a89d1005b25e62f98.tar.xz dexon-solidity-73c5d99bfaa4d17a97d4554a89d1005b25e62f98.tar.zst dexon-solidity-73c5d99bfaa4d17a97d4554a89d1005b25e62f98.zip |
Add basic test for shift opcodes
Diffstat (limited to 'test/libsolidity/InlineAssembly.cpp')
-rw-r--r-- | test/libsolidity/InlineAssembly.cpp | 14 |
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"); |