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

24 lines
420 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] = 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);
}
}
// ====
2021-03-31 15:11:54 +00:00
// SMTEngine: all
// SMTIgnoreCex: yes
// ----
2021-03-31 15:11:54 +00:00
// Warning 6328: (278-291): CHC: Assertion violation happens here.