solidity/test/libsolidity/smtCheckerTests/loops/while_1_break.sol
2019-09-13 12:40:53 +02:00

22 lines
360 B
Solidity

pragma experimental SMTChecker;
contract C
{
function f(uint x, bool b) public pure {
require(x < 10);
while (x < 10) {
if (b)
++x;
else {
x = 20;
break;
}
}
// Assertion is safe but break is unsupported for now
// so knowledge is erased.
assert(x >= 10);
}
}
// ----
// Warning: (274-289): Assertion violation happens here