solidity/test/libsolidity/semanticTests/viaYul/array_storage_push_empty.sol
Alex Beregszaszi 159f50e189 Turn on semantic tests for the old codegen where possible
These were marked IR-only, but they do pass on the old codegen too.

Also add old codegen version of semantictests/revertStrings/function_entry_checks.
2020-11-25 14:33:39 +00:00

17 lines
426 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);
}
}
// ====
// compileViaYul: also
// EVMVersion: >=petersburg
// ----
// pushEmpty(uint256): 128
// pushEmpty(uint256): 256
// pushEmpty(uint256): 32768 -> FAILURE # out-of-gas #