diff options
Diffstat (limited to 'test/libyul/yulOptimizerTests/commonSubexpressionEliminator/object_access.yul')
-rw-r--r-- | test/libyul/yulOptimizerTests/commonSubexpressionEliminator/object_access.yul | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test/libyul/yulOptimizerTests/commonSubexpressionEliminator/object_access.yul b/test/libyul/yulOptimizerTests/commonSubexpressionEliminator/object_access.yul new file mode 100644 index 00000000..5cfa3e6e --- /dev/null +++ b/test/libyul/yulOptimizerTests/commonSubexpressionEliminator/object_access.yul @@ -0,0 +1,23 @@ +{ + // Arguments to ``datasize`` and ``dataoffset`` need to be + // literals. We cannot simplify their arguments, but we can + // simplify them as a full expression. + // ``datacopy`` does not have this restriction. + let r := "abc" + let a := datasize("abc") + let x := dataoffset("abc") + // should be replaced by a + let y := datasize("abc") + datacopy("abc", x, y) + mstore(a, x) +} +// ---- +// commonSubexpressionEliminator +// { +// let r := "abc" +// let a := datasize("abc") +// let x := dataoffset("abc") +// let y := a +// datacopy(r, x, a) +// mstore(a, x) +// } |