aboutsummaryrefslogtreecommitdiffstats
path: root/test/libyul/yulOptimizerTests/fullInliner/multi_fun_callback.yul
blob: 6e4acb979949b4da7303393c2135f5c0b18d49fc (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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
{
    // This is a test for an older version where
    // inlining was performed on a function
    // just being called. This is a problem
    // because the statemenst of the original
    // function might be in an invalid state.

    function f(x) {
        mstore(0, x)
        mstore(7, h())
        g(10)
        mstore(1, x)
    }
    function g(x) {
        f(1)
    }
    function h() -> t {
        t := 2

    }
    {
        f(100)
    }
}
// ----
// fullInliner
// {
//     {
//         {
//             let f_x := 100
//             mstore(0, f_x)
//             mstore(7, h())
//             g(10)
//             mstore(1, f_x)
//         }
//     }
//     function f(x)
//     {
//         mstore(0, x)
//         let h_t := 0
//         h_t := 2
//         mstore(7, h_t)
//         let g_x_1 := 10
//         let g_f_x_8 := 1
//         mstore(0, g_f_x_8)
//         mstore(7, h())
//         g(10)
//         mstore(1, g_f_x_8)
//         mstore(1, x)
//     }
//     function g(x_1)
//     {
//         let f_x_8 := 1
//         mstore(0, f_x_8)
//         mstore(7, h())
//         g(10)
//         mstore(1, f_x_8)
//     }
//     function h() -> t
//     {
//         t := 2
//     }
// }