solidity/test/libsolidity/semanticTests/structs/struct_copy_via_local.sol

27 lines
495 B
Solidity
Raw Normal View History

contract c {
struct Struct {
uint256 a;
uint256 b;
}
uint[75] r;
Struct data1;
Struct data2;
function test() public returns (bool) {
data1.a = 1;
data1.b = 2;
Struct memory x = data1;
data2 = x;
return data2.a == data1.a && data2.b == data1.b;
}
}
// ====
// compileToEwasm: also
2021-02-12 12:45:15 +00:00
// compileViaYul: also
// ----
// test() -> true
2021-07-01 12:17:27 +00:00
// gas irOptimized: 110144
// gas legacy: 110627
// gas legacyOptimized: 109706