Skip to content

Commit 9032d58

Browse files
committed
eof: Add tests
1 parent 4436907 commit 9032d58

6 files changed

+81
-12
lines changed

test/libyul/yulSyntaxTests/eof/auxdataloadn_in_legacy.yul

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ object "a" {
1111
// EVMVersion: >=prague
1212
// bytecodeFormat: legacy
1313
// ----
14-
// DeclarationError 4619: (42-54): Function "auxdataloadn" not found.
15-
// TypeError 3950: (42-57): Expected expression to evaluate to one value, but got 0 values instead.
14+
// DeclarationError 7223: (42-54): Builtin function "auxdataloadn" is only available in EOF.
15+
// TypeError 3950: (42-57): Expected expression to evaluate to one value, but got 0 values instead.

test/libyul/yulSyntaxTests/eof/eof_identifiers_in_legacy.yul

Lines changed: 0 additions & 10 deletions
This file was deleted.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
auxdataloadn(0)
3+
dataloadn(0)
4+
eofcreate("name", 0, 0, 0, 0)
5+
returncontract("name", 0, 0)
6+
rjump()
7+
rjumpi()
8+
callf(0)
9+
jumpf(0)
10+
retf()
11+
extcall(0, 1, 2, 3)
12+
extstaticcall(0, 1, 2)
13+
extdelegatecall(0, 1, 2)
14+
}
15+
// ====
16+
// bytecodeFormat: legacy
17+
// ----
18+
// DeclarationError 7223: (6-18): Builtin function "auxdataloadn" is only available in EOF.
19+
// DeclarationError 4619: (26-35): Function "dataloadn" not found.
20+
// DeclarationError 7223: (43-52): Builtin function "eofcreate" is only available in EOF.
21+
// DeclarationError 4619: (77-91): Function "returncontract" not found.
22+
// DeclarationError 4619: (110-115): Function "rjump" not found.
23+
// DeclarationError 4619: (122-128): Function "rjumpi" not found.
24+
// DeclarationError 4619: (135-140): Function "callf" not found.
25+
// DeclarationError 4619: (148-153): Function "jumpf" not found.
26+
// DeclarationError 4619: (161-165): Function "retf" not found.
27+
// TypeError 4328: (172-179): The "extcall" instruction is only available in EOF.
28+
// TypeError 4328: (196-209): The "extstaticcall" instruction is only available in EOF.
29+
// TypeError 4328: (223-238): The "extdelegatecall" instruction is only available in EOF.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
function auxdataloadn() {}
3+
function dataloadn() {}
4+
function eofcreate() {}
5+
function returncontract() {}
6+
function rjump() {}
7+
function rjumpi() {}
8+
function callf() {}
9+
function jumpf() {}
10+
function retf() {}
11+
function extcall() {}
12+
function extstaticcall() {}
13+
function extdelegatecall() {}
14+
}
15+
// ====
16+
// bytecodeFormat: legacy
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
function auxdataloadn() {}
3+
function eofcreate() {}
4+
function returncontract() {}
5+
function extcall() {}
6+
function extdelegatecall() {}
7+
function extstaticcall() {}
8+
}
9+
// ====
10+
// bytecodeFormat: >=EOFv1
11+
// ----
12+
// ParserError 5568: (15-27): Cannot use builtin function name "auxdataloadn" as identifier name.
13+
// ParserError 5568: (46-55): Cannot use builtin function name "eofcreate" as identifier name.
14+
// ParserError 5568: (74-88): Cannot use builtin function name "returncontract" as identifier name.
15+
// ParserError 5568: (107-114): Cannot use builtin function name "extcall" as identifier name.
16+
// ParserError 5568: (133-148): Cannot use builtin function name "extdelegatecall" as identifier name.
17+
// ParserError 5568: (167-180): Cannot use builtin function name "extstaticcall" as identifier name.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
function dataloadn() {}
3+
function rjump() {}
4+
function rjumpi() {}
5+
function callf() {}
6+
function jumpf() {}
7+
function retf() {}
8+
}
9+
// ====
10+
// bytecodeFormat: >=EOFv1
11+
// ----
12+
// DeclarationError 5017: (6-29): The identifier "dataloadn" is reserved and can not be used.
13+
// DeclarationError 5017: (34-53): The identifier "rjump" is reserved and can not be used.
14+
// DeclarationError 5017: (58-78): The identifier "rjumpi" is reserved and can not be used.
15+
// DeclarationError 5017: (83-102): The identifier "callf" is reserved and can not be used.
16+
// DeclarationError 5017: (107-126): The identifier "jumpf" is reserved and can not be used.
17+
// DeclarationError 5017: (131-149): The identifier "retf" is reserved and can not be used.

0 commit comments

Comments
 (0)