diff --git a/test/cmdlineTests/inline_assembly_function_name_clash/output b/test/cmdlineTests/inline_assembly_function_name_clash/output index 889514d96..8becb87ae 100644 --- a/test/cmdlineTests/inline_assembly_function_name_clash/output +++ b/test/cmdlineTests/inline_assembly_function_name_clash/output @@ -5,171 +5,201 @@ { "function-debug-runtime": { - "abi_decode_tuple_": + "abi_decode": { - "entryPoint": 117, + "entryPoint": 80, "parameterSlots": 2, "returnSlots": 0 }, - "abi_encode_t_uint256_to_t_uint256_fromStack": + "abi_encode_uint256": { - "entryPoint": 149, - "parameterSlots": 2, - "returnSlots": 0 - }, - "abi_encode_tuple_t_uint256__to_t_uint256__fromStack": - { - "entryPoint": 164, + "entryPoint": 111, "parameterSlots": 2, "returnSlots": 1 }, + "abi_encode_uint256_to_uint256": + { + "entryPoint": 98, + "parameterSlots": 2, + "returnSlots": 0 + }, "allocate_unbounded": { - "entryPoint": 100, + "entryPoint": 66, "parameterSlots": 0, "returnSlots": 1 }, - "cleanup_t_uint256": + "cleanup_uint256": { - "entryPoint": 140, + "entryPoint": 95, "parameterSlots": 1, "returnSlots": 1 }, - "convert_t_uint256_to_t_uint256": + "convert_uint256_to_uint256": { - "entryPoint": 398, + "entryPoint": 276, "parameterSlots": 1, "returnSlots": 1 }, - "external_fun_f_25": + "external_fun_f": { - "entryPoint": 189, + "entryPoint": 132, "parameterSlots": 0, "returnSlots": 0 }, - "external_fun_g_36": + "external_fun_g": { - "entryPoint": 247, + "entryPoint": 185, "parameterSlots": 0, "returnSlots": 0 }, - "fun_f_25": + "fun_f": { - "entryPoint": 653, + "entryPoint": 442, "id": 25, "parameterSlots": 0, "returnSlots": 1 }, - "fun_f_25_inner": + "fun_f_inner": { - "entryPoint": 621, + "entryPoint": 430, "parameterSlots": 1, "returnSlots": 1 }, - "fun_g_36": + "fun_g": { - "entryPoint": 858, + "entryPoint": 564, "id": 36, "parameterSlots": 0, "returnSlots": 1 }, - "fun_g_36_inner": + "fun_g_inner": { - "entryPoint": 826, + "entryPoint": 552, "parameterSlots": 1, "returnSlots": 1 }, "identity": { - "entryPoint": 389, + "entryPoint": 273, + "parameterSlots": 1, + "returnSlots": 1 + }, + "modifier_m": + { + "entryPoint": 509, + "id": 14, "parameterSlots": 1, "returnSlots": 1 }, "modifier_m_17": { - "entryPoint": 475, + "entryPoint": 344, "id": 14, "parameterSlots": 1, "returnSlots": 1 }, "modifier_m_19": { - "entryPoint": 548, + "entryPoint": 387, "id": 14, "parameterSlots": 1, "returnSlots": 1 }, "modifier_m_28": { - "entryPoint": 680, + "entryPoint": 466, "id": 14, "parameterSlots": 1, "returnSlots": 1 }, - "modifier_m_30": + "prepare_store_uint256": { - "entryPoint": 753, - "id": 14, - "parameterSlots": 1, - "returnSlots": 1 - }, - "prepare_store_t_uint256": - { - "entryPoint": 431, + "entryPoint": 304, "parameterSlots": 1, "returnSlots": 1 }, "revert_error_42b3090547df1d2001c96683413b8cf91c1b902ef5e3cb8d9f6f304cf7446f74": { - "entryPoint": 305, + "entryPoint": 238, "parameterSlots": 0, "returnSlots": 0 }, "revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb": { - "entryPoint": 109, + "entryPoint": 72, "parameterSlots": 0, "returnSlots": 0 }, "revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b": { - "entryPoint": 113, + "entryPoint": 76, "parameterSlots": 0, "returnSlots": 0 }, - "shift_left_0": + "shift_left": { - "entryPoint": 313, + "entryPoint": 246, "parameterSlots": 1, "returnSlots": 1 }, - "shift_right_224_unsigned": + "shift_right_unsigned": { - "entryPoint": 88, + "entryPoint": 60, "parameterSlots": 1, "returnSlots": 1 }, - "update_byte_slice_32_shift_0": + "update_byte_slice_shift": { - "entryPoint": 324, + "entryPoint": 251, "parameterSlots": 2, "returnSlots": 1 }, - "update_storage_value_offset_0t_uint256_to_t_uint256": + "update_storage_value_offsett_uint256_to_uint256": { - "entryPoint": 440, + "entryPoint": 307, "parameterSlots": 2, "returnSlots": 0 }, "usr$f": { - "entryPoint": 496, + "entryPoint": 339, "parameterSlots": 0, "returnSlots": 1 }, - "zero_value_for_split_t_uint256": + "usr$f_17": { - "entryPoint": 309, + "entryPoint": 382, + "parameterSlots": 0, + "returnSlots": 1 + }, + "usr$f_22": + { + "entryPoint": 425, + "parameterSlots": 0, + "returnSlots": 1 + }, + "usr$f_26": + { + "entryPoint": 461, + "parameterSlots": 0, + "returnSlots": 1 + }, + "usr$f_32": + { + "entryPoint": 504, + "parameterSlots": 0, + "returnSlots": 1 + }, + "usr$f_37": + { + "entryPoint": 547, + "parameterSlots": 0, + "returnSlots": 1 + }, + "zero_value_for_split_uint256": + { + "entryPoint": 242, "parameterSlots": 0, "returnSlots": 1 } diff --git a/test/cmdlineTests/linking_strict_assembly/output b/test/cmdlineTests/linking_strict_assembly/output index 520b3cf7b..29a8abdfa 100644 --- a/test/cmdlineTests/linking_strict_assembly/output +++ b/test/cmdlineTests/linking_strict_assembly/output @@ -4,23 +4,23 @@ Pretty printed source: object "a" { code { - let addr := linkersymbol("contract/test.sol:L") - sstore(0, addr) + { + let addr := linkersymbol("contract/test.sol:L") + sstore(0, addr) + } } } Binary representation: -731234567890123456789012345678901234567890805f5550 +7312345678901234567890123456789012345678905f5500 Text representation: /* "linking_strict_assembly/input.yul":44:79 */ linkerSymbol("f919ba91ac99f96129544b80b9516b27a80e376b9dc693819d0b18b7e0395612") - /* "linking_strict_assembly/input.yul":98:102 */ - dup1 /* "linking_strict_assembly/input.yul":95:96 */ 0x00 /* "linking_strict_assembly/input.yul":88:103 */ sstore /* "linking_strict_assembly/input.yul":22:109 */ - pop + stop diff --git a/test/cmdlineTests/linking_strict_assembly_qualified_library_qualified_reference/output b/test/cmdlineTests/linking_strict_assembly_qualified_library_qualified_reference/output index a919ba72e..e4fa4fcbd 100644 --- a/test/cmdlineTests/linking_strict_assembly_qualified_library_qualified_reference/output +++ b/test/cmdlineTests/linking_strict_assembly_qualified_library_qualified_reference/output @@ -4,18 +4,19 @@ Pretty printed source: object "a" { code { - let addr := linkersymbol(":L") - sstore(0, addr) + { + let addr := linkersymbol(":L") + sstore(0, addr) + } } } Binary representation: -731234567890123456789012345678901234567890805f5550 +7312345678901234567890123456789012345678905f5500 Text representation: linkerSymbol("20a18a9bf97d889dcf77111b674da319a4e9e3e05d3f4df9e0bf5c588dd4f0f8") - dup1 0x00 sstore - pop + stop diff --git a/test/cmdlineTests/linking_strict_assembly_qualified_library_unqualified_reference/output b/test/cmdlineTests/linking_strict_assembly_qualified_library_unqualified_reference/output index 660876888..ebf7f6542 100644 --- a/test/cmdlineTests/linking_strict_assembly_qualified_library_unqualified_reference/output +++ b/test/cmdlineTests/linking_strict_assembly_qualified_library_unqualified_reference/output @@ -4,18 +4,19 @@ Pretty printed source: object "a" { code { - let addr := linkersymbol("L") - sstore(0, addr) + { + let addr := linkersymbol("L") + sstore(0, addr) + } } } Binary representation: -73__$8aa64f937099b65a4febc243a5ae0f2d64$__805f5550 +73__$8aa64f937099b65a4febc243a5ae0f2d64$__5f5500 Text representation: linkerSymbol("8aa64f937099b65a4febc243a5ae0f2d6416bb9e473c30dd29c1ee498fb7c5a8") - dup1 0x00 sstore - pop + stop diff --git a/test/cmdlineTests/linking_strict_assembly_same_library_name_different_files/output b/test/cmdlineTests/linking_strict_assembly_same_library_name_different_files/output index 5babd2279..4aecfc6b2 100644 --- a/test/cmdlineTests/linking_strict_assembly_same_library_name_different_files/output +++ b/test/cmdlineTests/linking_strict_assembly_same_library_name_different_files/output @@ -4,34 +4,33 @@ Pretty printed source: object "a" { code { - let addr1 := linkersymbol("library1.sol:L") - let addr2 := linkersymbol("library2.sol:L") - sstore(0, addr1) - sstore(1, addr2) + { + let addr1 := linkersymbol("library1.sol:L") + let addr2 := linkersymbol("library2.sol:L") + sstore(0, addr1) + sstore(1, addr2) + } } } Binary representation: -731111111111111111111111111111111111111111732222222222222222222222222222222222222222815f55806001555050 +731111111111111111111111111111111111111111732222222222222222222222222222222222222222905f5560015500 Text representation: /* "linking_strict_assembly_same_library_name_different_files/input.yul":45:75 */ linkerSymbol("f3ffc10c396a7cc41ae954b050792839d20947bf73497d30c49a9fda1ea477ec") /* "linking_strict_assembly_same_library_name_different_files/input.yul":97:127 */ linkerSymbol("c3523432985587641d17c68161d2f700c57aaf4ed21cda4f25d76193c831f97f") - /* "linking_strict_assembly_same_library_name_different_files/input.yul":146:151 */ - dup2 + /* "linking_strict_assembly_same_library_name_different_files/input.yul":136:152 */ + swap1 /* "linking_strict_assembly_same_library_name_different_files/input.yul":143:144 */ 0x00 /* "linking_strict_assembly_same_library_name_different_files/input.yul":136:152 */ sstore - /* "linking_strict_assembly_same_library_name_different_files/input.yul":171:176 */ - dup1 /* "linking_strict_assembly_same_library_name_different_files/input.yul":168:169 */ 0x01 /* "linking_strict_assembly_same_library_name_different_files/input.yul":161:177 */ sstore /* "linking_strict_assembly_same_library_name_different_files/input.yul":22:183 */ - pop - pop + stop diff --git a/test/cmdlineTests/linking_strict_assembly_same_library_name_different_files_in_link_references/output b/test/cmdlineTests/linking_strict_assembly_same_library_name_different_files_in_link_references/output index 0eba8cf84..10a7fe7fe 100644 --- a/test/cmdlineTests/linking_strict_assembly_same_library_name_different_files_in_link_references/output +++ b/test/cmdlineTests/linking_strict_assembly_same_library_name_different_files_in_link_references/output @@ -4,34 +4,33 @@ Pretty printed source: object "a" { code { - let addr1 := linkersymbol("library1.sol:L") - let addr2 := linkersymbol("library2.sol:L") - sstore(0, addr1) - sstore(1, addr2) + { + let addr1 := linkersymbol("library1.sol:L") + let addr2 := linkersymbol("library2.sol:L") + sstore(0, addr1) + sstore(1, addr2) + } } } Binary representation: -73123456789012345678901234567890123456789073__$c3523432985587641d17c68161d2f700c5$__815f55806001555050 +73123456789012345678901234567890123456789073__$c3523432985587641d17c68161d2f700c5$__905f5560015500 Text representation: /* "linking_strict_assembly_same_library_name_different_files_in_link_references/input.yul":45:75 */ linkerSymbol("f3ffc10c396a7cc41ae954b050792839d20947bf73497d30c49a9fda1ea477ec") /* "linking_strict_assembly_same_library_name_different_files_in_link_references/input.yul":97:127 */ linkerSymbol("c3523432985587641d17c68161d2f700c57aaf4ed21cda4f25d76193c831f97f") - /* "linking_strict_assembly_same_library_name_different_files_in_link_references/input.yul":146:151 */ - dup2 + /* "linking_strict_assembly_same_library_name_different_files_in_link_references/input.yul":136:152 */ + swap1 /* "linking_strict_assembly_same_library_name_different_files_in_link_references/input.yul":143:144 */ 0x00 /* "linking_strict_assembly_same_library_name_different_files_in_link_references/input.yul":136:152 */ sstore - /* "linking_strict_assembly_same_library_name_different_files_in_link_references/input.yul":171:176 */ - dup1 /* "linking_strict_assembly_same_library_name_different_files_in_link_references/input.yul":168:169 */ 0x01 /* "linking_strict_assembly_same_library_name_different_files_in_link_references/input.yul":161:177 */ sstore /* "linking_strict_assembly_same_library_name_different_files_in_link_references/input.yul":22:183 */ - pop - pop + stop diff --git a/test/cmdlineTests/linking_strict_assembly_unqualified_library_qualified_reference/output b/test/cmdlineTests/linking_strict_assembly_unqualified_library_qualified_reference/output index 71d19f7ae..aaf03d073 100644 --- a/test/cmdlineTests/linking_strict_assembly_unqualified_library_qualified_reference/output +++ b/test/cmdlineTests/linking_strict_assembly_unqualified_library_qualified_reference/output @@ -4,18 +4,19 @@ Pretty printed source: object "a" { code { - let addr := linkersymbol(":L") - sstore(0, addr) + { + let addr := linkersymbol(":L") + sstore(0, addr) + } } } Binary representation: -73__$20a18a9bf97d889dcf77111b674da319a4$__805f5550 +73__$20a18a9bf97d889dcf77111b674da319a4$__5f5500 Text representation: linkerSymbol("20a18a9bf97d889dcf77111b674da319a4e9e3e05d3f4df9e0bf5c588dd4f0f8") - dup1 0x00 sstore - pop + stop diff --git a/test/cmdlineTests/linking_strict_assembly_unqualified_library_unqualified_reference/output b/test/cmdlineTests/linking_strict_assembly_unqualified_library_unqualified_reference/output index 6f3ee5eb7..d91d89f5c 100644 --- a/test/cmdlineTests/linking_strict_assembly_unqualified_library_unqualified_reference/output +++ b/test/cmdlineTests/linking_strict_assembly_unqualified_library_unqualified_reference/output @@ -4,18 +4,19 @@ Pretty printed source: object "a" { code { - let addr := linkersymbol("L") - sstore(0, addr) + { + let addr := linkersymbol("L") + sstore(0, addr) + } } } Binary representation: -731234567890123456789012345678901234567890805f5550 +7312345678901234567890123456789012345678905f5500 Text representation: linkerSymbol("8aa64f937099b65a4febc243a5ae0f2d6416bb9e473c30dd29c1ee498fb7c5a8") - dup1 0x00 sstore - pop + stop diff --git a/test/cmdlineTests/linking_strict_assembly_unresolved_references/output b/test/cmdlineTests/linking_strict_assembly_unresolved_references/output index bc2e167b3..a110db5a3 100644 --- a/test/cmdlineTests/linking_strict_assembly_unresolved_references/output +++ b/test/cmdlineTests/linking_strict_assembly_unresolved_references/output @@ -4,34 +4,33 @@ Pretty printed source: object "a" { code { - let addr1 := linkersymbol("contract/test.sol:L1") - let addr2 := linkersymbol("contract/test.sol:L2") - sstore(0, addr1) - sstore(1, addr2) + { + let addr1 := linkersymbol("contract/test.sol:L1") + let addr2 := linkersymbol("contract/test.sol:L2") + sstore(0, addr1) + sstore(1, addr2) + } } } Binary representation: -73123456789012345678901234567890123456789073__$fb58009a6b1ecea3b9d99bedd645df4ec3$__815f55806001555050 +73123456789012345678901234567890123456789073__$fb58009a6b1ecea3b9d99bedd645df4ec3$__905f5560015500 Text representation: /* "linking_strict_assembly_unresolved_references/input.yul":45:81 */ linkerSymbol("05b0326038374a21e0895480a58bda0768cdcc04c8d18f154362d1ca5223d245") /* "linking_strict_assembly_unresolved_references/input.yul":103:139 */ linkerSymbol("fb58009a6b1ecea3b9d99bedd645df4ec308f17bc0087e5f39d078f77f809177") - /* "linking_strict_assembly_unresolved_references/input.yul":158:163 */ - dup2 + /* "linking_strict_assembly_unresolved_references/input.yul":148:164 */ + swap1 /* "linking_strict_assembly_unresolved_references/input.yul":155:156 */ 0x00 /* "linking_strict_assembly_unresolved_references/input.yul":148:164 */ sstore - /* "linking_strict_assembly_unresolved_references/input.yul":183:188 */ - dup1 /* "linking_strict_assembly_unresolved_references/input.yul":180:181 */ 0x01 /* "linking_strict_assembly_unresolved_references/input.yul":173:189 */ sstore /* "linking_strict_assembly_unresolved_references/input.yul":22:195 */ - pop - pop + stop diff --git a/test/cmdlineTests/standard_irOptimized_ast_requested/output.json b/test/cmdlineTests/standard_irOptimized_ast_requested/output.json index ed7138c8f..200b653ff 100644 --- a/test/cmdlineTests/standard_irOptimized_ast_requested/output.json +++ b/test/cmdlineTests/standard_irOptimized_ast_requested/output.json @@ -17,278 +17,267 @@ "statements": [ { - "expression": - { - "arguments": - [ - { - "kind": "number", - "nativeSrc": "103:2:0", - "nodeType": "YulLiteral", - "src": "56:13:0", - "type": "", - "value": "64" - }, + "nativeSrc": "44:790:0", + "nodeType": "YulBlock", + "src": "-1:-1:0", + "statements": + [ + { + "expression": { "arguments": [ { "kind": "number", - "nativeSrc": "119:3:0", + "nativeSrc": "103:2:0", "nodeType": "YulLiteral", "src": "56:13:0", "type": "", - "value": "128" + "value": "64" + }, + { + "arguments": + [ + { + "kind": "number", + "nativeSrc": "119:3:0", + "nodeType": "YulLiteral", + "src": "56:13:0", + "type": "", + "value": "0x80" + } + ], + "functionName": + { + "name": "memoryguard", + "nativeSrc": "107:11:0", + "nodeType": "YulIdentifier", + "src": "56:13:0" + }, + "nativeSrc": "107:16:0", + "nodeType": "YulFunctionCall", + "src": "56:13:0" } ], "functionName": { - "name": "memoryguard", - "nativeSrc": "107:11:0", + "name": "mstore", + "nativeSrc": "96:6:0", "nodeType": "YulIdentifier", "src": "56:13:0" }, - "nativeSrc": "107:16:0", + "nativeSrc": "96:28:0", "nodeType": "YulFunctionCall", "src": "56:13:0" - } - ], - "functionName": - { - "name": "mstore", - "nativeSrc": "96:6:0", - "nodeType": "YulIdentifier", + }, + "nativeSrc": "96:28:0", + "nodeType": "YulExpressionStatement", "src": "56:13:0" }, - "nativeSrc": "96:28:0", - "nodeType": "YulFunctionCall", - "src": "56:13:0" - }, - "nativeSrc": "96:28:0", - "nodeType": "YulExpressionStatement", - "src": "56:13:0" - }, - { - "body": - { - "nativeSrc": "148:83:0", - "nodeType": "YulBlock", - "src": "56:13:0", - "statements": - [ + { + "body": { - "expression": - { - "arguments": [], - "functionName": + "nativeSrc": "148:83:0", + "nodeType": "YulBlock", + "src": "56:13:0", + "statements": + [ { - "name": "revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb", - "nativeSrc": "150:77:0", + "expression": + { + "arguments": [], + "functionName": + { + "name": "revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb", + "nativeSrc": "150:77:0", + "nodeType": "YulIdentifier", + "src": "56:13:0" + }, + "nativeSrc": "150:79:0", + "nodeType": "YulFunctionCall", + "src": "56:13:0" + }, + "nativeSrc": "150:79:0", + "nodeType": "YulExpressionStatement", + "src": "56:13:0" + } + ] + }, + "condition": + { + "arguments": [], + "functionName": + { + "name": "callvalue", + "nativeSrc": "136:9:0", + "nodeType": "YulIdentifier", + "src": "56:13:0" + }, + "nativeSrc": "136:11:0", + "nodeType": "YulFunctionCall", + "src": "56:13:0" + }, + "nativeSrc": "133:98:0", + "nodeType": "YulIf", + "src": "56:13:0" + }, + { + "nativeSrc": "268:30:0", + "nodeType": "YulVariableDeclaration", + "src": "56:13:0", + "value": + { + "arguments": [], + "functionName": + { + "name": "allocate_unbounded", + "nativeSrc": "278:18:0", + "nodeType": "YulIdentifier", + "src": "56:13:0" + }, + "nativeSrc": "278:20:0", + "nodeType": "YulFunctionCall", + "src": "56:13:0" + }, + "variables": + [ + { + "name": "_1", + "nativeSrc": "272:2:0", + "nodeType": "YulTypedName", + "src": "56:13:0", + "type": "" + } + ] + }, + { + "expression": + { + "arguments": + [ + { + "name": "_1", + "nativeSrc": "316:2:0", "nodeType": "YulIdentifier", "src": "56:13:0" }, - "nativeSrc": "150:79:0", - "nodeType": "YulFunctionCall", + { + "arguments": + [ + { + "hexValue": "435f325f6465706c6f796564", + "kind": "string", + "nativeSrc": "331:14:0", + "nodeType": "YulLiteral", + "src": "56:13:0", + "type": "", + "value": "C_2_deployed" + } + ], + "functionName": + { + "name": "dataoffset", + "nativeSrc": "320:10:0", + "nodeType": "YulIdentifier", + "src": "56:13:0" + }, + "nativeSrc": "320:26:0", + "nodeType": "YulFunctionCall", + "src": "56:13:0" + }, + { + "arguments": + [ + { + "hexValue": "435f325f6465706c6f796564", + "kind": "string", + "nativeSrc": "357:14:0", + "nodeType": "YulLiteral", + "src": "56:13:0", + "type": "", + "value": "C_2_deployed" + } + ], + "functionName": + { + "name": "datasize", + "nativeSrc": "348:8:0", + "nodeType": "YulIdentifier", + "src": "56:13:0" + }, + "nativeSrc": "348:24:0", + "nodeType": "YulFunctionCall", + "src": "56:13:0" + } + ], + "functionName": + { + "name": "codecopy", + "nativeSrc": "307:8:0", + "nodeType": "YulIdentifier", "src": "56:13:0" }, - "nativeSrc": "150:79:0", - "nodeType": "YulExpressionStatement", + "nativeSrc": "307:66:0", + "nodeType": "YulFunctionCall", "src": "56:13:0" - } - ] - }, - "condition": - { - "arguments": [], - "functionName": - { - "name": "callvalue", - "nativeSrc": "136:9:0", - "nodeType": "YulIdentifier", + }, + "nativeSrc": "307:66:0", + "nodeType": "YulExpressionStatement", "src": "56:13:0" }, - "nativeSrc": "136:11:0", - "nodeType": "YulFunctionCall", - "src": "56:13:0" - }, - "nativeSrc": "133:98:0", - "nodeType": "YulIf", - "src": "56:13:0" - }, - { - "expression": - { - "arguments": [], - "functionName": { - "name": "constructor_C_2", - "nativeSrc": "241:15:0", - "nodeType": "YulIdentifier", + "expression": + { + "arguments": + [ + { + "name": "_1", + "nativeSrc": "390:2:0", + "nodeType": "YulIdentifier", + "src": "56:13:0" + }, + { + "arguments": + [ + { + "hexValue": "435f325f6465706c6f796564", + "kind": "string", + "nativeSrc": "403:14:0", + "nodeType": "YulLiteral", + "src": "56:13:0", + "type": "", + "value": "C_2_deployed" + } + ], + "functionName": + { + "name": "datasize", + "nativeSrc": "394:8:0", + "nodeType": "YulIdentifier", + "src": "56:13:0" + }, + "nativeSrc": "394:24:0", + "nodeType": "YulFunctionCall", + "src": "56:13:0" + } + ], + "functionName": + { + "name": "return", + "nativeSrc": "383:6:0", + "nodeType": "YulIdentifier", + "src": "56:13:0" + }, + "nativeSrc": "383:36:0", + "nodeType": "YulFunctionCall", + "src": "56:13:0" + }, + "nativeSrc": "383:36:0", + "nodeType": "YulExpressionStatement", "src": "56:13:0" - }, - "nativeSrc": "241:17:0", - "nodeType": "YulFunctionCall", - "src": "56:13:0" - }, - "nativeSrc": "241:17:0", - "nodeType": "YulExpressionStatement", - "src": "56:13:0" - }, - { - "nativeSrc": "268:30:0", - "nodeType": "YulVariableDeclaration", - "src": "56:13:0", - "value": - { - "arguments": [], - "functionName": - { - "name": "allocate_unbounded", - "nativeSrc": "278:18:0", - "nodeType": "YulIdentifier", - "src": "56:13:0" - }, - "nativeSrc": "278:20:0", - "nodeType": "YulFunctionCall", - "src": "56:13:0" - }, - "variables": - [ - { - "name": "_1", - "nativeSrc": "272:2:0", - "nodeType": "YulTypedName", - "src": "56:13:0", - "type": "" } ] }, - { - "expression": - { - "arguments": - [ - { - "name": "_1", - "nativeSrc": "316:2:0", - "nodeType": "YulIdentifier", - "src": "56:13:0" - }, - { - "arguments": - [ - { - "hexValue": "435f325f6465706c6f796564", - "kind": "string", - "nativeSrc": "331:14:0", - "nodeType": "YulLiteral", - "src": "56:13:0", - "type": "", - "value": "C_2_deployed" - } - ], - "functionName": - { - "name": "dataoffset", - "nativeSrc": "320:10:0", - "nodeType": "YulIdentifier", - "src": "56:13:0" - }, - "nativeSrc": "320:26:0", - "nodeType": "YulFunctionCall", - "src": "56:13:0" - }, - { - "arguments": - [ - { - "hexValue": "435f325f6465706c6f796564", - "kind": "string", - "nativeSrc": "357:14:0", - "nodeType": "YulLiteral", - "src": "56:13:0", - "type": "", - "value": "C_2_deployed" - } - ], - "functionName": - { - "name": "datasize", - "nativeSrc": "348:8:0", - "nodeType": "YulIdentifier", - "src": "56:13:0" - }, - "nativeSrc": "348:24:0", - "nodeType": "YulFunctionCall", - "src": "56:13:0" - } - ], - "functionName": - { - "name": "codecopy", - "nativeSrc": "307:8:0", - "nodeType": "YulIdentifier", - "src": "56:13:0" - }, - "nativeSrc": "307:66:0", - "nodeType": "YulFunctionCall", - "src": "56:13:0" - }, - "nativeSrc": "307:66:0", - "nodeType": "YulExpressionStatement", - "src": "56:13:0" - }, - { - "expression": - { - "arguments": - [ - { - "name": "_1", - "nativeSrc": "390:2:0", - "nodeType": "YulIdentifier", - "src": "56:13:0" - }, - { - "arguments": - [ - { - "hexValue": "435f325f6465706c6f796564", - "kind": "string", - "nativeSrc": "403:14:0", - "nodeType": "YulLiteral", - "src": "56:13:0", - "type": "", - "value": "C_2_deployed" - } - ], - "functionName": - { - "name": "datasize", - "nativeSrc": "394:8:0", - "nodeType": "YulIdentifier", - "src": "56:13:0" - }, - "nativeSrc": "394:24:0", - "nodeType": "YulFunctionCall", - "src": "56:13:0" - } - ], - "functionName": - { - "name": "return", - "nativeSrc": "383:6:0", - "nodeType": "YulIdentifier", - "src": "56:13:0" - }, - "nativeSrc": "383:36:0", - "nodeType": "YulFunctionCall", - "src": "56:13:0" - }, - "nativeSrc": "383:36:0", - "nodeType": "YulExpressionStatement", - "src": "56:13:0" - }, { "body": { @@ -403,19 +392,6 @@ "nativeSrc": "522:125:0", "nodeType": "YulFunctionDefinition", "src": "56:13:0" - }, - { - "body": - { - "nativeSrc": "726:59:0", - "nodeType": "YulBlock", - "src": "56:13:0", - "statements": [] - }, - "name": "constructor_C_2", - "nativeSrc": "699:86:0", - "nodeType": "YulFunctionDefinition", - "src": "56:13:0" } ] }, @@ -436,217 +412,83 @@ "statements": [ { - "expression": - { - "arguments": - [ - { - "kind": "number", - "nativeSrc": "966:2:0", - "nodeType": "YulLiteral", - "src": "56:13:0", - "type": "", - "value": "64" - }, + "nativeSrc": "899:588:0", + "nodeType": "YulBlock", + "src": "-1:-1:0", + "statements": + [ + { + "expression": { "arguments": [ { "kind": "number", - "nativeSrc": "982:3:0", + "nativeSrc": "966:2:0", "nodeType": "YulLiteral", "src": "56:13:0", "type": "", - "value": "128" + "value": "64" + }, + { + "arguments": + [ + { + "kind": "number", + "nativeSrc": "982:3:0", + "nodeType": "YulLiteral", + "src": "56:13:0", + "type": "", + "value": "0x80" + } + ], + "functionName": + { + "name": "memoryguard", + "nativeSrc": "970:11:0", + "nodeType": "YulIdentifier", + "src": "56:13:0" + }, + "nativeSrc": "970:16:0", + "nodeType": "YulFunctionCall", + "src": "56:13:0" } ], "functionName": { - "name": "memoryguard", - "nativeSrc": "970:11:0", + "name": "mstore", + "nativeSrc": "959:6:0", "nodeType": "YulIdentifier", "src": "56:13:0" }, - "nativeSrc": "970:16:0", + "nativeSrc": "959:28:0", "nodeType": "YulFunctionCall", "src": "56:13:0" - } - ], - "functionName": - { - "name": "mstore", - "nativeSrc": "959:6:0", - "nodeType": "YulIdentifier", + }, + "nativeSrc": "959:28:0", + "nodeType": "YulExpressionStatement", "src": "56:13:0" }, - "nativeSrc": "959:28:0", - "nodeType": "YulFunctionCall", - "src": "56:13:0" - }, - "nativeSrc": "959:28:0", - "nodeType": "YulExpressionStatement", - "src": "56:13:0" - }, - { - "expression": - { - "arguments": [], - "functionName": { - "name": "revert_error_42b3090547df1d2001c96683413b8cf91c1b902ef5e3cb8d9f6f304cf7446f74", - "nativeSrc": "1001:77:0", - "nodeType": "YulIdentifier", + "expression": + { + "arguments": [], + "functionName": + { + "name": "revert_error_42b3090547df1d2001c96683413b8cf91c1b902ef5e3cb8d9f6f304cf7446f74", + "nativeSrc": "1001:77:0", + "nodeType": "YulIdentifier", + "src": "56:13:0" + }, + "nativeSrc": "1001:79:0", + "nodeType": "YulFunctionCall", + "src": "56:13:0" + }, + "nativeSrc": "1001:79:0", + "nodeType": "YulExpressionStatement", "src": "56:13:0" - }, - "nativeSrc": "1001:79:0", - "nodeType": "YulFunctionCall", - "src": "56:13:0" - }, - "nativeSrc": "1001:79:0", - "nodeType": "YulExpressionStatement", - "src": "56:13:0" - }, - { - "body": - { - "nativeSrc": "1147:77:0", - "nodeType": "YulBlock", - "src": "56:13:0", - "statements": - [ - { - "nativeSrc": "1165:44:0", - "nodeType": "YulAssignment", - "src": "56:13:0", - "value": - { - "arguments": - [ - { - "kind": "number", - "nativeSrc": "1198:3:0", - "nodeType": "YulLiteral", - "src": "56:13:0", - "type": "", - "value": "224" - }, - { - "name": "value", - "nativeSrc": "1203:5:0", - "nodeType": "YulIdentifier", - "src": "56:13:0" - } - ], - "functionName": - { - "name": "shr", - "nativeSrc": "1194:3:0", - "nodeType": "YulIdentifier", - "src": "56:13:0" - }, - "nativeSrc": "1194:15:0", - "nodeType": "YulFunctionCall", - "src": "56:13:0" - }, - "variableNames": - [ - { - "name": "newValue", - "nativeSrc": "1165:8:0", - "nodeType": "YulIdentifier", - "src": "56:13:0" - } - ] - } - ] - }, - "name": "shift_right_224_unsigned", - "nativeSrc": "1094:130:0", - "nodeType": "YulFunctionDefinition", - "parameters": - [ - { - "name": "value", - "nativeSrc": "1128:5:0", - "nodeType": "YulTypedName", - "src": "56:13:0", - "type": "" } - ], - "returnVariables": - [ - { - "name": "newValue", - "nativeSrc": "1138:8:0", - "nodeType": "YulTypedName", - "src": "56:13:0", - "type": "" - } - ], - "src": "56:13:0" - }, - { - "body": - { - "nativeSrc": "1278:51:0", - "nodeType": "YulBlock", - "src": "56:13:0", - "statements": - [ - { - "nativeSrc": "1296:19:0", - "nodeType": "YulAssignment", - "src": "56:13:0", - "value": - { - "arguments": - [ - { - "kind": "number", - "nativeSrc": "1312:2:0", - "nodeType": "YulLiteral", - "src": "56:13:0", - "type": "", - "value": "64" - } - ], - "functionName": - { - "name": "mload", - "nativeSrc": "1306:5:0", - "nodeType": "YulIdentifier", - "src": "56:13:0" - }, - "nativeSrc": "1306:9:0", - "nodeType": "YulFunctionCall", - "src": "56:13:0" - }, - "variableNames": - [ - { - "name": "memPtr", - "nativeSrc": "1296:6:0", - "nodeType": "YulIdentifier", - "src": "56:13:0" - } - ] - } - ] - }, - "name": "allocate_unbounded", - "nativeSrc": "1238:91:0", - "nodeType": "YulFunctionDefinition", - "returnVariables": - [ - { - "name": "memPtr", - "nativeSrc": "1271:6:0", - "nodeType": "YulTypedName", - "src": "56:13:0", - "type": "" - } - ], - "src": "56:13:0" + ] }, { "body": diff --git a/test/cmdlineTests/standard_irOptimized_requested/output.json b/test/cmdlineTests/standard_irOptimized_requested/output.json index b3a27c5ca..88ce64895 100644 --- a/test/cmdlineTests/standard_irOptimized_requested/output.json +++ b/test/cmdlineTests/standard_irOptimized_requested/output.json @@ -8,37 +8,38 @@ "irOptimized": "/// @use-src 0:\"A\" object \"C_7\" { code { - /// @src 0:79:121 \"contract C { function f() public pure {} }\" - mstore(64, memoryguard(128)) - if callvalue() { - revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb() + /// @src 0:79:121 \"contract C { function f() public pure {} }\" + mstore(64, memoryguard(0x80)) + if callvalue() + { + revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb() + } + let _1 := allocate_unbounded() + codecopy(_1, dataoffset(\"C_7_deployed\"), datasize(\"C_7_deployed\")) + return(_1, datasize(\"C_7_deployed\")) } - constructor_C_7() - let _1 := allocate_unbounded() - codecopy(_1, dataoffset(\"C_7_deployed\"), datasize(\"C_7_deployed\")) - return(_1, datasize(\"C_7_deployed\")) function allocate_unbounded() -> memPtr { memPtr := mload(64) } function revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb() { revert(0, 0) } - function constructor_C_7() - { } } /// @use-src 0:\"A\" object \"C_7_deployed\" { code { - /// @src 0:79:121 \"contract C { function f() public pure {} }\" - mstore(64, memoryguard(128)) - if iszero(lt(calldatasize(), 4)) { - let selector := shift_right_224_unsigned(calldataload(0)) - switch selector - case 0x26121ff0 { external_fun_f_6() } - default { } + /// @src 0:79:121 \"contract C { function f() public pure {} }\" + mstore(64, memoryguard(0x80)) + if iszero(lt(calldatasize(), 4)) + { + let selector := shift_right_unsigned(calldataload(0)) + switch selector + case 0x26121ff0 { external_fun_f() } + default { } + } + revert_error_42b3090547df1d2001c96683413b8cf91c1b902ef5e3cb8d9f6f304cf7446f74() } - revert_error_42b3090547df1d2001c96683413b8cf91c1b902ef5e3cb8d9f6f304cf7446f74() - function shift_right_224_unsigned(value) -> newValue + function shift_right_unsigned(value) -> newValue { newValue := shr(224, value) } function allocate_unbounded() -> memPtr { memPtr := mload(64) } @@ -46,32 +47,28 @@ object \"C_7\" { { revert(0, 0) } function revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b() { revert(0, 0) } - function abi_decode_tuple_(headStart, dataEnd) + function abi_decode(headStart, dataEnd) { if slt(sub(dataEnd, headStart), 0) { revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b() } } - function abi_encode_tuple__to__fromStack(headStart) -> tail + function abi_encode_tuple(headStart) -> tail { tail := add(headStart, 0) } - function external_fun_f_6() + function external_fun_f() { if callvalue() { revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb() } - abi_decode_tuple_(4, calldatasize()) - fun_f_6() + abi_decode(4, calldatasize()) let memPos := allocate_unbounded() - let memEnd := abi_encode_tuple__to__fromStack(memPos) + let memEnd := abi_encode_tuple(memPos) return(memPos, sub(memEnd, memPos)) } function revert_error_42b3090547df1d2001c96683413b8cf91c1b902ef5e3cb8d9f6f304cf7446f74() { revert(0, 0) } - /// @ast-id 6 @src 0:92:119 \"function f() public pure {}\" - function fun_f_6() - { } } data \".metadata\" hex\"\" } diff --git a/test/cmdlineTests/standard_yul/output.json b/test/cmdlineTests/standard_yul/output.json index d335c3a96..9dcf20113 100644 --- a/test/cmdlineTests/standard_yul/output.json +++ b/test/cmdlineTests/standard_yul/output.json @@ -7,22 +7,18 @@ { "evm": { - "assembly": " /* \"A\":17:18 */ + "assembly": " /* \"A\":38:39 */ 0x00 /* \"A\":11:19 */ - mload - /* \"A\":38:39 */ - 0x00 - /* \"A\":34:35 */ dup1 - /* \"A\":31:32 */ - dup3 + dup1 + mload /* \"A\":27:36 */ add /* \"A\":20:40 */ sstore /* \"A\":0:42 */ - pop + stop ", "bytecode": { @@ -43,8 +39,10 @@ ", "irOptimized": "object \"object\" { code { - let x := mload(0) - sstore(add(x, 0), 0) + { + let x := mload(0) + sstore(add(x, 0), 0) + } } } " diff --git a/test/cmdlineTests/standard_yul_debug_info_print_all/output.json b/test/cmdlineTests/standard_yul_debug_info_print_all/output.json index 0c78efb80..9d675a069 100644 --- a/test/cmdlineTests/standard_yul_debug_info_print_all/output.json +++ b/test/cmdlineTests/standard_yul_debug_info_print_all/output.json @@ -13,12 +13,11 @@ tag_1 jump\t// in tag_2: + stop /* \"input.sol\":77:99 */ - jump(tag_3) tag_1: sstore(0x00, 0x2a) jump\t// out -tag_3: " } } diff --git a/test/cmdlineTests/standard_yul_debug_info_print_location_only/output.json b/test/cmdlineTests/standard_yul_debug_info_print_location_only/output.json index 53be3d073..8cbbd326c 100644 --- a/test/cmdlineTests/standard_yul_debug_info_print_location_only/output.json +++ b/test/cmdlineTests/standard_yul_debug_info_print_location_only/output.json @@ -13,12 +13,11 @@ tag_1 jump\t// in tag_2: + stop /* \"input.sol\":77:99 */ - jump(tag_3) tag_1: sstore(0x00, 0x2a) jump\t// out -tag_3: " } } diff --git a/test/cmdlineTests/standard_yul_debug_info_print_none/output.json b/test/cmdlineTests/standard_yul_debug_info_print_none/output.json index ac2a93b0f..d1e4cff4c 100644 --- a/test/cmdlineTests/standard_yul_debug_info_print_none/output.json +++ b/test/cmdlineTests/standard_yul_debug_info_print_none/output.json @@ -12,11 +12,10 @@ tag_1 jump\t// in tag_2: - jump(tag_3) + stop tag_1: sstore(0x00, 0x2a) jump\t// out -tag_3: " } } diff --git a/test/cmdlineTests/standard_yul_object/output.json b/test/cmdlineTests/standard_yul_object/output.json index af55758f4..edf139dc0 100644 --- a/test/cmdlineTests/standard_yul_object/output.json +++ b/test/cmdlineTests/standard_yul_object/output.json @@ -7,20 +7,17 @@ { "evm": { - "assembly": " /* \"A\":39:61 */ - data_4e03657aea45a94fc7d47ba826c8d667c0d1e6e33a64a036ec44f58fa12d6c45 - /* \"A\":80:81 */ + "assembly": " /* \"A\":80:81 */ 0x00 - /* \"A\":76:77 */ + /* \"A\":39:61 */ dup1 - /* \"A\":73:74 */ - dup3 + data_4e03657aea45a94fc7d47ba826c8d667c0d1e6e33a64a036ec44f58fa12d6c45 /* \"A\":69:78 */ add /* \"A\":62:82 */ sstore /* \"A\":28:84 */ - pop + stop stop data_4e03657aea45a94fc7d47ba826c8d667c0d1e6e33a64a036ec44f58fa12d6c45 616263 ", @@ -44,8 +41,10 @@ data_4e03657aea45a94fc7d47ba826c8d667c0d1e6e33a64a036ec44f58fa12d6c45 616263 ", "irOptimized": "object \"NamedObject\" { code { - let x := dataoffset(\"DataName\") - sstore(add(x, 0), 0) + { + let x := dataoffset(\"DataName\") + sstore(add(x, 0), 0) + } } data \"DataName\" hex\"616263\" } diff --git a/test/cmdlineTests/standard_yul_object_name/output.json b/test/cmdlineTests/standard_yul_object_name/output.json index e94a9bc6a..7faeed3c3 100644 --- a/test/cmdlineTests/standard_yul_object_name/output.json +++ b/test/cmdlineTests/standard_yul_object_name/output.json @@ -7,29 +7,25 @@ { "evm": { - "assembly": " /* \"A\":39:61 */ - data_4e03657aea45a94fc7d47ba826c8d667c0d1e6e33a64a036ec44f58fa12d6c45 - /* \"A\":80:81 */ + "assembly": " /* \"A\":80:81 */ 0x00 - /* \"A\":76:77 */ + /* \"A\":39:61 */ dup1 - /* \"A\":73:74 */ - dup3 + data_4e03657aea45a94fc7d47ba826c8d667c0d1e6e33a64a036ec44f58fa12d6c45 /* \"A\":69:78 */ add /* \"A\":62:82 */ sstore /* \"A\":28:84 */ - pop + stop stop data_4e03657aea45a94fc7d47ba826c8d667c0d1e6e33a64a036ec44f58fa12d6c45 616263 sub_0: assembly { /* \"A\":147:148 */ 0x00 - /* \"A\":144:145 */ - dup1 /* \"A\":137:149 */ + dup1 revert } ", @@ -66,12 +62,14 @@ sub_0: assembly { ", "irOptimized": "object \"NamedObject\" { code { - let x := dataoffset(\"DataName\") - sstore(add(x, 0), 0) + { + let x := dataoffset(\"DataName\") + sstore(add(x, 0), 0) + } } data \"DataName\" hex\"616263\" object \"OtherObject\" { - code { revert(0, 0) } + code { { revert(0, 0) } } } } " diff --git a/test/cmdlineTests/strict_asm_ast_compact_json/output b/test/cmdlineTests/strict_asm_ast_compact_json/output index ff944e8e4..98afddcfa 100644 --- a/test/cmdlineTests/strict_asm_ast_compact_json/output +++ b/test/cmdlineTests/strict_asm_ast_compact_json/output @@ -13,73 +13,49 @@ AST: "statements": [ { - "expression": - { - "arguments": - [ + "nativeSrc": "60:246:0", + "nodeType": "YulBlock", + "src": "-1:-1:0", + "statements": + [ + { + "expression": { - "kind": "number", - "nativeSrc": "122:2:0", - "nodeType": "YulLiteral", - "src": "60:41:0", - "type": "", - "value": "64" + "arguments": + [ + { + "kind": "number", + "nativeSrc": "122:2:0", + "nodeType": "YulLiteral", + "src": "60:41:0", + "type": "", + "value": "64" + }, + { + "kind": "number", + "nativeSrc": "126:3:0", + "nodeType": "YulLiteral", + "src": "60:41:0", + "type": "", + "value": "128" + } + ], + "functionName": + { + "name": "mstore", + "nativeSrc": "115:6:0", + "nodeType": "YulIdentifier", + "src": "60:41:0" + }, + "nativeSrc": "115:15:0", + "nodeType": "YulFunctionCall", + "src": "60:41:0" }, - { - "kind": "number", - "nativeSrc": "126:3:0", - "nodeType": "YulLiteral", - "src": "60:41:0", - "type": "", - "value": "128" - } - ], - "functionName": - { - "name": "mstore", - "nativeSrc": "115:6:0", - "nodeType": "YulIdentifier", + "nativeSrc": "115:15:0", + "nodeType": "YulExpressionStatement", "src": "60:41:0" - }, - "nativeSrc": "115:15:0", - "nodeType": "YulFunctionCall", - "src": "60:41:0" - }, - "nativeSrc": "115:15:0", - "nodeType": "YulExpressionStatement", - "src": "60:41:0" - }, - { - "expression": - { - "arguments": [], - "functionName": - { - "name": "fun_f_5", - "nativeSrc": "155:7:0", - "nodeType": "YulIdentifier", - "src": "60:41:0" - }, - "nativeSrc": "155:9:0", - "nodeType": "YulFunctionCall", - "src": "60:41:0" - }, - "nativeSrc": "155:9:0", - "nodeType": "YulExpressionStatement", - "src": "60:41:0" - }, - { - "body": - { - "nativeSrc": "244:11:0", - "nodeType": "YulBlock", - "src": "77:22:0", - "statements": [] - }, - "name": "fun_f_5", - "nativeSrc": "225:30:0", - "nodeType": "YulFunctionDefinition", - "src": "77:22:0" + } + ] } ] }, diff --git a/test/cmdlineTests/strict_asm_debug_info_print_all/output b/test/cmdlineTests/strict_asm_debug_info_print_all/output index 2242e6630..0e58baf57 100644 --- a/test/cmdlineTests/strict_asm_debug_info_print_all/output +++ b/test/cmdlineTests/strict_asm_debug_info_print_all/output @@ -5,18 +5,20 @@ Pretty printed source: /// @use-src 0:"input.sol" object "C_6_deployed" { code { - /// @src 0:60:101 - mstore(64, 128) - fun_f_5() + { + /// @src 0:60:101 + mstore(64, 128) + fun_f() + } /// @src 0:77:99 - function fun_f_5() + function fun_f() { sstore(0, 42) } } } Binary representation: -6080604052600a600e565b6014565b602a5f55565b +6080604052600a600c565b005b602a5f5556 Text representation: /* "input.sol":60:101 */ @@ -25,9 +27,8 @@ Text representation: tag_1 jump // in tag_2: + stop /* "input.sol":77:99 */ - jump(tag_3) tag_1: sstore(0x00, 0x2a) jump // out -tag_3: diff --git a/test/cmdlineTests/strict_asm_debug_info_print_location_only/output b/test/cmdlineTests/strict_asm_debug_info_print_location_only/output index c5de7c439..17d2f50e2 100644 --- a/test/cmdlineTests/strict_asm_debug_info_print_location_only/output +++ b/test/cmdlineTests/strict_asm_debug_info_print_location_only/output @@ -5,18 +5,20 @@ Pretty printed source: /// @use-src 0:"input.sol" object "C_6_deployed" { code { - /// @src 0:60:101 - mstore(64, 128) - fun_f_5() + { + /// @src 0:60:101 + mstore(64, 128) + fun_f() + } /// @src 0:77:99 - function fun_f_5() + function fun_f() { sstore(0, 42) } } } Binary representation: -6080604052600a600e565b6014565b602a5f55565b +6080604052600a600c565b005b602a5f5556 Text representation: /* "input.sol":60:101 */ @@ -25,9 +27,8 @@ Text representation: tag_1 jump // in tag_2: + stop /* "input.sol":77:99 */ - jump(tag_3) tag_1: sstore(0x00, 0x2a) jump // out -tag_3: diff --git a/test/cmdlineTests/strict_asm_debug_info_print_none/output b/test/cmdlineTests/strict_asm_debug_info_print_none/output index 3db44c1f5..51f779490 100644 --- a/test/cmdlineTests/strict_asm_debug_info_print_none/output +++ b/test/cmdlineTests/strict_asm_debug_info_print_none/output @@ -5,16 +5,18 @@ Pretty printed source: /// @use-src 0:"input.sol" object "C_6_deployed" { code { - mstore(64, 128) - fun_f_5() - function fun_f_5() + { + mstore(64, 128) + fun_f() + } + function fun_f() { sstore(0, 42) } } } Binary representation: -6080604052600a600e565b6014565b602a5f55565b +6080604052600a600c565b005b602a5f5556 Text representation: mstore(0x40, 0x80) @@ -22,8 +24,7 @@ Text representation: tag_1 jump // in tag_2: - jump(tag_3) + stop tag_1: sstore(0x00, 0x2a) jump // out -tag_3: diff --git a/test/cmdlineTests/yul_function_name_clashes/output b/test/cmdlineTests/yul_function_name_clashes/output index cfbb96bfa..2c54b6f50 100644 --- a/test/cmdlineTests/yul_function_name_clashes/output +++ b/test/cmdlineTests/yul_function_name_clashes/output @@ -4,63 +4,43 @@ Pretty printed source: object "object" { code { - let a - let b { - function z() -> y - { y := calldataload(0) } + let a + let b a := z() + b := z_1() + sstore(a, b) } - { - function z() -> y - { y := calldataload(0x20) } - b := z() - } - sstore(a, b) + function z() -> y + { y := calldataload(0) } + function z_1() -> y + { y := calldataload(0x20) } } } Binary representation: -5f80600d565b5f8035905090565b60136005565b91506022565b5f602035905090565b60286019565b90508082555050 +6005600f565b600b6014565b9055005b5f3590565b6020359056 Text representation: - 0x00 - dup1 - jump(tag_2) + tag_3 + tag_1 + jump // in +tag_3: + tag_4 + tag_2 + jump // in +tag_4: + swap1 + sstore + stop tag_1: 0x00 - dup1 calldataload swap1 - pop - swap1 jump // out tag_2: - tag_4 - tag_1 - jump // in -tag_4: - swap2 - pop - jump(tag_6) -tag_5: - 0x00 0x20 calldataload swap1 - pop - swap1 jump // out -tag_6: - tag_8 - tag_5 - jump // in -tag_8: - swap1 - pop - dup1 - dup3 - sstore - pop - pop diff --git a/test/cmdlineTests/yul_function_name_clashes_different_params/output b/test/cmdlineTests/yul_function_name_clashes_different_params/output index cd0dce30c..22cee64c1 100644 --- a/test/cmdlineTests/yul_function_name_clashes_different_params/output +++ b/test/cmdlineTests/yul_function_name_clashes_different_params/output @@ -4,90 +4,56 @@ Pretty printed source: object "object" { code { - let a - let b { - function z() -> y - { y := calldataload(0) } + let a + let b a := z() + b := z_1(0x70) + sstore(a, b) } - { - function z(r) -> y - { y := calldataload(r) } - b := z(0x70) - } - sstore(a, b) + function z() -> y + { y := calldataload(0) } + function z_1(r) -> y + { y := calldataload(r) } } } Binary representation: -5f80600d565b5f8035905090565b60136005565b91506023565b5f81359050919050565b602b60706019565b90508082555050 +60056011565b600d60706016565b9055005b5f3590565b359056 Text representation: - /* "yul_function_name_clashes_different_params/input.yul":37:42 */ - 0x00 - /* "yul_function_name_clashes_different_params/input.yul":51:56 */ - dup1 - /* "yul_function_name_clashes_different_params/input.yul":79:133 */ - jump(tag_2) -tag_1: - /* "yul_function_name_clashes_different_params/input.yul":95:96 */ - 0x00 - /* "yul_function_name_clashes_different_params/input.yul":129:130 */ - dup1 - /* "yul_function_name_clashes_different_params/input.yul":116:131 */ - calldataload - /* "yul_function_name_clashes_different_params/input.yul":111:131 */ - swap1 - pop - /* "yul_function_name_clashes_different_params/input.yul":79:133 */ - swap1 - jump // out -tag_2: /* "yul_function_name_clashes_different_params/input.yul":151:154 */ - tag_4 + tag_3 tag_1 jump // in -tag_4: - /* "yul_function_name_clashes_different_params/input.yul":146:154 */ - swap2 - pop - /* "yul_function_name_clashes_different_params/input.yul":187:242 */ - jump(tag_6) -tag_5: - /* "yul_function_name_clashes_different_params/input.yul":204:205 */ - 0x00 - /* "yul_function_name_clashes_different_params/input.yul":238:239 */ - dup2 - /* "yul_function_name_clashes_different_params/input.yul":225:240 */ - calldataload - /* "yul_function_name_clashes_different_params/input.yul":220:240 */ - swap1 - pop - /* "yul_function_name_clashes_different_params/input.yul":187:242 */ - swap2 - swap1 - pop - jump // out -tag_6: +tag_3: /* "yul_function_name_clashes_different_params/input.yul":260:267 */ - tag_8 + tag_4 /* "yul_function_name_clashes_different_params/input.yul":262:266 */ 0x70 /* "yul_function_name_clashes_different_params/input.yul":260:267 */ - tag_5 + tag_2 jump // in -tag_8: - /* "yul_function_name_clashes_different_params/input.yul":255:267 */ - swap1 - pop - /* "yul_function_name_clashes_different_params/input.yul":296:297 */ - dup1 - /* "yul_function_name_clashes_different_params/input.yul":293:294 */ - dup3 +tag_4: /* "yul_function_name_clashes_different_params/input.yul":286:298 */ + swap1 sstore /* "yul_function_name_clashes_different_params/input.yul":27:304 */ - pop - pop + stop + /* "yul_function_name_clashes_different_params/input.yul":79:133 */ +tag_1: + /* "yul_function_name_clashes_different_params/input.yul":129:130 */ + 0x00 + /* "yul_function_name_clashes_different_params/input.yul":116:131 */ + calldataload + /* "yul_function_name_clashes_different_params/input.yul":79:133 */ + swap1 + jump // out + /* "yul_function_name_clashes_different_params/input.yul":187:242 */ +tag_2: + /* "yul_function_name_clashes_different_params/input.yul":225:240 */ + calldataload + /* "yul_function_name_clashes_different_params/input.yul":187:242 */ + swap1 + jump // out diff --git a/test/libyul/objectCompiler/data.yul b/test/libyul/objectCompiler/data.yul index 611715b65..caa649921 100644 --- a/test/libyul/objectCompiler/data.yul +++ b/test/libyul/objectCompiler/data.yul @@ -5,8 +5,10 @@ object "a" { } // ---- // Assembly: +// /* "source":20:22 */ +// stop // stop // data_acaf3289d7b601cbd114fb36c4d29c85bbfd5e133f14cb355c3fd8d99367964f 48656c6c6f2c20576f726c6421 -// Bytecode: fe -// Opcodes: INVALID -// SourceMappings: +// Bytecode: 00fe +// Opcodes: STOP INVALID +// SourceMappings: 20:2:0:-:0 diff --git a/test/libyul/objectCompiler/datacopy.yul b/test/libyul/objectCompiler/datacopy.yul index a5fbfb7b0..cb9fbcb18 100644 --- a/test/libyul/objectCompiler/datacopy.yul +++ b/test/libyul/objectCompiler/datacopy.yul @@ -42,9 +42,11 @@ object "a" { // 0x00 // /* "source":178:206 */ // mstore +// /* "source":135:212 */ +// stop // stop // data_acaf3289d7b601cbd114fb36c4d29c85bbfd5e133f14cb355c3fd8d99367964f 48656c6c6f2c20576f726c6421 // } -// Bytecode: 6008600b5f3960085ff3fe5f8055600d5f52fe -// Opcodes: PUSH1 0x8 PUSH1 0xB PUSH0 CODECOPY PUSH1 0x8 PUSH0 RETURN INVALID PUSH0 DUP1 SSTORE PUSH1 0xD PUSH0 MSTORE INVALID +// Bytecode: 6009600b5f3960095ff3fe5f8055600d5f5200fe +// Opcodes: PUSH1 0x9 PUSH1 0xB PUSH0 CODECOPY PUSH1 0x9 PUSH0 RETURN INVALID PUSH0 DUP1 SSTORE PUSH1 0xD PUSH0 MSTORE STOP INVALID // SourceMappings: 57:15:0:-:0;38:17;35:1;26:47;88:15;85:1;78:26 diff --git a/test/libyul/objectCompiler/dataoffset_code.yul b/test/libyul/objectCompiler/dataoffset_code.yul index e363ec7c6..58521c87f 100644 --- a/test/libyul/objectCompiler/dataoffset_code.yul +++ b/test/libyul/objectCompiler/dataoffset_code.yul @@ -13,6 +13,8 @@ object "a" { // 0x00 // /* "source":22:50 */ // sstore +// /* "source":20:52 */ +// stop // stop // // sub_0: assembly { @@ -22,9 +24,11 @@ object "a" { // 0x00 // /* "source":81:93 */ // sstore +// /* "source":79:95 */ +// stop // stop // data_acaf3289d7b601cbd114fb36c4d29c85bbfd5e133f14cb355c3fd8d99367964f 48656c6c6f2c20576f726c6421 // } -// Bytecode: 60055f55fe60085f55fe -// Opcodes: PUSH1 0x5 PUSH0 SSTORE INVALID PUSH1 0x8 PUSH0 SSTORE INVALID -// SourceMappings: 32:17:0:-:0;29:1;22:28 +// Bytecode: 60065f5500fe60085f5500fe +// Opcodes: PUSH1 0x6 PUSH0 SSTORE STOP INVALID PUSH1 0x8 PUSH0 SSTORE STOP INVALID +// SourceMappings: 32:17:0:-:0;29:1;22:28;20:32 diff --git a/test/libyul/objectCompiler/dataoffset_data.yul b/test/libyul/objectCompiler/dataoffset_data.yul index 2bb68e8a8..61f0c4418 100644 --- a/test/libyul/objectCompiler/dataoffset_data.yul +++ b/test/libyul/objectCompiler/dataoffset_data.yul @@ -10,8 +10,10 @@ object "a" { // 0x00 // /* "source":22:52 */ // sstore +// /* "source":20:54 */ +// stop // stop // data_acaf3289d7b601cbd114fb36c4d29c85bbfd5e133f14cb355c3fd8d99367964f 48656c6c6f2c20576f726c6421 -// Bytecode: 60055f55fe48656c6c6f2c20576f726c6421 -// Opcodes: PUSH1 0x5 PUSH0 SSTORE INVALID BASEFEE PUSH6 0x6C6C6F2C2057 PUSH16 0x726C6421000000000000000000000000 -// SourceMappings: 32:19:0:-:0;29:1;22:30 +// Bytecode: 60065f5500fe48656c6c6f2c20576f726c6421 +// Opcodes: PUSH1 0x6 PUSH0 SSTORE STOP INVALID BASEFEE PUSH6 0x6C6C6F2C2057 PUSH16 0x726C6421000000000000000000000000 +// SourceMappings: 32:19:0:-:0;29:1;22:30;20:34 diff --git a/test/libyul/objectCompiler/dataoffset_self.yul b/test/libyul/objectCompiler/dataoffset_self.yul index e56097ab5..7c38b9502 100644 --- a/test/libyul/objectCompiler/dataoffset_self.yul +++ b/test/libyul/objectCompiler/dataoffset_self.yul @@ -10,8 +10,10 @@ object "a" { // dup1 // /* "source":22:48 */ // sstore +// /* "source":20:50 */ +// stop // stop // data_acaf3289d7b601cbd114fb36c4d29c85bbfd5e133f14cb355c3fd8d99367964f 48656c6c6f2c20576f726c6421 -// Bytecode: 5f8055fe -// Opcodes: PUSH0 DUP1 SSTORE INVALID -// SourceMappings: 32:15:0:-:0;29:1;22:26 +// Bytecode: 5f805500fe +// Opcodes: PUSH0 DUP1 SSTORE STOP INVALID +// SourceMappings: 32:15:0:-:0;29:1;22:26;20:30 diff --git a/test/libyul/objectCompiler/datasize_code.yul b/test/libyul/objectCompiler/datasize_code.yul index 0a379cb33..4e559ab89 100644 --- a/test/libyul/objectCompiler/datasize_code.yul +++ b/test/libyul/objectCompiler/datasize_code.yul @@ -13,6 +13,8 @@ object "a" { // 0x00 // /* "source":22:48 */ // sstore +// /* "source":20:50 */ +// stop // stop // // sub_0: assembly { @@ -22,9 +24,11 @@ object "a" { // 0x00 // /* "source":79:91 */ // sstore +// /* "source":77:93 */ +// stop // stop // data_acaf3289d7b601cbd114fb36c4d29c85bbfd5e133f14cb355c3fd8d99367964f 48656c6c6f2c20576f726c6421 // } -// Bytecode: 60055f55fe -// Opcodes: PUSH1 0x5 PUSH0 SSTORE INVALID -// SourceMappings: 32:15:0:-:0;29:1;22:26 +// Bytecode: 60065f5500fe +// Opcodes: PUSH1 0x6 PUSH0 SSTORE STOP INVALID +// SourceMappings: 32:15:0:-:0;29:1;22:26;20:30 diff --git a/test/libyul/objectCompiler/datasize_data.yul b/test/libyul/objectCompiler/datasize_data.yul index 815e78fe4..3281bd9ba 100644 --- a/test/libyul/objectCompiler/datasize_data.yul +++ b/test/libyul/objectCompiler/datasize_data.yul @@ -10,8 +10,10 @@ object "a" { // 0x00 // /* "source":22:50 */ // sstore +// /* "source":20:52 */ +// stop // stop // data_acaf3289d7b601cbd114fb36c4d29c85bbfd5e133f14cb355c3fd8d99367964f 48656c6c6f2c20576f726c6421 -// Bytecode: 600d5f55fe -// Opcodes: PUSH1 0xD PUSH0 SSTORE INVALID -// SourceMappings: 32:17:0:-:0;29:1;22:28 +// Bytecode: 600d5f5500fe +// Opcodes: PUSH1 0xD PUSH0 SSTORE STOP INVALID +// SourceMappings: 32:17:0:-:0;29:1;22:28;20:32 diff --git a/test/libyul/objectCompiler/datasize_self.yul b/test/libyul/objectCompiler/datasize_self.yul index 178e3a948..6bc520af5 100644 --- a/test/libyul/objectCompiler/datasize_self.yul +++ b/test/libyul/objectCompiler/datasize_self.yul @@ -10,8 +10,10 @@ object "a" { // 0x00 // /* "source":22:46 */ // sstore +// /* "source":20:48 */ +// stop // stop // data_acaf3289d7b601cbd114fb36c4d29c85bbfd5e133f14cb355c3fd8d99367964f 48656c6c6f2c20576f726c6421 -// Bytecode: 60055f55fe -// Opcodes: PUSH1 0x5 PUSH0 SSTORE INVALID -// SourceMappings: 32:13:0:-:0;29:1;22:24 +// Bytecode: 60065f5500fe +// Opcodes: PUSH1 0x6 PUSH0 SSTORE STOP INVALID +// SourceMappings: 32:13:0:-:0;29:1;22:24;20:28 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 e991dc6b7..285a8a8d5 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 @@ -15,6 +15,8 @@ object "a" { // 0x00 // /* "source":32:219 */ // assignImmutable("0x85a5b1db611c82c46f5fa18e39ae218397536256c451e5de155a86de843a9ad6") -// Bytecode: 7312345678901234567890123456789012345678905f5050 -// Opcodes: PUSH20 0x1234567890123456789012345678901234567890 PUSH0 POP POP -// SourceMappings: 167:42:0:-:0;58:1;32:187; +// /* "source":22:225 */ +// stop +// Bytecode: 7312345678901234567890123456789012345678905f505000 +// Opcodes: PUSH20 0x1234567890123456789012345678901234567890 PUSH0 POP POP STOP +// SourceMappings: 167:42:0:-:0;58:1;32:187;;22:203 diff --git a/test/libyul/objectCompiler/linkersymbol.yul b/test/libyul/objectCompiler/linkersymbol.yul index a28ee23e2..c4da288e6 100644 --- a/test/libyul/objectCompiler/linkersymbol.yul +++ b/test/libyul/objectCompiler/linkersymbol.yul @@ -7,7 +7,15 @@ object "a" { } // ---- // Assembly: +// /* "source":179:180 */ +// 0x00 +// /* "source":174:177 */ +// 0x80 +// /* "source":171:172 */ +// 0x04 // /* "source":44:79 */ +// dup2 +// dup4 // linkerSymbol("f919ba91ac99f96129544b80b9516b27a80e376b9dc693819d0b18b7e0395612") // /* "source":109:119 */ // 0x18530aaf @@ -15,29 +23,15 @@ object "a" { // 0xe3 // /* "source":100:120 */ // shl -// /* "source":95:98 */ -// 0x80 // /* "source":88:121 */ +// dup4 // mstore -// /* "source":179:180 */ -// 0x00 -// /* "source":174:177 */ -// 0x80 -// /* "source":171:172 */ -// 0x04 -// /* "source":166:169 */ -// 0x80 -// /* "source":163:164 */ -// 0x00 -// /* "source":157:161 */ -// dup6 // /* "source":150:155 */ // gas // /* "source":145:181 */ // call -// /* "source":22:187 */ -// pop -// pop -// Bytecode: 7300000000000000000000000000000000000000006318530aaf60e31b6080525f6080600460805f855af15050 -// Opcodes: PUSH20 0x0 PUSH4 0x18530AAF PUSH1 0xE3 SHL PUSH1 0x80 MSTORE PUSH0 PUSH1 0x80 PUSH1 0x4 PUSH1 0x80 PUSH0 DUP6 GAS CALL POP POP -// SourceMappings: 44:35:0:-:0;109:10;104:3;100:20;95:3;88:33;179:1;174:3;171:1;166:3;163:1;157:4;150:5;145:36;22:165; +// /* "source":130:181 */ +// stop +// Bytecode: 5f6080600481837300000000000000000000000000000000000000006318530aaf60e31b83525af100 +// Opcodes: PUSH0 PUSH1 0x80 PUSH1 0x4 DUP2 DUP4 PUSH20 0x0 PUSH4 0x18530AAF PUSH1 0xE3 SHL DUP4 MSTORE GAS CALL STOP +// SourceMappings: 179:1:0:-:0;174:3;171:1;44:35;;;109:10;104:3;100:20;88:33;;150:5;145:36;130:51 diff --git a/test/libyul/objectCompiler/metadata.yul b/test/libyul/objectCompiler/metadata.yul index 5a75507ba..335522d04 100644 --- a/test/libyul/objectCompiler/metadata.yul +++ b/test/libyul/objectCompiler/metadata.yul @@ -25,21 +25,18 @@ object "A" { // 0x0e // /* "source":62:75 */ // 0x03 -// /* "source":90:91 */ -// dup2 +// /* "source":80:92 */ +// swap1 // /* "source":87:88 */ // 0x00 // /* "source":80:92 */ // sstore -// /* "source":108:109 */ -// dup1 // /* "source":104:106 */ // 0x20 // /* "source":97:110 */ // sstore // /* "source":20:114 */ -// pop -// pop +// stop // stop // data_211450822d7f8c345093893187e7e1fbebc4ec67af72601920194be14104e336 48656c6c6f2c20576f726c643221 // data_e1629b9dda060bb30c7908346f6af189c16773fa148d3366701fbaa35d54f3c8 414243 @@ -47,14 +44,12 @@ object "A" { // sub_0: assembly { // /* "source":157:176 */ // data_211450822d7f8c345093893187e7e1fbebc4ec67af72601920194be14104e336 -// /* "source":193:194 */ -// dup1 // /* "source":190:191 */ // 0x00 // /* "source":183:195 */ // sstore // /* "source":140:201 */ -// pop +// stop // stop // data_211450822d7f8c345093893187e7e1fbebc4ec67af72601920194be14104e336 48656c6c6f2c20576f726c643221 // @@ -62,6 +57,6 @@ object "A" { // } // // auxdata: 0x4d32 -// Bytecode: 600e6003815f55806020555050fe4d32 -// Opcodes: PUSH1 0xE PUSH1 0x3 DUP2 PUSH0 SSTORE DUP1 PUSH1 0x20 SSTORE POP POP INVALID 0x4D ORIGIN -// SourceMappings: 35:13:0:-:0;62;90:1;87;80:12;108:1;104:2;97:13;20:94; +// Bytecode: 600e6003905f5560205500fe4d32 +// Opcodes: PUSH1 0xE PUSH1 0x3 SWAP1 PUSH0 SSTORE PUSH1 0x20 SSTORE STOP INVALID 0x4D ORIGIN +// SourceMappings: 35:13:0:-:0;62;80:12;87:1;80:12;104:2;97:13;20:94 diff --git a/test/libyul/objectCompiler/namedObject.yul b/test/libyul/objectCompiler/namedObject.yul index 940160fd2..d55c3ca25 100644 --- a/test/libyul/objectCompiler/namedObject.yul +++ b/test/libyul/objectCompiler/namedObject.yul @@ -3,4 +3,8 @@ object "a" { } // ---- // Assembly: -// -- empty bytecode -- +// /* "source":20:22 */ +// stop +// Bytecode: 00 +// Opcodes: STOP +// SourceMappings: 20:2:0:-:0 diff --git a/test/libyul/objectCompiler/namedObjectCode.yul b/test/libyul/objectCompiler/namedObjectCode.yul index f9e97bec4..5936aa744 100644 --- a/test/libyul/objectCompiler/namedObjectCode.yul +++ b/test/libyul/objectCompiler/namedObjectCode.yul @@ -9,6 +9,8 @@ object "a" { // 0x00 // /* "source":22:34 */ // sstore -// Bytecode: 60015f55 -// Opcodes: PUSH1 0x1 PUSH0 SSTORE -// SourceMappings: 32:1:0:-:0;29;22:12 +// /* "source":20:36 */ +// stop +// Bytecode: 60015f5500 +// Opcodes: PUSH1 0x1 PUSH0 SSTORE STOP +// SourceMappings: 32:1:0:-:0;29;22:12;20:16 diff --git a/test/libyul/objectCompiler/simple.yul b/test/libyul/objectCompiler/simple.yul index d94b53de9..b84c49a5a 100644 --- a/test/libyul/objectCompiler/simple.yul +++ b/test/libyul/objectCompiler/simple.yul @@ -9,6 +9,8 @@ // 0x00 // /* "source":4:16 */ // sstore -// Bytecode: 60015f55 -// Opcodes: PUSH1 0x1 PUSH0 SSTORE -// SourceMappings: 14:1:0:-:0;11;4:12 +// /* "source":0:18 */ +// stop +// Bytecode: 60015f5500 +// Opcodes: PUSH1 0x1 PUSH0 SSTORE STOP +// SourceMappings: 14:1:0:-:0;11;4:12;0:18 diff --git a/test/libyul/objectCompiler/smoke.yul b/test/libyul/objectCompiler/smoke.yul index b2e44d4dc..3f1079aa7 100644 --- a/test/libyul/objectCompiler/smoke.yul +++ b/test/libyul/objectCompiler/smoke.yul @@ -2,4 +2,8 @@ } // ---- // Assembly: -// -- empty bytecode -- +// /* "source":0:3 */ +// stop +// Bytecode: 00 +// Opcodes: STOP +// SourceMappings: 0:3:0:-:0 diff --git a/test/libyul/objectCompiler/sourceLocations.yul b/test/libyul/objectCompiler/sourceLocations.yul index 849d275fe..1c8477324 100644 --- a/test/libyul/objectCompiler/sourceLocations.yul +++ b/test/libyul/objectCompiler/sourceLocations.yul @@ -46,9 +46,10 @@ object "a" { // sstore // /* "abc.sol":2:5 */ // mstore(0x00, 0x0d) +// stop // stop // data_acaf3289d7b601cbd114fb36c4d29c85bbfd5e133f14cb355c3fd8d99367964f 48656c6c6f2c20576f726c6421 // } -// Bytecode: 6008600b5f3960085ff3fe5f8055600d5f52fe -// Opcodes: PUSH1 0x8 PUSH1 0xB PUSH0 CODECOPY PUSH1 0x8 PUSH0 RETURN INVALID PUSH0 DUP1 SSTORE PUSH1 0xD PUSH0 MSTORE INVALID +// Bytecode: 6009600b5f3960095ff3fe5f8055600d5f5200fe +// Opcodes: PUSH1 0x9 PUSH1 0xB PUSH0 CODECOPY PUSH1 0x9 PUSH0 RETURN INVALID PUSH0 DUP1 SSTORE PUSH1 0xD PUSH0 MSTORE STOP INVALID // SourceMappings: 0:2::-:0;;;;5:1;0:2; diff --git a/test/libyul/objectCompiler/subObject.yul b/test/libyul/objectCompiler/subObject.yul index f99b071af..46fc03f10 100644 --- a/test/libyul/objectCompiler/subObject.yul +++ b/test/libyul/objectCompiler/subObject.yul @@ -6,6 +6,8 @@ object "a" { } // ---- // Assembly: +// /* "source":20:22 */ +// stop // stop // data_acaf3289d7b601cbd114fb36c4d29c85bbfd5e133f14cb355c3fd8d99367964f 48656c6c6f2c20576f726c6421 // @@ -16,7 +18,9 @@ object "a" { // 0x00 // /* "source":139:151 */ // sstore +// /* "source":137:153 */ +// stop // } -// Bytecode: fe -// Opcodes: INVALID -// SourceMappings: +// Bytecode: 00fe +// Opcodes: STOP INVALID +// SourceMappings: 20:2:0:-:0 diff --git a/test/libyul/objectCompiler/subObjectAccess.yul b/test/libyul/objectCompiler/subObjectAccess.yul index e8bf0bcaf..291749220 100644 --- a/test/libyul/objectCompiler/subObjectAccess.yul +++ b/test/libyul/objectCompiler/subObjectAccess.yul @@ -80,69 +80,55 @@ object "A" { // /* "source":192:207 */ // dataSize(sub_0.sub_0) // /* "source":224:241 */ +// swap1 // dataOffset(sub_0.sub_1) // /* "source":258:273 */ +// swap3 // dataSize(sub_0.sub_1) // /* "source":291:310 */ +// swap5 // dataOffset(sub_0.sub_0.sub_0) // /* "source":328:345 */ +// swap7 // dataSize(sub_0.sub_0.sub_0) -// /* "source":361:364 */ -// dup10 +// /* "source":351:365 */ +// swap9 // /* "source":358:359 */ // 0x00 // /* "source":351:365 */ // sstore -// /* "source":381:384 */ -// dup9 // /* "source":377:379 */ // 0x20 // /* "source":370:385 */ // sstore -// /* "source":401:404 */ -// dup8 // /* "source":397:399 */ // 0x40 // /* "source":390:405 */ // sstore -// /* "source":421:424 */ -// dup7 // /* "source":417:419 */ // 0x60 // /* "source":410:425 */ // sstore -// /* "source":442:446 */ -// dup6 // /* "source":437:440 */ // 0x80 // /* "source":430:447 */ // sstore -// /* "source":464:468 */ -// dup5 // /* "source":459:462 */ // 0xa0 // /* "source":452:469 */ // sstore -// /* "source":486:490 */ -// dup4 // /* "source":481:484 */ // 0xc0 // /* "source":474:491 */ // sstore -// /* "source":508:512 */ -// dup3 // /* "source":503:506 */ // 0xe0 // /* "source":496:513 */ // sstore -// /* "source":530:535 */ -// dup2 // /* "source":525:528 */ // 0x0100 // /* "source":518:536 */ // sstore -// /* "source":553:558 */ -// dup1 // /* "source":548:551 */ // 0x0120 // /* "source":541:559 */ @@ -166,41 +152,33 @@ object "A" { // /* "source":756:769 */ // dataSize(sub_1) // /* "source":788:805 */ +// swap1 // dataOffset(sub_0.sub_0) // /* "source":824:839 */ +// swap3 // dataSize(sub_0.sub_0) -// /* "source":857:860 */ -// dup6 +// /* "source":847:861 */ +// swap5 // /* "source":854:855 */ // 0x00 // /* "source":847:861 */ // sstore -// /* "source":879:882 */ -// dup5 // /* "source":875:877 */ // 0x20 // /* "source":868:883 */ // sstore -// /* "source":901:904 */ -// dup4 // /* "source":897:899 */ // 0x40 // /* "source":890:905 */ // sstore -// /* "source":923:926 */ -// dup3 // /* "source":919:921 */ // 0x60 // /* "source":912:927 */ // sstore -// /* "source":946:950 */ -// dup2 // /* "source":941:944 */ // 0x80 // /* "source":934:951 */ // sstore -// /* "source":970:974 */ -// dup1 // /* "source":965:968 */ // 0xa0 // /* "source":958:975 */ @@ -218,14 +196,12 @@ object "A" { // dataOffset(sub_0) // /* "source":1087:1100 */ // dataSize(sub_0) -// /* "source":1120:1123 */ -// dup2 +// /* "source":1110:1124 */ +// swap1 // /* "source":1117:1118 */ // 0x00 // /* "source":1110:1124 */ // sstore -// /* "source":1144:1147 */ -// dup1 // /* "source":1140:1142 */ // 0x20 // /* "source":1133:1148 */ @@ -249,6 +225,6 @@ object "A" { // invalid // } // } -// Bytecode: 5f608e6042603a607d6011607c6001607c6001895f55886020558760405586606055856080558460a0558360c0558260e055816101005580610120556101405ff3fe602860116039600160396001855f55846020558360405582606055816080558060a05560c05ff3fe60106001815f558060205560405ff3fefefefe60106001815f558060205560405ff3fefe -// Opcodes: PUSH0 PUSH1 0x8E PUSH1 0x42 PUSH1 0x3A PUSH1 0x7D PUSH1 0x11 PUSH1 0x7C PUSH1 0x1 PUSH1 0x7C PUSH1 0x1 DUP10 PUSH0 SSTORE DUP9 PUSH1 0x20 SSTORE DUP8 PUSH1 0x40 SSTORE DUP7 PUSH1 0x60 SSTORE DUP6 PUSH1 0x80 SSTORE DUP5 PUSH1 0xA0 SSTORE DUP4 PUSH1 0xC0 SSTORE DUP3 PUSH1 0xE0 SSTORE DUP2 PUSH2 0x100 SSTORE DUP1 PUSH2 0x120 SSTORE PUSH2 0x140 PUSH0 RETURN INVALID PUSH1 0x28 PUSH1 0x11 PUSH1 0x39 PUSH1 0x1 PUSH1 0x39 PUSH1 0x1 DUP6 PUSH0 SSTORE DUP5 PUSH1 0x20 SSTORE DUP4 PUSH1 0x40 SSTORE DUP3 PUSH1 0x60 SSTORE DUP2 PUSH1 0x80 SSTORE DUP1 PUSH1 0xA0 SSTORE PUSH1 0xC0 PUSH0 RETURN INVALID PUSH1 0x10 PUSH1 0x1 DUP2 PUSH0 SSTORE DUP1 PUSH1 0x20 SSTORE PUSH1 0x40 PUSH0 RETURN INVALID INVALID INVALID INVALID PUSH1 0x10 PUSH1 0x1 DUP2 PUSH0 SSTORE DUP1 PUSH1 0x20 SSTORE PUSH1 0x40 PUSH0 RETURN INVALID INVALID -// SourceMappings: 37:15:0:-:0;68:13;97:15;128:13;158:17;192:15;224:17;258:15;291:19;328:17;361:3;358:1;351:14;381:3;377:2;370:15;401:3;397:2;390:15;421:3;417:2;410:15;442:4;437:3;430:17;464:4;459:3;452:17;486:4;481:3;474:17;508:4;503:3;496:17;530:5;525:3;518:18;553:5;548:3;541:18;574:3;571:1;564:14 +// Bytecode: 5f6084603d603660746010906073926001946073966001985f5560205560405560605560805560a05560c05560e05561010055610120556101405ff3fe6025601060356001906035926001945f5560205560405560605560805560a05560c05ff3fe600f6001905f5560205560405ff3fefefefe600f6001905f5560205560405ff3fefe +// Opcodes: PUSH0 PUSH1 0x84 PUSH1 0x3D PUSH1 0x36 PUSH1 0x74 PUSH1 0x10 SWAP1 PUSH1 0x73 SWAP3 PUSH1 0x1 SWAP5 PUSH1 0x73 SWAP7 PUSH1 0x1 SWAP9 PUSH0 SSTORE PUSH1 0x20 SSTORE PUSH1 0x40 SSTORE PUSH1 0x60 SSTORE PUSH1 0x80 SSTORE PUSH1 0xA0 SSTORE PUSH1 0xC0 SSTORE PUSH1 0xE0 SSTORE PUSH2 0x100 SSTORE PUSH2 0x120 SSTORE PUSH2 0x140 PUSH0 RETURN INVALID PUSH1 0x25 PUSH1 0x10 PUSH1 0x35 PUSH1 0x1 SWAP1 PUSH1 0x35 SWAP3 PUSH1 0x1 SWAP5 PUSH0 SSTORE PUSH1 0x20 SSTORE PUSH1 0x40 SSTORE PUSH1 0x60 SSTORE PUSH1 0x80 SSTORE PUSH1 0xA0 SSTORE PUSH1 0xC0 PUSH0 RETURN INVALID PUSH1 0xF PUSH1 0x1 SWAP1 PUSH0 SSTORE PUSH1 0x20 SSTORE PUSH1 0x40 PUSH0 RETURN INVALID INVALID INVALID INVALID PUSH1 0xF PUSH1 0x1 SWAP1 PUSH0 SSTORE PUSH1 0x20 SSTORE PUSH1 0x40 PUSH0 RETURN INVALID INVALID +// SourceMappings: 37:15:0:-:0;68:13;97:15;128:13;158:17;192:15;224:17;;258:15;;291:19;;328:17;;351:14;358:1;351:14;377:2;370:15;397:2;390:15;417:2;410:15;437:3;430:17;459:3;452:17;481:3;474:17;503:3;496:17;525:3;518:18;548:3;541:18;574:3;571:1;564:14 diff --git a/test/libyul/objectCompiler/subSubObject.yul b/test/libyul/objectCompiler/subSubObject.yul index a36f97619..a9936d58f 100644 --- a/test/libyul/objectCompiler/subSubObject.yul +++ b/test/libyul/objectCompiler/subSubObject.yul @@ -12,6 +12,8 @@ object "a" { } // ---- // Assembly: +// /* "source":20:22 */ +// stop // stop // data_acaf3289d7b601cbd114fb36c4d29c85bbfd5e133f14cb355c3fd8d99367964f 48656c6c6f2c20576f726c6421 // @@ -22,6 +24,8 @@ object "a" { // 0x00 // /* "source":143:155 */ // sstore +// /* "source":141:157 */ +// stop // stop // // sub_0: assembly { @@ -31,10 +35,12 @@ object "a" { // 0x02 // /* "source":193:205 */ // sstore +// /* "source":191:207 */ +// stop // stop // data_6adf031833174bbe4c85eafe59ddb54e6584648c2c962c6f94791ab49caa0ad4 123456 // } // } -// Bytecode: fe -// Opcodes: INVALID -// SourceMappings: +// Bytecode: 00fe +// Opcodes: STOP INVALID +// SourceMappings: 20:2:0:-:0