mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Add two test cases for unbalanced inline assembly
This commit is contained in:
parent
0e33b63468
commit
6cb2770344
@ -4079,6 +4079,34 @@ BOOST_AUTO_TEST_CASE(shift_constant_right_excessive_rvalue)
|
||||
BOOST_CHECK(expectError(text, false) == Error::Type::TypeError);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(inline_assembly_unbalanced_positive_stack)
|
||||
{
|
||||
char const* text = R"(
|
||||
contract test {
|
||||
function f() {
|
||||
assembly {
|
||||
1
|
||||
}
|
||||
}
|
||||
}
|
||||
)";
|
||||
BOOST_CHECK(expectError(text, true) == Error::Type::Warning);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(inline_assembly_unbalanced_negative_stack)
|
||||
{
|
||||
char const* text = R"(
|
||||
contract test {
|
||||
function f() {
|
||||
assembly {
|
||||
pop
|
||||
}
|
||||
}
|
||||
}
|
||||
)";
|
||||
BOOST_CHECK(expectError(text, true) == Error::Type::Warning);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_SUITE_END()
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user