From b09f411f57cd0de1fb15b054ebef5ceb00d273b0 Mon Sep 17 00:00:00 2001 From: rodiazet Date: Thu, 19 Dec 2024 15:33:42 +0100 Subject: [PATCH] eof: `objectCompiler` tests updating --- test/libyul/objectCompiler/data.yul | 1 + test/libyul/objectCompiler/datacopy.yul | 1 + .../libyul/objectCompiler/dataoffset_code.yul | 1 + .../libyul/objectCompiler/dataoffset_data.yul | 1 + .../libyul/objectCompiler/dataoffset_self.yul | 1 + test/libyul/objectCompiler/datasize_code.yul | 1 + test/libyul/objectCompiler/datasize_data.yul | 1 + test/libyul/objectCompiler/datasize_self.yul | 1 + ...identical_subobjects_creation_deployed.yul | 109 +++++++++++ .../identical_subobjects_full_debug_info.yul | 116 ++++++++++++ .../identical_subobjects_no_debug_info.yul | 165 +++++++++++++++++ ...dentical_subobjects_partial_debug_info.yul | 153 ++++++++++++++++ ...bobjects_partial_debug_info_no_use_src.yul | 171 ++++++++++++++++++ .../eof/leading_and_trailing_dots.yul | 33 ++++ .../objectCompiler/eof/linkersymbol.yul | 38 ++++ .../libyul/objectCompiler/eof/namedObject.yul | 13 ++ .../objectCompiler/eof/namedObjectCode.yul | 19 ++ .../objectCompiler/eof/nested_optimizer.yul | 47 +++++ test/libyul/objectCompiler/eof/simple.yul | 19 ++ .../objectCompiler/eof/simple_optimizer.yul | 24 +++ test/libyul/objectCompiler/eof/smoke.yul | 12 ++ test/libyul/objectCompiler/eof/subObject.yul | 29 +++ .../objectCompiler/eof/subSubObject.yul | 49 +++++ .../objectCompiler/eof/verbatim_bug.yul | 120 ++++++++++++ .../libyul/objectCompiler/function_series.yul | 1 + ...identical_subobjects_creation_deployed.yul | 1 + .../identical_subobjects_full_debug_info.yul | 1 + .../identical_subobjects_no_debug_info.yul | 1 + ...dentical_subobjects_partial_debug_info.yul | 1 + ...bobjects_partial_debug_info_no_use_src.yul | 1 + ...cal_subobjects_with_subject_references.yul | 1 + ..._long_name_does_not_end_up_in_bytecode.yul | 1 + test/libyul/objectCompiler/jump_tags.yul | 1 + .../leading_and_trailing_dots.yul | 1 + test/libyul/objectCompiler/linkersymbol.yul | 1 + .../objectCompiler/long_object_name.yul | 1 + test/libyul/objectCompiler/manySubObjects.yul | 1 + test/libyul/objectCompiler/metadata.yul | 1 + test/libyul/objectCompiler/namedObject.yul | 1 + .../libyul/objectCompiler/namedObjectCode.yul | 1 + .../objectCompiler/nested_optimizer.yul | 1 + test/libyul/objectCompiler/simple.yul | 1 + .../objectCompiler/simple_optimizer.yul | 1 + test/libyul/objectCompiler/smoke.yul | 1 + .../libyul/objectCompiler/sourceLocations.yul | 1 + test/libyul/objectCompiler/subObject.yul | 1 + .../libyul/objectCompiler/subObjectAccess.yul | 1 + test/libyul/objectCompiler/subSubObject.yul | 1 + test/libyul/objectCompiler/verbatim_bug.yul | 1 + 49 files changed, 1150 insertions(+) create mode 100644 test/libyul/objectCompiler/eof/identical_subobjects_creation_deployed.yul create mode 100644 test/libyul/objectCompiler/eof/identical_subobjects_full_debug_info.yul create mode 100644 test/libyul/objectCompiler/eof/identical_subobjects_no_debug_info.yul create mode 100644 test/libyul/objectCompiler/eof/identical_subobjects_partial_debug_info.yul create mode 100644 test/libyul/objectCompiler/eof/identical_subobjects_partial_debug_info_no_use_src.yul create mode 100644 test/libyul/objectCompiler/eof/leading_and_trailing_dots.yul create mode 100644 test/libyul/objectCompiler/eof/linkersymbol.yul create mode 100644 test/libyul/objectCompiler/eof/namedObject.yul create mode 100644 test/libyul/objectCompiler/eof/namedObjectCode.yul create mode 100644 test/libyul/objectCompiler/eof/nested_optimizer.yul create mode 100644 test/libyul/objectCompiler/eof/simple.yul create mode 100644 test/libyul/objectCompiler/eof/simple_optimizer.yul create mode 100644 test/libyul/objectCompiler/eof/smoke.yul create mode 100644 test/libyul/objectCompiler/eof/subObject.yul create mode 100644 test/libyul/objectCompiler/eof/subSubObject.yul create mode 100644 test/libyul/objectCompiler/eof/verbatim_bug.yul diff --git a/test/libyul/objectCompiler/data.yul b/test/libyul/objectCompiler/data.yul index 4447a0b8e97f..643bd1c34bda 100644 --- a/test/libyul/objectCompiler/data.yul +++ b/test/libyul/objectCompiler/data.yul @@ -5,6 +5,7 @@ object "a" { } // ==== // EVMVersion: >=constantinople +// bytecodeFormat: legacy // ---- // Assembly: // /* "source":22:29 */ diff --git a/test/libyul/objectCompiler/datacopy.yul b/test/libyul/objectCompiler/datacopy.yul index 46a0ec0f7a6d..ea00b4478461 100644 --- a/test/libyul/objectCompiler/datacopy.yul +++ b/test/libyul/objectCompiler/datacopy.yul @@ -13,6 +13,7 @@ object "a" { } // ==== // EVMVersion: >=shanghai +// bytecodeFormat: legacy // ---- // Assembly: // /* "source":77:92 */ diff --git a/test/libyul/objectCompiler/dataoffset_code.yul b/test/libyul/objectCompiler/dataoffset_code.yul index 1171303af291..2a1aa04a14dd 100644 --- a/test/libyul/objectCompiler/dataoffset_code.yul +++ b/test/libyul/objectCompiler/dataoffset_code.yul @@ -7,6 +7,7 @@ object "a" { } // ==== // EVMVersion: >=shanghai +// bytecodeFormat: legacy // ---- // Assembly: // /* "source":44:61 */ diff --git a/test/libyul/objectCompiler/dataoffset_data.yul b/test/libyul/objectCompiler/dataoffset_data.yul index 381cb999f0ed..9490986819e0 100644 --- a/test/libyul/objectCompiler/dataoffset_data.yul +++ b/test/libyul/objectCompiler/dataoffset_data.yul @@ -4,6 +4,7 @@ object "a" { } // ==== // EVMVersion: >=shanghai +// bytecodeFormat: legacy // ---- // Assembly: // /* "source":56:75 */ diff --git a/test/libyul/objectCompiler/dataoffset_self.yul b/test/libyul/objectCompiler/dataoffset_self.yul index b6a0552cb7b1..9f82f5568023 100644 --- a/test/libyul/objectCompiler/dataoffset_self.yul +++ b/test/libyul/objectCompiler/dataoffset_self.yul @@ -4,6 +4,7 @@ object "a" { } // ==== // EVMVersion: >=shanghai +// bytecodeFormat: legacy // ---- // Assembly: // /* "source":44:59 */ diff --git a/test/libyul/objectCompiler/datasize_code.yul b/test/libyul/objectCompiler/datasize_code.yul index 7bf365031b5b..db2fee4d8392 100644 --- a/test/libyul/objectCompiler/datasize_code.yul +++ b/test/libyul/objectCompiler/datasize_code.yul @@ -7,6 +7,7 @@ object "a" { } // ==== // EVMVersion: >=shanghai +// bytecodeFormat: legacy // ---- // Assembly: // /* "source":44:59 */ diff --git a/test/libyul/objectCompiler/datasize_data.yul b/test/libyul/objectCompiler/datasize_data.yul index f0ae32b1b661..52afde6fcad0 100644 --- a/test/libyul/objectCompiler/datasize_data.yul +++ b/test/libyul/objectCompiler/datasize_data.yul @@ -4,6 +4,7 @@ object "a" { } // ==== // EVMVersion: >=shanghai +// bytecodeFormat: legacy // ---- // Assembly: // /* "source":44:61 */ diff --git a/test/libyul/objectCompiler/datasize_self.yul b/test/libyul/objectCompiler/datasize_self.yul index fb5b7fb89489..93512f1da5ac 100644 --- a/test/libyul/objectCompiler/datasize_self.yul +++ b/test/libyul/objectCompiler/datasize_self.yul @@ -4,6 +4,7 @@ object "a" { } // ==== // EVMVersion: >=shanghai +// bytecodeFormat: legacy // ---- // Assembly: // /* "source":36:49 */ diff --git a/test/libyul/objectCompiler/eof/identical_subobjects_creation_deployed.yul b/test/libyul/objectCompiler/eof/identical_subobjects_creation_deployed.yul new file mode 100644 index 000000000000..ad5c16a6cf57 --- /dev/null +++ b/test/libyul/objectCompiler/eof/identical_subobjects_creation_deployed.yul @@ -0,0 +1,109 @@ +// All objects have identical unoptimized code, but at 200 runs the creation objects will optimized +// differently from deployed objects. + +/// @use-src 0:"A.sol" +object "A" { + code { + function load(i) -> r { r := calldataload(i) } + let x := add(shl(255, 1), shl(127, not(0))) + sstore(load(x), load(1)) + } + + /// @use-src 0:"B.sol" + object "B_deployed" { + code { + function load(i) -> r { r := calldataload(i) } + let x := add(shl(255, 1), shl(127, not(0))) + sstore(load(x), load(1)) + } + + /// @use-src 0:"A.sol" + object "A" { + code { + function load(i) -> r { r := calldataload(i) } + let x := add(shl(255, 1), shl(127, not(0))) + sstore(load(x), load(1)) + } + + /// @use-src 0:"B.sol" + object "B_deployed" { + code { + function load(i) -> r { r := calldataload(i) } + let x := add(shl(255, 1), shl(127, not(0))) + sstore(load(x), load(1)) + } + } + + /// @use-src 0:"C.sol" + object "C" { + code { + function load(i) -> r { r := calldataload(i) } + let x := add(shl(255, 1), shl(127, not(0))) + sstore(load(x), load(1)) + } + } + } + } + + /// @use-src 0:"C.sol" + object "C_deployed" { + code { + function load(i) -> r { r := calldataload(i) } + let x := add(shl(255, 1), shl(127, not(0))) + sstore(load(x), load(1)) + } + } + + /// @use-src 0:"D.sol" + object "D" { + code { + function load(i) -> r { r := calldataload(i) } + let x := add(shl(255, 1), shl(127, not(0))) + sstore(load(x), load(1)) + } + } +} +// ==== +// EVMVersion: >=constantinople +// bytecodeFormat: >=EOFv1 +// optimizationPreset: full +// ---- +// Assembly: +// sstore(calldataload(sub(shl(0xff, 0x01), shl(0x7f, 0x01))), calldataload(0x01)) +// stop +// stop +// +// sub_0: assembly { +// sstore(calldataload(shl(0x7f, 0xffffffffffffffffffffffffffffffff)), calldataload(0x01)) +// stop +// stop +// +// sub_0: assembly { +// sstore(calldataload(sub(shl(0xff, 0x01), shl(0x7f, 0x01))), calldataload(0x01)) +// stop +// stop +// +// sub_0: assembly { +// sstore(calldataload(shl(0x7f, 0xffffffffffffffffffffffffffffffff)), calldataload(0x01)) +// stop +// } +// +// sub_1: assembly { +// sstore(calldataload(sub(shl(0xff, 0x01), shl(0x7f, 0x01))), calldataload(0x01)) +// stop +// } +// } +// } +// +// sub_1: assembly { +// sstore(calldataload(shl(0x7f, 0xffffffffffffffffffffffffffffffff)), calldataload(0x01)) +// stop +// } +// +// sub_2: assembly { +// sstore(calldataload(sub(shl(0xff, 0x01), shl(0x7f, 0x01))), calldataload(0x01)) +// stop +// } +// Bytecode: ef0001010004020001001104000000008000046001356001607f1b600160ff1b03355500 +// Opcodes: 0xEF STOP ADD ADD STOP DIV MUL STOP ADD STOP GT DIV STOP STOP STOP STOP DUP1 STOP DIV PUSH1 0x1 CALLDATALOAD PUSH1 0x1 PUSH1 0x7F SHL PUSH1 0x1 PUSH1 0xFF SHL SUB CALLDATALOAD SSTORE STOP +// SourceMappings: :::-:0;;;;;;;;;;; diff --git a/test/libyul/objectCompiler/eof/identical_subobjects_full_debug_info.yul b/test/libyul/objectCompiler/eof/identical_subobjects_full_debug_info.yul new file mode 100644 index 000000000000..a580300d4be8 --- /dev/null +++ b/test/libyul/objectCompiler/eof/identical_subobjects_full_debug_info.yul @@ -0,0 +1,116 @@ +// All objects have identical unoptimized code, but with different debug annotations. +// The optimized Yul will be identical only between objects that have identical debug info. + +/// @use-src 0:"A.sol" +object "A" { + code { + function load(i) -> r { r := calldataload(i) } + /// @src 0:10:20 + sstore(load(0), load(1)) + } + + /// @use-src 0:"B.sol" + object "B" { + code { + function load(i) -> r { r := calldataload(i) } + /// @src 0:10:20 + sstore(load(0), load(1)) + } + + /// @use-src 0:"A.sol" + object "A" { + code { + function load(i) -> r { r := calldataload(i) } + /// @src 0:10:20 + sstore(load(0), load(1)) + } + + /// @use-src 0:"B.sol" + object "B" { + code { + function load(i) -> r { r := calldataload(i) } + /// @src 0:10:20 + sstore(load(0), load(1)) + } + } + + /// @use-src 0:"C.sol" + object "C" { + code { + function load(i) -> r { r := calldataload(i) } + /// @src 0:10:20 + sstore(load(0), load(1)) + } + } + } + } + + /// @use-src 0:"C.sol" + object "C" { + code { + function load(i) -> r { r := calldataload(i) } + /// @src 0:10:20 + sstore(load(0), load(1)) + } + } + + /// @use-src 0:"D.sol" + object "D" { + code { + function load(i) -> r { r := calldataload(i) } + /// @src 0:10:20 + sstore(load(0), load(1)) + } + } +} +// ==== +// EVMVersion: >=shanghai +// bytecodeFormat: >=EOFv1 +// optimizationPreset: full +// ---- +// Assembly: +// /* "A.sol":10:20 */ +// sstore(calldataload(0x00), calldataload(0x01)) +// stop +// stop +// +// sub_0: assembly { +// /* "B.sol":10:20 */ +// sstore(calldataload(0x00), calldataload(0x01)) +// stop +// stop +// +// sub_0: assembly { +// /* "A.sol":10:20 */ +// sstore(calldataload(0x00), calldataload(0x01)) +// stop +// stop +// +// sub_0: assembly { +// /* "B.sol":10:20 */ +// sstore(calldataload(0x00), calldataload(0x01)) +// stop +// } +// +// sub_1: assembly { +// /* "C.sol":10:20 */ +// sstore(calldataload(0x00), calldataload(0x01)) +// stop +// } +// } +// } +// +// sub_1: assembly { +// /* "C.sol":10:20 */ +// sstore(calldataload(0x00), calldataload(0x01)) +// stop +// } +// +// sub_2: assembly { +// /* "D.sol":10:20 */ +// sstore(calldataload(0x00), calldataload(0x01)) +// stop +// } +// Bytecode: ef0001010004020001000704000000008000026001355f355500 +// Opcodes: 0xEF STOP ADD ADD STOP DIV MUL STOP ADD STOP SMOD DIV STOP STOP STOP STOP DUP1 STOP MUL PUSH1 0x1 CALLDATALOAD PUSH0 CALLDATALOAD SSTORE STOP +// SourceMappings: 10:10::-:0;-1:-1;10:10;-1:-1;10:10;-1:-1 diff --git a/test/libyul/objectCompiler/eof/identical_subobjects_no_debug_info.yul b/test/libyul/objectCompiler/eof/identical_subobjects_no_debug_info.yul new file mode 100644 index 000000000000..681d2d7c013f --- /dev/null +++ b/test/libyul/objectCompiler/eof/identical_subobjects_no_debug_info.yul @@ -0,0 +1,165 @@ +// All objects have identical unoptimized code. +// After optimizations we should end up with identical code for all of them. + +object "A" { + code { + function load(i) -> r { r := calldataload(i) } + sstore(load(0), load(1)) + } + + object "B" { + code { + function load(i) -> r { r := calldataload(i) } + sstore(load(0), load(1)) + } + + object "A" { + code { + function load(i) -> r { r := calldataload(i) } + sstore(load(0), load(1)) + } + + object "B" { + code { + function load(i) -> r { r := calldataload(i) } + sstore(load(0), load(1)) + } + } + + object "C" { + code { + function load(i) -> r { r := calldataload(i) } + sstore(load(0), load(1)) + } + } + } + } + + object "C" { + code { + function load(i) -> r { r := calldataload(i) } + sstore(load(0), load(1)) + } + } + + object "D" { + code { + function load(i) -> r { r := calldataload(i) } + sstore(load(0), load(1)) + } + } +} +// ==== +// EVMVersion: >=shanghai +// bytecodeFormat: >=EOFv1 +// optimizationPreset: full +// ---- +// Assembly: +// /* "source":83:84 */ +// 0x01 +// /* "source":70:85 */ +// calldataload +// /* "source":66:67 */ +// 0x00 +// /* "source":53:68 */ +// calldataload +// /* "source":46:86 */ +// sstore +// /* "source":22:102 */ +// stop +// stop +// +// sub_0: assembly { +// /* "source":202:203 */ +// 0x01 +// /* "source":189:204 */ +// calldataload +// /* "source":185:186 */ +// 0x00 +// /* "source":172:187 */ +// calldataload +// /* "source":165:205 */ +// sstore +// /* "source":133:229 */ +// stop +// stop +// +// sub_0: assembly { +// /* "source":345:346 */ +// 0x01 +// /* "source":332:347 */ +// calldataload +// /* "source":328:329 */ +// 0x00 +// /* "source":315:330 */ +// calldataload +// /* "source":308:348 */ +// sstore +// /* "source":268:380 */ +// stop +// stop +// +// sub_0: assembly { +// /* "source":512:513 */ +// 0x01 +// /* "source":499:514 */ +// calldataload +// /* "source":495:496 */ +// 0x00 +// /* "source":482:497 */ +// calldataload +// /* "source":475:515 */ +// sstore +// /* "source":427:555 */ +// stop +// } +// +// sub_1: assembly { +// /* "source":701:702 */ +// 0x01 +// /* "source":688:703 */ +// calldataload +// /* "source":684:685 */ +// 0x00 +// /* "source":671:686 */ +// calldataload +// /* "source":664:704 */ +// sstore +// /* "source":616:744 */ +// stop +// } +// } +// } +// +// sub_1: assembly { +// /* "source":874:875 */ +// 0x01 +// /* "source":861:876 */ +// calldataload +// /* "source":857:858 */ +// 0x00 +// /* "source":844:859 */ +// calldataload +// /* "source":837:877 */ +// sstore +// /* "source":805:901 */ +// stop +// } +// +// sub_2: assembly { +// /* "source":1007:1008 */ +// 0x01 +// /* "source":994:1009 */ +// calldataload +// /* "source":990:991 */ +// 0x00 +// /* "source":977:992 */ +// calldataload +// /* "source":970:1010 */ +// sstore +// /* "source":938:1034 */ +// stop +// } +// Bytecode: ef0001010004020001000704000000008000026001355f355500 +// Opcodes: 0xEF STOP ADD ADD STOP DIV MUL STOP ADD STOP SMOD DIV STOP STOP STOP STOP DUP1 STOP MUL PUSH1 0x1 CALLDATALOAD PUSH0 CALLDATALOAD SSTORE STOP +// SourceMappings: 83:1:0:-:0;70:15;66:1;53:15;46:40;22:80 diff --git a/test/libyul/objectCompiler/eof/identical_subobjects_partial_debug_info.yul b/test/libyul/objectCompiler/eof/identical_subobjects_partial_debug_info.yul new file mode 100644 index 000000000000..27d24867c2ff --- /dev/null +++ b/test/libyul/objectCompiler/eof/identical_subobjects_partial_debug_info.yul @@ -0,0 +1,153 @@ +// All objects have identical unoptimized code, but don't necessarily contain the same location comments. +// The optimized Yul will be identical only between objects that have identical debug info. +// Note that when @use-src is missing, the parser ignores location comments, so they do not become +// a part of the debug info. + +/// @use-src 0:"A.sol" +object "A" { + code { + function load(i) -> r { r := calldataload(i) } + /// @src 0:10:20 + sstore(load(0), load(1)) + } + + /// @use-src 0:"B.sol" + object "B" { + code { + function load(i) -> r { r := calldataload(i) } + /// @src 0:10:20 + sstore(load(0), load(1)) + } + + object "A" { + code { + function load(i) -> r { r := calldataload(i) } + sstore(load(0), load(1)) + } + + object "B" { + code { + function load(i) -> r { r := calldataload(i) } + sstore(load(0), load(1)) + } + } + + /// @use-src 0:"C.sol" + object "C" { + code { + function load(i) -> r { r := calldataload(i) } + /// @src 0:10:20 + sstore(load(0), load(1)) + } + } + } + } + + /// @use-src 0:"C.sol" + object "C" { + code { + function load(i) -> r { r := calldataload(i) } + /// @src 0:10:20 + sstore(load(0), load(1)) + } + } + + /// @use-src 0:"C.sol" + object "D" { + code { + function load(i) -> r { r := calldataload(i) } + sstore(load(0), load(1)) + } + } + + object "E" { + code { + function load(i) -> r { r := calldataload(i) } + /// @src 0:10:20 + sstore(load(0), load(1)) + } + } +} +// ==== +// EVMVersion: >=shanghai +// bytecodeFormat: >=EOFv1 +// optimizationPreset: full +// ---- +// Assembly: +// /* "A.sol":10:20 */ +// sstore(calldataload(0x00), calldataload(0x01)) +// stop +// stop +// +// sub_0: assembly { +// /* "B.sol":10:20 */ +// sstore(calldataload(0x00), calldataload(0x01)) +// stop +// stop +// +// sub_0: assembly { +// /* "source":621:622 */ +// 0x01 +// /* "source":608:623 */ +// calldataload +// /* "source":604:605 */ +// 0x00 +// /* "source":591:606 */ +// calldataload +// /* "source":584:624 */ +// sstore +// /* "source":544:656 */ +// stop +// stop +// +// sub_0: assembly { +// /* "source":788:789 */ +// 0x01 +// /* "source":775:790 */ +// calldataload +// /* "source":771:772 */ +// 0x00 +// /* "source":758:773 */ +// calldataload +// /* "source":751:791 */ +// sstore +// /* "source":703:831 */ +// stop +// } +// +// sub_1: assembly { +// /* "C.sol":10:20 */ +// sstore(calldataload(0x00), calldataload(0x01)) +// stop +// } +// } +// } +// +// sub_1: assembly { +// /* "C.sol":10:20 */ +// sstore(calldataload(0x00), calldataload(0x01)) +// stop +// } +// +// sub_2: assembly { +// sstore(calldataload(0x00), calldataload(0x01)) +// stop +// } +// +// sub_3: assembly { +// /* "source":1743:1744 */ +// 0x01 +// /* "source":1730:1745 */ +// calldataload +// /* "source":1726:1727 */ +// 0x00 +// /* "source":1713:1728 */ +// calldataload +// /* "source":1706:1746 */ +// sstore +// /* "source":1674:1770 */ +// stop +// } +// Bytecode: ef0001010004020001000704000000008000026001355f355500 +// Opcodes: 0xEF STOP ADD ADD STOP DIV MUL STOP ADD STOP SMOD DIV STOP STOP STOP STOP DUP1 STOP MUL PUSH1 0x1 CALLDATALOAD PUSH0 CALLDATALOAD SSTORE STOP +// SourceMappings: 10:10::-:0;-1:-1;10:10;-1:-1;10:10;-1:-1 diff --git a/test/libyul/objectCompiler/eof/identical_subobjects_partial_debug_info_no_use_src.yul b/test/libyul/objectCompiler/eof/identical_subobjects_partial_debug_info_no_use_src.yul new file mode 100644 index 000000000000..d5f9ce544592 --- /dev/null +++ b/test/libyul/objectCompiler/eof/identical_subobjects_partial_debug_info_no_use_src.yul @@ -0,0 +1,171 @@ +// All objects have identical unoptimized code, but don't necessarily contain the same location comments. +// After optimizations we should end up with identical code for all of them, because location +// comments will be ignored due to missing @use-src annotations and won't end up in the AST. + +object "A" { + code { + function load(i) -> r { r := calldataload(i) } + /// @src 0:10:20 + sstore(load(0), load(1)) + } + + object "B" { + code { + function load(i) -> r { r := calldataload(i) } + /// @src 0:10:20 + sstore(load(0), load(1)) + } + + object "A" { + code { + function load(i) -> r { r := calldataload(i) } + sstore(load(0), load(1)) + } + + object "B" { + code { + function load(i) -> r { r := calldataload(i) } + sstore(load(0), load(1)) + } + } + + object "C" { + code { + function load(i) -> r { r := calldataload(i) } + /// @src 0:10:20 + sstore(load(0), load(1)) + } + } + } + } + + object "C" { + code { + function load(i) -> r { r := calldataload(i) } + /// @src 0:10:20 + sstore(load(0), load(1)) + } + } + + object "D" { + code { + function load(i) -> r { r := calldataload(i) } + /// @src 0:10:20 + sstore(load(0), load(1)) + } + } +} +// ==== +// EVMVersion: >=shanghai +// bytecodeFormat: >=EOFv1 +// optimizationPreset: full +// ---- +// Assembly: +// /* "source":83:84 */ +// 0x01 +// /* "source":70:85 */ +// calldataload +// /* "source":66:67 */ +// 0x00 +// /* "source":53:68 */ +// calldataload +// /* "source":46:86 */ +// sstore +// /* "source":22:102 */ +// stop +// stop +// +// sub_0: assembly { +// /* "source":202:203 */ +// 0x01 +// /* "source":189:204 */ +// calldataload +// /* "source":185:186 */ +// 0x00 +// /* "source":172:187 */ +// calldataload +// /* "source":165:205 */ +// sstore +// /* "source":133:229 */ +// stop +// stop +// +// sub_0: assembly { +// /* "source":345:346 */ +// 0x01 +// /* "source":332:347 */ +// calldataload +// /* "source":328:329 */ +// 0x00 +// /* "source":315:330 */ +// calldataload +// /* "source":308:348 */ +// sstore +// /* "source":268:380 */ +// stop +// stop +// +// sub_0: assembly { +// /* "source":512:513 */ +// 0x01 +// /* "source":499:514 */ +// calldataload +// /* "source":495:496 */ +// 0x00 +// /* "source":482:497 */ +// calldataload +// /* "source":475:515 */ +// sstore +// /* "source":427:555 */ +// stop +// } +// +// sub_1: assembly { +// /* "source":701:702 */ +// 0x01 +// /* "source":688:703 */ +// calldataload +// /* "source":684:685 */ +// 0x00 +// /* "source":671:686 */ +// calldataload +// /* "source":664:704 */ +// sstore +// /* "source":616:744 */ +// stop +// } +// } +// } +// +// sub_1: assembly { +// /* "source":874:875 */ +// 0x01 +// /* "source":861:876 */ +// calldataload +// /* "source":857:858 */ +// 0x00 +// /* "source":844:859 */ +// calldataload +// /* "source":837:877 */ +// sstore +// /* "source":805:901 */ +// stop +// } +// +// sub_2: assembly { +// /* "source":1007:1008 */ +// 0x01 +// /* "source":994:1009 */ +// calldataload +// /* "source":990:991 */ +// 0x00 +// /* "source":977:992 */ +// calldataload +// /* "source":970:1010 */ +// sstore +// /* "source":938:1034 */ +// stop +// } +// Bytecode: ef0001010004020001000704000000008000026001355f355500 +// Opcodes: 0xEF STOP ADD ADD STOP DIV MUL STOP ADD STOP SMOD DIV STOP STOP STOP STOP DUP1 STOP MUL PUSH1 0x1 CALLDATALOAD PUSH0 CALLDATALOAD SSTORE STOP +// SourceMappings: 83:1:0:-:0;70:15;66:1;53:15;46:40;22:80 diff --git a/test/libyul/objectCompiler/eof/leading_and_trailing_dots.yul b/test/libyul/objectCompiler/eof/leading_and_trailing_dots.yul new file mode 100644 index 000000000000..a89ea3689039 --- /dev/null +++ b/test/libyul/objectCompiler/eof/leading_and_trailing_dots.yul @@ -0,0 +1,33 @@ +{ + function e(_._) { + e(0) + } + e(2) + function f(n._) { + f(0) + } + f(2) + function g(_.n) { + g(0) + } + g(2) +} +// ==== +// EVMVersion: >=shanghai +// bytecodeFormat: >=EOFv1 +// ---- +// Assembly: +// /* "source":53:54 */ +// 0x02 +// /* "source":51:55 */ +// jumpf{code_section_1} +// +// code_section_1: assembly { +// /* "source":136:137 */ +// 0x00 +// /* "source":134:138 */ +// jumpf{code_section_1} +// } +// Bytecode: ef0001010008020002000500040400000000800001018000026002e500015fe50001 +// Opcodes: 0xEF STOP ADD ADD STOP ADDMOD MUL STOP MUL STOP SDIV STOP DIV DIV STOP STOP STOP STOP DUP1 STOP ADD ADD DUP1 STOP MUL PUSH1 0x2 JUMPF 0x1 PUSH0 JUMPF 0x1 +// SourceMappings: 53:1:0:-:0;51:4::i136:1:0:-:0;134:4::i diff --git a/test/libyul/objectCompiler/eof/linkersymbol.yul b/test/libyul/objectCompiler/eof/linkersymbol.yul new file mode 100644 index 000000000000..30a5a20e8b7e --- /dev/null +++ b/test/libyul/objectCompiler/eof/linkersymbol.yul @@ -0,0 +1,38 @@ +object "a" { + code { + let addr := linkersymbol("contract/test.sol:L") + mstore(128, shl(227, 0x18530aaf)) + let success := extcall(addr, 0, 128, 4) + } +} +// ==== +// EVMVersion: >=shanghai +// bytecodeFormat: >=EOFv1 +// ---- +// Assembly: +// /* "source":178:179 */ +// 0x04 +// /* "source":173:176 */ +// 0x80 +// /* "source":170:171 */ +// 0x00 +// /* "source":58:93 */ +// linkerSymbol("f919ba91ac99f96129544b80b9516b27a80e376b9dc693819d0b18b7e0395612") +// /* "source":127:137 */ +// 0x18530aaf +// /* "source":122:125 */ +// 0xe3 +// /* "source":118:138 */ +// shl +// /* "source":106:139 */ +// dup4 +// mstore +// /* "source":156:180 */ +// extcall +// /* "source":152:181 */ +// pop +// /* "source":22:197 */ +// stop +// Bytecode: ef000101000402000100270400000000800006600460805f7300000000000000000000000000000000000000006318530aaf60e31b8352f85000 +// Opcodes: 0xEF STOP ADD ADD STOP DIV MUL STOP ADD STOP 0x27 DIV STOP STOP STOP STOP DUP1 STOP MOD PUSH1 0x4 PUSH1 0x80 PUSH0 PUSH20 0x0 PUSH4 0x18530AAF PUSH1 0xE3 SHL DUP4 MSTORE EXTCALL POP STOP +// SourceMappings: 178:1:0:-:0;173:3;170:1;58:35;127:10;122:3;118:20;106:33;;156:24;152:29;22:175 diff --git a/test/libyul/objectCompiler/eof/namedObject.yul b/test/libyul/objectCompiler/eof/namedObject.yul new file mode 100644 index 000000000000..05007d3dfc1a --- /dev/null +++ b/test/libyul/objectCompiler/eof/namedObject.yul @@ -0,0 +1,13 @@ +object "a" { + code {} +} +// ==== +// EVMVersion: >=constantinople +// bytecodeFormat: >=EOFv1 +// ---- +// Assembly: +// /* "source":22:29 */ +// stop +// Bytecode: ef00010100040200010001040000000080000000 +// Opcodes: 0xEF STOP ADD ADD STOP DIV MUL STOP ADD STOP ADD DIV STOP STOP STOP STOP DUP1 STOP STOP STOP +// SourceMappings: 22:7:0:-:0 diff --git a/test/libyul/objectCompiler/eof/namedObjectCode.yul b/test/libyul/objectCompiler/eof/namedObjectCode.yul new file mode 100644 index 000000000000..8e82614ca8c9 --- /dev/null +++ b/test/libyul/objectCompiler/eof/namedObjectCode.yul @@ -0,0 +1,19 @@ +object "a" { + code { sstore(0, 1) } +} +// ==== +// EVMVersion: >=shanghai +// bytecodeFormat: >=EOFv1 +// ---- +// Assembly: +// /* "source":36:37 */ +// 0x01 +// /* "source":33:34 */ +// 0x00 +// /* "source":26:38 */ +// sstore +// /* "source":22:42 */ +// stop +// Bytecode: ef00010100040200010005040000000080000260015f5500 +// Opcodes: 0xEF STOP ADD ADD STOP DIV MUL STOP ADD STOP SDIV DIV STOP STOP STOP STOP DUP1 STOP MUL PUSH1 0x1 PUSH0 SSTORE STOP +// SourceMappings: 36:1:0:-:0;33;26:12;22:20 diff --git a/test/libyul/objectCompiler/eof/nested_optimizer.yul b/test/libyul/objectCompiler/eof/nested_optimizer.yul new file mode 100644 index 000000000000..df0e74f01d3f --- /dev/null +++ b/test/libyul/objectCompiler/eof/nested_optimizer.yul @@ -0,0 +1,47 @@ +object "a" { + code { + let x := calldataload(0) + let y := calldataload(0) + let z := sub(y, x) + sstore(add(x, 0), z) + } + object "sub" { + code { + let x := calldataload(0) + let y := calldataload(0) + let z := sub(y, x) + sstore(add(x, 0), z) + } + } +} +// ==== +// EVMVersion: >=shanghai +// bytecodeFormat: >=EOFv1 +// optimizationPreset: full +// ---- +// Assembly: +// /* "source":58:59 */ +// 0x00 +// /* "source":41:56 */ +// dup1 +// calldataload +// /* "source":34:60 */ +// sstore +// /* "source":22:68 */ +// stop +// stop +// +// sub_0: assembly { +// /* "source":141:142 */ +// 0x00 +// /* "source":124:139 */ +// dup1 +// calldataload +// /* "source":117:143 */ +// sstore +// /* "source":101:155 */ +// stop +// } +// Bytecode: ef0001010004020001000504000000008000025f80355500 +// Opcodes: 0xEF STOP ADD ADD STOP DIV MUL STOP ADD STOP SDIV DIV STOP STOP STOP STOP DUP1 STOP MUL PUSH0 DUP1 CALLDATALOAD SSTORE STOP +// SourceMappings: 58:1:0:-:0;41:15;;34:26;22:46 diff --git a/test/libyul/objectCompiler/eof/simple.yul b/test/libyul/objectCompiler/eof/simple.yul new file mode 100644 index 000000000000..cfb95fbecfb1 --- /dev/null +++ b/test/libyul/objectCompiler/eof/simple.yul @@ -0,0 +1,19 @@ +{ + sstore(0, 1) +} +// ==== +// EVMVersion: >=shanghai +// bytecodeFormat: >=EOFv1 +// ---- +// Assembly: +// /* "source":41:42 */ +// 0x01 +// /* "source":38:39 */ +// 0x00 +// /* "source":31:43 */ +// sstore +// /* "source":27:47 */ +// stop +// Bytecode: ef00010100040200010005040000000080000260015f5500 +// Opcodes: 0xEF STOP ADD ADD STOP DIV MUL STOP ADD STOP SDIV DIV STOP STOP STOP STOP DUP1 STOP MUL PUSH1 0x1 PUSH0 SSTORE STOP +// SourceMappings: 41:1:0:-:0;38;31:12;27:20 diff --git a/test/libyul/objectCompiler/eof/simple_optimizer.yul b/test/libyul/objectCompiler/eof/simple_optimizer.yul new file mode 100644 index 000000000000..c1d56a8402df --- /dev/null +++ b/test/libyul/objectCompiler/eof/simple_optimizer.yul @@ -0,0 +1,24 @@ +{ + let x := calldataload(0) + let y := calldataload(0) + let z := sub(y, x) + sstore(add(x, 0), z) +} +// ==== +// EVMVersion: >=shanghai +// bytecodeFormat: >=EOFv1 +// optimizationPreset: full +// ---- +// Assembly: +// /* "source":63:64 */ +// 0x00 +// /* "source":46:61 */ +// dup1 +// calldataload +// /* "source":39:65 */ +// sstore +// /* "source":27:73 */ +// stop +// Bytecode: ef0001010004020001000504000000008000025f80355500 +// Opcodes: 0xEF STOP ADD ADD STOP DIV MUL STOP ADD STOP SDIV DIV STOP STOP STOP STOP DUP1 STOP MUL PUSH0 DUP1 CALLDATALOAD SSTORE STOP +// SourceMappings: 63:1:0:-:0;46:15;;39:26;27:46 diff --git a/test/libyul/objectCompiler/eof/smoke.yul b/test/libyul/objectCompiler/eof/smoke.yul new file mode 100644 index 000000000000..eecfac9a8741 --- /dev/null +++ b/test/libyul/objectCompiler/eof/smoke.yul @@ -0,0 +1,12 @@ +{ +} +// ==== +// EVMVersion: >=constantinople +// bytecodeFormat: >=EOFv1 +// ---- +// Assembly: +// /* "source":27:34 */ +// stop +// Bytecode: ef00010100040200010001040000000080000000 +// Opcodes: 0xEF STOP ADD ADD STOP DIV MUL STOP ADD STOP ADD DIV STOP STOP STOP STOP DUP1 STOP STOP STOP +// SourceMappings: 27:7:0:-:0 diff --git a/test/libyul/objectCompiler/eof/subObject.yul b/test/libyul/objectCompiler/eof/subObject.yul new file mode 100644 index 000000000000..dd6cce28668c --- /dev/null +++ b/test/libyul/objectCompiler/eof/subObject.yul @@ -0,0 +1,29 @@ +object "a" { + code {} + // Unreferenced data is not added to the assembled bytecode. + data "str" "Hello, World!" + object "sub" { code { sstore(0, 1) } } +} +// ==== +// EVMVersion: >=constantinople +// bytecodeFormat: >=EOFv1 +// ---- +// Assembly: +// /* "source":22:29 */ +// stop +// stop +// data_acaf3289d7b601cbd114fb36c4d29c85bbfd5e133f14cb355c3fd8d99367964f 48656c6c6f2c20576f726c6421 +// +// sub_0: assembly { +// /* "source":123:124 */ +// 0x01 +// /* "source":120:121 */ +// 0x00 +// /* "source":113:125 */ +// sstore +// /* "source":109:129 */ +// stop +// } +// Bytecode: ef0001010004020001000104000d00008000000048656c6c6f2c20576f726c6421 +// Opcodes: 0xEF STOP ADD ADD STOP DIV MUL STOP ADD STOP ADD DIV STOP 0xD STOP STOP DUP1 STOP STOP STOP BASEFEE PUSH6 0x6C6C6F2C2057 PUSH16 0x726C6421000000000000000000000000 +// SourceMappings: 22:7:0:-:0 diff --git a/test/libyul/objectCompiler/eof/subSubObject.yul b/test/libyul/objectCompiler/eof/subSubObject.yul new file mode 100644 index 000000000000..39acf1f1d953 --- /dev/null +++ b/test/libyul/objectCompiler/eof/subSubObject.yul @@ -0,0 +1,49 @@ +object "a" { + code {} + // Unreferenced data is not added to the assembled bytecode. + data "str" "Hello, World!" + object "sub" { + code { sstore(0, 1) } + object "subsub" { + code { sstore(2, 3) } + data "str" hex"123456" + } + } +} +// ==== +// EVMVersion: >=constantinople +// bytecodeFormat: >=EOFv1 +// ---- +// Assembly: +// /* "source":22:29 */ +// stop +// stop +// data_acaf3289d7b601cbd114fb36c4d29c85bbfd5e133f14cb355c3fd8d99367964f 48656c6c6f2c20576f726c6421 +// +// sub_0: assembly { +// /* "source":123:124 */ +// 0x01 +// /* "source":120:121 */ +// 0x00 +// /* "source":113:125 */ +// sstore +// /* "source":109:129 */ +// stop +// stop +// +// sub_0: assembly { +// /* "source":187:188 */ +// 0x03 +// /* "source":184:185 */ +// 0x02 +// /* "source":177:189 */ +// sstore +// /* "source":173:193 */ +// stop +// stop +// data_6adf031833174bbe4c85eafe59ddb54e6584648c2c962c6f94791ab49caa0ad4 123456 +// } +// } +// Bytecode: ef0001010004020001000104000d00008000000048656c6c6f2c20576f726c6421 +// Opcodes: 0xEF STOP ADD ADD STOP DIV MUL STOP ADD STOP ADD DIV STOP 0xD STOP STOP DUP1 STOP STOP STOP BASEFEE PUSH6 0x6C6C6F2C2057 PUSH16 0x726C6421000000000000000000000000 +// SourceMappings: 22:7:0:-:0 diff --git a/test/libyul/objectCompiler/eof/verbatim_bug.yul b/test/libyul/objectCompiler/eof/verbatim_bug.yul new file mode 100644 index 000000000000..99b2bc19dd4c --- /dev/null +++ b/test/libyul/objectCompiler/eof/verbatim_bug.yul @@ -0,0 +1,120 @@ +object "a" { + code { + let dummy := 0xAABBCCDDEEFF + let input := sload(0) + let output + + switch input + case 0x00 { + // Note that due to a bug the following disappeared from the assembly output. + output := verbatim_1i_1o(hex"506000", dummy) + } + case 0x01 { + output := 1 + } + case 0x02 { + output := verbatim_1i_1o(hex"506002", dummy) + } + case 0x03 { + output := 3 + } + + sstore(0, output) + } +} +// ==== +// EVMVersion: >=shanghai +// bytecodeFormat: >=EOFv1 +// optimizationPreset: full +// ---- +// Assembly: +// /* "source":65:66 */ +// 0x00 +// /* "source":59:67 */ +// sload +// /* "source":94:95 */ +// 0x00 +// /* "source":108:406 */ +// swap1 +// /* "source":133:225 */ +// dup1 +// /* "source":138:142 */ +// 0x00 +// /* "source":133:225 */ +// eq +// rjumpi{tag_1} +// /* "source":108:406 */ +// tag_2: +// /* "source":238:263 */ +// dup1 +// /* "source":243:247 */ +// 0x01 +// /* "source":238:263 */ +// eq +// rjumpi{tag_3} +// /* "source":108:406 */ +// tag_4: +// /* "source":276:368 */ +// dup1 +// /* "source":281:285 */ +// 0x02 +// /* "source":276:368 */ +// eq +// rjumpi{tag_5} +// /* "source":108:406 */ +// tag_6: +// /* "source":386:390 */ +// 0x03 +// /* "source":381:406 */ +// eq +// rjumpi{tag_7} +// /* "source":108:406 */ +// tag_8: +// /* "source":426:427 */ +// 0x00 +// /* "source":419:436 */ +// sstore +// /* "source":108:406 */ +// stop +// /* "source":391:406 */ +// tag_7: +// /* "source":393:404 */ +// pop +// /* "source":403:404 */ +// 0x03 +// /* "source":391:406 */ +// rjump{tag_8} +// /* "source":286:368 */ +// tag_5: +// /* "source":314:354 */ +// pop +// pop +// /* "source":339:353 */ +// 0xaabbccddeeff +// /* "source":314:354 */ +// verbatimbytecode_506002 +// /* "source":286:368 */ +// rjump{tag_8} +// /* "source":248:263 */ +// tag_3: +// /* "source":250:261 */ +// pop +// pop +// /* "source":260:261 */ +// 0x01 +// /* "source":248:263 */ +// rjump{tag_8} +// /* "source":143:225 */ +// tag_1: +// /* "source":171:211 */ +// pop +// pop +// /* "source":196:210 */ +// 0xaabbccddeeff +// /* "source":171:211 */ +// verbatimbytecode_506000 +// /* "source":143:225 */ +// rjump{tag_8} +// Bytecode: ef0001010004020001004c04000000008000045f545f90805f14e1003380600114e1002580600214e1000f600314e100035f5500506003e0fff7505065aabbccddeeff506002e0ffe850506001e0ffe1505065aabbccddeeff506000e0ffd2 +// Opcodes: 0xEF STOP ADD ADD STOP DIV MUL STOP ADD STOP 0x4C DIV STOP STOP STOP STOP DUP1 STOP DIV PUSH0 SLOAD PUSH0 SWAP1 DUP1 PUSH0 EQ RJUMPI 0x33 DUP1 PUSH1 0x1 EQ RJUMPI 0x25 DUP1 PUSH1 0x2 EQ RJUMPI 0xF PUSH1 0x3 EQ RJUMPI 0x3 PUSH0 SSTORE STOP POP PUSH1 0x3 RJUMP 0xFFF7 POP POP PUSH6 0xAABBCCDDEEFF POP PUSH1 0x2 RJUMP 0xFFE8 POP POP PUSH1 0x1 RJUMP 0xFFE1 POP POP PUSH6 0xAABBCCDDEEFF POP PUSH1 0x0 RJUMP 0xFFD2 +// SourceMappings: 65:1:0:-:0;59:8;94:1;108:298;133:92;138:4;133:92;;108:298;238:25;243:4;238:25;;108:298;276:92;281:4;276:92;;108:298;386:4;381:25;;108:298;426:1;419:17;108:298;391:15;393:11;403:1;391:15;286:82;314:40;;339:14;314:40;286:82;248:15;250:11;;260:1;248:15;143:82;171:40;;196:14;171:40;143:82 diff --git a/test/libyul/objectCompiler/function_series.yul b/test/libyul/objectCompiler/function_series.yul index 8750f164991a..fd5a5d6c05f6 100644 --- a/test/libyul/objectCompiler/function_series.yul +++ b/test/libyul/objectCompiler/function_series.yul @@ -13,6 +13,7 @@ object "Contract" { // ==== // EVMVersion: >=shanghai // optimizationPreset: none +// bytecodeFormat: legacy // ---- // Assembly: // /* "source":33:48 */ diff --git a/test/libyul/objectCompiler/identical_subobjects_creation_deployed.yul b/test/libyul/objectCompiler/identical_subobjects_creation_deployed.yul index 01270ef44316..f39352eb0712 100644 --- a/test/libyul/objectCompiler/identical_subobjects_creation_deployed.yul +++ b/test/libyul/objectCompiler/identical_subobjects_creation_deployed.yul @@ -66,6 +66,7 @@ object "A" { // ==== // EVMVersion: >=constantinople // optimizationPreset: full +// bytecodeFormat: legacy // ---- // Assembly: // sstore(calldataload(sub(shl(0xff, 0x01), shl(0x7f, 0x01))), calldataload(0x01)) diff --git a/test/libyul/objectCompiler/identical_subobjects_full_debug_info.yul b/test/libyul/objectCompiler/identical_subobjects_full_debug_info.yul index 88ec2c3542c7..c5f8430b43f6 100644 --- a/test/libyul/objectCompiler/identical_subobjects_full_debug_info.yul +++ b/test/libyul/objectCompiler/identical_subobjects_full_debug_info.yul @@ -66,6 +66,7 @@ object "A" { // ==== // EVMVersion: >=shanghai // optimizationPreset: full +// bytecodeFormat: legacy // ---- // Assembly: // /* "A.sol":10:20 */ diff --git a/test/libyul/objectCompiler/identical_subobjects_no_debug_info.yul b/test/libyul/objectCompiler/identical_subobjects_no_debug_info.yul index 309d995469a9..fa383b461a93 100644 --- a/test/libyul/objectCompiler/identical_subobjects_no_debug_info.yul +++ b/test/libyul/objectCompiler/identical_subobjects_no_debug_info.yul @@ -52,6 +52,7 @@ object "A" { // ==== // EVMVersion: >=shanghai // optimizationPreset: full +// bytecodeFormat: legacy // ---- // Assembly: // /* "source":83:84 */ diff --git a/test/libyul/objectCompiler/identical_subobjects_partial_debug_info.yul b/test/libyul/objectCompiler/identical_subobjects_partial_debug_info.yul index 82c2fd766e2c..aac90d8a34e2 100644 --- a/test/libyul/objectCompiler/identical_subobjects_partial_debug_info.yul +++ b/test/libyul/objectCompiler/identical_subobjects_partial_debug_info.yul @@ -71,6 +71,7 @@ object "A" { // ==== // EVMVersion: >=shanghai // optimizationPreset: full +// bytecodeFormat: legacy // ---- // Assembly: // /* "A.sol":10:20 */ diff --git a/test/libyul/objectCompiler/identical_subobjects_partial_debug_info_no_use_src.yul b/test/libyul/objectCompiler/identical_subobjects_partial_debug_info_no_use_src.yul index 230535525007..918c42c58acf 100644 --- a/test/libyul/objectCompiler/identical_subobjects_partial_debug_info_no_use_src.yul +++ b/test/libyul/objectCompiler/identical_subobjects_partial_debug_info_no_use_src.yul @@ -58,6 +58,7 @@ object "A" { // ==== // EVMVersion: >=shanghai // optimizationPreset: full +// bytecodeFormat: legacy // ---- // Assembly: // /* "source":83:84 */ diff --git a/test/libyul/objectCompiler/identical_subobjects_with_subject_references.yul b/test/libyul/objectCompiler/identical_subobjects_with_subject_references.yul index 74f613cdfffa..2cc8269418f5 100644 --- a/test/libyul/objectCompiler/identical_subobjects_with_subject_references.yul +++ b/test/libyul/objectCompiler/identical_subobjects_with_subject_references.yul @@ -97,6 +97,7 @@ object "A" { // ==== // EVMVersion: >=shanghai // optimizationPreset: full +// bytecodeFormat: legacy // ---- // Assembly: // sstore(calldataload(0x00), calldataload(dataOffset(sub_0))) diff --git a/test/libyul/objectCompiler/immutable_long_name_does_not_end_up_in_bytecode.yul b/test/libyul/objectCompiler/immutable_long_name_does_not_end_up_in_bytecode.yul index 18d31087f9c5..e77506c30fbd 100644 --- a/test/libyul/objectCompiler/immutable_long_name_does_not_end_up_in_bytecode.yul +++ b/test/libyul/objectCompiler/immutable_long_name_does_not_end_up_in_bytecode.yul @@ -9,6 +9,7 @@ object "a" { } // ==== // EVMVersion: >=shanghai +// bytecodeFormat: legacy // ---- // Assembly: // /* "source":143:185 */ diff --git a/test/libyul/objectCompiler/jump_tags.yul b/test/libyul/objectCompiler/jump_tags.yul index 0d1f1ff791ab..9261c7765653 100644 --- a/test/libyul/objectCompiler/jump_tags.yul +++ b/test/libyul/objectCompiler/jump_tags.yul @@ -12,6 +12,7 @@ object "Contract" { // ==== // optimizationPreset: none +// bytecodeFormat: legacy // ---- // Assembly: // /* "source":33:54 */ diff --git a/test/libyul/objectCompiler/leading_and_trailing_dots.yul b/test/libyul/objectCompiler/leading_and_trailing_dots.yul index ddacd8b45dde..7229535ac5f5 100644 --- a/test/libyul/objectCompiler/leading_and_trailing_dots.yul +++ b/test/libyul/objectCompiler/leading_and_trailing_dots.yul @@ -14,6 +14,7 @@ } // ==== // EVMVersion: >=shanghai +// bytecodeFormat: legacy // ---- // Assembly: // /* "source":53:54 */ diff --git a/test/libyul/objectCompiler/linkersymbol.yul b/test/libyul/objectCompiler/linkersymbol.yul index ba0319108b27..d5f66d544dca 100644 --- a/test/libyul/objectCompiler/linkersymbol.yul +++ b/test/libyul/objectCompiler/linkersymbol.yul @@ -7,6 +7,7 @@ object "a" { } // ==== // EVMVersion: >=shanghai +// bytecodeFormat: legacy // ---- // Assembly: // /* "source":190:191 */ diff --git a/test/libyul/objectCompiler/long_object_name.yul b/test/libyul/objectCompiler/long_object_name.yul index 805beb42495d..b1993bb8cb32 100644 --- a/test/libyul/objectCompiler/long_object_name.yul +++ b/test/libyul/objectCompiler/long_object_name.yul @@ -9,6 +9,7 @@ object "t" { // ==== // EVMVersion: >=shanghai // optimizationPreset: full +// bytecodeFormat: legacy // ---- // Assembly: // /* "source":56:169 */ diff --git a/test/libyul/objectCompiler/manySubObjects.yul b/test/libyul/objectCompiler/manySubObjects.yul index 1a087f9c9430..a0f364a181af 100644 --- a/test/libyul/objectCompiler/manySubObjects.yul +++ b/test/libyul/objectCompiler/manySubObjects.yul @@ -136,6 +136,7 @@ object "root" { } // ==== // EVMVersion: >=shanghai +// bytecodeFormat: legacy // ---- // Assembly: // /* "source":59:75 */ diff --git a/test/libyul/objectCompiler/metadata.yul b/test/libyul/objectCompiler/metadata.yul index dbd802e3384d..3787710e644c 100644 --- a/test/libyul/objectCompiler/metadata.yul +++ b/test/libyul/objectCompiler/metadata.yul @@ -21,6 +21,7 @@ object "A" { } // ==== // EVMVersion: >=shanghai +// bytecodeFormat: legacy // ---- // Assembly: // /* "source":55:68 */ diff --git a/test/libyul/objectCompiler/namedObject.yul b/test/libyul/objectCompiler/namedObject.yul index 66727585dbcb..1897414b1e90 100644 --- a/test/libyul/objectCompiler/namedObject.yul +++ b/test/libyul/objectCompiler/namedObject.yul @@ -3,6 +3,7 @@ object "a" { } // ==== // EVMVersion: >=constantinople +// bytecodeFormat: legacy // ---- // Assembly: // /* "source":22:29 */ diff --git a/test/libyul/objectCompiler/namedObjectCode.yul b/test/libyul/objectCompiler/namedObjectCode.yul index efb41524b5cc..d66138c18f33 100644 --- a/test/libyul/objectCompiler/namedObjectCode.yul +++ b/test/libyul/objectCompiler/namedObjectCode.yul @@ -3,6 +3,7 @@ object "a" { } // ==== // EVMVersion: >=shanghai +// bytecodeFormat: legacy // ---- // Assembly: // /* "source":36:37 */ diff --git a/test/libyul/objectCompiler/nested_optimizer.yul b/test/libyul/objectCompiler/nested_optimizer.yul index 0275e1665ae5..2833f58597e1 100644 --- a/test/libyul/objectCompiler/nested_optimizer.yul +++ b/test/libyul/objectCompiler/nested_optimizer.yul @@ -17,6 +17,7 @@ object "a" { // ==== // EVMVersion: >=shanghai // optimizationPreset: full +// bytecodeFormat: legacy // ---- // Assembly: // /* "source":58:59 */ diff --git a/test/libyul/objectCompiler/simple.yul b/test/libyul/objectCompiler/simple.yul index f7f945abf58a..3af2c0f6a05d 100644 --- a/test/libyul/objectCompiler/simple.yul +++ b/test/libyul/objectCompiler/simple.yul @@ -3,6 +3,7 @@ } // ==== // EVMVersion: >=shanghai +// bytecodeFormat: legacy // ---- // Assembly: // /* "source":41:42 */ diff --git a/test/libyul/objectCompiler/simple_optimizer.yul b/test/libyul/objectCompiler/simple_optimizer.yul index 7348b2e20cd4..a24386cf4de2 100644 --- a/test/libyul/objectCompiler/simple_optimizer.yul +++ b/test/libyul/objectCompiler/simple_optimizer.yul @@ -7,6 +7,7 @@ // ==== // EVMVersion: >=shanghai // optimizationPreset: full +// bytecodeFormat: legacy // ---- // Assembly: // /* "source":63:64 */ diff --git a/test/libyul/objectCompiler/smoke.yul b/test/libyul/objectCompiler/smoke.yul index 2ca3d62f004a..06736baa8710 100644 --- a/test/libyul/objectCompiler/smoke.yul +++ b/test/libyul/objectCompiler/smoke.yul @@ -2,6 +2,7 @@ } // ==== // EVMVersion: >=constantinople +// bytecodeFormat: legacy // ---- // Assembly: // /* "source":27:34 */ diff --git a/test/libyul/objectCompiler/sourceLocations.yul b/test/libyul/objectCompiler/sourceLocations.yul index a1e55ade4ae1..756260259b2c 100644 --- a/test/libyul/objectCompiler/sourceLocations.yul +++ b/test/libyul/objectCompiler/sourceLocations.yul @@ -30,6 +30,7 @@ object "a" { } // ==== // EVMVersion: >=shanghai +// bytecodeFormat: legacy // ---- // Assembly: // /* "abc.sol":0:2 */ diff --git a/test/libyul/objectCompiler/subObject.yul b/test/libyul/objectCompiler/subObject.yul index f394054d74f0..c10cbaac1407 100644 --- a/test/libyul/objectCompiler/subObject.yul +++ b/test/libyul/objectCompiler/subObject.yul @@ -6,6 +6,7 @@ object "a" { } // ==== // EVMVersion: >=constantinople +// bytecodeFormat: legacy // ---- // Assembly: // /* "source":22:29 */ diff --git a/test/libyul/objectCompiler/subObjectAccess.yul b/test/libyul/objectCompiler/subObjectAccess.yul index 047eae408730..1ef30838f9a8 100644 --- a/test/libyul/objectCompiler/subObjectAccess.yul +++ b/test/libyul/objectCompiler/subObjectAccess.yul @@ -67,6 +67,7 @@ object "A" { } // ==== // EVMVersion: >=shanghai +// bytecodeFormat: legacy // ---- // Assembly: // /* "source":57:72 */ diff --git a/test/libyul/objectCompiler/subSubObject.yul b/test/libyul/objectCompiler/subSubObject.yul index a7274ce639db..2aa89592be5a 100644 --- a/test/libyul/objectCompiler/subSubObject.yul +++ b/test/libyul/objectCompiler/subSubObject.yul @@ -12,6 +12,7 @@ object "a" { } // ==== // EVMVersion: >=constantinople +// bytecodeFormat: legacy // ---- // Assembly: // /* "source":22:29 */ diff --git a/test/libyul/objectCompiler/verbatim_bug.yul b/test/libyul/objectCompiler/verbatim_bug.yul index 3858b5984dba..547869b041ed 100644 --- a/test/libyul/objectCompiler/verbatim_bug.yul +++ b/test/libyul/objectCompiler/verbatim_bug.yul @@ -25,6 +25,7 @@ object "a" { // ==== // EVMVersion: >=shanghai // optimizationPreset: full +// bytecodeFormat: legacy // ---- // Assembly: // /* "source":65:66 */