aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2019-01-08 22:03:40 +0800
committerchriseth <chris@ethereum.org>2019-01-08 22:05:09 +0800
commitf5b24a38b8006b66f5e5bed37e8041d87998eddf (patch)
treef523e9a63aed68e1303b5883b79fb74665e9c94a /test
parent6414d63906d1a768d4f8829eca49d6020630a261 (diff)
downloaddexon-solidity-f5b24a38b8006b66f5e5bed37e8041d87998eddf.tar
dexon-solidity-f5b24a38b8006b66f5e5bed37e8041d87998eddf.tar.gz
dexon-solidity-f5b24a38b8006b66f5e5bed37e8041d87998eddf.tar.bz2
dexon-solidity-f5b24a38b8006b66f5e5bed37e8041d87998eddf.tar.lz
dexon-solidity-f5b24a38b8006b66f5e5bed37e8041d87998eddf.tar.xz
dexon-solidity-f5b24a38b8006b66f5e5bed37e8041d87998eddf.tar.zst
dexon-solidity-f5b24a38b8006b66f5e5bed37e8041d87998eddf.zip
Make function grouper idempotent.
Diffstat (limited to 'test')
-rw-r--r--test/libyul/yulOptimizerTests/fullInliner/multi_fun_callback.yul12
-rw-r--r--test/libyul/yulOptimizerTests/functionGrouper/already_grouped.yul17
-rw-r--r--test/libyul/yulOptimizerTests/functionGrouper/grouped_but_not_ordered.yul19
3 files changed, 41 insertions, 7 deletions
diff --git a/test/libyul/yulOptimizerTests/fullInliner/multi_fun_callback.yul b/test/libyul/yulOptimizerTests/fullInliner/multi_fun_callback.yul
index 6e4acb97..dbbc5422 100644
--- a/test/libyul/yulOptimizerTests/fullInliner/multi_fun_callback.yul
+++ b/test/libyul/yulOptimizerTests/fullInliner/multi_fun_callback.yul
@@ -26,13 +26,11 @@
// fullInliner
// {
// {
-// {
-// let f_x := 100
-// mstore(0, f_x)
-// mstore(7, h())
-// g(10)
-// mstore(1, f_x)
-// }
+// let f_x := 100
+// mstore(0, f_x)
+// mstore(7, h())
+// g(10)
+// mstore(1, f_x)
// }
// function f(x)
// {
diff --git a/test/libyul/yulOptimizerTests/functionGrouper/already_grouped.yul b/test/libyul/yulOptimizerTests/functionGrouper/already_grouped.yul
new file mode 100644
index 00000000..42e8a48e
--- /dev/null
+++ b/test/libyul/yulOptimizerTests/functionGrouper/already_grouped.yul
@@ -0,0 +1,17 @@
+{
+ {
+ let x := 2
+ }
+ function f() -> y { y := 8 }
+}
+// ----
+// functionGrouper
+// {
+// {
+// let x := 2
+// }
+// function f() -> y
+// {
+// y := 8
+// }
+// }
diff --git a/test/libyul/yulOptimizerTests/functionGrouper/grouped_but_not_ordered.yul b/test/libyul/yulOptimizerTests/functionGrouper/grouped_but_not_ordered.yul
new file mode 100644
index 00000000..0abb5d87
--- /dev/null
+++ b/test/libyul/yulOptimizerTests/functionGrouper/grouped_but_not_ordered.yul
@@ -0,0 +1,19 @@
+{
+ function f() -> y { y := 8 }
+ {
+ let x := 2
+ }
+}
+// ----
+// functionGrouper
+// {
+// {
+// {
+// let x := 2
+// }
+// }
+// function f() -> y
+// {
+// y := 8
+// }
+// }