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

18 lines
261 B
Solidity
Raw Normal View History

pragma experimental SMTChecker;
contract c {
uint x;
function f() internal returns (uint) {
x = x + 1;
return x;
}
2019-03-26 11:03:16 +00:00
function g() public returns (bool) {
x = 0;
2019-03-22 16:05:58 +00:00
bool b = (f() > 0) || (f() > 0);
assert(x == 1);
2019-03-26 11:03:16 +00:00
assert(b);
return b;
}
}
// ----