2020-11-03 15:52:04 +00:00
|
|
|
library L {
|
|
|
|
struct S { uint x; uint y; }
|
|
|
|
function f(uint[] storage r, S storage s) public returns (uint, uint, uint, uint) {
|
|
|
|
r[2] = 8;
|
|
|
|
s.x = 7;
|
|
|
|
return (r[0], r[1], s.x, s.y);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
contract C {
|
|
|
|
uint8 x = 3;
|
|
|
|
L.S s;
|
|
|
|
uint[] r;
|
|
|
|
function f() public returns (uint, uint, uint, uint, uint, uint) {
|
|
|
|
r = new uint[](6);
|
|
|
|
r[0] = 1;
|
|
|
|
r[1] = 2;
|
|
|
|
r[2] = 3;
|
|
|
|
s.x = 11;
|
|
|
|
s.y = 12;
|
|
|
|
(uint a, uint b, uint c, uint d) = L.f(r, s);
|
|
|
|
return (r[2], s.x, a, b, c, d);
|
|
|
|
}
|
|
|
|
}
|
2021-01-11 13:51:33 +00:00
|
|
|
// ====
|
|
|
|
// compileViaYul: also
|
2020-11-03 15:52:04 +00:00
|
|
|
// ----
|
|
|
|
// library: L
|
|
|
|
// f() -> 8, 7, 1, 2, 7, 12
|
2022-01-14 12:37:40 +00:00
|
|
|
// gas irOptimized: 167691
|
2021-10-27 15:26:44 +00:00
|
|
|
// gas legacy: 169347
|
2021-11-04 17:20:10 +00:00
|
|
|
// gas legacyOptimized: 167269
|