mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
20 lines
450 B
Solidity
20 lines
450 B
Solidity
|
// A long time ago, some opcodes were renamed, which involved the opcodes
|
||
|
// "iszero" and "not".
|
||
|
contract C {
|
||
|
function f() public returns (bool) {
|
||
|
bytes32 x = bytes32(uint256(1));
|
||
|
assembly {
|
||
|
x := not(x)
|
||
|
}
|
||
|
if (x != ~bytes32(uint256(1))) return false;
|
||
|
assembly {
|
||
|
x := iszero(x)
|
||
|
}
|
||
|
if (x != bytes32(0)) return false;
|
||
|
return true;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
// ----
|
||
|
// f() -> true
|