diff --git a/test/libyul/yulOptimizerTests/fullSuite/medium.yul b/test/libyul/yulOptimizerTests/fullSuite/medium.yul index bebb8c418..a27acf809 100644 --- a/test/libyul/yulOptimizerTests/fullSuite/medium.yul +++ b/test/libyul/yulOptimizerTests/fullSuite/medium.yul @@ -21,11 +21,10 @@ // ---- // { // { -// let _1 := 0x40 -// mstore(_1, add(mload(_1), 0x20)) -// let p := mload(_1) -// mstore(_1, add(p, _1)) -// mstore(add(p, 96), 2) -// mstore(_1, 0x20) +// let _1 := mload(0x40) +// mstore(0x40, add(_1, 0x20)) +// mstore(0x40, add(_1, 96)) +// mstore(add(_1, 128), 2) +// mstore(0x40, 0x20) // } // } diff --git a/test/libyul/yulOptimizerTests/fullSuite/storage.yul b/test/libyul/yulOptimizerTests/fullSuite/storage.yul index 9867345fa..4daff379f 100644 --- a/test/libyul/yulOptimizerTests/fullSuite/storage.yul +++ b/test/libyul/yulOptimizerTests/fullSuite/storage.yul @@ -10,6 +10,6 @@ // { // sstore(4, 5) // sstore(4, 3) -// sstore(8, sload(4)) +// sstore(8, 3) // } // } diff --git a/test/libyul/yulOptimizerTests/loadResolver/loop.yul b/test/libyul/yulOptimizerTests/loadResolver/loop.yul new file mode 100644 index 000000000..4f7b27734 --- /dev/null +++ b/test/libyul/yulOptimizerTests/loadResolver/loop.yul @@ -0,0 +1,18 @@ +{ + sstore(0, 123213) + for {let x := 0 let y} lt(x, sload(0)) { + x := add(x, 1)} {y := add(x, y) + } +} +// ==== +// step: loadResolver +// ---- +// { +// let _1 := 123213 +// let _2 := 0 +// sstore(_2, _1) +// let x := _2 +// let y +// for { } lt(x, _1) { x := add(x, 1) } +// { y := add(x, y) } +// } diff --git a/test/libyul/yulOptimizerTests/loadResolver/memory_with_different_kinds_of_invalidation.yul b/test/libyul/yulOptimizerTests/loadResolver/memory_with_different_kinds_of_invalidation.yul index 65312c8b4..a9487afa7 100644 --- a/test/libyul/yulOptimizerTests/loadResolver/memory_with_different_kinds_of_invalidation.yul +++ b/test/libyul/yulOptimizerTests/loadResolver/memory_with_different_kinds_of_invalidation.yul @@ -31,5 +31,5 @@ // mstore8(calldataload(_5), 4) // sstore(_5, mload(_2)) // mstore(_2, _17) -// sstore(_5, mload(_2)) +// sstore(_5, _17) // } diff --git a/test/libyul/yulOptimizerTests/loadResolver/side_effects_of_user_functions.yul b/test/libyul/yulOptimizerTests/loadResolver/side_effects_of_user_functions.yul new file mode 100644 index 000000000..b07883c3a --- /dev/null +++ b/test/libyul/yulOptimizerTests/loadResolver/side_effects_of_user_functions.yul @@ -0,0 +1,28 @@ +{ + function stores() { mstore(0, 1) } + function reads() { sstore(9, mload(7)) } + + mstore(2, 9) + reads() + sstore(0, mload(2)) + stores() + sstore(0, mload(2)) +} +// ==== +// step: loadResolver +// ---- +// { +// function stores() +// { mstore(0, 1) } +// function reads() +// { sstore(9, mload(7)) } +// let _6 := 9 +// let _7 := 2 +// mstore(_7, _6) +// reads() +// let _9 := _6 +// let _10 := 0 +// sstore(_10, _9) +// stores() +// sstore(_10, mload(_7)) +// }