mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Add a test about checking a warning
This commit is contained in:
parent
464dea2459
commit
a0f8c94dad
@ -193,11 +193,16 @@ CHECK_ERROR_OR_WARNING(text, type, substring, false, false)
|
||||
#define CHECK_ERROR_ALLOW_MULTI(text, type, substring) \
|
||||
CHECK_ERROR_OR_WARNING(text, type, substring, false, true)
|
||||
|
||||
// [checkWarning(text, type, substring)] asserts that the compilation down to typechecking
|
||||
// emits a warning of type [type] and with a message containing [substring].
|
||||
// [checkWarning(text, substring)] asserts that the compilation down to typechecking
|
||||
// emits a warning and with a message containing [substring].
|
||||
#define CHECK_WARNING(text, substring) \
|
||||
CHECK_ERROR_OR_WARNING(text, Warning, substring, true, false)
|
||||
|
||||
// [checkWarningAllowMulti(text, substring)] aserts that the compilation down to typechecking
|
||||
// emits a warning and with a message containing [substring].
|
||||
#define CHECK_WARNING_ALLOW_MULTI(text, substring) \
|
||||
CHECK_ERROR_OR_WARNING(text, Warning, substring, true, true)
|
||||
|
||||
// [checkSuccess(text)] asserts that the compilation down to typechecking succeeds.
|
||||
#define CHECK_SUCCESS(text) do { BOOST_CHECK(success((text))); } while(0)
|
||||
|
||||
@ -5780,6 +5785,13 @@ BOOST_AUTO_TEST_CASE(no_unused_inline_asm)
|
||||
CHECK_SUCCESS_NO_WARNINGS(text);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(returndatacopy_as_variable)
|
||||
{
|
||||
char const* text = R"(
|
||||
contract c { function f() { uint returndatasize; assembly { returndatasize }}}
|
||||
)";
|
||||
CHECK_WARNING_ALLOW_MULTI(text, "shadowed by an insturction of the same name");
|
||||
}
|
||||
|
||||
|
||||
BOOST_AUTO_TEST_SUITE_END()
|
||||
|
Loading…
Reference in New Issue
Block a user