solidity/test/libsolidity/semanticTests/viaYul/array_storage_push_empty.sol
Paweł Bylica c4b6f5f00b
test: Properly clear storage dirty flag
Clear storage dirty flag between transactions in EVMHost. The EIP-2200
dirty flag should be persisted only in a single transaction.
2022-11-08 18:13:17 +01:00

26 lines
653 B
Solidity

contract C {
uint256[] storageArray;
function pushEmpty(uint256 len) public {
while(storageArray.length < len)
storageArray.push();
for (uint i = 0; i < len; i++)
require(storageArray[i] == 0);
}
}
// ====
// EVMVersion: >=petersburg
// ----
// pushEmpty(uint256): 128
// gas irOptimized: 406798
// gas legacy: 416903
// gas legacyOptimized: 398280
// pushEmpty(uint256): 256
// gas irOptimized: 693826
// gas legacy: 717115
// gas legacyOptimized: 690172
// pushEmpty(uint256): 38869 -> FAILURE # out-of-gas #
// gas irOptimized: 100000000
// gas legacy: 100000000
// gas legacyOptimized: 100000000