aboutsummaryrefslogtreecommitdiffstats
path: root/test/libjulia/yulOptimizerTests/expressionInliner/no_move_with_sideeffects.yul
diff options
context:
space:
mode:
Diffstat (limited to 'test/libjulia/yulOptimizerTests/expressionInliner/no_move_with_sideeffects.yul')
-rw-r--r--test/libjulia/yulOptimizerTests/expressionInliner/no_move_with_sideeffects.yul27
1 files changed, 27 insertions, 0 deletions
diff --git a/test/libjulia/yulOptimizerTests/expressionInliner/no_move_with_sideeffects.yul b/test/libjulia/yulOptimizerTests/expressionInliner/no_move_with_sideeffects.yul
new file mode 100644
index 00000000..7fdad6c4
--- /dev/null
+++ b/test/libjulia/yulOptimizerTests/expressionInliner/no_move_with_sideeffects.yul
@@ -0,0 +1,27 @@
+// The calls to g and h cannot be moved because g and h are not movable. Therefore, the call
+// to f is not inlined.
+{
+ function f(a, b) -> x { x := add(b, a) }
+ function g() -> y { y := mload(0) mstore(0, 4) }
+ function h() -> z { mstore(0, 4) z := mload(0) }
+ let r := f(g(), h())
+}
+// ----
+// expressionInliner
+// {
+// function f(a, b) -> x
+// {
+// x := add(b, a)
+// }
+// function g() -> y
+// {
+// y := mload(0)
+// mstore(0, 4)
+// }
+// function h() -> z
+// {
+// mstore(0, 4)
+// z := mload(0)
+// }
+// let r := f(g(), h())
+// }