2019-04-02 10:59:19 +00:00
|
|
|
pragma experimental SMTChecker;
|
|
|
|
|
|
|
|
contract C
|
|
|
|
{
|
|
|
|
uint[] array;
|
2021-03-23 18:15:14 +00:00
|
|
|
function p() public {
|
|
|
|
array.push();
|
|
|
|
}
|
2019-04-02 10:59:19 +00:00
|
|
|
function f(uint x) public {
|
2021-03-23 18:15:14 +00:00
|
|
|
require(x < array.length);
|
2019-04-02 10:59:19 +00:00
|
|
|
array[x] = 2;
|
|
|
|
uint a = ++array[x];
|
|
|
|
assert(array[x] == 3);
|
|
|
|
assert(a == 3);
|
|
|
|
uint b = array[x]++;
|
|
|
|
assert(array[x] == 4);
|
|
|
|
// Should fail.
|
|
|
|
assert(b < 3);
|
|
|
|
}
|
|
|
|
}
|
2020-12-29 10:53:35 +00:00
|
|
|
// ====
|
|
|
|
// SMTIgnoreCex: yes
|
2019-04-02 10:59:19 +00:00
|
|
|
// ----
|
2021-03-23 18:15:14 +00:00
|
|
|
// Warning 6328: (311-324): CHC: Assertion violation happens here.
|