Test `_offset` for constants in inline assembly.

This commit is contained in:
chriseth 2018-02-19 19:21:16 +01:00
parent abc23ac608
commit a680cbd474

View File

@ -5776,6 +5776,21 @@ BOOST_AUTO_TEST_CASE(inline_assembly_storage_variable_access_out_of_functions)
CHECK_SUCCESS_NO_WARNINGS(text);
}
BOOST_AUTO_TEST_CASE(inline_assembly_constant_variable_via_offset)
{
char const* text = R"(
contract test {
uint constant x = 2;
function f() pure public {
assembly {
let r := x_offset
}
}
}
)";
CHECK_ERROR(text, TypeError, "Constant variables not supported by inline assembly.");
}
BOOST_AUTO_TEST_CASE(inline_assembly_calldata_variables)
{
char const* text = R"(