solidity/test/libsolidity/semanticTests/viaYul/copy_struct_invalid_ir_bug.sol
Matheus Aguiar 562b6ea7a8 Update tests
2023-08-24 15:33:21 -03: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: 112980
// gas legacy: 112888
// gas legacyOptimized: 112580