mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Test for side-effect free condition.
This commit is contained in:
parent
937695bfdc
commit
aad64d818a
@ -5505,6 +5505,19 @@ BOOST_AUTO_TEST_CASE(pure_statement_in_for_loop)
|
|||||||
CHECK_WARNING(text, "Statement has no effect.");
|
CHECK_WARNING(text, "Statement has no effect.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BOOST_AUTO_TEST_CASE(pure_statement_check_for_regular_for_loop)
|
||||||
|
{
|
||||||
|
char const* text = R"(
|
||||||
|
contract C {
|
||||||
|
function f() {
|
||||||
|
for (uint x = 0; true; x++)
|
||||||
|
{}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)";
|
||||||
|
success(text);
|
||||||
|
}
|
||||||
|
|
||||||
BOOST_AUTO_TEST_SUITE_END()
|
BOOST_AUTO_TEST_SUITE_END()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user