2019-05-21 12:40:28 +00:00
|
|
|
contract C {
|
2020-11-24 23:25:42 +00:00
|
|
|
// If these two functions are identical, the optimiser
|
|
|
|
// on the old codegen path can deduplicate them, and breaking the test.
|
2019-05-21 12:40:28 +00:00
|
|
|
function internal1() internal pure returns (bool) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
function internal2() internal pure returns (bool) {
|
2020-11-24 23:25:42 +00:00
|
|
|
return false;
|
2019-05-21 12:40:28 +00:00
|
|
|
}
|
|
|
|
|
2019-05-22 10:25:00 +00:00
|
|
|
function equal() public pure returns (bool same, bool diff, bool inv) {
|
|
|
|
function() internal pure returns (bool) invalid;
|
|
|
|
delete invalid;
|
2019-05-21 12:40:28 +00:00
|
|
|
same = internal1 == internal1;
|
|
|
|
diff = internal1 == internal2;
|
2019-05-22 10:25:00 +00:00
|
|
|
inv = internal1 == invalid;
|
2019-05-21 12:40:28 +00:00
|
|
|
}
|
|
|
|
|
2019-05-22 10:25:00 +00:00
|
|
|
function unequal() public pure returns (bool same, bool diff, bool inv) {
|
|
|
|
function() internal pure returns (bool) invalid;
|
|
|
|
delete invalid;
|
2019-05-21 12:40:28 +00:00
|
|
|
same = internal1 != internal1;
|
|
|
|
diff = internal1 != internal2;
|
2019-05-22 10:25:00 +00:00
|
|
|
inv = internal1 != invalid;
|
2019-05-21 12:40:28 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
// ====
|
2020-11-21 13:54:16 +00:00
|
|
|
// compileToEwasm: also
|
2021-03-12 23:02:36 +00:00
|
|
|
// compileViaYul: also
|
2019-05-21 12:40:28 +00:00
|
|
|
// ----
|
2019-05-22 10:25:00 +00:00
|
|
|
// equal() -> true, false, false
|
|
|
|
// unequal() -> false, true, true
|