solidity/test/libsolidity/semanticTests/viaYul/array_storage_length_access.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

19 lines
553 B
Solidity

contract C {
uint[] storageArray;
function set_get_length(uint256 len) public returns (uint256) {
while(storageArray.length < len)
storageArray.push();
return storageArray.length;
}
}
// ====
// compileViaYul: also
// ----
// set_get_length(uint256): 0 -> 0
// set_get_length(uint256): 1 -> 1
// set_get_length(uint256): 10 -> 10
// set_get_length(uint256): 20 -> 20
// set_get_length(uint256): 0xFF -> 0xFF
// set_get_length(uint256): 0xFFF -> 0xFFF
// set_get_length(uint256): 0xFFFFF -> FAILURE # Out-of-gas #