solidity/test/cmdlineTests/optimizer_inliner_add/input.sol

18 lines
306 B
Solidity
Raw Normal View History

2021-01-14 12:02:14 +00:00
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.0;
function unsafe_add(uint x, uint y) pure returns (uint)
{
unchecked {
return x + y;
}
}
contract C {
function f() public pure {
for(uint x = 0; x < 10; x = unsafe_add(x, unsafe_add(x, 1)))
{
}
}
}