InlineAssembly: Extracting function expression tests

This commit is contained in:
Christian Parpart 2020-10-19 14:17:53 +02:00
parent 616f03f577
commit 671b1c950e
7 changed files with 24 additions and 32 deletions

View File

@ -203,31 +203,6 @@ BOOST_AUTO_TEST_CASE(constants)
BOOST_CHECK(successParse("{ pop(mul(7, 8)) }"));
}
BOOST_AUTO_TEST_CASE(functional)
{
BOOST_CHECK(successParse("{ let x := 2 x := add(add(7, mul(6, x)), mul(7, 8)) }"));
}
BOOST_AUTO_TEST_CASE(functional_partial)
{
CHECK_PARSE_ERROR("{ let x := byte }", ParserError, "Expected '(' but got '}'");
}
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 }"));
}
BOOST_AUTO_TEST_CASE(functional_assignment_complex)
{
BOOST_CHECK(successParse("{ let x := 2 x := add(add(7, mul(6, x)), mul(7, 8)) }"));
}
BOOST_AUTO_TEST_CASE(for_statement)
{
BOOST_CHECK(successParse("{ for {} 1 {} {} }"));
@ -572,13 +547,6 @@ BOOST_AUTO_TEST_CASE(returndatacopy)
BOOST_CHECK(successAssemble("{ returndatacopy(0, 32, 64) }"));
}
BOOST_AUTO_TEST_CASE(returndatacopy_functional)
{
if (!solidity::test::CommonOptions::get().evmVersion().supportsReturndata())
return;
BOOST_CHECK(successAssemble("{ returndatacopy(0, 32, 64) }"));
}
BOOST_AUTO_TEST_CASE(staticcall)
{
if (!solidity::test::CommonOptions::get().evmVersion().hasStaticCall())

View File

@ -0,0 +1,3 @@
{
let x := 2 x := add(add(7, mul(6, x)), mul(7, 8))
}

View File

@ -0,0 +1,3 @@
{
let x := 2 x := add(add(7, mul(6, x)), mul(7, 8))
}

View File

@ -0,0 +1,5 @@
{
let x := 2
x := 7
}

View File

@ -0,0 +1,5 @@
{
let x := byte
}
// ----
// ParserError 2314: (20-21): Expected '(' but got '}'

View File

@ -0,0 +1,3 @@
{
let x := byte(1, 2)
}

View File

@ -0,0 +1,5 @@
{
returndatacopy(0, 32, 64)
}
// ====
// EVMVersion: >=byzantium