InlineAssembly: Extracting function expression tests

This commit is contained in:
Christian Parpart
2020-11-04 12:03:33 +01:00
parent 616f03f577
commit 671b1c950e
7 changed files with 24 additions and 32 deletions
-32
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())
@@ -0,0 +1,3 @@
{
let x := 2 x := add(add(7, mul(6, x)), mul(7, 8))
}
@@ -0,0 +1,3 @@
{
let x := 2 x := add(add(7, mul(6, x)), mul(7, 8))
}
@@ -0,0 +1,5 @@
{
let x := 2
x := 7
}
@@ -0,0 +1,5 @@
{
let x := byte
}
// ----
// ParserError 2314: (20-21): Expected '(' but got '}'
@@ -0,0 +1,3 @@
{
let x := byte(1, 2)
}
@@ -0,0 +1,5 @@
{
returndatacopy(0, 32, 64)
}
// ====
// EVMVersion: >=byzantium