mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Add tests for invalid instruction
This commit is contained in:
parent
bfa3b4ca78
commit
eb530aa217
@ -182,6 +182,11 @@ BOOST_AUTO_TEST_CASE(error_tag)
|
|||||||
BOOST_CHECK(successAssemble("{ invalidJumpLabel }"));
|
BOOST_CHECK(successAssemble("{ invalidJumpLabel }"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BOOST_AUTO_TEST_CASE(designated_invalid_instruction)
|
||||||
|
{
|
||||||
|
BOOST_CHECK(successAssemble("{ invalid }"));
|
||||||
|
}
|
||||||
|
|
||||||
BOOST_AUTO_TEST_CASE(inline_assembly_shadowed_instruction_declaration)
|
BOOST_AUTO_TEST_CASE(inline_assembly_shadowed_instruction_declaration)
|
||||||
{
|
{
|
||||||
// Error message: "Cannot use instruction names for identifier names."
|
// Error message: "Cannot use instruction names for identifier names."
|
||||||
|
@ -9043,6 +9043,21 @@ BOOST_AUTO_TEST_CASE(recursive_structs)
|
|||||||
BOOST_CHECK(callContractFunction("f()") == encodeArgs(u256(1)));
|
BOOST_CHECK(callContractFunction("f()") == encodeArgs(u256(1)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BOOST_AUTO_TEST_CASE(invalid_instruction)
|
||||||
|
{
|
||||||
|
char const* sourceCode = R"(
|
||||||
|
contract C {
|
||||||
|
function f() {
|
||||||
|
assembly {
|
||||||
|
invalid
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)";
|
||||||
|
compileAndRun(sourceCode, 0, "C");
|
||||||
|
BOOST_CHECK(callContractFunction("f()") == encodeArgs());
|
||||||
|
}
|
||||||
|
|
||||||
BOOST_AUTO_TEST_SUITE_END()
|
BOOST_AUTO_TEST_SUITE_END()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user