diff --git a/test/libyul/yulOptimizerTests/loadResolver/merge_with_rewrite.yul b/test/libyul/yulOptimizerTests/loadResolver/merge_with_rewrite.yul new file mode 100644 index 000000000..ebe65992a --- /dev/null +++ b/test/libyul/yulOptimizerTests/loadResolver/merge_with_rewrite.yul @@ -0,0 +1,23 @@ +{ + mstore(2, 3) + if calldataload(1) { + mstore(2, 7) + // Re-writing the old value, should allow to eliminate the load below. + mstore(2, 3) + } + sstore(0, mload(2)) +} +// ==== +// step: loadResolver +// ---- +// { +// let _1 := 3 +// let _2 := 2 +// mstore(_2, _1) +// if calldataload(1) +// { +// mstore(_2, 7) +// mstore(_2, _1) +// } +// sstore(0, _1) +// }