2019-04-30 17:08:02 +00:00
|
|
|
contract C {
|
|
|
|
function f(bool a) public pure returns (bool x) {
|
|
|
|
bool b = a;
|
|
|
|
x = b;
|
|
|
|
assert(b);
|
|
|
|
}
|
|
|
|
function fail() public pure returns (bool x) {
|
|
|
|
x = true;
|
|
|
|
assert(false);
|
|
|
|
}
|
|
|
|
function succeed() public pure returns (bool x) {
|
|
|
|
x = true;
|
|
|
|
assert(true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// ====
|
2020-11-21 13:54:16 +00:00
|
|
|
// compileToEwasm: also
|
2021-03-12 23:02:36 +00:00
|
|
|
// compileViaYul: also
|
2019-04-30 17:08:02 +00:00
|
|
|
// ----
|
|
|
|
// f(bool): true -> true
|
2020-10-13 11:28:39 +00:00
|
|
|
// f(bool): false -> FAILURE, hex"4e487b71", 0x01
|
|
|
|
// fail() -> FAILURE, hex"4e487b71", 0x01
|
2019-04-30 17:08:02 +00:00
|
|
|
// succeed() -> true
|