aboutsummaryrefslogtreecommitdiffstats
path: root/test/libyul/yulOptimizerTests/disambiguator
diff options
context:
space:
mode:
authorChristian Parpart <christian@ethereum.org>2018-10-15 17:52:35 +0800
committerChristian Parpart <christian@ethereum.org>2018-10-15 17:52:35 +0800
commit9a4bec7e474a310c7f93ff3b84928e0e9ba9cce6 (patch)
tree2668ab22a40aad2448081f7bf22c7235d4b4c963 /test/libyul/yulOptimizerTests/disambiguator
parentb965fd6e17f77e94afeb070a27182251b85b8ab3 (diff)
downloaddexon-solidity-9a4bec7e474a310c7f93ff3b84928e0e9ba9cce6.tar.gz
dexon-solidity-9a4bec7e474a310c7f93ff3b84928e0e9ba9cce6.tar.zst
dexon-solidity-9a4bec7e474a310c7f93ff3b84928e0e9ba9cce6.zip
Renaming libjulia to libyul
Diffstat (limited to 'test/libyul/yulOptimizerTests/disambiguator')
-rw-r--r--test/libyul/yulOptimizerTests/disambiguator/for_statement.yul28
-rw-r--r--test/libyul/yulOptimizerTests/disambiguator/funtion_call.yul22
-rw-r--r--test/libyul/yulOptimizerTests/disambiguator/if_statement.yul22
-rw-r--r--test/libyul/yulOptimizerTests/disambiguator/smoke.yul5
-rw-r--r--test/libyul/yulOptimizerTests/disambiguator/smoke_yul.yul6
-rw-r--r--test/libyul/yulOptimizerTests/disambiguator/switch_statement.yul27
-rw-r--r--test/libyul/yulOptimizerTests/disambiguator/variables.yul12
-rw-r--r--test/libyul/yulOptimizerTests/disambiguator/variables_clash.yul13
-rw-r--r--test/libyul/yulOptimizerTests/disambiguator/variables_inside_functions.yul24
9 files changed, 159 insertions, 0 deletions
diff --git a/test/libyul/yulOptimizerTests/disambiguator/for_statement.yul b/test/libyul/yulOptimizerTests/disambiguator/for_statement.yul
new file mode 100644
index 00000000..0d2a38c5
--- /dev/null
+++ b/test/libyul/yulOptimizerTests/disambiguator/for_statement.yul
@@ -0,0 +1,28 @@
+// yul
+{
+ { let a:u256, b:u256 }
+ {
+ for { let a:u256 } a { a := a } {
+ let b:u256 := a
+ }
+ }
+}
+// ----
+// disambiguator
+// {
+// {
+// let a:u256, b:u256
+// }
+// {
+// for {
+// let a_1:u256
+// }
+// a_1
+// {
+// a_1 := a_1
+// }
+// {
+// let b_1:u256 := a_1
+// }
+// }
+// }
diff --git a/test/libyul/yulOptimizerTests/disambiguator/funtion_call.yul b/test/libyul/yulOptimizerTests/disambiguator/funtion_call.yul
new file mode 100644
index 00000000..f917bb68
--- /dev/null
+++ b/test/libyul/yulOptimizerTests/disambiguator/funtion_call.yul
@@ -0,0 +1,22 @@
+// yul
+{
+ { let a:u256, b:u256, c:u256, d:u256, f:u256 }
+ {
+ function f(a:u256) -> c:u256, d:u256 {
+ let b:u256, c_1:u256 := f(a)
+ }
+ }
+}
+// ----
+// disambiguator
+// {
+// {
+// let a:u256, b:u256, c:u256, d:u256, f:u256
+// }
+// {
+// function f_1(a_1:u256) -> c_1:u256, d_1:u256
+// {
+// let b_1:u256, c_1_1:u256 := f_1(a_1)
+// }
+// }
+// }
diff --git a/test/libyul/yulOptimizerTests/disambiguator/if_statement.yul b/test/libyul/yulOptimizerTests/disambiguator/if_statement.yul
new file mode 100644
index 00000000..14f53757
--- /dev/null
+++ b/test/libyul/yulOptimizerTests/disambiguator/if_statement.yul
@@ -0,0 +1,22 @@
+// yul
+{
+ { let a:u256, b:u256, c:u256 }
+ {
+ let a:bool
+ if a { let b:bool := a }
+ }
+}
+// ----
+// disambiguator
+// {
+// {
+// let a:u256, b:u256, c:u256
+// }
+// {
+// let a_1:bool
+// if a_1
+// {
+// let b_1:bool := a_1
+// }
+// }
+// }
diff --git a/test/libyul/yulOptimizerTests/disambiguator/smoke.yul b/test/libyul/yulOptimizerTests/disambiguator/smoke.yul
new file mode 100644
index 00000000..d6cd8a61
--- /dev/null
+++ b/test/libyul/yulOptimizerTests/disambiguator/smoke.yul
@@ -0,0 +1,5 @@
+{ }
+// ----
+// disambiguator
+// {
+// }
diff --git a/test/libyul/yulOptimizerTests/disambiguator/smoke_yul.yul b/test/libyul/yulOptimizerTests/disambiguator/smoke_yul.yul
new file mode 100644
index 00000000..e55f4cd3
--- /dev/null
+++ b/test/libyul/yulOptimizerTests/disambiguator/smoke_yul.yul
@@ -0,0 +1,6 @@
+// yul
+{ }
+// ----
+// disambiguator
+// {
+// }
diff --git a/test/libyul/yulOptimizerTests/disambiguator/switch_statement.yul b/test/libyul/yulOptimizerTests/disambiguator/switch_statement.yul
new file mode 100644
index 00000000..340ecccf
--- /dev/null
+++ b/test/libyul/yulOptimizerTests/disambiguator/switch_statement.yul
@@ -0,0 +1,27 @@
+// yul
+{
+ { let a:u256, b:u256, c:u256 }
+ {
+ let a:u256
+ switch a
+ case 0:u256 { let b:u256 := a }
+ default { let c:u256 := a }
+ }
+}
+// ----
+// disambiguator
+// {
+// {
+// let a:u256, b:u256, c:u256
+// }
+// {
+// let a_1:u256
+// switch a_1
+// case 0:u256 {
+// let b_1:u256 := a_1
+// }
+// default {
+// let c_1:u256 := a_1
+// }
+// }
+// }
diff --git a/test/libyul/yulOptimizerTests/disambiguator/variables.yul b/test/libyul/yulOptimizerTests/disambiguator/variables.yul
new file mode 100644
index 00000000..65bd4c8f
--- /dev/null
+++ b/test/libyul/yulOptimizerTests/disambiguator/variables.yul
@@ -0,0 +1,12 @@
+// yul
+{ { let a:u256 } { let a:u256 } }
+// ----
+// disambiguator
+// {
+// {
+// let a:u256
+// }
+// {
+// let a_1:u256
+// }
+// }
diff --git a/test/libyul/yulOptimizerTests/disambiguator/variables_clash.yul b/test/libyul/yulOptimizerTests/disambiguator/variables_clash.yul
new file mode 100644
index 00000000..e462442a
--- /dev/null
+++ b/test/libyul/yulOptimizerTests/disambiguator/variables_clash.yul
@@ -0,0 +1,13 @@
+// yul
+{ { let a:u256 let a_1:u256 } { let a:u256 } }
+// ----
+// disambiguator
+// {
+// {
+// let a:u256
+// let a_1:u256
+// }
+// {
+// let a_2:u256
+// }
+// }
diff --git a/test/libyul/yulOptimizerTests/disambiguator/variables_inside_functions.yul b/test/libyul/yulOptimizerTests/disambiguator/variables_inside_functions.yul
new file mode 100644
index 00000000..e80959f6
--- /dev/null
+++ b/test/libyul/yulOptimizerTests/disambiguator/variables_inside_functions.yul
@@ -0,0 +1,24 @@
+// yul
+{
+ { let c:u256 let b:u256 }
+ function f(a:u256, c:u256) -> b:u256 { let x:u256 }
+ {
+ let a:u256 let x:u256
+ }
+}
+// ----
+// disambiguator
+// {
+// {
+// let c:u256
+// let b:u256
+// }
+// function f(a:u256, c_1:u256) -> b_1:u256
+// {
+// let x:u256
+// }
+// {
+// let a_1:u256
+// let x_1:u256
+// }
+// }