Skip to content

Commit 1da9b39

Browse files
authored
Merge pull request #15662 from ipsilon/eof-object-compiler-tests-update
eof: `objectCompiler` tests updating
2 parents 0bcfc62 + 8fc863d commit 1da9b39

40 files changed

+339
-60
lines changed

test/libyul/objectCompiler/data.yul

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
object "a" {
22
code {}
33
// Unreferenced data is not added to the assembled bytecode.
4+
// TODO: This is not implemented for EOF. Should work for legacy and EOF when implemented.
45
data "str" "Hello, World!"
56
}
67
// ====
78
// EVMVersion: >=constantinople
9+
// bytecodeFormat: legacy
810
// ----
911
// Assembly:
1012
// /* "source":22:29 */

test/libyul/objectCompiler/datacopy.yul

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ object "a" {
1313
}
1414
// ====
1515
// EVMVersion: >=shanghai
16+
// bytecodeFormat: legacy
1617
// ----
1718
// Assembly:
1819
// /* "source":77:92 */

test/libyul/objectCompiler/dataoffset_code.yul

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ object "a" {
77
}
88
// ====
99
// EVMVersion: >=shanghai
10+
// bytecodeFormat: legacy
1011
// ----
1112
// Assembly:
1213
// /* "source":44:61 */

test/libyul/objectCompiler/dataoffset_data.yul

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ object "a" {
44
}
55
// ====
66
// EVMVersion: >=shanghai
7+
// bytecodeFormat: legacy
78
// ----
89
// Assembly:
910
// /* "source":56:75 */

test/libyul/objectCompiler/dataoffset_self.yul

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ object "a" {
44
}
55
// ====
66
// EVMVersion: >=shanghai
7+
// bytecodeFormat: legacy
78
// ----
89
// Assembly:
910
// /* "source":44:59 */

test/libyul/objectCompiler/datasize_code.yul

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ object "a" {
77
}
88
// ====
99
// EVMVersion: >=shanghai
10+
// bytecodeFormat: legacy
1011
// ----
1112
// Assembly:
1213
// /* "source":44:59 */

test/libyul/objectCompiler/datasize_data.yul

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ object "a" {
44
}
55
// ====
66
// EVMVersion: >=shanghai
7+
// bytecodeFormat: legacy
78
// ----
89
// Assembly:
910
// /* "source":44:61 */

test/libyul/objectCompiler/datasize_self.yul

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ object "a" {
44
}
55
// ====
66
// EVMVersion: >=shanghai
7+
// bytecodeFormat: legacy
78
// ----
89
// Assembly:
910
// /* "source":36:49 */
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
function e(_._) {
3+
e(0)
4+
}
5+
e(2)
6+
function f(n._) {
7+
f(0)
8+
}
9+
f(2)
10+
function g(_.n) {
11+
g(0)
12+
}
13+
g(2)
14+
}
15+
// ====
16+
// bytecodeFormat: >=EOFv1
17+
// outputs: Assembly
18+
// ----
19+
// Assembly:
20+
// /* "source":53:54 */
21+
// 0x02
22+
// /* "source":51:55 */
23+
// jumpf{code_section_1}
24+
//
25+
// code_section_1: assembly {
26+
// /* "source":136:137 */
27+
// 0x00
28+
// /* "source":134:138 */
29+
// jumpf{code_section_1}
30+
// }
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
object "t" {
2+
code {
3+
sstore(0, eofcreate("name_that_is_longer_than_32_bytes_name_that_is_longer_than_32_bytes_name_that_is_longer_than_32_bytes", 0, 0, 0, 0))
4+
}
5+
object "name_that_is_longer_than_32_bytes_name_that_is_longer_than_32_bytes_name_that_is_longer_than_32_bytes" {
6+
code {}
7+
}
8+
}
9+
// ====
10+
// bytecodeFormat: >=EOFv1
11+
// optimizationPreset: full
12+
// outputs: Assembly
13+
// ----
14+
// Assembly:
15+
// /* "source":180:181 */
16+
// 0x00
17+
// /* "source":56:182 */
18+
// dup1
19+
// dup1
20+
// dup1
21+
// eofcreate{0}
22+
// /* "source":53:54 */
23+
// 0x00
24+
// /* "source":46:183 */
25+
// sstore
26+
// /* "source":22:199 */
27+
// stop
28+
// stop
29+
//
30+
// sub_0: assembly {
31+
// /* "source":330:337 */
32+
// stop
33+
// }

0 commit comments

Comments
 (0)