solidity/test/libsolidity/semanticTests/various/flipping_sign_tests.sol

14 lines
232 B
Solidity
Raw Normal View History

contract test {
function f() public returns (bool) {
int256 x = -2**255;
2020-09-15 14:16:30 +00:00
unchecked { assert(-x == x); }
return true;
}
}
// ====
// compileViaYul: also
2021-04-23 15:59:01 +00:00
// compileToEwasm: also
// ----
// f() -> true