solidity/test/libyul/yulOptimizerTests/redundantAssignEliminator/for_break.yul

32 lines
555 B
Plaintext
Raw Normal View History

{
let x
// Cannot be removed, because we might skip the loop
x := 1
for { } calldataload(0) { }
{
if callvalue() {
x := 2 // is preserved because of break stmt below.
break
}
x := 3
}
mstore(x, 0x42)
}
2019-04-01 14:33:46 +00:00
// ====
// step: redundantAssignEliminator
// ----
// {
// let x
// x := 1
// for { } calldataload(0) { }
// {
// if callvalue()
// {
// x := 2
// break
// }
// x := 3
// }
// mstore(x, 0x42)
// }