2020-09-11 19:41:39 +00:00
|
|
|
pragma experimental SMTChecker;
|
|
|
|
|
|
|
|
contract C {
|
|
|
|
function f() pure public {
|
2020-09-11 19:49:04 +00:00
|
|
|
revert();
|
2020-09-11 19:41:39 +00:00
|
|
|
// This is not reachable.
|
|
|
|
assert(false);
|
|
|
|
}
|
|
|
|
|
|
|
|
function g() pure public {
|
2020-09-11 19:49:04 +00:00
|
|
|
revert("revert message");
|
2020-09-11 19:41:39 +00:00
|
|
|
// This is not reachable.
|
|
|
|
assert(false);
|
|
|
|
}
|
2020-09-11 19:49:04 +00:00
|
|
|
|
|
|
|
function h(bool b) pure public {
|
|
|
|
if (b)
|
|
|
|
revert();
|
|
|
|
assert(!b);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Check that arguments are evaluated.
|
|
|
|
bool x = false;
|
|
|
|
function m() view internal returns (string memory) {
|
|
|
|
assert(x != true);
|
|
|
|
}
|
|
|
|
function i() public {
|
|
|
|
x = true;
|
|
|
|
revert(m());
|
|
|
|
}
|
2020-09-11 19:41:39 +00:00
|
|
|
}
|
|
|
|
// ----
|
2020-09-11 19:49:04 +00:00
|
|
|
// Warning 5740: (116-129): Unreachable code.
|
|
|
|
// Warning 5740: (221-234): Unreachable code.
|
2020-09-25 17:09:06 +00:00
|
|
|
// Warning 6328: (427-444): CHC: Assertion violation happens here.
|