solidity/test/libsolidity/semanticTests/modifiers/break_in_modifier.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

21 lines
323 B
Solidity

contract C {
uint256 public x;
modifier run() {
for (uint256 i = 0; i < 10; i++) {
_;
if (i == 1)
break;
}
}
function f() public run {
uint256 k = x;
uint256 t = k + 1;
x = t;
}
}
// ----
// x() -> 0
// f() ->
// x() -> 2