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

33 lines
518 B
Plaintext
Raw Normal View History

{
// Cannot be removed, because we might run the loop only once
let x := 1
for { } calldataload(0) { }
{
if callvalue() {
x := 2 // is preserved because of continue stmt below.
continue
}
x := 3
}
mstore(x, 0x42)
}
// ----
// redundantAssignEliminator
// {
// let x := 1
// for {
// }
// calldataload(0)
// {
// }
// {
// if callvalue()
// {
// x := 2
// continue
// }
// x := 3
// }
// mstore(x, 0x42)
// }