Move "create2_as_variable" back to non-isoltest tests.

This commit is contained in:
chriseth 2018-06-04 19:14:25 +02:00
parent 283cdef98c
commit 1ce40f4089
2 changed files with 15 additions and 6 deletions

View File

@ -402,6 +402,21 @@ BOOST_AUTO_TEST_CASE(returndatasize_as_variable)
CHECK_ALLOW_MULTI(text, expectations);
}
BOOST_AUTO_TEST_CASE(create2_as_variable)
{
char const* text = R"(
contract c { function f() public { uint create2; assembly { create2(0, 0, 0, 0) } }}
)";
// This needs special treatment, because the message mentions the EVM version,
// so cannot be run via isoltest.
CHECK_ALLOW_MULTI(text, (std::vector<std::pair<Error::Type, std::string>>{
{Error::Type::Warning, "Variable is shadowed in inline assembly by an instruction of the same name"},
{Error::Type::Warning, "The \"create2\" instruction is not supported by the VM version"},
{Error::Type::DeclarationError, "Unbalanced stack"},
{Error::Type::Warning, "not supposed to return values"}
}));
}
BOOST_AUTO_TEST_CASE(getter_is_memory_type)
{
char const* text = R"(

View File

@ -1,6 +0,0 @@
contract c { function f() public { uint create2; assembly { create2(0, 0, 0, 0) } }}
// ----
// Warning: (35-47): Variable is shadowed in inline assembly by an instruction of the same name
// Warning: (60-79): The "create2" instruction is not supported by the VM version "byzantium" you are currently compiling for. It will be interpreted as an invalid instruction on this VM.
// Warning: (60-79): Top-level expressions are not supposed to return values (this expression returns 1 value). Use ``pop()`` or assign them.
// DeclarationError: (58-81): Unbalanced stack at the end of a block: 1 surplus item(s).