aboutsummaryrefslogtreecommitdiffstats
path: root/test/libyul/yulOptimizerTests/commonSubexpressionEliminator/case2.yul
diff options
context:
space:
mode:
Diffstat (limited to 'test/libyul/yulOptimizerTests/commonSubexpressionEliminator/case2.yul')
-rw-r--r--test/libyul/yulOptimizerTests/commonSubexpressionEliminator/case2.yul52
1 files changed, 52 insertions, 0 deletions
diff --git a/test/libyul/yulOptimizerTests/commonSubexpressionEliminator/case2.yul b/test/libyul/yulOptimizerTests/commonSubexpressionEliminator/case2.yul
new file mode 100644
index 00000000..fd8b4bc8
--- /dev/null
+++ b/test/libyul/yulOptimizerTests/commonSubexpressionEliminator/case2.yul
@@ -0,0 +1,52 @@
+{
+ let _13 := 0x20
+ let _14 := allocate(_13)
+ pop(_14)
+ let _15 := 2
+ let _16 := 3
+ let _17 := 0x40
+ let _18 := allocate(_17)
+ let _19 := array_index_access(_18, _16)
+ mstore(_19, _15)
+ function allocate(size) -> p
+ {
+ let _1 := 0x40
+ let p_2 := mload(_1)
+ p := p_2
+ let _20 := add(p_2, size)
+ mstore(_1, _20)
+ }
+ function array_index_access(array, index) -> p_1
+ {
+ let _21 := 0x20
+ let _22 := mul(index, _21)
+ p_1 := add(array, _22)
+ }
+}
+// ----
+// commonSubexpressionEliminator
+// {
+// let _13 := 0x20
+// let _14 := allocate(_13)
+// pop(_14)
+// let _15 := 2
+// let _16 := 3
+// let _17 := 0x40
+// let _18 := allocate(_17)
+// let _19 := array_index_access(_18, _16)
+// mstore(_19, _15)
+// function allocate(size) -> p
+// {
+// let _1 := 0x40
+// let p_2 := mload(_1)
+// p := p_2
+// let _20 := add(p_2, size)
+// mstore(_1, _20)
+// }
+// function array_index_access(array, index) -> p_1
+// {
+// let _21 := 0x20
+// let _22 := mul(index, _21)
+// p_1 := add(array, _22)
+// }
+// }