mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
151e637336
- simplifications for GasLeft, Selfdestruct and BlockHash. - add support for addmod & mulmod.
27 lines
512 B
Solidity
27 lines
512 B
Solidity
contract C {
|
|
function f(uint256 d) public pure returns (uint256) {
|
|
addmod(1, 2, d);
|
|
return 2;
|
|
}
|
|
|
|
function g(uint256 d) public pure returns (uint256) {
|
|
mulmod(1, 2, d);
|
|
return 2;
|
|
}
|
|
|
|
function h() public pure returns (uint256) {
|
|
mulmod(0, 1, 2);
|
|
mulmod(1, 0, 2);
|
|
addmod(0, 1, 2);
|
|
addmod(1, 0, 2);
|
|
return 2;
|
|
}
|
|
}
|
|
|
|
// ====
|
|
// compileViaYul: also
|
|
// ----
|
|
// f(uint256): 0 -> FAILURE
|
|
// g(uint256): 0 -> FAILURE
|
|
// h() -> 2
|