solidity/test/libsolidity/semanticTests/immutable/use_scratch.sol
Matheus Aguiar 562b6ea7a8 Update tests
2023-08-24 15:33:21 -03:00

23 lines
396 B
Solidity

contract C {
uint256 immutable x;
uint256 immutable y;
mapping(uint => uint) public m;
constructor(uint _a) {
x = 42;
y = 23;
m[_a] = 7;
new uint[](4);
}
function f() public view returns (uint256, uint256) {
return (x+x,y);
}
}
// ----
// constructor(): 3 ->
// gas irOptimized: 123542
// gas legacy: 197644
// gas legacyOptimized: 138326
// f() -> 84, 23
// m(uint256): 3 -> 7