Skip to content

Commit ecac5a8

Browse files
committed
eof: objectCompiler tests updating
1 parent be30965 commit ecac5a8

40 files changed

+307
-60
lines changed

test/libyul/ObjectCompilerTest.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
#include <liblangutil/DebugInfoSelection.h>
3333

3434
#include <boost/algorithm/string.hpp>
35+
#include <boost/algorithm/string/split.hpp>
3536

3637
#include <ostream>
3738

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+
// }

0 commit comments

Comments
 (0)