diff --git a/test/libyul/yulOptimizerTests/loadResolver/mstore_in_function_loop_body.yul b/test/libyul/yulOptimizerTests/loadResolver/mstore_in_function_loop_body.yul new file mode 100644 index 000000000..2de873942 --- /dev/null +++ b/test/libyul/yulOptimizerTests/loadResolver/mstore_in_function_loop_body.yul @@ -0,0 +1,35 @@ +{ + function userNot(x) -> y { + y := iszero(x) + } + + function funcWithLoop(x) { + for {} userNot(x) { mstore(0, 0) } {} + } + + mstore(0, 1337) + funcWithLoop(42) + sstore(0, mload(0)) +} +// ==== +// step: loadResolver +// ---- +// { +// function userNot(x) -> y +// { y := iszero(x) } +// function funcWithLoop(x_1) +// { +// for { } +// userNot(x_1) +// { +// let _1 := 0 +// mstore(_1, _1) +// } +// { } +// } +// let _3 := 1337 +// let _4 := 0 +// mstore(_4, _3) +// funcWithLoop(42) +// sstore(_4, mload(_4)) +// } diff --git a/test/libyul/yulOptimizerTests/loadResolver/mstore_in_function_loop_init.yul b/test/libyul/yulOptimizerTests/loadResolver/mstore_in_function_loop_init.yul new file mode 100644 index 000000000..1e06cf8df --- /dev/null +++ b/test/libyul/yulOptimizerTests/loadResolver/mstore_in_function_loop_init.yul @@ -0,0 +1,32 @@ +{ + function userNot(x) -> y { + y := iszero(x) + } + + function funcWithLoop(x) { + for { mstore(0, 0) } userNot(x) {} {} + } + + mstore(0, 1337) + funcWithLoop(42) + sstore(0, mload(0)) +} +// ==== +// step: loadResolver +// ---- +// { +// function userNot(x) -> y +// { y := iszero(x) } +// function funcWithLoop(x_1) +// { +// let _1 := 0 +// mstore(_1, _1) +// for { } userNot(x_1) { } +// { } +// } +// let _3 := 1337 +// let _4 := 0 +// mstore(_4, _3) +// funcWithLoop(42) +// sstore(_4, mload(_4)) +// }