mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Add basic test for shift opcodes
This commit is contained in:
parent
317e017849
commit
73c5d99bfa
@ -774,6 +774,20 @@ BOOST_AUTO_TEST_CASE(create2)
|
|||||||
BOOST_CHECK(successAssemble("{ pop(create2(10, 0x123, 32, 64)) }"));
|
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)
|
BOOST_AUTO_TEST_CASE(jump_warning)
|
||||||
{
|
{
|
||||||
CHECK_PARSE_WARNING("{ 1 jump }", Warning, "Jump instructions");
|
CHECK_PARSE_WARNING("{ 1 jump }", Warning, "Jump instructions");
|
||||||
|
Loading…
Reference in New Issue
Block a user