-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
eof: Add test, make needed test support bytecodeFormat flag, adjust s…
…ubcontainers tests
- Loading branch information
Showing
8 changed files
with
121 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -517,7 +517,6 @@ object "a" { | |
} | ||
|
||
// ==== | ||
// EVMVersion: >=prague | ||
// bytecodeFormat: >=EOFv1 | ||
// ---- | ||
// Assembly: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
object "a" { | ||
code { | ||
mstore(0, fun1(calldataload(0))) | ||
|
||
if calldataload(32) { | ||
non_ret_fun() | ||
} | ||
|
||
return(0, 32) | ||
|
||
function fun1(i) -> r { | ||
if i { | ||
r := 5 | ||
leave | ||
} | ||
r := 99 | ||
} | ||
|
||
function non_ret_fun() { | ||
revert(0, 0) | ||
} | ||
} | ||
} | ||
|
||
// ==== | ||
// bytecodeFormat: >=EOFv1 | ||
// ---- | ||
// Assembly: | ||
// /* "source":74:75 */ | ||
// 0x00 | ||
// /* "source":61:76 */ | ||
// calldataload | ||
// /* "source":56:77 */ | ||
// callf{code_section_1} | ||
// /* "source":53:54 */ | ||
// 0x00 | ||
// /* "source":46:78 */ | ||
// mstore | ||
// /* "source":107:109 */ | ||
// 0x20 | ||
// /* "source":94:110 */ | ||
// calldataload | ||
// /* "source":91:128 */ | ||
// rjumpi{tag_1} | ||
// /* "source":22:386 */ | ||
// tag_2: | ||
// /* "source":151:153 */ | ||
// 0x20 | ||
// /* "source":148:149 */ | ||
// 0x00 | ||
// /* "source":141:154 */ | ||
// return | ||
// /* "source":111:128 */ | ||
// tag_1: | ||
// /* "source":113:126 */ | ||
// jumpf{code_section_2} | ||
// | ||
// code_section_1: assembly { | ||
// /* "source":217:294 */ | ||
// rjumpi{tag_3} | ||
// /* "source":203:324 */ | ||
// tag_4: | ||
// /* "source":312:314 */ | ||
// 0x63 | ||
// /* "source":173:324 */ | ||
// retf | ||
// /* "source":234:294 */ | ||
// tag_3: | ||
// /* "source":257:258 */ | ||
// 0x05 | ||
// /* "source":275:280 */ | ||
// retf | ||
// } | ||
// | ||
// code_section_2: assembly { | ||
// /* "source":376:377 */ | ||
// 0x00 | ||
// /* "source":366:378 */ | ||
// dup1 | ||
// revert | ||
// } | ||
// Bytecode: ef000101000c020003001400090003040000000080ffff0101ffff0080ffff5f35e300015f52602035e1000460205ff3e50002e100036063e46005e45f80fd | ||
// Opcodes: 0xEF STOP ADD ADD STOP 0xC MUL STOP SUB STOP EQ STOP MULMOD STOP SUB DIV STOP STOP STOP STOP DUP1 SELFDESTRUCT SELFDESTRUCT ADD ADD SELFDESTRUCT SELFDESTRUCT STOP DUP1 SELFDESTRUCT SELFDESTRUCT PUSH0 CALLDATALOAD CALLF 0x1 PUSH0 MSTORE PUSH1 0x20 CALLDATALOAD RJUMPI 0x4 PUSH1 0x20 PUSH0 RETURN JUMPF 0x2 RJUMPI 0x3 PUSH1 0x63 RETF PUSH1 0x5 RETF PUSH0 DUP1 REVERT | ||
// SourceMappings: 74:1:0:-:0;61:15;56:21::i;53:1::-;46:32;107:2;94:16;91:37;22:364;151:2;148:1;141:13;111:17;113:13::i217:77:0:-:0;203:121;312:2;173:151::o;234:60::-;257:1;275:5::o376:1:0:-:0;366:12; |
26 changes: 26 additions & 0 deletions
26
test/libyul/yulSyntaxTests/eof/too_many_functions_arguments_or_returns.yul
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
object "a" { | ||
code { | ||
function too_many_arguments( | ||
i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23, i24, i25, i26, i27, i28, i29, i30, | ||
i31, i32, i33, i34, i35, i36, i37, i38, i39, i40, i41, i42, i43, i44, i45, i46, i47, i48, i49, i50, i51, i52, i53, i54, i55, i56, i57, i58, i59, i60, | ||
i61, i62, i63, i64, i65, i66, i67, i68, i69, i70, i71, i72, i73, i74, i75, i76, i77, i78, i79, i80, i81, i82, i83, i84, i85, i86, i87, i88, i89, i90, | ||
i91, i92, i93, i94, i95, i96, i97, i98, i99, i100, i101, i102, i103, i104, i105, i106, i107, i108, i109, i110, i111, i112, i113, i114, i115, i116, i117, i118, i119, i120, | ||
i121, i122, i123, i124, i125, i126, i127, i128 | ||
) | ||
{} | ||
|
||
function too_many_returns()-> | ||
i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23, i24, i25, i26, i27, i28, i29, i30, | ||
i31, i32, i33, i34, i35, i36, i37, i38, i39, i40, i41, i42, i43, i44, i45, i46, i47, i48, i49, i50, i51, i52, i53, i54, i55, i56, i57, i58, i59, i60, | ||
i61, i62, i63, i64, i65, i66, i67, i68, i69, i70, i71, i72, i73, i74, i75, i76, i77, i78, i79, i80, i81, i82, i83, i84, i85, i86, i87, i88, i89, i90, | ||
i91, i92, i93, i94, i95, i96, i97, i98, i99, i100, i101, i102, i103, i104, i105, i106, i107, i108, i109, i110, i111, i112, i113, i114, i115, i116, i117, i118, i119, i120, | ||
i121, i122, i123, i124, i125, i126, i127, i128 | ||
{} | ||
} | ||
} | ||
|
||
// ==== | ||
// bytecodeFormat: >=EOFv1 | ||
// ---- | ||
// TypeError 8534: (32-800): Too many function parameters. At most 127 parameters allowed for EOF | ||
// TypeError 2101: (810-1569): Too many function return variables. At most 127 return variables allowed for EOF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters