aboutsummaryrefslogtreecommitdiffstats
path: root/test/libyul/yulOptimizerTests/fullSuite/medium.yul
blob: 47812fa8c0d9a1c5837e0ff9b8fb08bd27cfd869 (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
{
    function allocate(size) -> p {
        p := mload(0x40)
        mstore(0x40, add(p, size))
    }
    function array_index_access(array, index) -> p {
        p := add(array, mul(index, 0x20))
    }
    pop(allocate(0x20))
    let x := allocate(0x40)
    mstore(array_index_access(x, 3), 2)
}
// ----
// fullSuite
// {
//     {
//         let _18 := 0x20
//         let allocate__7 := 0x40
//         let allocate_p_12 := mload(allocate__7)
//         mstore(allocate__7, add(allocate_p_12, _18))
//         pop(allocate_p_12)
//         let allocate_p_12_31 := mload(allocate__7)
//         mstore(allocate__7, add(allocate_p_12_31, allocate__7))
//         mstore(add(allocate_p_12_31, 96), 2)
//     }
// }