solidity/test/libsolidity/smtCheckerTests/control_flow/revert_complex_flow.sol

19 lines
432 B
Solidity
Raw Normal View History

2020-09-11 19:49:04 +00:00
pragma experimental SMTChecker;
contract C {
function f(bool b, uint a) pure public {
require(a <= 256);
if (b)
revert();
uint c = a + 1;
if (b)
c--;
else
c++;
assert(c == a);
}
}
// ----
// Warning 6328: (183-197): CHC: Assertion violation happens here.\nCounterexample:\n\nb = false\na = 0\n\n\nTransaction trace:\nC.constructor()\nC.f(false, 0)
// Warning 6838: (155-156): BMC: Condition is always false.