solidity/test/libsolidity/semanticTests/array/fixed_array_cleanup.sol

22 lines
445 B
Solidity
Raw Normal View History

contract c {
uint spacer1;
uint spacer2;
uint[20] data;
function fill() public {
for (uint i = 0; i < data.length; ++i) data[i] = i+1;
}
function clear() public { delete data; }
}
// ====
// compileToEwasm: also
2021-02-12 12:45:15 +00:00
// compileViaYul: also
// ----
// storageEmpty -> 1
// fill() ->
// gas irOptimized: 465878
// gas legacy: 471460
// gas legacyOptimized: 467520
// storageEmpty -> 0
// clear() ->
// storageEmpty -> 1