Skip to content

Commit 40e05d6

Browse files
committed
Yul optimizer tests: Update test expectations to use evm instead of evmTyped
1 parent 6512722 commit 40e05d6

27 files changed

+109
-224
lines changed

test/libyul/yulOptimizerTests/conditionalSimplifier/add_correct_type.yul

-19
This file was deleted.

test/libyul/yulOptimizerTests/disambiguator/for_statement.yul

+5-7
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,19 @@
11
{
2-
{ let a:u256, b:u256 }
2+
{ let a, b }
33
{
4-
function eq_function(x: u256, y: u256) -> z: bool {}
5-
for { let a:u256 } eq_function(a, a) { a := a } {
6-
let b:u256 := a
4+
function eq_function(x, y) -> z {}
5+
for { let a } eq_function(a, a) { a := a } {
6+
let b := a
77
}
88
}
99
}
10-
// ====
11-
// dialect: evmTyped
1210
// ----
1311
// step: disambiguator
1412
//
1513
// {
1614
// { let a, b }
1715
// {
18-
// function eq_function(x, y) -> z:bool
16+
// function eq_function(x, y) -> z
1917
// { }
2018
// for { let a_1 } eq_function(a_1, a_1) { a_1 := a_1 }
2119
// { let b_2 := a_1 }

test/libyul/yulOptimizerTests/disambiguator/funtion_call.yul

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
{
2-
{ let a:u256, b:u256, c:u256, d:u256, f:u256 }
2+
{ let a, b, c, d, f }
33
{
4-
function f(a:u256) -> c:u256, d:u256 {
5-
let b:u256, c_1:u256 := f(a)
4+
function f(a) -> c, d {
5+
let b, c_1 := f(a)
66
}
77
}
88
}
9-
// ====
10-
// dialect: evmTyped
119
// ----
1210
// step: disambiguator
1311
//
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,17 @@
11
{
2-
{ let a:u256, b:u256, c:u256 }
2+
{ let a, b, c }
33
{
4-
let a:bool
5-
if a { let b:bool := a }
4+
let a
5+
if a { let b := a }
66
}
77
}
8-
// ====
9-
// dialect: evmTyped
108
// ----
119
// step: disambiguator
1210
//
1311
// {
1412
// { let a, b, c }
1513
// {
16-
// let a_1:bool
17-
// if a_1 { let b_2:bool := a_1 }
14+
// let a_1
15+
// if a_1 { let b_2 := a_1 }
1816
// }
1917
// }

test/libyul/yulOptimizerTests/disambiguator/long_names.yul

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
{ { let aanteuhdaoneudbrgkjiuaothduiathudaoeuh:u256 } { let aanteuhdaoneudbrgkjiuaothduiathudaoeuh:u256 } }
2-
// ====
3-
// dialect: evmTyped
1+
{ { let aanteuhdaoneudbrgkjiuaothduiathudaoeuh } { let aanteuhdaoneudbrgkjiuaothduiathudaoeuh } }
42
// ----
53
// step: disambiguator
64
//

test/libyul/yulOptimizerTests/disambiguator/smoke_evmTyped.yul

-7
This file was deleted.

test/libyul/yulOptimizerTests/disambiguator/switch_statement.yul

+4-6
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
{
2-
{ let a:u256, b:u256, c:u256 }
2+
{ let a, b, c }
33
{
4-
let a:u256
4+
let a
55
switch a
6-
case 0:u256 { let b:u256 := a }
7-
default { let c:u256 := a }
6+
case 0 { let b := a }
7+
default { let c := a }
88
}
99
}
10-
// ====
11-
// dialect: evmTyped
1210
// ----
1311
// step: disambiguator
1412
//

test/libyul/yulOptimizerTests/disambiguator/variables.yul

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
{ { let a:u256 } { let a:u256 } }
2-
// ====
3-
// dialect: evmTyped
1+
{ { let a } { let a } }
42
// ----
53
// step: disambiguator
64
//

test/libyul/yulOptimizerTests/disambiguator/variables_clash.yul

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
{ { let a:u256 let a_1:u256 } { let a:u256 } }
2-
// ====
3-
// dialect: evmTyped
1+
{ { let a let a_1 } { let a } }
42
// ----
53
// step: disambiguator
64
//

test/libyul/yulOptimizerTests/disambiguator/variables_inside_functions.yul

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
{
2-
{ let c:u256 let b:u256 }
3-
function f(a:u256, c:u256) -> b:u256 { let x:u256 }
2+
{ let c let b }
3+
function f(a, c) -> b { let x }
44
{
5-
let a:u256 let x:u256
5+
let a let x
66
}
77
}
8-
// ====
9-
// dialect: evmTyped
108
// ----
119
// step: disambiguator
1210
//

test/libyul/yulOptimizerTests/expressionInliner/simple.yul

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
{
2-
function f() -> x:u256 { x := 2:u256 }
3-
let y:u256 := f()
2+
function f() -> x { x := 2 }
3+
let y := f()
44
}
5-
// ====
6-
// dialect: evmTyped
75
// ----
86
// step: expressionInliner
97
//

test/libyul/yulOptimizerTests/expressionInliner/with_args.yul

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
{
2-
function f(a:u256) -> x:u256 { x := a }
3-
let y:u256 := f(7:u256)
2+
function f(a) -> x { x := a }
3+
let y := f(7)
44
}
5-
// ====
6-
// dialect: evmTyped
75
// ----
86
// step: expressionInliner
97
//

test/libyul/yulOptimizerTests/fullInliner/multi_return_typed.yul

-23
This file was deleted.

test/libyul/yulOptimizerTests/functionGrouper/empty_block.yul

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
{ let a:u256 { } function f() -> x:bool { let b:u256 := 4:u256 {} for {} f() {} {} } }
2-
// ====
3-
// dialect: evmTyped
1+
{ let a { } function f() -> x { let b := 4 {} for {} f() {} {} } }
42
// ----
53
// step: functionGrouper
64
//
@@ -9,7 +7,7 @@
97
// let a
108
// { }
119
// }
12-
// function f() -> x:bool
10+
// function f() -> x
1311
// {
1412
// let b := 4
1513
// { }

test/libyul/yulOptimizerTests/functionGrouper/multi_fun_mixed.yul

+4-6
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
{
2-
let a:u256
3-
function f() { let b:u256 }
4-
let c:u256 function g() { let d:u256 }
5-
let e:u256
2+
let a
3+
function f() { let b }
4+
let c function g() { let d }
5+
let e
66
}
7-
// ====
8-
// dialect: evmTyped
97
// ----
108
// step: functionGrouper
119
//

test/libyul/yulOptimizerTests/functionGrouper/nested_fun.yul

+4-6
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
{
2-
let a:u256
2+
let a
33
function f() {
4-
let b:u256
4+
let b
55
function g() {
6-
let c:u256
6+
let c
77
}
8-
let d:u256
8+
let d
99
}
1010
}
11-
// ====
12-
// dialect: evmTyped
1311
// ----
1412
// step: functionGrouper
1513
//

test/libyul/yulOptimizerTests/functionGrouper/single_fun.yul

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
{
2-
let a:u256 function f() {}
2+
let a function f() {}
33
}
4-
// ====
5-
// dialect: evmTyped
64
// ----
75
// step: functionGrouper
86
//

test/libyul/yulOptimizerTests/functionHoister/empty_block.yul

+4-6
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,18 @@
11
{
2-
let a:u256
2+
let a
33
{ }
4-
function f() -> x:bool {
5-
let b:u256 := 4:u256
4+
function f() -> x {
5+
let b := 4
66
{ }
77
for {} f() {} {}
88
}
99
}
10-
// ====
11-
// dialect: evmTyped
1210
// ----
1311
// step: functionHoister
1412
//
1513
// {
1614
// let a
17-
// function f() -> x:bool
15+
// function f() -> x
1816
// {
1917
// let b := 4
2018
// for { } f() { }

test/libyul/yulOptimizerTests/functionHoister/multi_mixed.yul

+5-7
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
{
2-
let a:u256
3-
function f() { let b:u256 }
4-
let c:u256
5-
function g() { let d:u256 }
6-
let e:u256
2+
let a
3+
function f() { let b }
4+
let c
5+
function g() { let d }
6+
let e
77
}
8-
// ====
9-
// dialect: evmTyped
108
// ----
119
// step: functionHoister
1210
//

test/libyul/yulOptimizerTests/functionHoister/nested.yul

+4-6
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
{
2-
let a:u256
2+
let a
33
function f() {
4-
let b:u256
5-
function g() { let c:u256 }
6-
let d:u256
4+
let b
5+
function g() { let c }
6+
let d
77
}
88
}
9-
// ====
10-
// dialect: evmTyped
119
// ----
1210
// step: functionHoister
1311
//

test/libyul/yulOptimizerTests/functionHoister/single.yul

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
{
2-
let a:u256
2+
let a
33
function f() {}
44
}
5-
// ====
6-
// dialect: evmTyped
75
// ----
86
// step: functionHoister
97
//
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
let b := true
3+
let c := false
4+
for {} b {} {
5+
c := true
6+
}
7+
let d := c
8+
}
9+
// ----
10+
// step: ssaTransform
11+
//
12+
// {
13+
// let b := true
14+
// let c_1 := false
15+
// let c := c_1
16+
// for { } b { }
17+
// {
18+
// let c_3 := c
19+
// let c_2 := true
20+
// c := c_2
21+
// }
22+
// let c_4 := c
23+
// let d := c_4
24+
// }
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
let b := true
3+
let c := false
4+
switch b
5+
case true { c := true}
6+
case false { }
7+
let d := c
8+
}
9+
// ----
10+
// step: ssaTransform
11+
//
12+
// {
13+
// let b := true
14+
// let c_1 := false
15+
// let c := c_1
16+
// switch b
17+
// case true {
18+
// let c_2 := true
19+
// c := c_2
20+
// }
21+
// case false { }
22+
// let c_3 := c
23+
// let d := c_3
24+
// }

0 commit comments

Comments
 (0)