aboutsummaryrefslogtreecommitdiffstats
path: root/test/libyul/yulOptimizerTests/fullInliner/inside_condition.yul
blob: 9e6c4e76fcd0db73c6494864744634aa763dac05 (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
// This tests that splitting the expression inside the condition works properly.
{
    if gt(f(mload(1)), mload(0)) {
        sstore(0, 2)
    }
    function f(a) -> r {
        a := mload(a)
        r := add(a, calldatasize())
    }
}
// ----
// fullInliner
// {
//     {
//         let _2 := mload(0)
//         let f_a := mload(1)
//         let f_r := 0
//         f_a := mload(f_a)
//         f_r := add(f_a, calldatasize())
//         if gt(f_r, _2)
//         {
//             sstore(0, 2)
//         }
//     }
//     function f(a) -> r
//     {
//         a := mload(a)
//         r := add(a, calldatasize())
//     }
// }