From 72b4629118a14e6a8666f7e54b8b13eceb8c0789 Mon Sep 17 00:00:00 2001 From: Alexander Arlt Date: Mon, 8 May 2023 08:44:59 -0500 Subject: [PATCH] Add cmdlineTests/asm_json_export_yul_subobjects. --- .../asm_json_export_yul_subobjects/args | 1 + .../asm_json_export_yul_subobjects/output | 415 ++++++++++++++++++ .../asm_json_export_yul_subobjects/stdin | 43 ++ .../output.orig | 7 - .../asm_json_import_yul_subobjects/args | 1 + .../asm_json_import_yul_subobjects/err | 5 + .../asm_json_import_yul_subobjects/exit | 1 + .../asm_json_import_yul_subobjects/stdin | 413 +++++++++++++++++ 8 files changed, 879 insertions(+), 7 deletions(-) create mode 100644 test/cmdlineTests/asm_json_export_yul_subobjects/args create mode 100644 test/cmdlineTests/asm_json_export_yul_subobjects/output create mode 100644 test/cmdlineTests/asm_json_export_yul_subobjects/stdin delete mode 100644 test/cmdlineTests/asm_json_export_yul_without_debug/output.orig create mode 100644 test/cmdlineTests/asm_json_import_yul_subobjects/args create mode 100644 test/cmdlineTests/asm_json_import_yul_subobjects/err create mode 100644 test/cmdlineTests/asm_json_import_yul_subobjects/exit create mode 100644 test/cmdlineTests/asm_json_import_yul_subobjects/stdin diff --git a/test/cmdlineTests/asm_json_export_yul_subobjects/args b/test/cmdlineTests/asm_json_export_yul_subobjects/args new file mode 100644 index 000000000..aa82dbacc --- /dev/null +++ b/test/cmdlineTests/asm_json_export_yul_subobjects/args @@ -0,0 +1 @@ +--strict-assembly - --asm-json --pretty-json diff --git a/test/cmdlineTests/asm_json_export_yul_subobjects/output b/test/cmdlineTests/asm_json_export_yul_subobjects/output new file mode 100644 index 000000000..463e925ba --- /dev/null +++ b/test/cmdlineTests/asm_json_export_yul_subobjects/output @@ -0,0 +1,415 @@ + +======= (EVM) ======= +{ + ".code": + [ + { + "begin": 36, + "end": 51, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { + "begin": 33, + "end": 34, + "name": "DUP1", + "source": 0 + }, + { + "begin": 26, + "end": 52, + "name": "SSTORE", + "source": 0 + }, + { + "begin": 67, + "end": 80, + "name": "PUSHSIZE", + "source": 0 + }, + { + "begin": 64, + "end": 65, + "name": "PUSH", + "source": 0, + "value": "1" + }, + { + "begin": 57, + "end": 81, + "name": "SSTORE", + "source": 0 + }, + { + "begin": 96, + "end": 111, + "name": "PUSH [$]", + "source": 0, + "value": "0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "begin": 93, + "end": 94, + "name": "PUSH", + "source": 0, + "value": "2" + }, + { + "begin": 86, + "end": 112, + "name": "SSTORE", + "source": 0 + }, + { + "begin": 127, + "end": 140, + "name": "PUSH #[$]", + "source": 0, + "value": "0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "begin": 124, + "end": 125, + "name": "PUSH", + "source": 0, + "value": "3" + }, + { + "begin": 117, + "end": 141, + "name": "SSTORE", + "source": 0 + }, + { + "begin": 156, + "end": 173, + "name": "PUSH [$]", + "source": 0, + "value": "000000000000000000000000000000000000000000000000ffffffffffffffff" + }, + { + "begin": 153, + "end": 154, + "name": "PUSH", + "source": 0, + "value": "4" + }, + { + "begin": 146, + "end": 174, + "name": "SSTORE", + "source": 0 + }, + { + "begin": 189, + "end": 204, + "name": "PUSH #[$]", + "source": 0, + "value": "000000000000000000000000000000000000000000000000ffffffffffffffff" + }, + { + "begin": 186, + "end": 187, + "name": "PUSH", + "source": 0, + "value": "5" + }, + { + "begin": 179, + "end": 205, + "name": "SSTORE", + "source": 0 + }, + { + "begin": 220, + "end": 237, + "name": "PUSH [$]", + "source": 0, + "value": "000000000000000000000000000000000000000000000000fffffffffffffffe" + }, + { + "begin": 217, + "end": 218, + "name": "PUSH", + "source": 0, + "value": "6" + }, + { + "begin": 210, + "end": 238, + "name": "SSTORE", + "source": 0 + }, + { + "begin": 253, + "end": 268, + "name": "PUSH #[$]", + "source": 0, + "value": "000000000000000000000000000000000000000000000000fffffffffffffffe" + }, + { + "begin": 250, + "end": 251, + "name": "PUSH", + "source": 0, + "value": "7" + }, + { + "begin": 243, + "end": 269, + "name": "SSTORE", + "source": 0 + }, + { + "begin": 284, + "end": 303, + "name": "PUSH [$]", + "source": 0, + "value": "000000000000000000000000000000000000000000000000fffffffffffffffd" + }, + { + "begin": 281, + "end": 282, + "name": "PUSH", + "source": 0, + "value": "8" + }, + { + "begin": 274, + "end": 304, + "name": "SSTORE", + "source": 0 + }, + { + "begin": 319, + "end": 336, + "name": "PUSH #[$]", + "source": 0, + "value": "000000000000000000000000000000000000000000000000fffffffffffffffd" + }, + { + "begin": 316, + "end": 317, + "name": "PUSH", + "source": 0, + "value": "9" + }, + { + "begin": 309, + "end": 337, + "name": "SSTORE", + "source": 0 + } + ], + ".data": + { + "0": + { + ".code": + [ + { + "begin": 418, + "end": 433, + "name": "PUSH [$]", + "source": 0, + "value": "0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "begin": 414, + "end": 416, + "name": "PUSH", + "source": 0, + "value": "A" + }, + { + "begin": 407, + "end": 434, + "name": "SSTORE", + "source": 0 + }, + { + "begin": 452, + "end": 465, + "name": "PUSH #[$]", + "source": 0, + "value": "0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "begin": 448, + "end": 450, + "name": "PUSH", + "source": 0, + "value": "B" + }, + { + "begin": 441, + "end": 466, + "name": "SSTORE", + "source": 0 + }, + { + "begin": 484, + "end": 499, + "name": "PUSH [$]", + "source": 0, + "value": "0000000000000000000000000000000000000000000000000000000000000001" + }, + { + "begin": 480, + "end": 482, + "name": "PUSH", + "source": 0, + "value": "C" + }, + { + "begin": 473, + "end": 500, + "name": "SSTORE", + "source": 0 + }, + { + "begin": 518, + "end": 531, + "name": "PUSH #[$]", + "source": 0, + "value": "0000000000000000000000000000000000000000000000000000000000000001" + }, + { + "begin": 514, + "end": 516, + "name": "PUSH", + "source": 0, + "value": "D" + }, + { + "begin": 507, + "end": 532, + "name": "SSTORE", + "source": 0 + }, + { + "begin": 550, + "end": 567, + "name": "PUSH [$]", + "source": 0, + "value": "000000000000000000000000000000000000000000000000ffffffffffffffff" + }, + { + "begin": 546, + "end": 548, + "name": "PUSH", + "source": 0, + "value": "E" + }, + { + "begin": 539, + "end": 568, + "name": "SSTORE", + "source": 0 + }, + { + "begin": 586, + "end": 601, + "name": "PUSH #[$]", + "source": 0, + "value": "000000000000000000000000000000000000000000000000ffffffffffffffff" + }, + { + "begin": 582, + "end": 584, + "name": "PUSH", + "source": 0, + "value": "F" + }, + { + "begin": 575, + "end": 602, + "name": "SSTORE", + "source": 0 + } + ], + ".data": + { + "0": + { + ".code": + [ + { + "begin": 658, + "end": 673, + "name": "PUSH [$]", + "source": 0, + "value": "0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "begin": 654, + "end": 656, + "name": "PUSH", + "source": 0, + "value": "10" + }, + { + "begin": 647, + "end": 674, + "name": "SSTORE", + "source": 0 + }, + { + "begin": 694, + "end": 707, + "name": "PUSH #[$]", + "source": 0, + "value": "0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "begin": 690, + "end": 692, + "name": "PUSH", + "source": 0, + "value": "11" + }, + { + "begin": 683, + "end": 708, + "name": "SSTORE", + "source": 0 + } + ], + ".data": + { + "0": + { + ".code": + [ + { + "begin": 761, + "end": 770, + "name": "INVALID", + "source": 0 + } + ] + } + } + }, + "1": + { + ".code": + [ + { + "begin": 833, + "end": 842, + "name": "INVALID", + "source": 0 + } + ] + } + } + }, + "ACAF3289D7B601CBD114FB36C4D29C85BBFD5E133F14CB355C3FD8D99367964F": "48656c6c6f2c20576f726c6421" + }, + "sourceList": + [ + "" + ] +} diff --git a/test/cmdlineTests/asm_json_export_yul_subobjects/stdin b/test/cmdlineTests/asm_json_export_yul_subobjects/stdin new file mode 100644 index 000000000..8ba3fd0ad --- /dev/null +++ b/test/cmdlineTests/asm_json_export_yul_subobjects/stdin @@ -0,0 +1,43 @@ +object "A" { + code { + sstore(0, dataoffset("A")) + sstore(1, datasize("A")) + sstore(2, dataoffset("B")) + sstore(3, datasize("B")) + sstore(4, dataoffset("B.C")) + sstore(5, datasize("B.C")) + sstore(6, dataoffset("B.E")) + sstore(7, datasize("B.E")) + sstore(8, dataoffset("B.C.D")) + sstore(9, datasize("B.C.D")) + } + + data "data1" "Hello, World!" + + object "B" { + code { + sstore(10, dataoffset("C")) + sstore(11, datasize("C")) + sstore(12, dataoffset("E")) + sstore(13, datasize("E")) + sstore(14, dataoffset("C.D")) + sstore(15, datasize("C.D")) + } + object "C" { + code { + sstore(16, dataoffset("D")) + sstore(17, datasize("D")) + } + object "D" { + code { + invalid() + } + } + } + object "E" { + code { + invalid() + } + } + } +} diff --git a/test/cmdlineTests/asm_json_export_yul_without_debug/output.orig b/test/cmdlineTests/asm_json_export_yul_without_debug/output.orig deleted file mode 100644 index 1415d157f..000000000 --- a/test/cmdlineTests/asm_json_export_yul_without_debug/output.orig +++ /dev/null @@ -1,7 +0,0 @@ - -======= (EVM) ======= -<<<<<<< HEAD -{".code":[{"begin":59,"end":76,"name":"PUSH","source":0,"value":"80"},{"begin":100,"end":102,"name":"DUP1","source":0},{"begin":96,"end":98,"name":"PUSH","source":0,"value":"40"},{"begin":89,"end":103,"name":"MSTORE","source":0},{"begin":119,"end":130,"name":"CALLVALUE","source":0},{"begin":116,"end":147,"name":"ISZERO","source":0},{"begin":116,"end":147,"name":"PUSH [tag]","source":0,"value":"1"},{"begin":116,"end":147,"name":"JUMPI","source":0},{"begin":143,"end":144,"name":"PUSH","source":0,"value":"0"},{"begin":140,"end":141,"name":"DUP1","source":0},{"begin":133,"end":145,"name":"REVERT","source":0},{"begin":116,"end":147,"name":"tag","source":0,"value":"1"},{"begin":116,"end":147,"name":"JUMPDEST","source":0},{"begin":173,"end":177,"name":"PUSH","source":0,"value":"2"},{"begin":167,"end":171,"name":"PUSH","source":0,"value":"0"},{"begin":160,"end":178,"name":"SSTORE","source":0},{"begin":204,"end":208,"name":"PUSH","source":0,"value":"0"},{"begin":198,"end":202,"name":"PUSH","source":0,"value":"1"},{"begin":191,"end":209,"name":"SSTORE","source":0},{"begin":232,"end":257,"name":"PUSH #[$]","source":0,"value":"0000000000000000000000000000000000000000000000000000000000000000"},{"begin":312,"end":314,"name":"DUP1","source":0},{"begin":283,"end":310,"name":"PUSH [$]","source":0,"value":"0000000000000000000000000000000000000000000000000000000000000000"},{"begin":279,"end":281,"name":"DUP4","source":0},{"begin":270,"end":315,"name":"CODECOPY","source":0},{"begin":339,"end":341,"name":"DUP1","source":0},{"begin":335,"end":337,"name":"DUP3","source":0},{"begin":328,"end":342,"name":"RETURN","source":0}],".data":{"0":{".auxdata":"",".code":[{"begin":443,"end":460,"name":"PUSH","source":0,"value":"80"},{"begin":488,"end":490,"name":"DUP1","source":0},{"begin":484,"end":486,"name":"PUSH","source":0,"value":"40"},{"begin":477,"end":491,"name":"MSTORE","source":0},{"begin":537,"end":538,"name":"PUSH","source":0,"value":"4"},{"begin":521,"end":535,"name":"CALLDATASIZE","source":0},{"begin":518,"end":539,"name":"LT","source":0},{"begin":508,"end":1367,"name":"PUSH [tag]","source":0,"value":"1"},{"begin":508,"end":1367,"name":"JUMPI","source":0},{"begin":589,"end":590,"name":"PUSH","source":0,"value":"0"},{"begin":640,"end":642,"name":"DUP1","source":0},{"begin":627,"end":643,"name":"CALLDATALOAD","source":0},{"begin":622,"end":625,"name":"PUSH","source":0,"value":"E0"},{"begin":618,"end":644,"name":"SHR","source":0},{"begin":670,"end":680,"name":"PUSH","source":0,"value":"B4F40C61"},{"begin":665,"end":970,"name":"DUP2","source":0},{"begin":665,"end":970,"name":"EQ","source":0},{"begin":665,"end":970,"name":"PUSH [tag]","source":0,"value":"3"},{"begin":665,"end":970,"name":"JUMPI","source":0},{"begin":996,"end":1006,"name":"PUSH","source":0,"value":"E5AA3D58"},{"begin":991,"end":1349,"name":"DUP2","source":0},{"begin":991,"end":1349,"name":"EQ","source":0},{"begin":991,"end":1349,"name":"PUSH [tag]","source":0,"value":"4"},{"begin":991,"end":1349,"name":"JUMPI","source":0},{"begin":611,"end":1349,"name":"PUSH [tag]","source":0,"value":"2"},{"begin":611,"end":1349,"name":"JUMP","source":0},{"begin":665,"end":970,"name":"tag","source":0,"value":"3"},{"begin":665,"end":970,"name":"JUMPDEST","source":0},{"begin":710,"end":721,"name":"CALLVALUE","source":0},{"begin":707,"end":740,"name":"ISZERO","source":0},{"begin":707,"end":740,"name":"PUSH [tag]","source":0,"value":"5"},{"begin":707,"end":740,"name":"JUMPI","source":0},{"begin":735,"end":737,"name":"DUP2","source":0},{"begin":731,"end":733,"name":"DUP3","source":0},{"begin":724,"end":738,"name":"REVERT","source":0},{"begin":707,"end":740,"name":"tag","source":0,"value":"5"},{"begin":707,"end":740,"name":"JUMPDEST","source":0},{"begin":801,"end":803,"name":"DUP2","source":0},{"begin":796,"end":797,"name":"PUSH","source":0,"value":"3"},{"begin":792,"end":798,"name":"NOT","source":0},{"begin":776,"end":790,"name":"CALLDATASIZE","source":0},{"begin":772,"end":799,"name":"ADD","source":0},{"begin":768,"end":804,"name":"SLT","source":0},{"begin":765,"end":823,"name":"ISZERO","source":0},{"begin":765,"end":823,"name":"PUSH [tag]","source":0,"value":"6"},{"begin":765,"end":823,"name":"JUMPI","source":0},{"begin":818,"end":820,"name":"DUP2","source":0},{"begin":814,"end":816,"name":"DUP3","source":0},{"begin":807,"end":821,"name":"REVERT","source":0},{"begin":765,"end":823,"name":"tag","source":0,"value":"6"},{"begin":765,"end":823,"name":"JUMPDEST","source":0},{"begin":906,"end":907,"name":"PUSH","source":0,"value":"1"},{"begin":859,"end":908,"name":"SLOAD","source":0},{"begin":855,"end":857,"name":"DUP4","source":0},{"begin":848,"end":909,"name":"MSTORE","source":0},{"begin":945,"end":947,"name":"PUSH","source":0,"value":"20"},{"begin":941,"end":943,"name":"DUP4","source":0},{"begin":934,"end":948,"name":"RETURN","source":0},{"begin":991,"end":1349,"name":"tag","source":0,"value":"4"},{"begin":991,"end":1349,"name":"JUMPDEST","source":0},{"begin":1036,"end":1047,"name":"CALLVALUE","source":0},{"begin":1033,"end":1066,"name":"ISZERO","source":0},{"begin":1033,"end":1066,"name":"PUSH [tag]","source":0,"value":"7"},{"begin":1033,"end":1066,"name":"JUMPI","source":0},{"begin":1061,"end":1063,"name":"DUP2","source":0},{"begin":1057,"end":1059,"name":"DUP3","source":0},{"begin":1050,"end":1064,"name":"REVERT","source":0},{"begin":1033,"end":1066,"name":"tag","source":0,"value":"7"},{"begin":1033,"end":1066,"name":"JUMPDEST","source":0},{"begin":1127,"end":1129,"name":"DUP2","source":0},{"begin":1122,"end":1123,"name":"PUSH","source":0,"value":"3"},{"begin":1118,"end":1124,"name":"NOT","source":0},{"begin":1102,"end":1116,"name":"CALLDATASIZE","source":0},{"begin":1098,"end":1125,"name":"ADD","source":0},{"begin":1094,"end":1130,"name":"SLT","source":0},{"begin":1091,"end":1149,"name":"ISZERO","source":0},{"begin":1091,"end":1149,"name":"PUSH [tag]","source":0,"value":"8"},{"begin":1091,"end":1149,"name":"JUMPI","source":0},{"begin":1144,"end":1146,"name":"DUP2","source":0},{"begin":1140,"end":1142,"name":"DUP3","source":0},{"begin":1133,"end":1147,"name":"REVERT","source":0},{"begin":1091,"end":1149,"name":"tag","source":0,"value":"8"},{"begin":1091,"end":1149,"name":"JUMPDEST","source":0},{"begin":1190,"end":1192,"name":"DUP2","source":0},{"begin":1184,"end":1193,"name":"SLOAD","source":0},{"begin":1238,"end":1240,"name":"PUSH","source":0,"value":"40"},{"begin":1232,"end":1241,"name":"MLOAD","source":0},{"begin":1281,"end":1283,"name":"DUP2","source":0},{"begin":1273,"end":1279,"name":"DUP2","source":0},{"begin":1266,"end":1284,"name":"MSTORE","source":0},{"begin":1324,"end":1326,"name":"PUSH","source":0,"value":"20"},{"begin":1316,"end":1322,"name":"DUP2","source":0},{"begin":1309,"end":1327,"name":"RETURN","source":0},{"begin":611,"end":1349,"name":"tag","source":0,"value":"2"},{"begin":611,"end":1349,"name":"JUMPDEST","source":0},{"begin":611,"end":1349,"name":"POP","source":0},{"begin":557,"end":1367,"name":"POP","source":0},{"begin":508,"end":1367,"name":"tag","source":0,"value":"1"},{"begin":508,"end":1367,"name":"JUMPDEST","source":0},{"begin":1394,"end":1395,"name":"PUSH","source":0,"value":"0"},{"begin":1391,"end":1392,"name":"DUP1","source":0},{"begin":1384,"end":1396,"name":"REVERT","source":0}]}},"sourceList":[""]} -======= -{".code":[{"begin":59,"end":76,"name":"PUSH","source":-1,"value":"80"},{"begin":100,"end":102,"name":"DUP1","source":-1},{"begin":96,"end":98,"name":"PUSH","source":-1,"value":"40"},{"begin":89,"end":103,"name":"MSTORE","source":-1},{"begin":119,"end":130,"name":"CALLVALUE","source":-1},{"begin":116,"end":147,"name":"ISZERO","source":-1},{"begin":116,"end":147,"name":"PUSH [tag]","source":-1,"value":"1"},{"begin":116,"end":147,"name":"JUMPI","source":-1},{"begin":143,"end":144,"name":"PUSH","source":-1,"value":"0"},{"begin":140,"end":141,"name":"DUP1","source":-1},{"begin":133,"end":145,"name":"REVERT","source":-1},{"begin":116,"end":147,"name":"tag","source":-1,"value":"1"},{"begin":116,"end":147,"name":"JUMPDEST","source":-1},{"begin":173,"end":177,"name":"PUSH","source":-1,"value":"2"},{"begin":167,"end":171,"name":"PUSH","source":-1,"value":"0"},{"begin":160,"end":178,"name":"SSTORE","source":-1},{"begin":204,"end":208,"name":"PUSH","source":-1,"value":"0"},{"begin":198,"end":202,"name":"PUSH","source":-1,"value":"1"},{"begin":191,"end":209,"name":"SSTORE","source":-1},{"begin":232,"end":257,"name":"PUSH #[$]","source":-1,"value":"0000000000000000000000000000000000000000000000000000000000000000"},{"begin":312,"end":314,"name":"DUP1","source":-1},{"begin":283,"end":310,"name":"PUSH [$]","source":-1,"value":"0000000000000000000000000000000000000000000000000000000000000000"},{"begin":279,"end":281,"name":"DUP4","source":-1},{"begin":270,"end":315,"name":"CODECOPY","source":-1},{"begin":339,"end":341,"name":"DUP1","source":-1},{"begin":335,"end":337,"name":"DUP3","source":-1},{"begin":328,"end":342,"name":"RETURN","source":-1}],".data":{"0":{".auxdata":"",".code":[{"begin":443,"end":460,"name":"PUSH","source":-1,"value":"80"},{"begin":488,"end":490,"name":"DUP1","source":-1},{"begin":484,"end":486,"name":"PUSH","source":-1,"value":"40"},{"begin":477,"end":491,"name":"MSTORE","source":-1},{"begin":537,"end":538,"name":"PUSH","source":-1,"value":"4"},{"begin":521,"end":535,"name":"CALLDATASIZE","source":-1},{"begin":518,"end":539,"name":"LT","source":-1},{"begin":508,"end":1367,"name":"PUSH [tag]","source":-1,"value":"1"},{"begin":508,"end":1367,"name":"JUMPI","source":-1},{"begin":589,"end":590,"name":"PUSH","source":-1,"value":"0"},{"begin":640,"end":642,"name":"DUP1","source":-1},{"begin":627,"end":643,"name":"CALLDATALOAD","source":-1},{"begin":622,"end":625,"name":"PUSH","source":-1,"value":"E0"},{"begin":618,"end":644,"name":"SHR","source":-1},{"begin":670,"end":680,"name":"PUSH","source":-1,"value":"B4F40C61"},{"begin":665,"end":970,"name":"DUP2","source":-1},{"begin":665,"end":970,"name":"EQ","source":-1},{"begin":665,"end":970,"name":"PUSH [tag]","source":-1,"value":"3"},{"begin":665,"end":970,"name":"JUMPI","source":-1},{"begin":996,"end":1006,"name":"PUSH","source":-1,"value":"E5AA3D58"},{"begin":991,"end":1349,"name":"DUP2","source":-1},{"begin":991,"end":1349,"name":"EQ","source":-1},{"begin":991,"end":1349,"name":"PUSH [tag]","source":-1,"value":"4"},{"begin":991,"end":1349,"name":"JUMPI","source":-1},{"begin":611,"end":1349,"name":"PUSH [tag]","source":-1,"value":"2"},{"begin":611,"end":1349,"name":"JUMP","source":-1},{"begin":665,"end":970,"name":"tag","source":-1,"value":"3"},{"begin":665,"end":970,"name":"JUMPDEST","source":-1},{"begin":710,"end":721,"name":"CALLVALUE","source":-1},{"begin":707,"end":740,"name":"ISZERO","source":-1},{"begin":707,"end":740,"name":"PUSH [tag]","source":-1,"value":"5"},{"begin":707,"end":740,"name":"JUMPI","source":-1},{"begin":735,"end":737,"name":"DUP2","source":-1},{"begin":731,"end":733,"name":"DUP3","source":-1},{"begin":724,"end":738,"name":"REVERT","source":-1},{"begin":707,"end":740,"name":"tag","source":-1,"value":"5"},{"begin":707,"end":740,"name":"JUMPDEST","source":-1},{"begin":801,"end":803,"name":"DUP2","source":-1},{"begin":796,"end":797,"name":"PUSH","source":-1,"value":"3"},{"begin":792,"end":798,"name":"NOT","source":-1},{"begin":776,"end":790,"name":"CALLDATASIZE","source":-1},{"begin":772,"end":799,"name":"ADD","source":-1},{"begin":768,"end":804,"name":"SLT","source":-1},{"begin":765,"end":823,"name":"ISZERO","source":-1},{"begin":765,"end":823,"name":"PUSH [tag]","source":-1,"value":"6"},{"begin":765,"end":823,"name":"JUMPI","source":-1},{"begin":818,"end":820,"name":"DUP2","source":-1},{"begin":814,"end":816,"name":"DUP3","source":-1},{"begin":807,"end":821,"name":"REVERT","source":-1},{"begin":765,"end":823,"name":"tag","source":-1,"value":"6"},{"begin":765,"end":823,"name":"JUMPDEST","source":-1},{"begin":906,"end":907,"name":"PUSH","source":-1,"value":"1"},{"begin":859,"end":908,"name":"SLOAD","source":-1},{"begin":855,"end":857,"name":"DUP4","source":-1},{"begin":848,"end":909,"name":"MSTORE","source":-1},{"begin":945,"end":947,"name":"PUSH","source":-1,"value":"20"},{"begin":941,"end":943,"name":"DUP4","source":-1},{"begin":934,"end":948,"name":"RETURN","source":-1},{"begin":991,"end":1349,"name":"tag","source":-1,"value":"4"},{"begin":991,"end":1349,"name":"JUMPDEST","source":-1},{"begin":1036,"end":1047,"name":"CALLVALUE","source":-1},{"begin":1033,"end":1066,"name":"ISZERO","source":-1},{"begin":1033,"end":1066,"name":"PUSH [tag]","source":-1,"value":"7"},{"begin":1033,"end":1066,"name":"JUMPI","source":-1},{"begin":1061,"end":1063,"name":"DUP2","source":-1},{"begin":1057,"end":1059,"name":"DUP3","source":-1},{"begin":1050,"end":1064,"name":"REVERT","source":-1},{"begin":1033,"end":1066,"name":"tag","source":-1,"value":"7"},{"begin":1033,"end":1066,"name":"JUMPDEST","source":-1},{"begin":1127,"end":1129,"name":"DUP2","source":-1},{"begin":1122,"end":1123,"name":"PUSH","source":-1,"value":"3"},{"begin":1118,"end":1124,"name":"NOT","source":-1},{"begin":1102,"end":1116,"name":"CALLDATASIZE","source":-1},{"begin":1098,"end":1125,"name":"ADD","source":-1},{"begin":1094,"end":1130,"name":"SLT","source":-1},{"begin":1091,"end":1149,"name":"ISZERO","source":-1},{"begin":1091,"end":1149,"name":"PUSH [tag]","source":-1,"value":"8"},{"begin":1091,"end":1149,"name":"JUMPI","source":-1},{"begin":1144,"end":1146,"name":"DUP2","source":-1},{"begin":1140,"end":1142,"name":"DUP3","source":-1},{"begin":1133,"end":1147,"name":"REVERT","source":-1},{"begin":1091,"end":1149,"name":"tag","source":-1,"value":"8"},{"begin":1091,"end":1149,"name":"JUMPDEST","source":-1},{"begin":1190,"end":1192,"name":"DUP2","source":-1},{"begin":1184,"end":1193,"name":"SLOAD","source":-1},{"begin":1238,"end":1240,"name":"PUSH","source":-1,"value":"40"},{"begin":1232,"end":1241,"name":"MLOAD","source":-1},{"begin":1281,"end":1283,"name":"DUP2","source":-1},{"begin":1273,"end":1279,"name":"DUP2","source":-1},{"begin":1266,"end":1284,"name":"MSTORE","source":-1},{"begin":1324,"end":1326,"name":"PUSH","source":-1,"value":"20"},{"begin":1316,"end":1322,"name":"DUP2","source":-1},{"begin":1309,"end":1327,"name":"RETURN","source":-1},{"begin":611,"end":1349,"name":"tag","source":-1,"value":"2"},{"begin":611,"end":1349,"name":"JUMPDEST","source":-1},{"begin":611,"end":1349,"name":"POP","source":-1},{"begin":557,"end":1367,"name":"POP","source":-1},{"begin":508,"end":1367,"name":"tag","source":-1,"value":"1"},{"begin":508,"end":1367,"name":"JUMPDEST","source":-1},{"begin":1394,"end":1395,"name":"PUSH","source":-1,"value":"0"},{"begin":1391,"end":1392,"name":"DUP1","source":-1},{"begin":1384,"end":1396,"name":"REVERT","source":-1}]}},"sourceList":[]} ->>>>>>> a9f8f4ed9 (Yul to EVM assembly json export: Add simple cmdline tests.) diff --git a/test/cmdlineTests/asm_json_import_yul_subobjects/args b/test/cmdlineTests/asm_json_import_yul_subobjects/args new file mode 100644 index 000000000..2b4b3a153 --- /dev/null +++ b/test/cmdlineTests/asm_json_import_yul_subobjects/args @@ -0,0 +1 @@ +--import-asm-json - --opcodes --asm diff --git a/test/cmdlineTests/asm_json_import_yul_subobjects/err b/test/cmdlineTests/asm_json_import_yul_subobjects/err new file mode 100644 index 000000000..6bce200fe --- /dev/null +++ b/test/cmdlineTests/asm_json_import_yul_subobjects/err @@ -0,0 +1,5 @@ +Uncaught exception: +/solidity/libevmasm/Assembly.cpp(1070): Throw in function vector solidity::evmasm::Assembly::decodeSubPath(size_t) const +Dynamic exception type: +std::exception::what: Assertion failed +[solidity::util::tag_comment*] = Assertion failed diff --git a/test/cmdlineTests/asm_json_import_yul_subobjects/exit b/test/cmdlineTests/asm_json_import_yul_subobjects/exit new file mode 100644 index 000000000..0cfbf0888 --- /dev/null +++ b/test/cmdlineTests/asm_json_import_yul_subobjects/exit @@ -0,0 +1 @@ +2 diff --git a/test/cmdlineTests/asm_json_import_yul_subobjects/stdin b/test/cmdlineTests/asm_json_import_yul_subobjects/stdin new file mode 100644 index 000000000..e504b4679 --- /dev/null +++ b/test/cmdlineTests/asm_json_import_yul_subobjects/stdin @@ -0,0 +1,413 @@ +{ + ".code": + [ + { + "begin": 36, + "end": 51, + "name": "PUSH", + "source": 0, + "value": "0" + }, + { + "begin": 33, + "end": 34, + "name": "DUP1", + "source": 0 + }, + { + "begin": 26, + "end": 52, + "name": "SSTORE", + "source": 0 + }, + { + "begin": 67, + "end": 80, + "name": "PUSHSIZE", + "source": 0 + }, + { + "begin": 64, + "end": 65, + "name": "PUSH", + "source": 0, + "value": "1" + }, + { + "begin": 57, + "end": 81, + "name": "SSTORE", + "source": 0 + }, + { + "begin": 96, + "end": 111, + "name": "PUSH [$]", + "source": 0, + "value": "0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "begin": 93, + "end": 94, + "name": "PUSH", + "source": 0, + "value": "2" + }, + { + "begin": 86, + "end": 112, + "name": "SSTORE", + "source": 0 + }, + { + "begin": 127, + "end": 140, + "name": "PUSH #[$]", + "source": 0, + "value": "0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "begin": 124, + "end": 125, + "name": "PUSH", + "source": 0, + "value": "3" + }, + { + "begin": 117, + "end": 141, + "name": "SSTORE", + "source": 0 + }, + { + "begin": 156, + "end": 173, + "name": "PUSH [$]", + "source": 0, + "value": "000000000000000000000000000000000000000000000000ffffffffffffffff" + }, + { + "begin": 153, + "end": 154, + "name": "PUSH", + "source": 0, + "value": "4" + }, + { + "begin": 146, + "end": 174, + "name": "SSTORE", + "source": 0 + }, + { + "begin": 189, + "end": 204, + "name": "PUSH #[$]", + "source": 0, + "value": "000000000000000000000000000000000000000000000000ffffffffffffffff" + }, + { + "begin": 186, + "end": 187, + "name": "PUSH", + "source": 0, + "value": "5" + }, + { + "begin": 179, + "end": 205, + "name": "SSTORE", + "source": 0 + }, + { + "begin": 220, + "end": 237, + "name": "PUSH [$]", + "source": 0, + "value": "000000000000000000000000000000000000000000000000fffffffffffffffe" + }, + { + "begin": 217, + "end": 218, + "name": "PUSH", + "source": 0, + "value": "6" + }, + { + "begin": 210, + "end": 238, + "name": "SSTORE", + "source": 0 + }, + { + "begin": 253, + "end": 268, + "name": "PUSH #[$]", + "source": 0, + "value": "000000000000000000000000000000000000000000000000fffffffffffffffe" + }, + { + "begin": 250, + "end": 251, + "name": "PUSH", + "source": 0, + "value": "7" + }, + { + "begin": 243, + "end": 269, + "name": "SSTORE", + "source": 0 + }, + { + "begin": 284, + "end": 303, + "name": "PUSH [$]", + "source": 0, + "value": "000000000000000000000000000000000000000000000000fffffffffffffffd" + }, + { + "begin": 281, + "end": 282, + "name": "PUSH", + "source": 0, + "value": "8" + }, + { + "begin": 274, + "end": 304, + "name": "SSTORE", + "source": 0 + }, + { + "begin": 319, + "end": 336, + "name": "PUSH #[$]", + "source": 0, + "value": "000000000000000000000000000000000000000000000000fffffffffffffffd" + }, + { + "begin": 316, + "end": 317, + "name": "PUSH", + "source": 0, + "value": "9" + }, + { + "begin": 309, + "end": 337, + "name": "SSTORE", + "source": 0 + } + ], + ".data": + { + "0": + { + ".code": + [ + { + "begin": 418, + "end": 433, + "name": "PUSH [$]", + "source": 0, + "value": "0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "begin": 414, + "end": 416, + "name": "PUSH", + "source": 0, + "value": "A" + }, + { + "begin": 407, + "end": 434, + "name": "SSTORE", + "source": 0 + }, + { + "begin": 452, + "end": 465, + "name": "PUSH #[$]", + "source": 0, + "value": "0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "begin": 448, + "end": 450, + "name": "PUSH", + "source": 0, + "value": "B" + }, + { + "begin": 441, + "end": 466, + "name": "SSTORE", + "source": 0 + }, + { + "begin": 484, + "end": 499, + "name": "PUSH [$]", + "source": 0, + "value": "0000000000000000000000000000000000000000000000000000000000000001" + }, + { + "begin": 480, + "end": 482, + "name": "PUSH", + "source": 0, + "value": "C" + }, + { + "begin": 473, + "end": 500, + "name": "SSTORE", + "source": 0 + }, + { + "begin": 518, + "end": 531, + "name": "PUSH #[$]", + "source": 0, + "value": "0000000000000000000000000000000000000000000000000000000000000001" + }, + { + "begin": 514, + "end": 516, + "name": "PUSH", + "source": 0, + "value": "D" + }, + { + "begin": 507, + "end": 532, + "name": "SSTORE", + "source": 0 + }, + { + "begin": 550, + "end": 567, + "name": "PUSH [$]", + "source": 0, + "value": "000000000000000000000000000000000000000000000000ffffffffffffffff" + }, + { + "begin": 546, + "end": 548, + "name": "PUSH", + "source": 0, + "value": "E" + }, + { + "begin": 539, + "end": 568, + "name": "SSTORE", + "source": 0 + }, + { + "begin": 586, + "end": 601, + "name": "PUSH #[$]", + "source": 0, + "value": "000000000000000000000000000000000000000000000000ffffffffffffffff" + }, + { + "begin": 582, + "end": 584, + "name": "PUSH", + "source": 0, + "value": "F" + }, + { + "begin": 575, + "end": 602, + "name": "SSTORE", + "source": 0 + } + ], + ".data": + { + "0": + { + ".code": + [ + { + "begin": 658, + "end": 673, + "name": "PUSH [$]", + "source": 0, + "value": "0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "begin": 654, + "end": 656, + "name": "PUSH", + "source": 0, + "value": "10" + }, + { + "begin": 647, + "end": 674, + "name": "SSTORE", + "source": 0 + }, + { + "begin": 694, + "end": 707, + "name": "PUSH #[$]", + "source": 0, + "value": "0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "begin": 690, + "end": 692, + "name": "PUSH", + "source": 0, + "value": "11" + }, + { + "begin": 683, + "end": 708, + "name": "SSTORE", + "source": 0 + } + ], + ".data": + { + "0": + { + ".code": + [ + { + "begin": 761, + "end": 770, + "name": "INVALID", + "source": 0 + } + ] + } + } + }, + "1": + { + ".code": + [ + { + "begin": 833, + "end": 842, + "name": "INVALID", + "source": 0 + } + ] + } + } + }, + "ACAF3289D7B601CBD114FB36C4D29C85BBFD5E133F14CB355C3FD8D99367964F": "48656c6c6f2c20576f726c6421" + }, + "sourceList": + [ + "" + ] +}