solidity/test/libsolidity/semanticTests/viaYul/copy_struct_invalid_ir_bug.sol
Nikola Matic fdc6699159 Rematerialize zero literals with default cleanup sequence
Add unused pruner step to the end of the default cleanup sequence
2023-09-04 15:40:33 +02:00

27 lines
403 B
Solidity

contract C {
struct Struct {
function () external el;
}
Struct[] array;
int externalCalled = 0;
function ext() external {
externalCalled++;
}
function f() public {
array.push(Struct(this.ext));
array.push(array[0]);
array[0].el();
array[1].el();
assert(externalCalled == 2);
}
}
// ----
// f() ->
// gas irOptimized: 112969
// gas legacy: 112890
// gas legacyOptimized: 112580