solidity/test/libsolidity/smtCheckerTests/functions/internal_multiple_calls_with_assertion_1_fail.sol

31 lines
905 B
Solidity
Raw Normal View History

2020-02-12 02:21:42 +00:00
pragma experimental SMTChecker;
contract C{
uint x;
2020-06-23 12:14:24 +00:00
constructor(uint y) {
2020-02-12 02:21:42 +00:00
assert(x == 1);
x = 1;
}
function f() public {
assert(x == 2);
++x;
++x;
g();
g();
assert(x == 3);
}
function g() internal {
--x;
}
}
// ----
// Warning 5667: (70-76): Unused function parameter. Remove or comment out the variable name to silence this warning.
2020-07-23 10:58:15 +00:00
// Warning 6328: (138-152): Assertion violation happens here
// Warning 6328: (184-198): Assertion violation happens here
// Warning 6328: (82-96): Assertion violation happens here
2020-06-23 12:14:24 +00:00
// Warning 2661: (156-159): Overflow (resulting value larger than 2**256 - 1) happens here
// Warning 2661: (163-166): Overflow (resulting value larger than 2**256 - 1) happens here
2020-06-23 12:14:24 +00:00
// Warning 2661: (234-237): Overflow (resulting value larger than 2**256 - 1) happens here
// Warning 4144: (234-237): Underflow (resulting value less than 0) happens here