solidity/test/libyul/yulOptimizerTests/fullSuite/medium.yul

30 lines
659 B
Plaintext
Raw Normal View History

2018-10-16 19:39:22 +00:00
{
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)
if 0 {
mstore(0x40, 0x20)
}
if sub(2,1) {
for { switch mul(1,2) case 2 { mstore(0x40, 0x20) } } sub(1,1) {} { mstore(0x80, 0x40) }
}
2021-08-17 20:50:27 +00:00
sstore(0, array_index_access(x, 3))
sstore(1, mload(0x40))
2018-10-16 19:39:22 +00:00
}
// ----
// step: fullSuite
//
2018-10-16 19:39:22 +00:00
// {
// {
2021-05-05 16:02:35 +00:00
// sstore(0, add(mload(0x40), 128))
2021-08-17 20:50:27 +00:00
// sstore(1, 0x20)
// }
2018-10-16 19:39:22 +00:00
// }