Skip to content

Commit c987b2b

Browse files
committed
Add test
1 parent 2b6253a commit c987b2b

2 files changed

Lines changed: 36 additions & 0 deletions

File tree

test/libyul/YulOptimizerTestCommon.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,16 @@ YulOptimizerTestCommon::YulOptimizerTestCommon(std::shared_ptr<Object const> _ob
311311
ExpressionJoiner::run(*m_context, block);
312312
return block;
313313
}},
314+
{"unusedStoreEliminatorNoSsaTransform", [&]() {
315+
auto block = disambiguate();
316+
updateContext(block);
317+
ForLoopInitRewriter::run(*m_context, block);
318+
ExpressionSplitter::run(*m_context, block);
319+
UnusedStoreEliminator::run(*m_context, block);
320+
SSAReverser::run(*m_context, block);
321+
ExpressionJoiner::run(*m_context, block);
322+
return block;
323+
}},
314324
{"equalStoreEliminator", [&]() {
315325
auto block = disambiguate();
316326
updateContext(block);
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
let x := calldataload(4)
3+
let x_5 := x
4+
let a := add(x_5, 32)
5+
x := add(x_5, 32)
6+
let b := x
7+
let outLen := 32
8+
mstore(a, 0xAA)
9+
return(b, outLen)
10+
}
11+
12+
// ----
13+
// step: unusedStoreEliminatorNoSsaTransform
14+
//
15+
// {
16+
// {
17+
// let x := calldataload(4)
18+
// let x_5 := x
19+
// let a := add(x_5, 32)
20+
// x := add(x_5, 32)
21+
// let b := x
22+
// let outLen := 32
23+
// mstore(a, 0xAA)
24+
// return(b, outLen)
25+
// }
26+
// }

0 commit comments

Comments
 (0)