solidity/test/libsolidity/semanticTests/arithmetics/checked_add_v2.sol

14 lines
346 B
Solidity
Raw Normal View History

2021-05-14 18:17:41 +00:00
pragma abicoder v2;
2020-09-30 22:13:03 +00:00
contract C {
function f(uint16 a, uint16 b) public returns (uint16) {
return a + b;
}
}
// ====
2021-05-14 18:17:41 +00:00
// compileViaYul: also
2020-09-30 22:13:03 +00:00
// ----
// f(uint16,uint16): 65534, 0 -> 0xfffe
2021-05-14 18:17:41 +00:00
// f(uint16,uint16): 65536, 0 -> FAILURE
2020-09-30 22:13:03 +00:00
// f(uint16,uint16): 65535, 0 -> 0xffff
2020-10-13 11:28:39 +00:00
// f(uint16,uint16): 65535, 1 -> FAILURE, hex"4e487b71", 0x11