solidity/test/libsolidity/semanticTests/viaYul/array_storage_push_empty.sol
Daniel Kirchner 2a7181ecb2 Test updates.
2022-09-09 14:38:34 +02: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: 403598
// gas legacy: 401543
// gas legacyOptimized: 389576
// pushEmpty(uint256): 256
// gas irOptimized: 684626
// gas legacy: 683595
// gas legacyOptimized: 669964
// pushEmpty(uint256): 38869 -> FAILURE # out-of-gas #
// gas irOptimized: 100000000
// gas legacy: 100000000
// gas legacyOptimized: 100000000