diff options
Diffstat (limited to 'test/libsolidity/InlineAssembly.cpp')
-rw-r--r-- | test/libsolidity/InlineAssembly.cpp | 42 |
1 files changed, 41 insertions, 1 deletions
diff --git a/test/libsolidity/InlineAssembly.cpp b/test/libsolidity/InlineAssembly.cpp index d2d320db..aae6dacd 100644 --- a/test/libsolidity/InlineAssembly.cpp +++ b/test/libsolidity/InlineAssembly.cpp @@ -213,6 +213,16 @@ BOOST_AUTO_TEST_CASE(functional) BOOST_CHECK(successParse("{ let x := 2 add(7, mul(6, x)) mul(7, 8) add =: x }")); } +BOOST_AUTO_TEST_CASE(functional_partial) +{ + CHECK_PARSE_ERROR("{ let x := byte }", ParserError, "Expected token \"(\""); +} + +BOOST_AUTO_TEST_CASE(functional_partial_success) +{ + BOOST_CHECK(successParse("{ let x := byte(1, 2) }")); +} + BOOST_AUTO_TEST_CASE(functional_assignment) { BOOST_CHECK(successParse("{ let x := 2 x := 7 }")); @@ -258,7 +268,7 @@ BOOST_AUTO_TEST_CASE(switch_duplicate_case) BOOST_AUTO_TEST_CASE(switch_invalid_expression) { CHECK_PARSE_ERROR("{ switch {} default {} }", ParserError, "Literal, identifier or instruction expected."); - CHECK_PARSE_ERROR("{ 1 2 switch mul default {} }", ParserError, "Instructions are not supported as expressions for switch."); + CHECK_PARSE_ERROR("{ switch calldatasize default {} }", ParserError, "Instructions are not supported as expressions for switch."); } BOOST_AUTO_TEST_CASE(switch_default_before_case) @@ -542,6 +552,36 @@ BOOST_AUTO_TEST_CASE(keccak256) BOOST_CHECK(successAssemble("{ pop(sha3(0, 0)) }")); } +BOOST_AUTO_TEST_CASE(returndatasize) +{ + BOOST_CHECK(successAssemble("{ let r := returndatasize }")); +} + +BOOST_AUTO_TEST_CASE(returndatasize_functional) +{ + BOOST_CHECK(successAssemble("{ let r := returndatasize() }")); +} + +BOOST_AUTO_TEST_CASE(returndatacopy) +{ + BOOST_CHECK(successAssemble("{ 64 32 0 returndatacopy }")); +} + +BOOST_AUTO_TEST_CASE(returndatacopy_functional) +{ + BOOST_CHECK(successAssemble("{ returndatacopy(0, 32, 64) }")); +} + +BOOST_AUTO_TEST_CASE(staticcall) +{ + BOOST_CHECK(successAssemble("{ pop(staticcall(10000, 0x123, 64, 0x10, 128, 0x10)) }")); +} + +BOOST_AUTO_TEST_CASE(create2) +{ + BOOST_CHECK(successAssemble("{ pop(create2(10, 0x123, 32, 64)) }")); +} + BOOST_AUTO_TEST_SUITE_END() BOOST_AUTO_TEST_SUITE_END() |