mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
29 lines
463 B
Solidity
29 lines
463 B
Solidity
|
pragma experimental SMTChecker;
|
||
|
|
||
|
contract C
|
||
|
{
|
||
|
uint x;
|
||
|
function f() internal {
|
||
|
require(x < 10000);
|
||
|
x = x + 1;
|
||
|
}
|
||
|
function g(bool b) public {
|
||
|
x = 0;
|
||
|
if (b)
|
||
|
f();
|
||
|
// Should fail for `b == true`.
|
||
|
assert(x == 0);
|
||
|
}
|
||
|
function h(bool b) public {
|
||
|
x = 0;
|
||
|
if (!b)
|
||
|
f();
|
||
|
// Should fail for `b == false`.
|
||
|
assert(x == 0);
|
||
|
}
|
||
|
|
||
|
}
|
||
|
// ----
|
||
|
// Warning: (209-223): Assertion violation happens here
|
||
|
// Warning: (321-335): Assertion violation happens here
|