aboutsummaryrefslogtreecommitdiffstats
path: root/test/libyul/yulOptimizerTests/redundantAssignEliminator/for_branch.yul
blob: 7f5e97ce8dbe7db21caf1d8a428f2c6945c8117f (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
28
29
30
31
{
    let x
    let y
    // Cannot be removed, because we might skip the loop
    x := 1
    for { } calldataload(0) { }
    {
        // Cannot be removed
        x := 2
        // Can be removed
        y := 3
    }
    y := 8
    mstore(x, 0)
}
// ----
// redundantAssignEliminator
// {
//     let x
//     let y
//     x := 1
//     for {
//     }
//     calldataload(0)
//     {
//     }
//     {
//         x := 2
//     }
//     mstore(x, 0)
// }