solidity/test/cmdlineTests/constant_optimizer_yul/input.sol
hrkrshnn 6d9e9e1b1e Fix small bug in GasMeter calculation in creation context
Old calculation did not ignore `optimize-runs` parameter, when creation code gas computations were
done. This would lead to expanding values such as `shl(180, 1)` inside constructor code, even for
the default value for `--optimize-runs`, i.e., 200.
2021-03-17 12:33:10 +01:00

17 lines
419 B
Solidity

// SPDX-License-Identifier: GPL-v3
pragma solidity >= 0.0.0;
contract C {
constructor () {
assembly {
// This shl should not be evaluated for all values of optimize-runs
sstore(0, shl(180, 1))
}
}
fallback() external {
assembly {
// This shl would be evaluated for high values of optimize-runs
sstore(0, shl(180, 1))
}
}
}