mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
21 lines
530 B
Solidity
21 lines
530 B
Solidity
|
pragma experimental SMTChecker;
|
||
|
|
||
|
contract LoopFor2 {
|
||
|
function testUnboundedForLoop(uint n, uint[] memory b, uint[] memory c) public pure {
|
||
|
b[0] = 900;
|
||
|
uint[] memory a = b;
|
||
|
require(n > 0 && n < 100);
|
||
|
for (uint i = 0; i < n; i += 1) {
|
||
|
b[i] = i + 1;
|
||
|
c[i] = b[i];
|
||
|
}
|
||
|
assert(b[0] == c[0]);
|
||
|
assert(a[0] == 900);
|
||
|
assert(b[0] == 900);
|
||
|
}
|
||
|
}
|
||
|
// ----
|
||
|
// Warning: (281-301): Assertion violation happens here
|
||
|
// Warning: (305-324): Assertion violation happens here
|
||
|
// Warning: (328-347): Assertion violation happens here
|