mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Review comments.
This commit is contained in:
@@ -342,6 +342,11 @@ BOOST_AUTO_TEST_CASE(magic_variables)
|
||||
BOOST_CHECK(successAssemble("{ let ecrecover := 1 ecrecover pop }"));
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(stack_variables)
|
||||
{
|
||||
BOOST_CHECK(successAssemble("{ let y := 3 { 2 { let x := y } pop} }"));
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(imbalanced_stack)
|
||||
{
|
||||
BOOST_CHECK(successAssemble("{ 1 2 mul pop }", false));
|
||||
|
||||
@@ -5078,6 +5078,36 @@ BOOST_AUTO_TEST_CASE(inline_assembly_storage_in_modifiers)
|
||||
CHECK_ERROR(text, DeclarationError, "Variable not found or variable not lvalue.");
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(inline_assembly_constant_assign)
|
||||
{
|
||||
char const* text = R"(
|
||||
contract test {
|
||||
uint constant x = 1;
|
||||
function f() {
|
||||
assembly {
|
||||
x := 2
|
||||
}
|
||||
}
|
||||
}
|
||||
)";
|
||||
CHECK_ERROR(text, DeclarationError, "Variable not found or variable not lvalue.");
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(inline_assembly_constant_access)
|
||||
{
|
||||
char const* text = R"(
|
||||
contract test {
|
||||
uint constant x = 1;
|
||||
function f() {
|
||||
assembly {
|
||||
let y := x
|
||||
}
|
||||
}
|
||||
}
|
||||
)";
|
||||
CHECK_ERROR(text, TypeError, "Constant variables not yet implemented for inline assembly");
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(invalid_mobile_type)
|
||||
{
|
||||
char const* text = R"(
|
||||
|
||||
Reference in New Issue
Block a user