solidity/test/libsolidity/smtCheckerTests/operators/unary_sub_array.sol

22 lines
417 B
Solidity
Raw Normal View History

contract C
{
uint[] array;
2021-03-23 18:15:14 +00:00
function p() public { array.push(); }
function f(uint x) public {
2021-03-23 18:15:14 +00:00
require(x < array.length);
array[x] = 5;
uint a = --array[x];
assert(array[x] == 4);
assert(a == 4);
uint b = array[x]--;
assert(array[x] == 3);
// Should fail.
assert(b > 4);
}
}
// ====
2021-03-31 15:11:54 +00:00
// SMTEngine: all
// SMTIgnoreCex: yes
// ----
2021-03-31 15:11:54 +00:00
// Warning 6328: (275-288): CHC: Assertion violation happens here.