solidity/test/libsolidity/semanticTests/inlineAssembly/inline_assembly_in_modifiers.sol
Alex Beregszaszi 28e65bac46 Add unimplemented assert for modifiers in the IR
Also improved relevant tests for modifiers to be more strict and detect if the modifier body was skipped.
2020-11-27 18:34:17 +00:00

34 lines
530 B
Solidity

contract C {
modifier m {
uint256 a = 1;
assembly {
a := 2
}
if (a != 2) revert();
_;
}
function f() public m returns (bool) {
return true;
}
modifier n {
uint256 a = 1;
assembly {
a := 2
}
if (a != 2)
_;
revert();
}
function g() public n returns (bool) {
// This statement should never execute.
return true;
}
}
// ----
// f() -> true
// g() -> FAILURE