solidity/test/libsolidity/semanticTests/array/array_storage_push_empty.sol
Matheus Aguiar af116a9500 Update tests
2023-09-22 17:11:50 -03: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: 401024
// gas legacy: 400640
// gas legacyOptimized: 388804
// pushEmpty(uint256): 256
// gas irOptimized: 683700
// gas legacy: 685108
// gas legacyOptimized: 671480
// pushEmpty(uint256): 38869 -> FAILURE # out-of-gas #
// gas irOptimized: 100000000
// gas legacy: 100000000
// gas legacyOptimized: 100000000