Skip to content

Commit

Permalink
eof: Update yulSyntaxTests tests for EOF
Browse files Browse the repository at this point in the history
  • Loading branch information
rodiazet committed Dec 19, 2024
1 parent 2fe4769 commit 914dbb9
Show file tree
Hide file tree
Showing 33 changed files with 58 additions and 0 deletions.
2 changes: 2 additions & 0 deletions test/libyul/yulSyntaxTests/builtin_function_literal.yul
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
datasize(x,1)
}
// ====
// bytecodeFormat: legacy
// ----
// TypeError 7000: (4-12): Function "datasize" expects 1 arguments but got 2.
// TypeError 9114: (4-12): Function expects direct literals as arguments.
Expand Down
2 changes: 2 additions & 0 deletions test/libyul/yulSyntaxTests/datacopy_shadowing.yul
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
function datacopy(a, b, c) {}
}
// ====
// bytecodeFormat: legacy
// ----
// ParserError 5568: (15-23): Cannot use builtin function name "datacopy" as identifier name.
2 changes: 2 additions & 0 deletions test/libyul/yulSyntaxTests/dataoffset_shadowing.yul
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
function dataoffset(a) -> b {}
}
// ====
// bytecodeFormat: legacy
// ----
// ParserError 5568: (15-25): Cannot use builtin function name "dataoffset" as identifier name.
2 changes: 2 additions & 0 deletions test/libyul/yulSyntaxTests/datasize_shadowing.yul
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
function datasize(a) -> b {}
}
// ====
// bytecodeFormat: legacy
// ----
// ParserError 5568: (15-23): Cannot use builtin function name "datasize" as identifier name.
2 changes: 2 additions & 0 deletions test/libyul/yulSyntaxTests/hex_switch_case.yul
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@
case hex"00" {}
case hex"1122" {}
}
// ====
// bytecodeFormat: legacy
// ----
2 changes: 2 additions & 0 deletions test/libyul/yulSyntaxTests/hex_switch_case_long.yul
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@
case hex"00" {}
case hex"112233445566778899001122334455667788990011223344556677889900112233445566778899001122334455667788990011223344556677889900" {}
}
// ====
// bytecodeFormat: legacy
// ----
// TypeError 3069: (53-178): String literal too long (60 > 32)
2 changes: 2 additions & 0 deletions test/libyul/yulSyntaxTests/invalid/pc_disallowed.yul
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
pop(pc())
}
// ====
// bytecodeFormat: legacy
// ----
// SyntaxError 2450: (10-12): PC instruction is a low-level EVM feature. Because of that PC is disallowed in strict assembly.
1 change: 1 addition & 0 deletions test/libyul/yulSyntaxTests/loadimmutable.yul
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
}
// ====
// dialect: evm
// bytecodeFormat: legacy
// ----
1 change: 1 addition & 0 deletions test/libyul/yulSyntaxTests/loadimmutable_bad_literal.yul
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
}
// ====
// dialect: evm
// bytecodeFormat: legacy
// ----
// TypeError 5859: (24-25): Function expects string literal.
// TypeError 5859: (50-54): Function expects string literal.
Expand Down
1 change: 1 addition & 0 deletions test/libyul/yulSyntaxTests/loadimmutable_shadowing.yul
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
}
// ====
// dialect: evm
// bytecodeFormat: legacy
// ----
// ParserError 5568: (15-28): Cannot use builtin function name "loadimmutable" as identifier name.
2 changes: 2 additions & 0 deletions test/libyul/yulSyntaxTests/metadata_access.yul
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ object "A" {
data ".metadata" "Hello, World!"
data ".other" "Hello, World2!"
}
// ====
// bytecodeFormat: legacy
// ----
// TypeError 3517: (41-49): Unknown data object ".other".
// TypeError 3517: (69-77): Unknown data object ".other".
Expand Down
2 changes: 2 additions & 0 deletions test/libyul/yulSyntaxTests/metadata_access_2.yul
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,7 @@ object "A" {
data "1" "XYZ"
data ".mightbereservedinthefuture" "TRS"
}
// ====
// bytecodeFormat: legacy
// ----
// TypeError 3517: (90-119): Unknown data object ".mightbereservedinthefuture".
2 changes: 2 additions & 0 deletions test/libyul/yulSyntaxTests/metadata_access_subobject.yul
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,7 @@ object "A" {
data "x" "ABC"
}
}
// ====
// bytecodeFormat: legacy
// ----
// TypeError 3517: (41-54): Unknown data object ".metadata.x".
2 changes: 2 additions & 0 deletions test/libyul/yulSyntaxTests/objects/data.yul
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,6 @@ object "A" {
data "2" hex"0011"
data "3" "hello world this is longer than 32 bytes and should still work"
}
// ====
// bytecodeFormat: legacy
// ----
2 changes: 2 additions & 0 deletions test/libyul/yulSyntaxTests/objects/data_access.yul
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,6 @@ object "A" {

data "B" hex"00"
}
// ====
// bytecodeFormat: legacy
// ----
2 changes: 2 additions & 0 deletions test/libyul/yulSyntaxTests/objects/datacopy.yul
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,6 @@
let s := ""
datacopy(x, "11", s)
}
// ====
// bytecodeFormat: legacy
// ----
2 changes: 2 additions & 0 deletions test/libyul/yulSyntaxTests/objects/dataoffset_nonliteral.yul
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,7 @@ object "A" {

data "B" hex"00"
}
// ====
// bytecodeFormat: legacy
// ----
// TypeError 9114: (47-57): Function expects direct literals as arguments.
2 changes: 2 additions & 0 deletions test/libyul/yulSyntaxTests/objects/dataoffset_nonstring.yul
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@ object "A" {
pop(dataoffset(0))
}
}
// ====
// bytecodeFormat: legacy
// ----
// TypeError 5859: (41-42): Function expects string literal.
2 changes: 2 additions & 0 deletions test/libyul/yulSyntaxTests/objects/dataoffset_notfound.yul
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@ object "A" {
}
data "B" ""
}
// ====
// bytecodeFormat: legacy
// ----
// TypeError 3517: (41-44): Unknown data object "C".
2 changes: 2 additions & 0 deletions test/libyul/yulSyntaxTests/objects/datasize_nonliteral.yul
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,7 @@ object "A" {

data "B" hex"00"
}
// ====
// bytecodeFormat: legacy
// ----
// TypeError 9114: (47-55): Function expects direct literals as arguments.
2 changes: 2 additions & 0 deletions test/libyul/yulSyntaxTests/objects/datasize_nonstring.yul
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@ object "A" {
pop(datasize(0))
}
}
// ====
// bytecodeFormat: legacy
// ----
// TypeError 5859: (39-40): Function expects string literal.
2 changes: 2 additions & 0 deletions test/libyul/yulSyntaxTests/objects/datasize_notfound.yul
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@ object "A" {
}
data "B" ""
}
// ====
// bytecodeFormat: legacy
// ----
// TypeError 3517: (39-42): Unknown data object "C".
2 changes: 2 additions & 0 deletions test/libyul/yulSyntaxTests/objects/subobject_access.yul
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,6 @@ object "A" {
code {}
}
}
// ====
// bytecodeFormat: legacy
// ----
2 changes: 2 additions & 0 deletions test/libyul/yulSyntaxTests/opcode_for_function_args_1.yul
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
function f(gas) {}
}
// ====
// bytecodeFormat: legacy
// ----
// ParserError 5568: (14-17): Cannot use builtin function name "gas" as identifier name.
2 changes: 2 additions & 0 deletions test/libyul/yulSyntaxTests/opcode_for_function_args_2.yul
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
function f() -> gas {}
}
// ====
// bytecodeFormat: legacy
// ----
// ParserError 5568: (19-22): Cannot use builtin function name "gas" as identifier name.
2 changes: 2 additions & 0 deletions test/libyul/yulSyntaxTests/opcode_for_functions.yul
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
function gas() {}
}
// ====
// bytecodeFormat: legacy
// ----
// ParserError 5568: (12-15): Cannot use builtin function name "gas" as identifier name.
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
}
// ====
// dialect: evm
// bytecodeFormat: legacy
// ----
// TypeError 9114: (6-18): Function expects direct literals as arguments.
2 changes: 2 additions & 0 deletions test/libyul/yulSyntaxTests/selfdestruct.yul
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
selfdestruct(0x02)
}
// ====
// bytecodeFormat: legacy
// ----
// Warning 1699: (3-15): "selfdestruct" has been deprecated. Note that, starting from the Cancun hard fork, the underlying opcode no longer deletes the code and data associated with an account and only transfers its Ether to the beneficiary, unless executed in the same transaction in which the contract was created (see EIP-6780). Any use in newly deployed contracts is strongly discouraged even if the new behavior is taken into account. Future changes to the EVM might further reduce the functionality of the opcode.
1 change: 1 addition & 0 deletions test/libyul/yulSyntaxTests/setimmutable.yul
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
}
// ====
// dialect: evm
// bytecodeFormat: legacy
// ----
1 change: 1 addition & 0 deletions test/libyul/yulSyntaxTests/setimmutable_bad_literal.yul
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
}
// ====
// dialect: evm
// bytecodeFormat: legacy
// ----
// TypeError 5859: (22-23): Function expects string literal.
// TypeError 5859: (89-93): Function expects string literal.
Expand Down
1 change: 1 addition & 0 deletions test/libyul/yulSyntaxTests/setimmutable_shadowing.yul
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
}
// ====
// dialect: evm
// bytecodeFormat: legacy
// ----
// ParserError 5568: (15-27): Cannot use builtin function name "setimmutable" as identifier name.
2 changes: 2 additions & 0 deletions test/libyul/yulSyntaxTests/string_literal_switch_case.yul
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@
case "1" {}
case "2" {}
}
// ====
// bytecodeFormat: legacy
// ----
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@
}
// ====
// dialect: evm
// bytecodeFormat: legacy
// ----

0 comments on commit 914dbb9

Please sign in to comment.