mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
25 lines
512 B
Solidity
25 lines
512 B
Solidity
contract C {
|
|
uint[] b;
|
|
|
|
function f() public {
|
|
require(b.length == 0);
|
|
b.push() = 1;
|
|
assert(b[0] == 1);
|
|
}
|
|
|
|
function g() public {
|
|
b.push() = 1;
|
|
assert(b[b.length - 1] == 1);
|
|
// Fails
|
|
assert(b[b.length - 1] == 100);
|
|
}
|
|
|
|
}
|
|
// ====
|
|
// SMTEngine: all
|
|
// SMTIgnoreCex: yes
|
|
// SMTIgnoreOS: macos
|
|
// ----
|
|
// Warning 6328: (199-229): CHC: Assertion violation happens here.
|
|
// Info 1391: CHC: 7 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them.
|