2020-05-05 11:25:53 +00:00
|
|
|
contract C {
|
|
|
|
function eq() public pure returns (bool) {
|
|
|
|
uint8 x = 1; uint8 y;
|
|
|
|
assembly { y := 0x0101 }
|
|
|
|
return (x == y);
|
|
|
|
}
|
|
|
|
function neq() public pure returns (bool) {
|
|
|
|
uint8 x = 1; uint8 y;
|
|
|
|
assembly { y := 0x0101 }
|
|
|
|
return (x != y);
|
|
|
|
}
|
|
|
|
function geq() public pure returns (bool) {
|
|
|
|
uint8 x = 1; uint8 y;
|
|
|
|
assembly { y := 0x0101 }
|
|
|
|
return (x >= y);
|
|
|
|
}
|
|
|
|
function leq() public pure returns (bool) {
|
|
|
|
uint8 x = 2; uint8 y;
|
|
|
|
assembly { y := 0x0101 }
|
|
|
|
return (x <= y);
|
|
|
|
}
|
|
|
|
function gt() public pure returns (bool) {
|
|
|
|
uint8 x = 2; uint8 y;
|
|
|
|
assembly { y := 0x0101 }
|
|
|
|
return (x > y);
|
|
|
|
}
|
|
|
|
function lt() public pure returns (bool) {
|
|
|
|
uint8 x = 1; uint8 y;
|
|
|
|
assembly { y := 0x0101 }
|
|
|
|
return (x < y);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// ====
|
|
|
|
// compileViaYul: also
|
2020-11-21 13:54:16 +00:00
|
|
|
// compileToEwasm: also
|
2020-05-05 11:25:53 +00:00
|
|
|
// ----
|
|
|
|
// eq() -> true
|
|
|
|
// neq() -> false
|
|
|
|
// geq() -> true
|
|
|
|
// leq() -> false
|
|
|
|
// gt() -> true
|
|
|
|
// lt() -> false
|