aboutsummaryrefslogtreecommitdiffstats
path: root/test/libyul/yulOptimizerTests/rematerialiser/cheap_caller.yul
diff options
context:
space:
mode:
Diffstat (limited to 'test/libyul/yulOptimizerTests/rematerialiser/cheap_caller.yul')
-rw-r--r--test/libyul/yulOptimizerTests/rematerialiser/cheap_caller.yul16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/libyul/yulOptimizerTests/rematerialiser/cheap_caller.yul b/test/libyul/yulOptimizerTests/rematerialiser/cheap_caller.yul
new file mode 100644
index 00000000..7e99e428
--- /dev/null
+++ b/test/libyul/yulOptimizerTests/rematerialiser/cheap_caller.yul
@@ -0,0 +1,16 @@
+{
+ // The caller opcode is cheap, so inline it,
+ // no matter how often it is used
+ let a := caller()
+ mstore(a, a)
+ mstore(add(a, a), mload(a))
+ sstore(a, sload(a))
+}
+// ----
+// rematerialiser
+// {
+// let a := caller()
+// mstore(caller(), caller())
+// mstore(add(caller(), caller()), mload(caller()))
+// sstore(caller(), sload(caller()))
+// }