aboutsummaryrefslogtreecommitdiffstats
path: root/test/libyul/yulOptimizerTests/redundantAssignEliminator/for_rerun.yul
blob: 65eb2838a675c7f7d519f99ae0638fcf414f5545 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
{
    let x
    // Cannot be removed, because we might run the loop only once
    x := 1
    for { } calldataload(0) { }
    {
        mstore(x, 2)
        // Cannot be removed because of the line above
        x := 2
    }
    x := 3
}
// ----
// redundantAssignEliminator
// {
//     let x
//     x := 1
//     for {
//     }
//     calldataload(0)
//     {
//     }
//     {
//         mstore(x, 2)
//         x := 2
//     }
// }