aboutsummaryrefslogtreecommitdiffstats
path: root/test/libyul/yulOptimizerTests/fullSuite/medium.yul
diff options
context:
space:
mode:
authorDaniel Kirchner <daniel@ekpyron.org>2018-12-04 00:19:37 +0800
committerDaniel Kirchner <daniel@ekpyron.org>2018-12-07 01:37:35 +0800
commit1eb60cbb3952df395df79ca1737f41708a658d4b (patch)
tree7c48065a0c5f14cac3f22559f5d91544020de859 /test/libyul/yulOptimizerTests/fullSuite/medium.yul
parent4b2a64306a6b85407210245a47a7df1e0a5e0cbf (diff)
downloaddexon-solidity-1eb60cbb3952df395df79ca1737f41708a658d4b.tar.gz
dexon-solidity-1eb60cbb3952df395df79ca1737f41708a658d4b.tar.zst
dexon-solidity-1eb60cbb3952df395df79ca1737f41708a658d4b.zip
Add structural simplifier as optimization step for Yul.
Diffstat (limited to 'test/libyul/yulOptimizerTests/fullSuite/medium.yul')
-rw-r--r--test/libyul/yulOptimizerTests/fullSuite/medium.yul19
1 files changed, 13 insertions, 6 deletions
diff --git a/test/libyul/yulOptimizerTests/fullSuite/medium.yul b/test/libyul/yulOptimizerTests/fullSuite/medium.yul
index deb02068..fbe243d4 100644
--- a/test/libyul/yulOptimizerTests/fullSuite/medium.yul
+++ b/test/libyul/yulOptimizerTests/fullSuite/medium.yul
@@ -9,16 +9,23 @@
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) }
+ }
}
// ----
// fullSuite
// {
// {
-// let _18 := 0x20
-// let allocate__7 := 0x40
-// mstore(allocate__7, add(mload(allocate__7), _18))
-// let allocate_p_12_31 := mload(allocate__7)
-// mstore(allocate__7, add(allocate_p_12_31, allocate__7))
-// mstore(add(allocate_p_12_31, 96), 2)
+// let _1 := 0x20
+// let allocate__19 := 0x40
+// mstore(allocate__19, add(mload(allocate__19), _1))
+// let allocate_p_24_41 := mload(allocate__19)
+// mstore(allocate__19, add(allocate_p_24_41, allocate__19))
+// mstore(add(allocate_p_24_41, 96), 2)
+// mstore(allocate__19, _1)
// }
// }