diff --git a/test/TestCase.cpp b/test/TestCase.cpp index 6f3c92a53..90140532e 100644 --- a/test/TestCase.cpp +++ b/test/TestCase.cpp @@ -17,76 +17,80 @@ #include +#include + #include #include #include +#include +#include #include +#include + using namespace dev; using namespace solidity; using namespace dev::solidity::test; using namespace std; +void TestCase::printUpdatedSettings(ostream& _stream, const string& _linePrefix, const bool) +{ + if (m_validatedSettings.empty()) + return; + + _stream << _linePrefix << "// ====" << endl; + for (auto const& setting: m_validatedSettings) + _stream << _linePrefix << "// " << setting.first << ": " << setting.second << endl; +} + bool TestCase::isTestFilename(boost::filesystem::path const& _filename) { string extension = _filename.extension().string(); return (extension == ".sol" || extension == ".yul") && !boost::starts_with(_filename.string(), "~") && - !boost::starts_with(_filename.string(), "."); + !boost::starts_with(_filename.string(), "."); } -bool TestCase::supportedForEVMVersion(langutil::EVMVersion _evmVersion) const +bool TestCase::validateSettings(langutil::EVMVersion) { - return boost::algorithm::none_of(m_evmVersionRules, [&](auto const& rule) { return !rule(_evmVersion); }); + if (!m_settings.empty()) + throw runtime_error( + "Unknown setting(s): " + + joinHumanReadable(m_settings | boost::adaptors::map_keys) + ); + return true; } -string TestCase::parseSource(istream& _stream) +string TestCase::parseSourceAndSettings(istream& _stream) { string source; string line; + static string const settingsDelimiter("// ===="); static string const delimiter("// ----"); - static string const evmVersion("// EVMVersion: "); - bool isTop = true; + bool sourcePart = true; while (getline(_stream, line)) + { if (boost::algorithm::starts_with(line, delimiter)) break; - else - { - if (isTop && boost::algorithm::starts_with(line, evmVersion)) - { - string versionString = line.substr(evmVersion.size() + 1); - auto version = langutil::EVMVersion::fromString(versionString); - if (!version) - throw runtime_error("Invalid EVM version: \"" + versionString + "\""); - switch (line.at(evmVersion.size())) - { - case '>': - m_evmVersionRules.emplace_back([version](langutil::EVMVersion _version) { - return version < _version; - }); - break; - case '<': - m_evmVersionRules.emplace_back([version](langutil::EVMVersion _version) { - return _version < version; - }); - break; - case '=': - m_evmVersionRules.emplace_back([version](langutil::EVMVersion _version) { - return _version == version; - }); - break; - case '!': - m_evmVersionRules.emplace_back([version](langutil::EVMVersion _version) { - return !(_version == version); - }); - break; - } - } - else - isTop = false; + else if (boost::algorithm::starts_with(line, settingsDelimiter)) + sourcePart = false; + else if (sourcePart) source += line + "\n"; + else if (boost::algorithm::starts_with(line, "// ")) + { + size_t colon = line.find(':'); + if (colon == string::npos) + throw runtime_error(string("Expected \":\" inside setting.")); + string key = line.substr(3, colon - 3); + string value = line.substr(colon + 1); + boost::algorithm::trim(key); + boost::algorithm::trim(value); + m_settings[key] = value; } + else + throw runtime_error(string("Expected \"//\" or \"// ---\" to terminate settings and source.")); + } return source; } @@ -96,3 +100,35 @@ void TestCase::expect(string::iterator& _it, string::iterator _end, string::valu throw runtime_error(string("Invalid test expectation. Expected: \"") + _c + "\"."); ++_it; } + +bool EVMVersionRestrictedTestCase::validateSettings(langutil::EVMVersion _evmVersion) +{ + if (!m_settings.count("EVMVersion")) + return true; + + string versionString = m_settings["EVMVersion"]; + m_validatedSettings["EVMVersion"] = versionString; + m_settings.erase("EVMVersion"); + + if (!TestCase::validateSettings(_evmVersion)) + return false; + + if (versionString.empty()) + return true; + + char comparator = versionString.front(); + versionString = versionString.substr(1); + boost::optional version = langutil::EVMVersion::fromString(versionString); + if (!version) + throw runtime_error("Invalid EVM version: \"" + versionString + "\""); + + switch (comparator) + { + case '>': return version < _evmVersion; + case '<': return _evmVersion < version; + case '=': return _evmVersion == version; + case '!': return !(_evmVersion == version); + } + throw runtime_error(string{"Invalid EVM comparator: \""} + comparator + "\""); + return false; // not reached +} diff --git a/test/TestCase.h b/test/TestCase.h index 86a109682..8f40725df 100644 --- a/test/TestCase.h +++ b/test/TestCase.h @@ -26,6 +26,7 @@ #include #include #include +#include namespace dev { @@ -42,7 +43,9 @@ namespace test } \ while (false) -/** Common superclass of SyntaxTest and SemanticsTest. */ +/** + * Common superclass of anything that can be run via isoltest. + */ class TestCase { public: @@ -68,17 +71,23 @@ public: /// If @arg _formatted is true, color-coding may be used to indicate /// error locations in the contract, if applicable. virtual void printSource(std::ostream &_stream, std::string const &_linePrefix = "", bool const _formatted = false) const = 0; + /// Outputs the updated settings. + virtual void printUpdatedSettings(std::ostream &_stream, std::string const &_linePrefix = "", bool const _formatted = false); /// Outputs test expectations to @arg _stream that match the actual results of the test. /// Each line of output is prefixed with @arg _linePrefix. virtual void printUpdatedExpectations(std::ostream& _stream, std::string const& _linePrefix) const = 0; static bool isTestFilename(boost::filesystem::path const& _filename); - /// Returns true, if the test case is supported for EVM version @arg _evmVersion, false otherwise. - bool supportedForEVMVersion(langutil::EVMVersion _evmVersion) const; + /// Validates the settings, i.e. moves them from m_settings to m_validatedSettings. + /// Throws a runtime exception if any setting is left at this class (i.e. unknown setting). + /// Returns true, if the test case is supported in the current environment and false + /// otherwise which causes this test to be skipped. + /// This might check e.g. for restrictions on the EVM version. + virtual bool validateSettings(langutil::EVMVersion /*_evmVersion*/); protected: - std::string parseSource(std::istream& _file); + std::string parseSourceAndSettings(std::istream& _file); static void expect(std::string::iterator& _it, std::string::iterator _end, std::string::value_type _c); template @@ -94,10 +103,19 @@ protected: while (_it != _end && *_it == '/') ++_it; } -private: - std::vector> m_evmVersionRules; + + /// Parsed settings. + std::map m_settings; + /// Updated settings after validation. + std::map m_validatedSettings; }; +class EVMVersionRestrictedTestCase: public TestCase +{ +public: + /// Returns true, if the test case is supported for EVM version @arg _evmVersion, false otherwise. + bool validateSettings(langutil::EVMVersion _evmVersion) override; +}; } } } diff --git a/test/boostTest.cpp b/test/boostTest.cpp index d9bf9c3fc..609274e9f 100644 --- a/test/boostTest.cpp +++ b/test/boostTest.cpp @@ -105,7 +105,7 @@ int registerTests( { stringstream errorStream; auto testCase = _testCaseCreator(config); - if (testCase->supportedForEVMVersion(dev::test::Options::get().evmVersion())) + if (testCase->validateSettings(dev::test::Options::get().evmVersion())) if (!testCase->run(errorStream)) BOOST_ERROR("Test expectation mismatch.\n" + errorStream.str()); } diff --git a/test/libsolidity/SemanticTest.cpp b/test/libsolidity/SemanticTest.cpp index 1dcf91719..ecfcf9321 100644 --- a/test/libsolidity/SemanticTest.cpp +++ b/test/libsolidity/SemanticTest.cpp @@ -43,7 +43,7 @@ SemanticTest::SemanticTest(string const& _filename, string const& _ipcPath, lang soltestAssert(file, "Cannot open test contract: \"" + _filename + "\"."); file.exceptions(ios::badbit); - m_source = parseSource(file); + m_source = parseSourceAndSettings(file); parseExpectations(file); } diff --git a/test/libsolidity/SemanticTest.h b/test/libsolidity/SemanticTest.h index 27e644220..ef2be8835 100644 --- a/test/libsolidity/SemanticTest.h +++ b/test/libsolidity/SemanticTest.h @@ -40,7 +40,7 @@ namespace test * section from the given file. This comment section should define a set of functions to be called * and an expected result they return after being executed. */ -class SemanticTest: public SolidityExecutionFramework, public TestCase +class SemanticTest: public SolidityExecutionFramework, public EVMVersionRestrictedTestCase { public: static std::unique_ptr create(Config const& _options) diff --git a/test/libsolidity/SyntaxTest.cpp b/test/libsolidity/SyntaxTest.cpp index 6764545ad..c1114c832 100644 --- a/test/libsolidity/SyntaxTest.cpp +++ b/test/libsolidity/SyntaxTest.cpp @@ -59,7 +59,7 @@ SyntaxTest::SyntaxTest(string const& _filename, langutil::EVMVersion _evmVersion BOOST_THROW_EXCEPTION(runtime_error("Cannot open test contract: \"" + _filename + "\".")); file.exceptions(ios::badbit); - m_source = parseSource(file); + m_source = parseSourceAndSettings(file); m_expectations = parseExpectations(file); } diff --git a/test/libsolidity/SyntaxTest.h b/test/libsolidity/SyntaxTest.h index a7f5d0b98..c6267d018 100644 --- a/test/libsolidity/SyntaxTest.h +++ b/test/libsolidity/SyntaxTest.h @@ -50,7 +50,7 @@ struct SyntaxTestError }; -class SyntaxTest: AnalysisFramework, public TestCase +class SyntaxTest: AnalysisFramework, public EVMVersionRestrictedTestCase { public: static std::unique_ptr create(Config const& _config) diff --git a/test/libsolidity/semanticTests/shifts.sol b/test/libsolidity/semanticTests/shifts.sol new file mode 100644 index 000000000..fb58ecb5c --- /dev/null +++ b/test/libsolidity/semanticTests/shifts.sol @@ -0,0 +1,9 @@ +contract C { + function f(uint x) public returns (uint y) { + assembly { y := shl(2, x) } + } +} +// ==== +// EVMVersion: >byzantium +// ---- +// f(uint256): 7 -> 28 diff --git a/test/libyul/YulOptimizerTest.cpp b/test/libyul/YulOptimizerTest.cpp index 4d3802819..9b09a33a3 100644 --- a/test/libyul/YulOptimizerTest.cpp +++ b/test/libyul/YulOptimizerTest.cpp @@ -78,19 +78,23 @@ YulOptimizerTest::YulOptimizerTest(string const& _filename) m_optimizerStep = std::prev(std::prev(path.end()))->string(); ifstream file(_filename); - if (!file) - BOOST_THROW_EXCEPTION(runtime_error("Cannot open test case: \"" + _filename + "\".")); + soltestAssert(file, "Cannot open test contract: \"" + _filename + "\"."); file.exceptions(ios::badbit); - string line; - while (getline(file, line)) + m_source = parseSourceAndSettings(file); + if (m_settings.count("yul")) { - if (boost::algorithm::starts_with(line, "// ----")) - break; - if (m_source.empty() && boost::algorithm::starts_with(line, "// yul")) - m_yul = true; - m_source += line + "\n"; + m_yul = true; + m_validatedSettings["yul"] = "true"; + m_settings.erase("yul"); } + if (m_settings.count("step")) + { + m_validatedSettings["step"] = m_settings["step"]; + m_settings.erase("step"); + } + + string line; while (getline(file, line)) if (boost::algorithm::starts_with(line, "// ")) m_expectation += line.substr(3) + "\n"; @@ -266,8 +270,22 @@ bool YulOptimizerTest::run(ostream& _stream, string const& _linePrefix, bool con return false; } - m_obtainedResult = m_optimizerStep + "\n" + AsmPrinter{m_yul}(*m_ast) + "\n"; + m_obtainedResult = AsmPrinter{m_yul}(*m_ast) + "\n"; + bool success = true; + if (m_optimizerStep != m_validatedSettings["step"]) + { + string nextIndentLevel = _linePrefix + " "; + AnsiColorized(_stream, _formatted, {formatting::BOLD, formatting::CYAN}) << + _linePrefix << + "Invalid optimizer step. Given: \"" << + m_validatedSettings["step"] << + "\", should be: \"" << + m_optimizerStep << + "\"." << + endl; + success = false; + } if (m_expectation != m_obtainedResult) { string nextIndentLevel = _linePrefix + " "; @@ -276,9 +294,9 @@ bool YulOptimizerTest::run(ostream& _stream, string const& _linePrefix, bool con printIndented(_stream, m_expectation, nextIndentLevel); AnsiColorized(_stream, _formatted, {formatting::BOLD, formatting::CYAN}) << _linePrefix << "Obtained result:" << endl; printIndented(_stream, m_obtainedResult, nextIndentLevel); - return false; + success = false; } - return true; + return success; } void YulOptimizerTest::printSource(ostream& _stream, string const& _linePrefix, bool const) const @@ -286,6 +304,12 @@ void YulOptimizerTest::printSource(ostream& _stream, string const& _linePrefix, printIndented(_stream, m_source, _linePrefix); } +void YulOptimizerTest::printUpdatedSettings(ostream& _stream, const string& _linePrefix, const bool _formatted) +{ + m_validatedSettings["step"] = m_optimizerStep; + EVMVersionRestrictedTestCase::printUpdatedSettings(_stream, _linePrefix, _formatted); +} + void YulOptimizerTest::printUpdatedExpectations(ostream& _stream, string const& _linePrefix) const { printIndented(_stream, m_obtainedResult, _linePrefix); diff --git a/test/libyul/YulOptimizerTest.h b/test/libyul/YulOptimizerTest.h index cb2109005..060d81383 100644 --- a/test/libyul/YulOptimizerTest.h +++ b/test/libyul/YulOptimizerTest.h @@ -38,7 +38,7 @@ namespace yul namespace test { -class YulOptimizerTest: public dev::solidity::test::TestCase +class YulOptimizerTest: public dev::solidity::test::EVMVersionRestrictedTestCase { public: static std::unique_ptr create(Config const& _config) @@ -51,6 +51,7 @@ public: bool run(std::ostream& _stream, std::string const& _linePrefix = "", bool const _formatted = false) override; void printSource(std::ostream& _stream, std::string const &_linePrefix = "", bool const _formatted = false) const override; + void printUpdatedSettings(std::ostream &_stream, std::string const &_linePrefix = "", bool const _formatted = false) override; void printUpdatedExpectations(std::ostream& _stream, std::string const& _linePrefix) const override; private: diff --git a/test/libyul/yulOptimizerTests/blockFlattener/basic.yul b/test/libyul/yulOptimizerTests/blockFlattener/basic.yul index adcaedd07..8558737cf 100644 --- a/test/libyul/yulOptimizerTests/blockFlattener/basic.yul +++ b/test/libyul/yulOptimizerTests/blockFlattener/basic.yul @@ -8,8 +8,9 @@ } let z := mload(2) } +// ==== +// step: blockFlattener // ---- -// blockFlattener // { // let _1 := mload(0) // let f_a := mload(1) diff --git a/test/libyul/yulOptimizerTests/blockFlattener/for_stmt.yul b/test/libyul/yulOptimizerTests/blockFlattener/for_stmt.yul index 07bd5c18f..83f9832e9 100644 --- a/test/libyul/yulOptimizerTests/blockFlattener/for_stmt.yul +++ b/test/libyul/yulOptimizerTests/blockFlattener/for_stmt.yul @@ -3,8 +3,9 @@ a := add(a, 1) } } +// ==== +// step: blockFlattener // ---- -// blockFlattener // { // for { // let a := 1 diff --git a/test/libyul/yulOptimizerTests/blockFlattener/if_stmt.yul b/test/libyul/yulOptimizerTests/blockFlattener/if_stmt.yul index 4d6ccf0e8..ca5055ac9 100644 --- a/test/libyul/yulOptimizerTests/blockFlattener/if_stmt.yul +++ b/test/libyul/yulOptimizerTests/blockFlattener/if_stmt.yul @@ -8,8 +8,9 @@ } let t := add(3, 9) } +// ==== +// step: blockFlattener // ---- -// blockFlattener // { // if add(mload(7), sload(mload(3))) // { diff --git a/test/libyul/yulOptimizerTests/blockFlattener/many_nested_blocks.yul b/test/libyul/yulOptimizerTests/blockFlattener/many_nested_blocks.yul index ae2a066ba..a397000e4 100644 --- a/test/libyul/yulOptimizerTests/blockFlattener/many_nested_blocks.yul +++ b/test/libyul/yulOptimizerTests/blockFlattener/many_nested_blocks.yul @@ -14,8 +14,9 @@ a := add(a, c) } } +// ==== +// step: blockFlattener // ---- -// blockFlattener // { // let a := 3 // let b := 4 diff --git a/test/libyul/yulOptimizerTests/blockFlattener/switch_stmt.yul b/test/libyul/yulOptimizerTests/blockFlattener/switch_stmt.yul index 2df4f9d09..f3243296b 100644 --- a/test/libyul/yulOptimizerTests/blockFlattener/switch_stmt.yul +++ b/test/libyul/yulOptimizerTests/blockFlattener/switch_stmt.yul @@ -5,8 +5,9 @@ default { a := 3 { a := 4 } } a := 5 } +// ==== +// step: blockFlattener // ---- -// blockFlattener // { // let a := 1 // switch calldataload(0) diff --git a/test/libyul/yulOptimizerTests/commonSubexpressionEliminator/branches_for.yul b/test/libyul/yulOptimizerTests/commonSubexpressionEliminator/branches_for.yul index c59bced76..ef366e529 100644 --- a/test/libyul/yulOptimizerTests/commonSubexpressionEliminator/branches_for.yul +++ b/test/libyul/yulOptimizerTests/commonSubexpressionEliminator/branches_for.yul @@ -5,8 +5,9 @@ } mstore(1, codesize()) } +// ==== +// step: commonSubexpressionEliminator // ---- -// commonSubexpressionEliminator // { // let a := 1 // let b := codesize() diff --git a/test/libyul/yulOptimizerTests/commonSubexpressionEliminator/branches_if.yul b/test/libyul/yulOptimizerTests/commonSubexpressionEliminator/branches_if.yul index 5b8200d9c..0fd259b86 100644 --- a/test/libyul/yulOptimizerTests/commonSubexpressionEliminator/branches_if.yul +++ b/test/libyul/yulOptimizerTests/commonSubexpressionEliminator/branches_if.yul @@ -3,8 +3,9 @@ if b { b := 1 } let c := 1 } +// ==== +// step: commonSubexpressionEliminator // ---- -// commonSubexpressionEliminator // { // let b := 1 // if b diff --git a/test/libyul/yulOptimizerTests/commonSubexpressionEliminator/case2.yul b/test/libyul/yulOptimizerTests/commonSubexpressionEliminator/case2.yul index fd8b4bc81..ab08c0dee 100644 --- a/test/libyul/yulOptimizerTests/commonSubexpressionEliminator/case2.yul +++ b/test/libyul/yulOptimizerTests/commonSubexpressionEliminator/case2.yul @@ -23,8 +23,9 @@ p_1 := add(array, _22) } } +// ==== +// step: commonSubexpressionEliminator // ---- -// commonSubexpressionEliminator // { // let _13 := 0x20 // let _14 := allocate(_13) diff --git a/test/libyul/yulOptimizerTests/commonSubexpressionEliminator/function_scopes.yul b/test/libyul/yulOptimizerTests/commonSubexpressionEliminator/function_scopes.yul index 28e840cff..957232a8f 100644 --- a/test/libyul/yulOptimizerTests/commonSubexpressionEliminator/function_scopes.yul +++ b/test/libyul/yulOptimizerTests/commonSubexpressionEliminator/function_scopes.yul @@ -23,8 +23,9 @@ let _11 := array_index_access(x, _10) mstore(_11, _9) } +// ==== +// step: commonSubexpressionEliminator // ---- -// commonSubexpressionEliminator // { // function allocate(size) -> p // { diff --git a/test/libyul/yulOptimizerTests/commonSubexpressionEliminator/non_movable_instr.yul b/test/libyul/yulOptimizerTests/commonSubexpressionEliminator/non_movable_instr.yul index cb0ca38dd..42b4274ce 100644 --- a/test/libyul/yulOptimizerTests/commonSubexpressionEliminator/non_movable_instr.yul +++ b/test/libyul/yulOptimizerTests/commonSubexpressionEliminator/non_movable_instr.yul @@ -2,8 +2,9 @@ let a := mload(1) let b := mload(1) } +// ==== +// step: commonSubexpressionEliminator // ---- -// commonSubexpressionEliminator // { // let a := mload(1) // let b := mload(1) diff --git a/test/libyul/yulOptimizerTests/commonSubexpressionEliminator/non_movable_instr2.yul b/test/libyul/yulOptimizerTests/commonSubexpressionEliminator/non_movable_instr2.yul index ebc17446c..6fee35665 100644 --- a/test/libyul/yulOptimizerTests/commonSubexpressionEliminator/non_movable_instr2.yul +++ b/test/libyul/yulOptimizerTests/commonSubexpressionEliminator/non_movable_instr2.yul @@ -2,8 +2,9 @@ let a := gas() let b := gas() } +// ==== +// step: commonSubexpressionEliminator // ---- -// commonSubexpressionEliminator // { // let a := gas() // let b := gas() diff --git a/test/libyul/yulOptimizerTests/commonSubexpressionEliminator/object_access.yul b/test/libyul/yulOptimizerTests/commonSubexpressionEliminator/object_access.yul index 5cfa3e6e6..b2b01550a 100644 --- a/test/libyul/yulOptimizerTests/commonSubexpressionEliminator/object_access.yul +++ b/test/libyul/yulOptimizerTests/commonSubexpressionEliminator/object_access.yul @@ -11,8 +11,9 @@ datacopy("abc", x, y) mstore(a, x) } +// ==== +// step: commonSubexpressionEliminator // ---- -// commonSubexpressionEliminator // { // let r := "abc" // let a := datasize("abc") diff --git a/test/libyul/yulOptimizerTests/commonSubexpressionEliminator/scopes.yul b/test/libyul/yulOptimizerTests/commonSubexpressionEliminator/scopes.yul index 49b4c9164..44d08679f 100644 --- a/test/libyul/yulOptimizerTests/commonSubexpressionEliminator/scopes.yul +++ b/test/libyul/yulOptimizerTests/commonSubexpressionEliminator/scopes.yul @@ -10,8 +10,9 @@ mstore(0, calldataload(0)) mstore(0, x) } +// ==== +// step: commonSubexpressionEliminator // ---- -// commonSubexpressionEliminator // { // let a := 10 // let x := 20 diff --git a/test/libyul/yulOptimizerTests/commonSubexpressionEliminator/smoke.yul b/test/libyul/yulOptimizerTests/commonSubexpressionEliminator/smoke.yul index b94572294..6ecbe105c 100644 --- a/test/libyul/yulOptimizerTests/commonSubexpressionEliminator/smoke.yul +++ b/test/libyul/yulOptimizerTests/commonSubexpressionEliminator/smoke.yul @@ -1,5 +1,6 @@ { } +// ==== +// step: commonSubexpressionEliminator // ---- -// commonSubexpressionEliminator // { // } diff --git a/test/libyul/yulOptimizerTests/commonSubexpressionEliminator/trivial.yul b/test/libyul/yulOptimizerTests/commonSubexpressionEliminator/trivial.yul index 684272f57..1fdc65d43 100644 --- a/test/libyul/yulOptimizerTests/commonSubexpressionEliminator/trivial.yul +++ b/test/libyul/yulOptimizerTests/commonSubexpressionEliminator/trivial.yul @@ -2,8 +2,9 @@ let a := mul(1, codesize()) let b := mul(1, codesize()) } +// ==== +// step: commonSubexpressionEliminator // ---- -// commonSubexpressionEliminator // { // let a := mul(1, codesize()) // let b := a diff --git a/test/libyul/yulOptimizerTests/commonSubexpressionEliminator/unassigned_return.yul b/test/libyul/yulOptimizerTests/commonSubexpressionEliminator/unassigned_return.yul index 5283ef9a0..178b8c523 100644 --- a/test/libyul/yulOptimizerTests/commonSubexpressionEliminator/unassigned_return.yul +++ b/test/libyul/yulOptimizerTests/commonSubexpressionEliminator/unassigned_return.yul @@ -9,8 +9,9 @@ let b := 0 sstore(a, b) } +// ==== +// step: commonSubexpressionEliminator // ---- -// commonSubexpressionEliminator // { // function f() -> x // { diff --git a/test/libyul/yulOptimizerTests/commonSubexpressionEliminator/unassigned_variables.yul b/test/libyul/yulOptimizerTests/commonSubexpressionEliminator/unassigned_variables.yul index a790ca654..0012af037 100644 --- a/test/libyul/yulOptimizerTests/commonSubexpressionEliminator/unassigned_variables.yul +++ b/test/libyul/yulOptimizerTests/commonSubexpressionEliminator/unassigned_variables.yul @@ -5,8 +5,9 @@ let b mstore(sub(a, b), 7) } +// ==== +// step: commonSubexpressionEliminator // ---- -// commonSubexpressionEliminator // { // let a // let b diff --git a/test/libyul/yulOptimizerTests/commonSubexpressionEliminator/variable_for_variable.yul b/test/libyul/yulOptimizerTests/commonSubexpressionEliminator/variable_for_variable.yul index ab94afc22..9f1bda665 100644 --- a/test/libyul/yulOptimizerTests/commonSubexpressionEliminator/variable_for_variable.yul +++ b/test/libyul/yulOptimizerTests/commonSubexpressionEliminator/variable_for_variable.yul @@ -12,8 +12,9 @@ a := b mstore(2, a) } +// ==== +// step: commonSubexpressionEliminator // ---- -// commonSubexpressionEliminator // { // let a := mload(0) // let b := add(a, 7) diff --git a/test/libyul/yulOptimizerTests/deadCodeEliminator/conditional_break.yul b/test/libyul/yulOptimizerTests/deadCodeEliminator/conditional_break.yul index 52c524ec4..7c824d8eb 100644 --- a/test/libyul/yulOptimizerTests/deadCodeEliminator/conditional_break.yul +++ b/test/libyul/yulOptimizerTests/deadCodeEliminator/conditional_break.yul @@ -13,8 +13,9 @@ } } +// ==== +// step: deadCodeEliminator // ---- -// deadCodeEliminator // { // for { // let a := 20 diff --git a/test/libyul/yulOptimizerTests/deadCodeEliminator/early_break.yul b/test/libyul/yulOptimizerTests/deadCodeEliminator/early_break.yul index 26ad5cf50..1706b60e0 100644 --- a/test/libyul/yulOptimizerTests/deadCodeEliminator/early_break.yul +++ b/test/libyul/yulOptimizerTests/deadCodeEliminator/early_break.yul @@ -14,8 +14,9 @@ } } +// ==== +// step: deadCodeEliminator // ---- -// deadCodeEliminator // { // for { // let a := 20 diff --git a/test/libyul/yulOptimizerTests/deadCodeEliminator/early_continue.yul b/test/libyul/yulOptimizerTests/deadCodeEliminator/early_continue.yul index 90ec208be..152221412 100644 --- a/test/libyul/yulOptimizerTests/deadCodeEliminator/early_continue.yul +++ b/test/libyul/yulOptimizerTests/deadCodeEliminator/early_continue.yul @@ -14,8 +14,9 @@ } } +// ==== +// step: deadCodeEliminator // ---- -// deadCodeEliminator // { // for { // let a := 20 diff --git a/test/libyul/yulOptimizerTests/deadCodeEliminator/early_revert.yul b/test/libyul/yulOptimizerTests/deadCodeEliminator/early_revert.yul index ff311acaf..be13641c2 100644 --- a/test/libyul/yulOptimizerTests/deadCodeEliminator/early_revert.yul +++ b/test/libyul/yulOptimizerTests/deadCodeEliminator/early_revert.yul @@ -15,8 +15,9 @@ } } +// ==== +// step: deadCodeEliminator // ---- -// deadCodeEliminator // { // let b := 20 // revert(0, 0) diff --git a/test/libyul/yulOptimizerTests/deadCodeEliminator/early_stop.yul b/test/libyul/yulOptimizerTests/deadCodeEliminator/early_stop.yul index 72357cdb0..ee4227b6a 100644 --- a/test/libyul/yulOptimizerTests/deadCodeEliminator/early_stop.yul +++ b/test/libyul/yulOptimizerTests/deadCodeEliminator/early_stop.yul @@ -15,8 +15,9 @@ } } +// ==== +// step: deadCodeEliminator // ---- -// deadCodeEliminator // { // let b := 20 // stop() diff --git a/test/libyul/yulOptimizerTests/deadCodeEliminator/function_after_revert.yul b/test/libyul/yulOptimizerTests/deadCodeEliminator/function_after_revert.yul index e19f4070f..4821a985b 100644 --- a/test/libyul/yulOptimizerTests/deadCodeEliminator/function_after_revert.yul +++ b/test/libyul/yulOptimizerTests/deadCodeEliminator/function_after_revert.yul @@ -12,8 +12,9 @@ pop(add(1, 1)) } +// ==== +// step: deadCodeEliminator // ---- -// deadCodeEliminator // { // fun() // revert(0, 0) diff --git a/test/libyul/yulOptimizerTests/deadCodeEliminator/nested_revert.yul b/test/libyul/yulOptimizerTests/deadCodeEliminator/nested_revert.yul index 12af39ca5..625b468ce 100644 --- a/test/libyul/yulOptimizerTests/deadCodeEliminator/nested_revert.yul +++ b/test/libyul/yulOptimizerTests/deadCodeEliminator/nested_revert.yul @@ -12,8 +12,9 @@ y := 10 } } +// ==== +// step: deadCodeEliminator // ---- -// deadCodeEliminator // { // let y := mload(0) // switch y diff --git a/test/libyul/yulOptimizerTests/deadCodeEliminator/no_removal.yul b/test/libyul/yulOptimizerTests/deadCodeEliminator/no_removal.yul index ef9242a92..f647be25e 100644 --- a/test/libyul/yulOptimizerTests/deadCodeEliminator/no_removal.yul +++ b/test/libyul/yulOptimizerTests/deadCodeEliminator/no_removal.yul @@ -4,8 +4,9 @@ } mstore(0, 0) } +// ==== +// step: deadCodeEliminator // ---- -// deadCodeEliminator // { // { // revert(0, 0) diff --git a/test/libyul/yulOptimizerTests/deadCodeEliminator/normal_break.yul b/test/libyul/yulOptimizerTests/deadCodeEliminator/normal_break.yul index 85c32c562..920f1b511 100644 --- a/test/libyul/yulOptimizerTests/deadCodeEliminator/normal_break.yul +++ b/test/libyul/yulOptimizerTests/deadCodeEliminator/normal_break.yul @@ -12,8 +12,9 @@ } } +// ==== +// step: deadCodeEliminator // ---- -// deadCodeEliminator // { // for { // let a := 20 diff --git a/test/libyul/yulOptimizerTests/deadCodeEliminator/normal_continue.yul b/test/libyul/yulOptimizerTests/deadCodeEliminator/normal_continue.yul index 3e9cf868b..81165540f 100644 --- a/test/libyul/yulOptimizerTests/deadCodeEliminator/normal_continue.yul +++ b/test/libyul/yulOptimizerTests/deadCodeEliminator/normal_continue.yul @@ -12,8 +12,9 @@ } } +// ==== +// step: deadCodeEliminator // ---- -// deadCodeEliminator // { // for { // let a := 20 diff --git a/test/libyul/yulOptimizerTests/deadCodeEliminator/normal_stop.yul b/test/libyul/yulOptimizerTests/deadCodeEliminator/normal_stop.yul index a8bca41d1..d636e31c1 100644 --- a/test/libyul/yulOptimizerTests/deadCodeEliminator/normal_stop.yul +++ b/test/libyul/yulOptimizerTests/deadCodeEliminator/normal_stop.yul @@ -15,8 +15,9 @@ stop() } +// ==== +// step: deadCodeEliminator // ---- -// deadCodeEliminator // { // let b := 20 // for { diff --git a/test/libyul/yulOptimizerTests/disambiguator/for_statement.yul b/test/libyul/yulOptimizerTests/disambiguator/for_statement.yul index 6875abec6..5158d0f2b 100644 --- a/test/libyul/yulOptimizerTests/disambiguator/for_statement.yul +++ b/test/libyul/yulOptimizerTests/disambiguator/for_statement.yul @@ -1,4 +1,3 @@ -// yul { { let a:u256, b:u256 } { @@ -7,8 +6,10 @@ } } } +// ==== +// step: disambiguator +// yul: true // ---- -// disambiguator // { // { // let a:u256, b:u256 diff --git a/test/libyul/yulOptimizerTests/disambiguator/funtion_call.yul b/test/libyul/yulOptimizerTests/disambiguator/funtion_call.yul index df49b92a7..b081ebe6f 100644 --- a/test/libyul/yulOptimizerTests/disambiguator/funtion_call.yul +++ b/test/libyul/yulOptimizerTests/disambiguator/funtion_call.yul @@ -1,4 +1,3 @@ -// yul { { let a:u256, b:u256, c:u256, d:u256, f:u256 } { @@ -7,8 +6,10 @@ } } } +// ==== +// step: disambiguator +// yul: true // ---- -// disambiguator // { // { // let a:u256, b:u256, c:u256, d:u256, f:u256 diff --git a/test/libyul/yulOptimizerTests/disambiguator/if_statement.yul b/test/libyul/yulOptimizerTests/disambiguator/if_statement.yul index bc3aa30f9..375030564 100644 --- a/test/libyul/yulOptimizerTests/disambiguator/if_statement.yul +++ b/test/libyul/yulOptimizerTests/disambiguator/if_statement.yul @@ -1,4 +1,3 @@ -// yul { { let a:u256, b:u256, c:u256 } { @@ -6,8 +5,10 @@ if a { let b:bool := a } } } +// ==== +// step: disambiguator +// yul: true // ---- -// disambiguator // { // { // let a:u256, b:u256, c:u256 diff --git a/test/libyul/yulOptimizerTests/disambiguator/long_names.yul b/test/libyul/yulOptimizerTests/disambiguator/long_names.yul index 933e1e8ff..2b9f3e522 100644 --- a/test/libyul/yulOptimizerTests/disambiguator/long_names.yul +++ b/test/libyul/yulOptimizerTests/disambiguator/long_names.yul @@ -1,7 +1,8 @@ -// yul { { let aanteuhdaoneudbrgkjiuaothduiathudaoeuh:u256 } { let aanteuhdaoneudbrgkjiuaothduiathudaoeuh:u256 } } +// ==== +// step: disambiguator +// yul: true // ---- -// disambiguator // { // { // let aanteuhdaoneudbrgkjiuaothduiathudaoeuh:u256 diff --git a/test/libyul/yulOptimizerTests/disambiguator/smoke.yul b/test/libyul/yulOptimizerTests/disambiguator/smoke.yul index d6cd8a619..c753de829 100644 --- a/test/libyul/yulOptimizerTests/disambiguator/smoke.yul +++ b/test/libyul/yulOptimizerTests/disambiguator/smoke.yul @@ -1,5 +1,6 @@ { } +// ==== +// step: disambiguator // ---- -// disambiguator // { // } diff --git a/test/libyul/yulOptimizerTests/disambiguator/smoke_yul.yul b/test/libyul/yulOptimizerTests/disambiguator/smoke_yul.yul index e55f4cd3e..18e47d0bc 100644 --- a/test/libyul/yulOptimizerTests/disambiguator/smoke_yul.yul +++ b/test/libyul/yulOptimizerTests/disambiguator/smoke_yul.yul @@ -1,6 +1,7 @@ -// yul { } +// ==== +// step: disambiguator +// yul: true // ---- -// disambiguator // { // } diff --git a/test/libyul/yulOptimizerTests/disambiguator/switch_statement.yul b/test/libyul/yulOptimizerTests/disambiguator/switch_statement.yul index e62e957f8..d17afaf63 100644 --- a/test/libyul/yulOptimizerTests/disambiguator/switch_statement.yul +++ b/test/libyul/yulOptimizerTests/disambiguator/switch_statement.yul @@ -1,4 +1,3 @@ -// yul { { let a:u256, b:u256, c:u256 } { @@ -8,8 +7,10 @@ default { let c:u256 := a } } } +// ==== +// step: disambiguator +// yul: true // ---- -// disambiguator // { // { // let a:u256, b:u256, c:u256 diff --git a/test/libyul/yulOptimizerTests/disambiguator/variables.yul b/test/libyul/yulOptimizerTests/disambiguator/variables.yul index 65bd4c8f8..7ae1a11b7 100644 --- a/test/libyul/yulOptimizerTests/disambiguator/variables.yul +++ b/test/libyul/yulOptimizerTests/disambiguator/variables.yul @@ -1,7 +1,8 @@ -// yul { { let a:u256 } { let a:u256 } } +// ==== +// step: disambiguator +// yul: true // ---- -// disambiguator // { // { // let a:u256 diff --git a/test/libyul/yulOptimizerTests/disambiguator/variables_clash.yul b/test/libyul/yulOptimizerTests/disambiguator/variables_clash.yul index e462442a9..46d0ac897 100644 --- a/test/libyul/yulOptimizerTests/disambiguator/variables_clash.yul +++ b/test/libyul/yulOptimizerTests/disambiguator/variables_clash.yul @@ -1,7 +1,8 @@ -// yul { { let a:u256 let a_1:u256 } { let a:u256 } } +// ==== +// step: disambiguator +// yul: true // ---- -// disambiguator // { // { // let a:u256 diff --git a/test/libyul/yulOptimizerTests/disambiguator/variables_inside_functions.yul b/test/libyul/yulOptimizerTests/disambiguator/variables_inside_functions.yul index 839692bc6..c0d59f923 100644 --- a/test/libyul/yulOptimizerTests/disambiguator/variables_inside_functions.yul +++ b/test/libyul/yulOptimizerTests/disambiguator/variables_inside_functions.yul @@ -1,4 +1,3 @@ -// yul { { let c:u256 let b:u256 } function f(a:u256, c:u256) -> b:u256 { let x:u256 } @@ -6,8 +5,10 @@ let a:u256 let x:u256 } } +// ==== +// step: disambiguator +// yul: true // ---- -// disambiguator // { // { // let c:u256 diff --git a/test/libyul/yulOptimizerTests/equivalentFunctionCombiner/multiple_complex.yul b/test/libyul/yulOptimizerTests/equivalentFunctionCombiner/multiple_complex.yul index 380f9f035..97f239ce8 100644 --- a/test/libyul/yulOptimizerTests/equivalentFunctionCombiner/multiple_complex.yul +++ b/test/libyul/yulOptimizerTests/equivalentFunctionCombiner/multiple_complex.yul @@ -54,8 +54,9 @@ } } } +// ==== +// step: equivalentFunctionCombiner // ---- -// equivalentFunctionCombiner // { // pop(f(1, 2, 3)) // pop(f(4, 5, 6)) diff --git a/test/libyul/yulOptimizerTests/equivalentFunctionCombiner/simple.yul b/test/libyul/yulOptimizerTests/equivalentFunctionCombiner/simple.yul index 2d5b3ef8f..aa53c5797 100644 --- a/test/libyul/yulOptimizerTests/equivalentFunctionCombiner/simple.yul +++ b/test/libyul/yulOptimizerTests/equivalentFunctionCombiner/simple.yul @@ -4,8 +4,9 @@ function f() { mstore(1, mload(0)) } function g() { mstore(1, mload(0)) } } +// ==== +// step: equivalentFunctionCombiner // ---- -// equivalentFunctionCombiner // { // f() // f() diff --git a/test/libyul/yulOptimizerTests/equivalentFunctionCombiner/simple_different_vars.yul b/test/libyul/yulOptimizerTests/equivalentFunctionCombiner/simple_different_vars.yul index d38a3d2ea..25ffa4017 100644 --- a/test/libyul/yulOptimizerTests/equivalentFunctionCombiner/simple_different_vars.yul +++ b/test/libyul/yulOptimizerTests/equivalentFunctionCombiner/simple_different_vars.yul @@ -4,8 +4,9 @@ function f() -> b { let a := mload(0) b := a } function g() -> a { let b := mload(0) a := b } } +// ==== +// step: equivalentFunctionCombiner // ---- -// equivalentFunctionCombiner // { // pop(f()) // pop(f()) diff --git a/test/libyul/yulOptimizerTests/equivalentFunctionCombiner/switch_case_order.yul b/test/libyul/yulOptimizerTests/equivalentFunctionCombiner/switch_case_order.yul index 4f3cad360..9f3ccc6ec 100644 --- a/test/libyul/yulOptimizerTests/equivalentFunctionCombiner/switch_case_order.yul +++ b/test/libyul/yulOptimizerTests/equivalentFunctionCombiner/switch_case_order.yul @@ -4,8 +4,9 @@ function f(x) { switch x case 0 { mstore(0, 42) } case 1 { mstore(1, 42) } } function g(x) { switch x case 1 { mstore(1, 42) } case 0 { mstore(0, 42) } } } +// ==== +// step: equivalentFunctionCombiner // ---- -// equivalentFunctionCombiner // { // f(0) // f(1) diff --git a/test/libyul/yulOptimizerTests/expressionInliner/complex_with_evm.yul b/test/libyul/yulOptimizerTests/expressionInliner/complex_with_evm.yul index 519a2af85..34d4eb986 100644 --- a/test/libyul/yulOptimizerTests/expressionInliner/complex_with_evm.yul +++ b/test/libyul/yulOptimizerTests/expressionInliner/complex_with_evm.yul @@ -2,8 +2,9 @@ function f(a) -> x { x := add(a, a) } let y := f(calldatasize()) } +// ==== +// step: expressionInliner // ---- -// expressionInliner // { // function f(a) -> x // { diff --git a/test/libyul/yulOptimizerTests/expressionInliner/double_calls.yul b/test/libyul/yulOptimizerTests/expressionInliner/double_calls.yul index e1da8e074..deae8482b 100644 --- a/test/libyul/yulOptimizerTests/expressionInliner/double_calls.yul +++ b/test/libyul/yulOptimizerTests/expressionInliner/double_calls.yul @@ -3,8 +3,9 @@ function g(b, c) -> y { y := mul(mload(c), f(b)) } let y := g(calldatasize(), 7) } +// ==== +// step: expressionInliner // ---- -// expressionInliner // { // function f(a) -> x // { diff --git a/test/libyul/yulOptimizerTests/expressionInliner/double_recursive_calls.yul b/test/libyul/yulOptimizerTests/expressionInliner/double_recursive_calls.yul index 082cb53fa..80843eca7 100644 --- a/test/libyul/yulOptimizerTests/expressionInliner/double_recursive_calls.yul +++ b/test/libyul/yulOptimizerTests/expressionInliner/double_recursive_calls.yul @@ -3,8 +3,9 @@ function g(b, s) -> y { y := f(b, f(s, s)) } let y := g(calldatasize(), 7) } +// ==== +// step: expressionInliner // ---- -// expressionInliner // { // function f(a, r) -> x // { diff --git a/test/libyul/yulOptimizerTests/expressionInliner/no_inline_mload.yul b/test/libyul/yulOptimizerTests/expressionInliner/no_inline_mload.yul index 0fb43a9d0..fc4ec9720 100644 --- a/test/libyul/yulOptimizerTests/expressionInliner/no_inline_mload.yul +++ b/test/libyul/yulOptimizerTests/expressionInliner/no_inline_mload.yul @@ -3,8 +3,9 @@ function f(a) -> x { x := a } let y := f(mload(2)) } +// ==== +// step: expressionInliner // ---- -// expressionInliner // { // function f(a) -> x // { diff --git a/test/libyul/yulOptimizerTests/expressionInliner/no_move_with_sideeffects.yul b/test/libyul/yulOptimizerTests/expressionInliner/no_move_with_sideeffects.yul index 7fdad6c41..eaaa863b1 100644 --- a/test/libyul/yulOptimizerTests/expressionInliner/no_move_with_sideeffects.yul +++ b/test/libyul/yulOptimizerTests/expressionInliner/no_move_with_sideeffects.yul @@ -6,8 +6,9 @@ function h() -> z { mstore(0, 4) z := mload(0) } let r := f(g(), h()) } +// ==== +// step: expressionInliner // ---- -// expressionInliner // { // function f(a, b) -> x // { diff --git a/test/libyul/yulOptimizerTests/expressionInliner/simple.yul b/test/libyul/yulOptimizerTests/expressionInliner/simple.yul index c186eafda..c1e9c1206 100644 --- a/test/libyul/yulOptimizerTests/expressionInliner/simple.yul +++ b/test/libyul/yulOptimizerTests/expressionInliner/simple.yul @@ -1,10 +1,11 @@ -// yul { function f() -> x:u256 { x := 2:u256 } let y:u256 := f() } +// ==== +// step: expressionInliner +// yul: true // ---- -// expressionInliner // { // function f() -> x:u256 // { diff --git a/test/libyul/yulOptimizerTests/expressionInliner/with_args.yul b/test/libyul/yulOptimizerTests/expressionInliner/with_args.yul index b5f4d5159..1d049cdfe 100644 --- a/test/libyul/yulOptimizerTests/expressionInliner/with_args.yul +++ b/test/libyul/yulOptimizerTests/expressionInliner/with_args.yul @@ -1,10 +1,11 @@ -// yul { function f(a:u256) -> x:u256 { x := a } let y:u256 := f(7:u256) } +// ==== +// step: expressionInliner +// yul: true // ---- -// expressionInliner // { // function f(a:u256) -> x:u256 // { diff --git a/test/libyul/yulOptimizerTests/expressionJoiner/if_condition.yul b/test/libyul/yulOptimizerTests/expressionJoiner/if_condition.yul index a1349511c..78ecfc88c 100644 --- a/test/libyul/yulOptimizerTests/expressionJoiner/if_condition.yul +++ b/test/libyul/yulOptimizerTests/expressionJoiner/if_condition.yul @@ -10,8 +10,9 @@ let z := 3 let t := add(z, 9) } +// ==== +// step: expressionJoiner // ---- -// expressionJoiner // { // if add(mload(7), sload(mload(3))) // { diff --git a/test/libyul/yulOptimizerTests/expressionJoiner/muli_wrong_order3.yul b/test/libyul/yulOptimizerTests/expressionJoiner/muli_wrong_order3.yul index 0d407c7ca..07982ca47 100644 --- a/test/libyul/yulOptimizerTests/expressionJoiner/muli_wrong_order3.yul +++ b/test/libyul/yulOptimizerTests/expressionJoiner/muli_wrong_order3.yul @@ -4,8 +4,9 @@ let x := mul(add(b, a), mload(2)) sstore(x, 3) } +// ==== +// step: expressionJoiner // ---- -// expressionJoiner // { // let a := mload(3) // let b := mload(6) diff --git a/test/libyul/yulOptimizerTests/expressionJoiner/multi.yul b/test/libyul/yulOptimizerTests/expressionJoiner/multi.yul index fd53ca51d..9d9a139a2 100644 --- a/test/libyul/yulOptimizerTests/expressionJoiner/multi.yul +++ b/test/libyul/yulOptimizerTests/expressionJoiner/multi.yul @@ -4,8 +4,9 @@ let x := mul(add(b, a), 2) sstore(x, 3) } +// ==== +// step: expressionJoiner // ---- -// expressionJoiner // { // sstore(mul(add(mload(6), mload(2)), 2), 3) // } diff --git a/test/libyul/yulOptimizerTests/expressionJoiner/multi_reference.yul b/test/libyul/yulOptimizerTests/expressionJoiner/multi_reference.yul index 078a12a56..95a0eccb3 100644 --- a/test/libyul/yulOptimizerTests/expressionJoiner/multi_reference.yul +++ b/test/libyul/yulOptimizerTests/expressionJoiner/multi_reference.yul @@ -3,8 +3,9 @@ let a := mload(2) let b := add(a, a) } +// ==== +// step: expressionJoiner // ---- -// expressionJoiner // { // let a := mload(2) // let b := add(a, a) diff --git a/test/libyul/yulOptimizerTests/expressionJoiner/multi_wrong_order.yul b/test/libyul/yulOptimizerTests/expressionJoiner/multi_wrong_order.yul index 965e07e97..d8624dc14 100644 --- a/test/libyul/yulOptimizerTests/expressionJoiner/multi_wrong_order.yul +++ b/test/libyul/yulOptimizerTests/expressionJoiner/multi_wrong_order.yul @@ -7,8 +7,9 @@ let x := mul(a, add(2, b)) sstore(x, 3) } +// ==== +// step: expressionJoiner // ---- -// expressionJoiner // { // let a := mload(2) // sstore(mul(a, add(2, mload(6))), 3) diff --git a/test/libyul/yulOptimizerTests/expressionJoiner/multi_wrong_order2.yul b/test/libyul/yulOptimizerTests/expressionJoiner/multi_wrong_order2.yul index c577e1820..6296c3778 100644 --- a/test/libyul/yulOptimizerTests/expressionJoiner/multi_wrong_order2.yul +++ b/test/libyul/yulOptimizerTests/expressionJoiner/multi_wrong_order2.yul @@ -4,8 +4,9 @@ let x := mul(add(a, b), 2) sstore(x, 3) } +// ==== +// step: expressionJoiner // ---- -// expressionJoiner // { // let a := mload(2) // sstore(mul(add(a, mload(6)), 2), 3) diff --git a/test/libyul/yulOptimizerTests/expressionJoiner/no_replacement_across_blocks.yul b/test/libyul/yulOptimizerTests/expressionJoiner/no_replacement_across_blocks.yul index a781bb2a7..02c4466a2 100644 --- a/test/libyul/yulOptimizerTests/expressionJoiner/no_replacement_across_blocks.yul +++ b/test/libyul/yulOptimizerTests/expressionJoiner/no_replacement_across_blocks.yul @@ -11,8 +11,9 @@ } sstore(x, 3) } +// ==== +// step: expressionJoiner // ---- -// expressionJoiner // { // let x := calldataload(mload(2)) // sstore(x, 3) diff --git a/test/libyul/yulOptimizerTests/expressionJoiner/no_replacement_in_loop_condition1.yul b/test/libyul/yulOptimizerTests/expressionJoiner/no_replacement_in_loop_condition1.yul index 75218a5c4..091a12566 100644 --- a/test/libyul/yulOptimizerTests/expressionJoiner/no_replacement_in_loop_condition1.yul +++ b/test/libyul/yulOptimizerTests/expressionJoiner/no_replacement_in_loop_condition1.yul @@ -1,8 +1,9 @@ { for { let b := mload(1) } b {} {} } +// ==== +// step: expressionJoiner // ---- -// expressionJoiner // { // for { // let b := mload(1) diff --git a/test/libyul/yulOptimizerTests/expressionJoiner/no_replacement_in_loop_condition2.yul b/test/libyul/yulOptimizerTests/expressionJoiner/no_replacement_in_loop_condition2.yul index d5f7d8fa6..3e86d6078 100644 --- a/test/libyul/yulOptimizerTests/expressionJoiner/no_replacement_in_loop_condition2.yul +++ b/test/libyul/yulOptimizerTests/expressionJoiner/no_replacement_in_loop_condition2.yul @@ -2,8 +2,9 @@ let a := mload(0) for { } a {} {} } +// ==== +// step: expressionJoiner // ---- -// expressionJoiner // { // let a := mload(0) // for { diff --git a/test/libyul/yulOptimizerTests/expressionJoiner/only_assignment.yul b/test/libyul/yulOptimizerTests/expressionJoiner/only_assignment.yul index c74112115..12fa6ec51 100644 --- a/test/libyul/yulOptimizerTests/expressionJoiner/only_assignment.yul +++ b/test/libyul/yulOptimizerTests/expressionJoiner/only_assignment.yul @@ -5,8 +5,9 @@ x := add(a, 3) } } +// ==== +// step: expressionJoiner // ---- -// expressionJoiner // { // function f(a) -> x // { diff --git a/test/libyul/yulOptimizerTests/expressionJoiner/reassignment.yul b/test/libyul/yulOptimizerTests/expressionJoiner/reassignment.yul index 1e502353d..97661414f 100644 --- a/test/libyul/yulOptimizerTests/expressionJoiner/reassignment.yul +++ b/test/libyul/yulOptimizerTests/expressionJoiner/reassignment.yul @@ -4,8 +4,9 @@ let b := mload(a) a := 4 } +// ==== +// step: expressionJoiner // ---- -// expressionJoiner // { // let a := mload(2) // let b := mload(a) diff --git a/test/libyul/yulOptimizerTests/expressionJoiner/simple.yul b/test/libyul/yulOptimizerTests/expressionJoiner/simple.yul index b03bcf45a..03d2a7aee 100644 --- a/test/libyul/yulOptimizerTests/expressionJoiner/simple.yul +++ b/test/libyul/yulOptimizerTests/expressionJoiner/simple.yul @@ -3,8 +3,9 @@ let x := calldataload(a) sstore(x, 3) } +// ==== +// step: expressionJoiner // ---- -// expressionJoiner // { // sstore(calldataload(mload(2)), 3) // } diff --git a/test/libyul/yulOptimizerTests/expressionJoiner/single_wrong_order.yul b/test/libyul/yulOptimizerTests/expressionJoiner/single_wrong_order.yul index 3b433f78b..21bf67c89 100644 --- a/test/libyul/yulOptimizerTests/expressionJoiner/single_wrong_order.yul +++ b/test/libyul/yulOptimizerTests/expressionJoiner/single_wrong_order.yul @@ -5,8 +5,9 @@ let d := add(b, c) sstore(d, 0) } +// ==== +// step: expressionJoiner // ---- -// expressionJoiner // { // let b := sload(mload(3)) // sstore(add(b, mload(7)), 0) diff --git a/test/libyul/yulOptimizerTests/expressionJoiner/smoke.yul b/test/libyul/yulOptimizerTests/expressionJoiner/smoke.yul index c0e2c6f22..1161c2092 100644 --- a/test/libyul/yulOptimizerTests/expressionJoiner/smoke.yul +++ b/test/libyul/yulOptimizerTests/expressionJoiner/smoke.yul @@ -1,5 +1,6 @@ { } +// ==== +// step: expressionJoiner // ---- -// expressionJoiner // { // } diff --git a/test/libyul/yulOptimizerTests/expressionJoiner/switch_expression.yul b/test/libyul/yulOptimizerTests/expressionJoiner/switch_expression.yul index 0e4e540e1..9ab421533 100644 --- a/test/libyul/yulOptimizerTests/expressionJoiner/switch_expression.yul +++ b/test/libyul/yulOptimizerTests/expressionJoiner/switch_expression.yul @@ -14,8 +14,9 @@ let z := 3 let t := add(z, 9) } +// ==== +// step: expressionJoiner // ---- -// expressionJoiner // { // switch add(mload(7), sload(mload(3))) // case 3 { diff --git a/test/libyul/yulOptimizerTests/expressionJoiner/triple.yul b/test/libyul/yulOptimizerTests/expressionJoiner/triple.yul index 7b722be18..cf2b4a615 100644 --- a/test/libyul/yulOptimizerTests/expressionJoiner/triple.yul +++ b/test/libyul/yulOptimizerTests/expressionJoiner/triple.yul @@ -5,8 +5,9 @@ let x := mul(add(c, b), a) sstore(x, 3) } +// ==== +// step: expressionJoiner // ---- -// expressionJoiner // { // sstore(mul(add(mload(7), mload(6)), mload(2)), 3) // } diff --git a/test/libyul/yulOptimizerTests/expressionSimplifier/assigned_vars_multi.yul b/test/libyul/yulOptimizerTests/expressionSimplifier/assigned_vars_multi.yul index 51f5df40b..74604e771 100644 --- a/test/libyul/yulOptimizerTests/expressionSimplifier/assigned_vars_multi.yul +++ b/test/libyul/yulOptimizerTests/expressionSimplifier/assigned_vars_multi.yul @@ -3,8 +3,9 @@ let c, d := f() let y := add(d, add(c, 7)) } +// ==== +// step: expressionSimplifier // ---- -// expressionSimplifier // { // function f() -> x, z // { diff --git a/test/libyul/yulOptimizerTests/expressionSimplifier/constant_propagation.yul b/test/libyul/yulOptimizerTests/expressionSimplifier/constant_propagation.yul index 0b55adc51..b0f675ac8 100644 --- a/test/libyul/yulOptimizerTests/expressionSimplifier/constant_propagation.yul +++ b/test/libyul/yulOptimizerTests/expressionSimplifier/constant_propagation.yul @@ -1,6 +1,7 @@ { let a := add(7, sub(mload(0), 7)) } +// ==== +// step: expressionSimplifier // ---- -// expressionSimplifier // { // let a := mload(0) // } diff --git a/test/libyul/yulOptimizerTests/expressionSimplifier/constants.yul b/test/libyul/yulOptimizerTests/expressionSimplifier/constants.yul index bd1a5a53d..daebf97f7 100644 --- a/test/libyul/yulOptimizerTests/expressionSimplifier/constants.yul +++ b/test/libyul/yulOptimizerTests/expressionSimplifier/constants.yul @@ -1,6 +1,7 @@ { let a := add(1, mul(3, 4)) } +// ==== +// step: expressionSimplifier // ---- -// expressionSimplifier // { // let a := 13 // } diff --git a/test/libyul/yulOptimizerTests/expressionSimplifier/identity_rules_complex.yul b/test/libyul/yulOptimizerTests/expressionSimplifier/identity_rules_complex.yul index f61906226..f3298e510 100644 --- a/test/libyul/yulOptimizerTests/expressionSimplifier/identity_rules_complex.yul +++ b/test/libyul/yulOptimizerTests/expressionSimplifier/identity_rules_complex.yul @@ -1,6 +1,7 @@ { let a := sub(calldataload(0), calldataload(0)) } +// ==== +// step: expressionSimplifier // ---- -// expressionSimplifier // { // let a := 0 // } diff --git a/test/libyul/yulOptimizerTests/expressionSimplifier/identity_rules_negative.yul b/test/libyul/yulOptimizerTests/expressionSimplifier/identity_rules_negative.yul index e91403cd8..2838eb193 100644 --- a/test/libyul/yulOptimizerTests/expressionSimplifier/identity_rules_negative.yul +++ b/test/libyul/yulOptimizerTests/expressionSimplifier/identity_rules_negative.yul @@ -1,6 +1,7 @@ { let a := sub(calldataload(1), calldataload(0)) } +// ==== +// step: expressionSimplifier // ---- -// expressionSimplifier // { // let a := sub(calldataload(1), calldataload(0)) // } diff --git a/test/libyul/yulOptimizerTests/expressionSimplifier/identity_rules_simple.yul b/test/libyul/yulOptimizerTests/expressionSimplifier/identity_rules_simple.yul index d35686cd3..554d080b2 100644 --- a/test/libyul/yulOptimizerTests/expressionSimplifier/identity_rules_simple.yul +++ b/test/libyul/yulOptimizerTests/expressionSimplifier/identity_rules_simple.yul @@ -2,8 +2,9 @@ let a := mload(0) let b := sub(a, a) } +// ==== +// step: expressionSimplifier // ---- -// expressionSimplifier // { // let a := mload(0) // let b := 0 diff --git a/test/libyul/yulOptimizerTests/expressionSimplifier/including_function_calls.yul b/test/libyul/yulOptimizerTests/expressionSimplifier/including_function_calls.yul index c2ca504a1..ad8f3c33a 100644 --- a/test/libyul/yulOptimizerTests/expressionSimplifier/including_function_calls.yul +++ b/test/libyul/yulOptimizerTests/expressionSimplifier/including_function_calls.yul @@ -2,8 +2,9 @@ function f() -> a {} let b := add(7, sub(f(), 7)) } +// ==== +// step: expressionSimplifier // ---- -// expressionSimplifier // { // function f() -> a // { diff --git a/test/libyul/yulOptimizerTests/expressionSimplifier/inside_for.yul b/test/libyul/yulOptimizerTests/expressionSimplifier/inside_for.yul index 42c378269..dfb420858 100644 --- a/test/libyul/yulOptimizerTests/expressionSimplifier/inside_for.yul +++ b/test/libyul/yulOptimizerTests/expressionSimplifier/inside_for.yul @@ -1,8 +1,9 @@ { for { let a := 10 } iszero(eq(a, 0)) { a := add(a, 1) } {} } +// ==== +// step: expressionSimplifier // ---- -// expressionSimplifier // { // for { // let a := 10 diff --git a/test/libyul/yulOptimizerTests/expressionSimplifier/invariant.yul b/test/libyul/yulOptimizerTests/expressionSimplifier/invariant.yul index e6d845528..9ad889243 100644 --- a/test/libyul/yulOptimizerTests/expressionSimplifier/invariant.yul +++ b/test/libyul/yulOptimizerTests/expressionSimplifier/invariant.yul @@ -2,8 +2,9 @@ let a := mload(sub(7, 7)) let b := sub(a, 0) } +// ==== +// step: expressionSimplifier // ---- -// expressionSimplifier // { // let a := mload(0) // let b := a diff --git a/test/libyul/yulOptimizerTests/expressionSimplifier/mod_and_1.yul b/test/libyul/yulOptimizerTests/expressionSimplifier/mod_and_1.yul index 88714ce0a..6d7b03035 100644 --- a/test/libyul/yulOptimizerTests/expressionSimplifier/mod_and_1.yul +++ b/test/libyul/yulOptimizerTests/expressionSimplifier/mod_and_1.yul @@ -1,8 +1,9 @@ { mstore(0, mod(calldataload(0), exp(2, 8))) } +// ==== +// step: expressionSimplifier // ---- -// expressionSimplifier // { // mstore(0, and(calldataload(0), 255)) // } diff --git a/test/libyul/yulOptimizerTests/expressionSimplifier/mod_and_2.yul b/test/libyul/yulOptimizerTests/expressionSimplifier/mod_and_2.yul index 4d52abe85..d949b2f17 100644 --- a/test/libyul/yulOptimizerTests/expressionSimplifier/mod_and_2.yul +++ b/test/libyul/yulOptimizerTests/expressionSimplifier/mod_and_2.yul @@ -1,8 +1,9 @@ { mstore(0, mod(calldataload(0), exp(2, 255))) } +// ==== +// step: expressionSimplifier // ---- -// expressionSimplifier // { // mstore(0, and(calldataload(0), 0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff)) // } diff --git a/test/libyul/yulOptimizerTests/expressionSimplifier/not_applied_function_call_different_arguments.yul b/test/libyul/yulOptimizerTests/expressionSimplifier/not_applied_function_call_different_arguments.yul index 53270b723..d769143da 100644 --- a/test/libyul/yulOptimizerTests/expressionSimplifier/not_applied_function_call_different_arguments.yul +++ b/test/libyul/yulOptimizerTests/expressionSimplifier/not_applied_function_call_different_arguments.yul @@ -2,8 +2,9 @@ function f(a) -> b { } let c := sub(f(0), f(1)) } +// ==== +// step: expressionSimplifier // ---- -// expressionSimplifier // { // function f(a) -> b // { diff --git a/test/libyul/yulOptimizerTests/expressionSimplifier/not_applied_function_call_different_names.yul b/test/libyul/yulOptimizerTests/expressionSimplifier/not_applied_function_call_different_names.yul index 6ab65d294..be80fee19 100644 --- a/test/libyul/yulOptimizerTests/expressionSimplifier/not_applied_function_call_different_names.yul +++ b/test/libyul/yulOptimizerTests/expressionSimplifier/not_applied_function_call_different_names.yul @@ -3,8 +3,9 @@ function f2() -> b { } let c := sub(f1(), f2()) } +// ==== +// step: expressionSimplifier // ---- -// expressionSimplifier // { // function f1() -> a // { diff --git a/test/libyul/yulOptimizerTests/expressionSimplifier/not_applied_function_call_equality_not_movable.yul b/test/libyul/yulOptimizerTests/expressionSimplifier/not_applied_function_call_equality_not_movable.yul index ab1bd1287..bc0664939 100644 --- a/test/libyul/yulOptimizerTests/expressionSimplifier/not_applied_function_call_equality_not_movable.yul +++ b/test/libyul/yulOptimizerTests/expressionSimplifier/not_applied_function_call_equality_not_movable.yul @@ -3,8 +3,9 @@ function f() -> a { } let b := sub(f(), f()) } +// ==== +// step: expressionSimplifier // ---- -// expressionSimplifier // { // function f() -> a // { diff --git a/test/libyul/yulOptimizerTests/expressionSimplifier/not_applied_removes_non_constant_and_not_movable.yul b/test/libyul/yulOptimizerTests/expressionSimplifier/not_applied_removes_non_constant_and_not_movable.yul index fc61c3df7..cee563173 100644 --- a/test/libyul/yulOptimizerTests/expressionSimplifier/not_applied_removes_non_constant_and_not_movable.yul +++ b/test/libyul/yulOptimizerTests/expressionSimplifier/not_applied_removes_non_constant_and_not_movable.yul @@ -3,8 +3,9 @@ { let a := div(keccak256(0, 0), 0) } +// ==== +// step: expressionSimplifier // ---- -// expressionSimplifier // { // let a := div(keccak256(0, 0), 0) // } diff --git a/test/libyul/yulOptimizerTests/expressionSimplifier/reassign.yul b/test/libyul/yulOptimizerTests/expressionSimplifier/reassign.yul index 10d5dc67a..8178c6d03 100644 --- a/test/libyul/yulOptimizerTests/expressionSimplifier/reassign.yul +++ b/test/libyul/yulOptimizerTests/expressionSimplifier/reassign.yul @@ -3,8 +3,9 @@ x := 0 mstore(0, add(7, x)) } +// ==== +// step: expressionSimplifier // ---- -// expressionSimplifier // { // let x := mload(0) // x := 0 diff --git a/test/libyul/yulOptimizerTests/expressionSimplifier/return_vars_zero.yul b/test/libyul/yulOptimizerTests/expressionSimplifier/return_vars_zero.yul index 46f9bc40b..250f5f6fb 100644 --- a/test/libyul/yulOptimizerTests/expressionSimplifier/return_vars_zero.yul +++ b/test/libyul/yulOptimizerTests/expressionSimplifier/return_vars_zero.yul @@ -4,8 +4,9 @@ let y := add(d, add(c, 7)) } } +// ==== +// step: expressionSimplifier // ---- -// expressionSimplifier // { // function f() -> c, d // { diff --git a/test/libyul/yulOptimizerTests/expressionSimplifier/reversed.yul b/test/libyul/yulOptimizerTests/expressionSimplifier/reversed.yul index 6353cda98..e993763a7 100644 --- a/test/libyul/yulOptimizerTests/expressionSimplifier/reversed.yul +++ b/test/libyul/yulOptimizerTests/expressionSimplifier/reversed.yul @@ -1,8 +1,9 @@ { let a := add(0, mload(0)) } +// ==== +// step: expressionSimplifier // ---- -// expressionSimplifier // { // let a := mload(0) // } diff --git a/test/libyul/yulOptimizerTests/expressionSimplifier/smoke.yul b/test/libyul/yulOptimizerTests/expressionSimplifier/smoke.yul index 88420e923..7503f997d 100644 --- a/test/libyul/yulOptimizerTests/expressionSimplifier/smoke.yul +++ b/test/libyul/yulOptimizerTests/expressionSimplifier/smoke.yul @@ -1,5 +1,6 @@ { } +// ==== +// step: expressionSimplifier // ---- -// expressionSimplifier // { // } diff --git a/test/libyul/yulOptimizerTests/expressionSimplifier/unassigend_vars_multi.yul b/test/libyul/yulOptimizerTests/expressionSimplifier/unassigend_vars_multi.yul index f260db0be..e5db5ff76 100644 --- a/test/libyul/yulOptimizerTests/expressionSimplifier/unassigend_vars_multi.yul +++ b/test/libyul/yulOptimizerTests/expressionSimplifier/unassigend_vars_multi.yul @@ -3,8 +3,9 @@ let c, d let y := add(d, add(c, 7)) } +// ==== +// step: expressionSimplifier // ---- -// expressionSimplifier // { // let c, d // let y := 7 diff --git a/test/libyul/yulOptimizerTests/expressionSimplifier/unassigned_vars.yul b/test/libyul/yulOptimizerTests/expressionSimplifier/unassigned_vars.yul index 7b1430f39..f8480a327 100644 --- a/test/libyul/yulOptimizerTests/expressionSimplifier/unassigned_vars.yul +++ b/test/libyul/yulOptimizerTests/expressionSimplifier/unassigned_vars.yul @@ -4,8 +4,9 @@ let d let y := add(d, add(c, 7)) } +// ==== +// step: expressionSimplifier // ---- -// expressionSimplifier // { // let c // let d diff --git a/test/libyul/yulOptimizerTests/expressionSplitter/control_flow.yul b/test/libyul/yulOptimizerTests/expressionSplitter/control_flow.yul index d021129fe..79791eabf 100644 --- a/test/libyul/yulOptimizerTests/expressionSplitter/control_flow.yul +++ b/test/libyul/yulOptimizerTests/expressionSplitter/control_flow.yul @@ -7,8 +7,9 @@ } } } +// ==== +// step: expressionSplitter // ---- -// expressionSplitter // { // let _1 := 0 // let x := calldataload(_1) diff --git a/test/libyul/yulOptimizerTests/expressionSplitter/inside_function.yul b/test/libyul/yulOptimizerTests/expressionSplitter/inside_function.yul index 53bbcea76..bb73118ec 100644 --- a/test/libyul/yulOptimizerTests/expressionSplitter/inside_function.yul +++ b/test/libyul/yulOptimizerTests/expressionSplitter/inside_function.yul @@ -5,8 +5,9 @@ } sstore(x, f(mload(2), mload(2))) } +// ==== +// step: expressionSplitter // ---- -// expressionSplitter // { // let _1 := 3 // let _2 := 7 diff --git a/test/libyul/yulOptimizerTests/expressionSplitter/object_access.yul b/test/libyul/yulOptimizerTests/expressionSplitter/object_access.yul index 2689ab6f2..a7b5e9232 100644 --- a/test/libyul/yulOptimizerTests/expressionSplitter/object_access.yul +++ b/test/libyul/yulOptimizerTests/expressionSplitter/object_access.yul @@ -6,8 +6,9 @@ // datacopy is fine, though datacopy(mload(0), mload(1), mload(2)) } +// ==== +// step: expressionSplitter // ---- -// expressionSplitter // { // let x := dataoffset("abc") // let y := datasize("abc") diff --git a/test/libyul/yulOptimizerTests/expressionSplitter/smoke.yul b/test/libyul/yulOptimizerTests/expressionSplitter/smoke.yul index f69f60b63..bcbc1a658 100644 --- a/test/libyul/yulOptimizerTests/expressionSplitter/smoke.yul +++ b/test/libyul/yulOptimizerTests/expressionSplitter/smoke.yul @@ -1,5 +1,6 @@ { } +// ==== +// step: expressionSplitter // ---- -// expressionSplitter // { // } diff --git a/test/libyul/yulOptimizerTests/expressionSplitter/switch.yul b/test/libyul/yulOptimizerTests/expressionSplitter/switch.yul index aee7976f3..3608cab4f 100644 --- a/test/libyul/yulOptimizerTests/expressionSplitter/switch.yul +++ b/test/libyul/yulOptimizerTests/expressionSplitter/switch.yul @@ -5,8 +5,9 @@ default { mstore(0, mload(3)) } x := add(mload(3), 4) } +// ==== +// step: expressionSplitter // ---- -// expressionSplitter // { // let x := 8 // let _1 := 0 diff --git a/test/libyul/yulOptimizerTests/expressionSplitter/trivial.yul b/test/libyul/yulOptimizerTests/expressionSplitter/trivial.yul index bff70cd88..3d48eed79 100644 --- a/test/libyul/yulOptimizerTests/expressionSplitter/trivial.yul +++ b/test/libyul/yulOptimizerTests/expressionSplitter/trivial.yul @@ -1,8 +1,9 @@ { mstore(add(calldataload(2), mload(3)), 8) } +// ==== +// step: expressionSplitter // ---- -// expressionSplitter // { // let _1 := 8 // let _2 := 3 diff --git a/test/libyul/yulOptimizerTests/forLoopInitRewriter/complex_pre.yul b/test/libyul/yulOptimizerTests/forLoopInitRewriter/complex_pre.yul index 3ca00f557..6dc96a37e 100644 --- a/test/libyul/yulOptimizerTests/forLoopInitRewriter/complex_pre.yul +++ b/test/libyul/yulOptimizerTests/forLoopInitRewriter/complex_pre.yul @@ -5,8 +5,9 @@ a := add(a, 1) } } +// ==== +// step: forLoopInitRewriter // ---- -// forLoopInitRewriter // { // let random := 42 // let a := 1 diff --git a/test/libyul/yulOptimizerTests/forLoopInitRewriter/empty_pre.yul b/test/libyul/yulOptimizerTests/forLoopInitRewriter/empty_pre.yul index 05aceb520..45df8479c 100644 --- a/test/libyul/yulOptimizerTests/forLoopInitRewriter/empty_pre.yul +++ b/test/libyul/yulOptimizerTests/forLoopInitRewriter/empty_pre.yul @@ -4,8 +4,9 @@ a := add(a, 1) } } +// ==== +// step: forLoopInitRewriter // ---- -// forLoopInitRewriter // { // let a := 1 // for { diff --git a/test/libyul/yulOptimizerTests/forLoopInitRewriter/nested.yul b/test/libyul/yulOptimizerTests/forLoopInitRewriter/nested.yul index 3f7aa0892..afeed5dc5 100644 --- a/test/libyul/yulOptimizerTests/forLoopInitRewriter/nested.yul +++ b/test/libyul/yulOptimizerTests/forLoopInitRewriter/nested.yul @@ -13,8 +13,9 @@ mstore(b,b) } } +// ==== +// step: forLoopInitRewriter // ---- -// forLoopInitRewriter // { // let random := 42 // let a := 1 diff --git a/test/libyul/yulOptimizerTests/forLoopInitRewriter/simple.yul b/test/libyul/yulOptimizerTests/forLoopInitRewriter/simple.yul index 565b77251..91078561c 100644 --- a/test/libyul/yulOptimizerTests/forLoopInitRewriter/simple.yul +++ b/test/libyul/yulOptimizerTests/forLoopInitRewriter/simple.yul @@ -4,8 +4,9 @@ a := add(a, 1) } } +// ==== +// step: forLoopInitRewriter // ---- -// forLoopInitRewriter // { // let random := 42 // let a := 1 diff --git a/test/libyul/yulOptimizerTests/fullInliner/double_inline.yul b/test/libyul/yulOptimizerTests/fullInliner/double_inline.yul index e1ef4ab9c..b3ec1bbe8 100644 --- a/test/libyul/yulOptimizerTests/fullInliner/double_inline.yul +++ b/test/libyul/yulOptimizerTests/fullInliner/double_inline.yul @@ -4,8 +4,9 @@ let b3, c3 := f(a1) let b4, c4 := f(c3) } +// ==== +// step: fullInliner // ---- -// fullInliner // { // { // let a_2 := calldataload(0) diff --git a/test/libyul/yulOptimizerTests/fullInliner/inside_condition.yul b/test/libyul/yulOptimizerTests/fullInliner/inside_condition.yul index f0bb2e0a7..a81d34ef3 100644 --- a/test/libyul/yulOptimizerTests/fullInliner/inside_condition.yul +++ b/test/libyul/yulOptimizerTests/fullInliner/inside_condition.yul @@ -8,8 +8,9 @@ r := add(a, calldatasize()) } } +// ==== +// step: fullInliner // ---- -// fullInliner // { // { // let _2 := mload(0) diff --git a/test/libyul/yulOptimizerTests/fullInliner/large_function_multi_use.yul b/test/libyul/yulOptimizerTests/fullInliner/large_function_multi_use.yul index 87b825886..a088e1681 100644 --- a/test/libyul/yulOptimizerTests/fullInliner/large_function_multi_use.yul +++ b/test/libyul/yulOptimizerTests/fullInliner/large_function_multi_use.yul @@ -15,8 +15,9 @@ // This should be inlined because it is a constant as well (zero) let s := f(a3) } +// ==== +// step: fullInliner // ---- -// fullInliner // { // { // let a_1 := mload(2) diff --git a/test/libyul/yulOptimizerTests/fullInliner/large_function_single_use.yul b/test/libyul/yulOptimizerTests/fullInliner/large_function_single_use.yul index 2861d58ec..b8c05b72c 100644 --- a/test/libyul/yulOptimizerTests/fullInliner/large_function_single_use.yul +++ b/test/libyul/yulOptimizerTests/fullInliner/large_function_single_use.yul @@ -10,8 +10,9 @@ // Single-use functions are always inlined. let r := f(mload(1)) } +// ==== +// step: fullInliner // ---- -// fullInliner // { // { // let a_6 := mload(1) diff --git a/test/libyul/yulOptimizerTests/fullInliner/long_names.yul b/test/libyul/yulOptimizerTests/fullInliner/long_names.yul index 95f824268..8e9c2019d 100644 --- a/test/libyul/yulOptimizerTests/fullInliner/long_names.yul +++ b/test/libyul/yulOptimizerTests/fullInliner/long_names.yul @@ -7,8 +7,9 @@ mstore(0, verylongfunctionname(verylongvariablename2)) mstore(1, verylongvariablename2) } +// ==== +// step: fullInliner // ---- -// fullInliner // { // { // let verylongvariablename2_1 := 3 diff --git a/test/libyul/yulOptimizerTests/fullInliner/move_up_rightwards_argument.yul b/test/libyul/yulOptimizerTests/fullInliner/move_up_rightwards_argument.yul index 32db4f0b3..f40563602 100644 --- a/test/libyul/yulOptimizerTests/fullInliner/move_up_rightwards_argument.yul +++ b/test/libyul/yulOptimizerTests/fullInliner/move_up_rightwards_argument.yul @@ -5,8 +5,9 @@ } let y := add(mload(1), add(f(mload(2), mload(3), mload(4)), mload(5))) } +// ==== +// step: fullInliner // ---- -// fullInliner // { // { // let _2 := mload(5) diff --git a/test/libyul/yulOptimizerTests/fullInliner/multi_fun.yul b/test/libyul/yulOptimizerTests/fullInliner/multi_fun.yul index 6aecf7166..b372da9ae 100644 --- a/test/libyul/yulOptimizerTests/fullInliner/multi_fun.yul +++ b/test/libyul/yulOptimizerTests/fullInliner/multi_fun.yul @@ -3,8 +3,9 @@ function g(b, c) -> y { y := mul(mload(c), f(b)) } let y := g(f(3), 7) } +// ==== +// step: fullInliner // ---- -// fullInliner // { // { // let _1 := 7 diff --git a/test/libyul/yulOptimizerTests/fullInliner/multi_fun_callback.yul b/test/libyul/yulOptimizerTests/fullInliner/multi_fun_callback.yul index caccc8b80..aa4b7cb86 100644 --- a/test/libyul/yulOptimizerTests/fullInliner/multi_fun_callback.yul +++ b/test/libyul/yulOptimizerTests/fullInliner/multi_fun_callback.yul @@ -22,8 +22,9 @@ f(100) } } +// ==== +// step: fullInliner // ---- -// fullInliner // { // { // let x_8 := 100 diff --git a/test/libyul/yulOptimizerTests/fullInliner/multi_return.yul b/test/libyul/yulOptimizerTests/fullInliner/multi_return.yul index 2f00aa30b..7d90e0118 100644 --- a/test/libyul/yulOptimizerTests/fullInliner/multi_return.yul +++ b/test/libyul/yulOptimizerTests/fullInliner/multi_return.yul @@ -6,8 +6,9 @@ let r, s := f(mload(0)) mstore(r, s) } +// ==== +// step: fullInliner // ---- -// fullInliner // { // { // let a_3 := mload(0) diff --git a/test/libyul/yulOptimizerTests/fullInliner/no_inline_into_big_function.yul b/test/libyul/yulOptimizerTests/fullInliner/no_inline_into_big_function.yul index 0fecbab88..cbbe57d29 100644 --- a/test/libyul/yulOptimizerTests/fullInliner/no_inline_into_big_function.yul +++ b/test/libyul/yulOptimizerTests/fullInliner/no_inline_into_big_function.yul @@ -9,8 +9,9 @@ x := f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(2))))))))))))))))))) } } +// ==== +// step: fullInliner // ---- -// fullInliner // { // function f(a) -> b // { diff --git a/test/libyul/yulOptimizerTests/fullInliner/no_inline_into_big_global_context.yul b/test/libyul/yulOptimizerTests/fullInliner/no_inline_into_big_global_context.yul index 8541402ee..354a6eff4 100644 --- a/test/libyul/yulOptimizerTests/fullInliner/no_inline_into_big_global_context.yul +++ b/test/libyul/yulOptimizerTests/fullInliner/no_inline_into_big_global_context.yul @@ -7,8 +7,9 @@ // the global context gets too big. let x := f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(2))))))))))))))))))) } +// ==== +// step: fullInliner // ---- -// fullInliner // { // { // let a_20 := 2 diff --git a/test/libyul/yulOptimizerTests/fullInliner/no_return.yul b/test/libyul/yulOptimizerTests/fullInliner/no_return.yul index fe8bd3996..258c07a61 100644 --- a/test/libyul/yulOptimizerTests/fullInliner/no_return.yul +++ b/test/libyul/yulOptimizerTests/fullInliner/no_return.yul @@ -4,8 +4,9 @@ } f(mload(0)) } +// ==== +// step: fullInliner // ---- -// fullInliner // { // { // let a_3 := mload(0) diff --git a/test/libyul/yulOptimizerTests/fullInliner/not_inside_for.yul b/test/libyul/yulOptimizerTests/fullInliner/not_inside_for.yul index 98a31003e..07c7c40d7 100644 --- a/test/libyul/yulOptimizerTests/fullInliner/not_inside_for.yul +++ b/test/libyul/yulOptimizerTests/fullInliner/not_inside_for.yul @@ -8,8 +8,9 @@ r := a } } +// ==== +// step: fullInliner // ---- -// fullInliner // { // { // for { diff --git a/test/libyul/yulOptimizerTests/fullInliner/pop_result.yul b/test/libyul/yulOptimizerTests/fullInliner/pop_result.yul index 63ad8e31e..373416925 100644 --- a/test/libyul/yulOptimizerTests/fullInliner/pop_result.yul +++ b/test/libyul/yulOptimizerTests/fullInliner/pop_result.yul @@ -8,8 +8,9 @@ } pop(add(f(7), 2)) } +// ==== +// step: fullInliner // ---- -// fullInliner // { // { // let _1 := 2 diff --git a/test/libyul/yulOptimizerTests/fullInliner/recursion.yul b/test/libyul/yulOptimizerTests/fullInliner/recursion.yul index 5ac6ce772..175d44fd2 100644 --- a/test/libyul/yulOptimizerTests/fullInliner/recursion.yul +++ b/test/libyul/yulOptimizerTests/fullInliner/recursion.yul @@ -4,8 +4,9 @@ } f(mload(0)) } +// ==== +// step: fullInliner // ---- -// fullInliner // { // { // let a_4 := mload(0) diff --git a/test/libyul/yulOptimizerTests/fullInliner/simple.yul b/test/libyul/yulOptimizerTests/fullInliner/simple.yul index 6b043c911..af6fa8283 100644 --- a/test/libyul/yulOptimizerTests/fullInliner/simple.yul +++ b/test/libyul/yulOptimizerTests/fullInliner/simple.yul @@ -5,8 +5,9 @@ } let y := add(f(sload(mload(2))), mload(7)) } +// ==== +// step: fullInliner // ---- -// fullInliner // { // { // let _2 := mload(7) diff --git a/test/libyul/yulOptimizerTests/fullSimplify/constant_propagation.yul b/test/libyul/yulOptimizerTests/fullSimplify/constant_propagation.yul index 90a3e16d9..4c7fa2692 100644 --- a/test/libyul/yulOptimizerTests/fullSimplify/constant_propagation.yul +++ b/test/libyul/yulOptimizerTests/fullSimplify/constant_propagation.yul @@ -2,8 +2,9 @@ let a := add(7, sub(mload(0), 7)) mstore(a, 0) } +// ==== +// step: fullSimplify // ---- -// fullSimplify // { // let _2 := 0 // mstore(mload(_2), _2) diff --git a/test/libyul/yulOptimizerTests/fullSimplify/constants.yul b/test/libyul/yulOptimizerTests/fullSimplify/constants.yul index b9c7c1fcd..814562fad 100644 --- a/test/libyul/yulOptimizerTests/fullSimplify/constants.yul +++ b/test/libyul/yulOptimizerTests/fullSimplify/constants.yul @@ -2,8 +2,9 @@ let a := add(1, mul(3, 4)) mstore(0, a) } +// ==== +// step: fullSimplify // ---- -// fullSimplify // { // mstore(0, 13) // } diff --git a/test/libyul/yulOptimizerTests/fullSimplify/identity_rules_complex.yul b/test/libyul/yulOptimizerTests/fullSimplify/identity_rules_complex.yul index 4b17d7ea1..eaa0845da 100644 --- a/test/libyul/yulOptimizerTests/fullSimplify/identity_rules_complex.yul +++ b/test/libyul/yulOptimizerTests/fullSimplify/identity_rules_complex.yul @@ -2,8 +2,9 @@ let a := sub(calldataload(0), calldataload(0)) mstore(a, 0) } +// ==== +// step: fullSimplify // ---- -// fullSimplify // { // mstore(0, 0) // } diff --git a/test/libyul/yulOptimizerTests/fullSimplify/identity_rules_negative.yul b/test/libyul/yulOptimizerTests/fullSimplify/identity_rules_negative.yul index a1737efac..bc7bf5b5a 100644 --- a/test/libyul/yulOptimizerTests/fullSimplify/identity_rules_negative.yul +++ b/test/libyul/yulOptimizerTests/fullSimplify/identity_rules_negative.yul @@ -2,8 +2,9 @@ let a := sub(calldataload(1), calldataload(0)) mstore(0, a) } +// ==== +// step: fullSimplify // ---- -// fullSimplify // { // let _1 := 0 // mstore(_1, sub(calldataload(1), calldataload(_1))) diff --git a/test/libyul/yulOptimizerTests/fullSimplify/identity_rules_simple.yul b/test/libyul/yulOptimizerTests/fullSimplify/identity_rules_simple.yul index 22a358fd5..fc6463d2b 100644 --- a/test/libyul/yulOptimizerTests/fullSimplify/identity_rules_simple.yul +++ b/test/libyul/yulOptimizerTests/fullSimplify/identity_rules_simple.yul @@ -2,8 +2,9 @@ let a := mload(0) mstore(0, sub(a, a)) } +// ==== +// step: fullSimplify // ---- -// fullSimplify // { // let _1 := 0 // pop(mload(_1)) diff --git a/test/libyul/yulOptimizerTests/fullSimplify/including_function_calls.yul b/test/libyul/yulOptimizerTests/fullSimplify/including_function_calls.yul index fa3ff07c3..469607d68 100644 --- a/test/libyul/yulOptimizerTests/fullSimplify/including_function_calls.yul +++ b/test/libyul/yulOptimizerTests/fullSimplify/including_function_calls.yul @@ -3,8 +3,9 @@ let b := add(7, sub(f(), 7)) mstore(b, 0) } +// ==== +// step: fullSimplify // ---- -// fullSimplify // { // function f() -> a // { diff --git a/test/libyul/yulOptimizerTests/fullSimplify/inside_for.yul b/test/libyul/yulOptimizerTests/fullSimplify/inside_for.yul index f1b403019..f18d73f26 100644 --- a/test/libyul/yulOptimizerTests/fullSimplify/inside_for.yul +++ b/test/libyul/yulOptimizerTests/fullSimplify/inside_for.yul @@ -2,8 +2,9 @@ let x := calldataload(3) for { let a := 10 } iszero(eq(a, sub(x, calldataload(3)))) { a := add(a, 1) } {} } +// ==== +// step: fullSimplify // ---- -// fullSimplify // { // for { // let a := 10 diff --git a/test/libyul/yulOptimizerTests/fullSimplify/invariant.yul b/test/libyul/yulOptimizerTests/fullSimplify/invariant.yul index a8eedef12..453f74e33 100644 --- a/test/libyul/yulOptimizerTests/fullSimplify/invariant.yul +++ b/test/libyul/yulOptimizerTests/fullSimplify/invariant.yul @@ -7,8 +7,9 @@ // run of CSE afterwards. mstore(b, eq(calldataload(0), a)) } +// ==== +// step: fullSimplify // ---- -// fullSimplify // { // let a := calldataload(0) // let _4 := 0 diff --git a/test/libyul/yulOptimizerTests/fullSimplify/mod_and_1.yul b/test/libyul/yulOptimizerTests/fullSimplify/mod_and_1.yul index bba16a944..59dbf172b 100644 --- a/test/libyul/yulOptimizerTests/fullSimplify/mod_and_1.yul +++ b/test/libyul/yulOptimizerTests/fullSimplify/mod_and_1.yul @@ -1,8 +1,9 @@ { mstore(0, mod(calldataload(0), exp(2, 8))) } +// ==== +// step: fullSimplify // ---- -// fullSimplify // { // let _4 := 0 // mstore(_4, and(calldataload(_4), 255)) diff --git a/test/libyul/yulOptimizerTests/fullSimplify/mod_and_2.yul b/test/libyul/yulOptimizerTests/fullSimplify/mod_and_2.yul index 4a6eaa526..41254b818 100644 --- a/test/libyul/yulOptimizerTests/fullSimplify/mod_and_2.yul +++ b/test/libyul/yulOptimizerTests/fullSimplify/mod_and_2.yul @@ -1,8 +1,9 @@ { mstore(0, mod(calldataload(0), exp(2, 255))) } +// ==== +// step: fullSimplify // ---- -// fullSimplify // { // let _4 := 0 // mstore(_4, and(calldataload(_4), 0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff)) diff --git a/test/libyul/yulOptimizerTests/fullSimplify/not_applied_function_call_different_arguments.yul b/test/libyul/yulOptimizerTests/fullSimplify/not_applied_function_call_different_arguments.yul index 0c5e3ed91..f6d7912fd 100644 --- a/test/libyul/yulOptimizerTests/fullSimplify/not_applied_function_call_different_arguments.yul +++ b/test/libyul/yulOptimizerTests/fullSimplify/not_applied_function_call_different_arguments.yul @@ -2,8 +2,9 @@ function f(a) -> b { } mstore(0, sub(f(0), f(1))) } +// ==== +// step: fullSimplify // ---- -// fullSimplify // { // function f(a) -> b // { diff --git a/test/libyul/yulOptimizerTests/fullSimplify/not_applied_function_call_different_names.yul b/test/libyul/yulOptimizerTests/fullSimplify/not_applied_function_call_different_names.yul index 90e89fe1f..655ad00ca 100644 --- a/test/libyul/yulOptimizerTests/fullSimplify/not_applied_function_call_different_names.yul +++ b/test/libyul/yulOptimizerTests/fullSimplify/not_applied_function_call_different_names.yul @@ -4,8 +4,9 @@ let c := sub(f1(), f2()) mstore(0, c) } +// ==== +// step: fullSimplify // ---- -// fullSimplify // { // function f1() -> a // { diff --git a/test/libyul/yulOptimizerTests/fullSimplify/not_applied_function_call_equality_not_movable.yul b/test/libyul/yulOptimizerTests/fullSimplify/not_applied_function_call_equality_not_movable.yul index 92e50ebe6..00bba7a79 100644 --- a/test/libyul/yulOptimizerTests/fullSimplify/not_applied_function_call_equality_not_movable.yul +++ b/test/libyul/yulOptimizerTests/fullSimplify/not_applied_function_call_equality_not_movable.yul @@ -4,8 +4,9 @@ let b := sub(f(), f()) mstore(0, b) } +// ==== +// step: fullSimplify // ---- -// fullSimplify // { // function f() -> a // { diff --git a/test/libyul/yulOptimizerTests/fullSimplify/not_applied_removes_non_constant_and_not_movable.yul b/test/libyul/yulOptimizerTests/fullSimplify/not_applied_removes_non_constant_and_not_movable.yul index 7dcdc280e..eeb5ba1ae 100644 --- a/test/libyul/yulOptimizerTests/fullSimplify/not_applied_removes_non_constant_and_not_movable.yul +++ b/test/libyul/yulOptimizerTests/fullSimplify/not_applied_removes_non_constant_and_not_movable.yul @@ -3,8 +3,9 @@ let a := div(keccak256(0, 0), 0) mstore(0, a) } +// ==== +// step: fullSimplify // ---- -// fullSimplify // { // let _1 := 0 // pop(keccak256(_1, _1)) diff --git a/test/libyul/yulOptimizerTests/fullSimplify/operations.yul b/test/libyul/yulOptimizerTests/fullSimplify/operations.yul index 25467b629..b0f979276 100644 --- a/test/libyul/yulOptimizerTests/fullSimplify/operations.yul +++ b/test/libyul/yulOptimizerTests/fullSimplify/operations.yul @@ -19,8 +19,9 @@ mstore(17, or(x, not(x))) mstore(18, or(not(x), x)) } +// ==== +// step: fullSimplify // ---- -// fullSimplify // { // pop(mload(0)) // mstore(1, 0) diff --git a/test/libyul/yulOptimizerTests/fullSimplify/reversed.yul b/test/libyul/yulOptimizerTests/fullSimplify/reversed.yul index fb916e6ae..fceec7ecf 100644 --- a/test/libyul/yulOptimizerTests/fullSimplify/reversed.yul +++ b/test/libyul/yulOptimizerTests/fullSimplify/reversed.yul @@ -2,8 +2,9 @@ let a := add(0, mload(0)) mstore(0, a) } +// ==== +// step: fullSimplify // ---- -// fullSimplify // { // let _1 := 0 // mstore(_1, mload(_1)) diff --git a/test/libyul/yulOptimizerTests/fullSimplify/signextend.yul b/test/libyul/yulOptimizerTests/fullSimplify/signextend.yul index 714eb8602..13d4997dd 100644 --- a/test/libyul/yulOptimizerTests/fullSimplify/signextend.yul +++ b/test/libyul/yulOptimizerTests/fullSimplify/signextend.yul @@ -4,8 +4,9 @@ let y := 255 mstore(1, signextend(0, y)) } +// ==== +// step: fullSimplify // ---- -// fullSimplify // { // mstore(0, 7) // mstore(1, 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff) diff --git a/test/libyul/yulOptimizerTests/fullSimplify/smoke.yul b/test/libyul/yulOptimizerTests/fullSimplify/smoke.yul index a4fbb8990..de485f3d0 100644 --- a/test/libyul/yulOptimizerTests/fullSimplify/smoke.yul +++ b/test/libyul/yulOptimizerTests/fullSimplify/smoke.yul @@ -1,5 +1,6 @@ { } +// ==== +// step: fullSimplify // ---- -// fullSimplify // { // } diff --git a/test/libyul/yulOptimizerTests/fullSuite/abi2.yul b/test/libyul/yulOptimizerTests/fullSuite/abi2.yul index 179dcc3d6..6cffd0765 100644 --- a/test/libyul/yulOptimizerTests/fullSuite/abi2.yul +++ b/test/libyul/yulOptimizerTests/fullSuite/abi2.yul @@ -1069,8 +1069,9 @@ result := and(add(value_389, 31), not(31)) } } +// ==== +// step: fullSuite // ---- -// fullSuite // { // let _1 := mload(1) // let _2 := mload(0) diff --git a/test/libyul/yulOptimizerTests/fullSuite/abi_example1.yul b/test/libyul/yulOptimizerTests/fullSuite/abi_example1.yul index bf60aa0a4..7dbd04fea 100644 --- a/test/libyul/yulOptimizerTests/fullSuite/abi_example1.yul +++ b/test/libyul/yulOptimizerTests/fullSuite/abi_example1.yul @@ -455,8 +455,9 @@ converted := cleanup_assert_t_uint160(value) } } +// ==== +// step: fullSuite // ---- -// fullSuite // { // let _1 := 0x20 // let _2 := 0 diff --git a/test/libyul/yulOptimizerTests/fullSuite/aztec.yul b/test/libyul/yulOptimizerTests/fullSuite/aztec.yul index 62e9d104d..09b40984f 100644 --- a/test/libyul/yulOptimizerTests/fullSuite/aztec.yul +++ b/test/libyul/yulOptimizerTests/fullSuite/aztec.yul @@ -228,8 +228,9 @@ mstore(0x00, keccak256(0x300, mul(n, 0x80))) } } +// ==== +// step: fullSuite // ---- -// fullSuite // { // mstore(0x80, 7673901602397024137095011250362199966051872585513276903826533215767972925880) // mstore(0xa0, 8489654445897228341090914135473290831551238522473825886865492707826370766375) diff --git a/test/libyul/yulOptimizerTests/fullSuite/medium.yul b/test/libyul/yulOptimizerTests/fullSuite/medium.yul index dc3cfaaa4..aeeebafc8 100644 --- a/test/libyul/yulOptimizerTests/fullSuite/medium.yul +++ b/test/libyul/yulOptimizerTests/fullSuite/medium.yul @@ -16,8 +16,9 @@ for { switch mul(1,2) case 2 { mstore(0x40, 0x20) } } sub(1,1) {} { mstore(0x80, 0x40) } } } +// ==== +// step: fullSuite // ---- -// fullSuite // { // let _1 := 0x40 // mstore(_1, add(mload(_1), 0x20)) diff --git a/test/libyul/yulOptimizerTests/fullSuite/reuse_vars_bug_in_simplifier.yul b/test/libyul/yulOptimizerTests/fullSuite/reuse_vars_bug_in_simplifier.yul index 8136a4e9e..a50e515f2 100644 --- a/test/libyul/yulOptimizerTests/fullSuite/reuse_vars_bug_in_simplifier.yul +++ b/test/libyul/yulOptimizerTests/fullSuite/reuse_vars_bug_in_simplifier.yul @@ -9,8 +9,9 @@ mstore(sub(1,div(sub(x_9,1),sub(1,sub(x_9,1)))), 1) } } +// ==== +// step: fullSuite // ---- -// fullSuite // { // mstore(1, 1) // } diff --git a/test/libyul/yulOptimizerTests/fullSuite/ssaReverse.yul b/test/libyul/yulOptimizerTests/fullSuite/ssaReverse.yul index 325baefbb..ceaa7ceed 100644 --- a/test/libyul/yulOptimizerTests/fullSuite/ssaReverse.yul +++ b/test/libyul/yulOptimizerTests/fullSuite/ssaReverse.yul @@ -31,8 +31,9 @@ a,b := abi_decode_t_bytes_calldata_ptr(a,b) mstore(a,b) } +// ==== +// step: fullSuite // ---- -// fullSuite // { // let a, b := abi_decode_t_bytes_calldata_ptr(mload(0), mload(1)) // a, b := abi_decode_t_bytes_calldata_ptr(a, b) diff --git a/test/libyul/yulOptimizerTests/fullSuite/ssaReverseComplex.yul b/test/libyul/yulOptimizerTests/fullSuite/ssaReverseComplex.yul index 2e178f312..c4be165e8 100644 --- a/test/libyul/yulOptimizerTests/fullSuite/ssaReverseComplex.yul +++ b/test/libyul/yulOptimizerTests/fullSuite/ssaReverseComplex.yul @@ -9,8 +9,9 @@ } mstore(a, b) } +// ==== +// step: fullSuite // ---- -// fullSuite // { // let a := mload(0) // let b := mload(1) diff --git a/test/libyul/yulOptimizerTests/fullSuite/switch_inline.yul b/test/libyul/yulOptimizerTests/fullSuite/switch_inline.yul index 876400ce9..2f7be6ae5 100644 --- a/test/libyul/yulOptimizerTests/fullSuite/switch_inline.yul +++ b/test/libyul/yulOptimizerTests/fullSuite/switch_inline.yul @@ -6,8 +6,9 @@ case 1 { y := 9 } } } +// ==== +// step: fullSuite // ---- -// fullSuite // { // mstore(9, 0) // } diff --git a/test/libyul/yulOptimizerTests/fullSuite/switch_inline_match_default.yul b/test/libyul/yulOptimizerTests/fullSuite/switch_inline_match_default.yul index 260bcdc68..de18975c4 100644 --- a/test/libyul/yulOptimizerTests/fullSuite/switch_inline_match_default.yul +++ b/test/libyul/yulOptimizerTests/fullSuite/switch_inline_match_default.yul @@ -7,8 +7,9 @@ default { y := 10 } } } +// ==== +// step: fullSuite // ---- -// fullSuite // { // mstore(10, 0) // } diff --git a/test/libyul/yulOptimizerTests/functionGrouper/already_grouped.yul b/test/libyul/yulOptimizerTests/functionGrouper/already_grouped.yul index 42e8a48e3..98a8f2e39 100644 --- a/test/libyul/yulOptimizerTests/functionGrouper/already_grouped.yul +++ b/test/libyul/yulOptimizerTests/functionGrouper/already_grouped.yul @@ -4,8 +4,9 @@ } function f() -> y { y := 8 } } +// ==== +// step: functionGrouper // ---- -// functionGrouper // { // { // let x := 2 diff --git a/test/libyul/yulOptimizerTests/functionGrouper/empty_block.yul b/test/libyul/yulOptimizerTests/functionGrouper/empty_block.yul index f0d49d7b3..c5a9065de 100644 --- a/test/libyul/yulOptimizerTests/functionGrouper/empty_block.yul +++ b/test/libyul/yulOptimizerTests/functionGrouper/empty_block.yul @@ -1,7 +1,8 @@ -// yul { let a:u256 { } function f() -> x:bool { let b:u256 := 4:u256 {} for {} f() {} {} } } +// ==== +// step: functionGrouper +// yul: true // ---- -// functionGrouper // { // { // let a:u256 diff --git a/test/libyul/yulOptimizerTests/functionGrouper/grouped_but_not_ordered.yul b/test/libyul/yulOptimizerTests/functionGrouper/grouped_but_not_ordered.yul index 0abb5d876..f18a4f6a4 100644 --- a/test/libyul/yulOptimizerTests/functionGrouper/grouped_but_not_ordered.yul +++ b/test/libyul/yulOptimizerTests/functionGrouper/grouped_but_not_ordered.yul @@ -4,8 +4,9 @@ let x := 2 } } +// ==== +// step: functionGrouper // ---- -// functionGrouper // { // { // { diff --git a/test/libyul/yulOptimizerTests/functionGrouper/multi_fun_mixed.yul b/test/libyul/yulOptimizerTests/functionGrouper/multi_fun_mixed.yul index c830d5da7..53baf628d 100644 --- a/test/libyul/yulOptimizerTests/functionGrouper/multi_fun_mixed.yul +++ b/test/libyul/yulOptimizerTests/functionGrouper/multi_fun_mixed.yul @@ -1,12 +1,13 @@ -// yul { let a:u256 function f() { let b:u256 } let c:u256 function g() { let d:u256 } let e:u256 } +// ==== +// step: functionGrouper +// yul: true // ---- -// functionGrouper // { // { // let a:u256 diff --git a/test/libyul/yulOptimizerTests/functionGrouper/nested_fun.yul b/test/libyul/yulOptimizerTests/functionGrouper/nested_fun.yul index 4a8be86a4..43bd5b1ad 100644 --- a/test/libyul/yulOptimizerTests/functionGrouper/nested_fun.yul +++ b/test/libyul/yulOptimizerTests/functionGrouper/nested_fun.yul @@ -1,4 +1,3 @@ -// yul { let a:u256 function f() { @@ -9,8 +8,10 @@ let d:u256 } } +// ==== +// step: functionGrouper +// yul: true // ---- -// functionGrouper // { // { // let a:u256 diff --git a/test/libyul/yulOptimizerTests/functionGrouper/single_fun.yul b/test/libyul/yulOptimizerTests/functionGrouper/single_fun.yul index 149a44eb8..15d2ddecf 100644 --- a/test/libyul/yulOptimizerTests/functionGrouper/single_fun.yul +++ b/test/libyul/yulOptimizerTests/functionGrouper/single_fun.yul @@ -1,9 +1,10 @@ -// yul { let a:u256 function f() {} } +// ==== +// step: functionGrouper +// yul: true // ---- -// functionGrouper // { // { // let a:u256 diff --git a/test/libyul/yulOptimizerTests/functionGrouper/smoke.yul b/test/libyul/yulOptimizerTests/functionGrouper/smoke.yul index 650a163e7..285265a4f 100644 --- a/test/libyul/yulOptimizerTests/functionGrouper/smoke.yul +++ b/test/libyul/yulOptimizerTests/functionGrouper/smoke.yul @@ -1,6 +1,7 @@ { } +// ==== +// step: functionGrouper // ---- -// functionGrouper // { // { // } diff --git a/test/libyul/yulOptimizerTests/functionHoister/empty_block.yul b/test/libyul/yulOptimizerTests/functionHoister/empty_block.yul index 6ea9f59d3..3f5ec85a7 100644 --- a/test/libyul/yulOptimizerTests/functionHoister/empty_block.yul +++ b/test/libyul/yulOptimizerTests/functionHoister/empty_block.yul @@ -1,4 +1,3 @@ -// yul { let a:u256 { } @@ -8,8 +7,10 @@ for {} f() {} {} } } +// ==== +// step: functionHoister +// yul: true // ---- -// functionHoister // { // let a:u256 // function f() -> x:bool diff --git a/test/libyul/yulOptimizerTests/functionHoister/multi_mixed.yul b/test/libyul/yulOptimizerTests/functionHoister/multi_mixed.yul index 1e3bc5a1a..41b263ac0 100644 --- a/test/libyul/yulOptimizerTests/functionHoister/multi_mixed.yul +++ b/test/libyul/yulOptimizerTests/functionHoister/multi_mixed.yul @@ -1,4 +1,3 @@ -// yul { let a:u256 function f() { let b:u256 } @@ -6,8 +5,10 @@ function g() { let d:u256 } let e:u256 } +// ==== +// step: functionHoister +// yul: true // ---- -// functionHoister // { // let a:u256 // let c:u256 diff --git a/test/libyul/yulOptimizerTests/functionHoister/nested.yul b/test/libyul/yulOptimizerTests/functionHoister/nested.yul index 20f094f18..e25bc0cf9 100644 --- a/test/libyul/yulOptimizerTests/functionHoister/nested.yul +++ b/test/libyul/yulOptimizerTests/functionHoister/nested.yul @@ -1,4 +1,3 @@ -// yul { let a:u256 function f() { @@ -7,8 +6,10 @@ let d:u256 } } +// ==== +// step: functionHoister +// yul: true // ---- -// functionHoister // { // let a:u256 // function g() diff --git a/test/libyul/yulOptimizerTests/functionHoister/single.yul b/test/libyul/yulOptimizerTests/functionHoister/single.yul index ba922612e..0366d9a87 100644 --- a/test/libyul/yulOptimizerTests/functionHoister/single.yul +++ b/test/libyul/yulOptimizerTests/functionHoister/single.yul @@ -1,10 +1,11 @@ -// yul { let a:u256 function f() {} } +// ==== +// step: functionHoister +// yul: true // ---- -// functionHoister // { // let a:u256 // function f() diff --git a/test/libyul/yulOptimizerTests/functionHoister/smoke.yul b/test/libyul/yulOptimizerTests/functionHoister/smoke.yul index 35c1ce5fb..c730174f3 100644 --- a/test/libyul/yulOptimizerTests/functionHoister/smoke.yul +++ b/test/libyul/yulOptimizerTests/functionHoister/smoke.yul @@ -1,6 +1,7 @@ { } +// ==== +// step: functionHoister // ---- -// functionHoister // { // } diff --git a/test/libyul/yulOptimizerTests/mainFunction/empty_block.yul b/test/libyul/yulOptimizerTests/mainFunction/empty_block.yul index bae6bd48d..cd5876597 100644 --- a/test/libyul/yulOptimizerTests/mainFunction/empty_block.yul +++ b/test/libyul/yulOptimizerTests/mainFunction/empty_block.yul @@ -1,4 +1,3 @@ -// yul { let a:u256 { } @@ -8,8 +7,10 @@ for {} f() {} {} } } +// ==== +// step: mainFunction +// yul: true // ---- -// mainFunction // { // function main() // { diff --git a/test/libyul/yulOptimizerTests/mainFunction/multi_fun_mixed.yul b/test/libyul/yulOptimizerTests/mainFunction/multi_fun_mixed.yul index dd5caaec4..e9a2b091e 100644 --- a/test/libyul/yulOptimizerTests/mainFunction/multi_fun_mixed.yul +++ b/test/libyul/yulOptimizerTests/mainFunction/multi_fun_mixed.yul @@ -1,4 +1,3 @@ -// yul { let a:u256 function f() { let b:u256 } @@ -6,8 +5,10 @@ function g() { let d:u256 } let e:u256 } +// ==== +// step: mainFunction +// yul: true // ---- -// mainFunction // { // function main() // { diff --git a/test/libyul/yulOptimizerTests/mainFunction/nested_fun.yul b/test/libyul/yulOptimizerTests/mainFunction/nested_fun.yul index 309b97ccf..8294172b1 100644 --- a/test/libyul/yulOptimizerTests/mainFunction/nested_fun.yul +++ b/test/libyul/yulOptimizerTests/mainFunction/nested_fun.yul @@ -1,4 +1,3 @@ -// yul { let a:u256 function f() { @@ -7,8 +6,10 @@ let d:u256 } } +// ==== +// step: mainFunction +// yul: true // ---- -// mainFunction // { // function main() // { diff --git a/test/libyul/yulOptimizerTests/mainFunction/sigle_fun.yul b/test/libyul/yulOptimizerTests/mainFunction/sigle_fun.yul index fa9a8f415..7a7fc9471 100644 --- a/test/libyul/yulOptimizerTests/mainFunction/sigle_fun.yul +++ b/test/libyul/yulOptimizerTests/mainFunction/sigle_fun.yul @@ -1,10 +1,11 @@ -// yul { let a:u256 function f() {} } +// ==== +// step: mainFunction +// yul: true // ---- -// mainFunction // { // function main() // { diff --git a/test/libyul/yulOptimizerTests/mainFunction/smoke.yul b/test/libyul/yulOptimizerTests/mainFunction/smoke.yul index 7be147467..156f8849a 100644 --- a/test/libyul/yulOptimizerTests/mainFunction/smoke.yul +++ b/test/libyul/yulOptimizerTests/mainFunction/smoke.yul @@ -1,7 +1,8 @@ -// yul {} +// ==== +// step: mainFunction +// yul: true // ---- -// mainFunction // { // function main() // { diff --git a/test/libyul/yulOptimizerTests/redundantAssignEliminator/for.yul b/test/libyul/yulOptimizerTests/redundantAssignEliminator/for.yul index d9bbd86d3..d1df2d9a9 100644 --- a/test/libyul/yulOptimizerTests/redundantAssignEliminator/for.yul +++ b/test/libyul/yulOptimizerTests/redundantAssignEliminator/for.yul @@ -9,8 +9,9 @@ a := 7 } } +// ==== +// step: redundantAssignEliminator // ---- -// redundantAssignEliminator // { // for { // let a := 2 diff --git a/test/libyul/yulOptimizerTests/redundantAssignEliminator/for_branch.yul b/test/libyul/yulOptimizerTests/redundantAssignEliminator/for_branch.yul index 7f5e97ce8..cad75ac9e 100644 --- a/test/libyul/yulOptimizerTests/redundantAssignEliminator/for_branch.yul +++ b/test/libyul/yulOptimizerTests/redundantAssignEliminator/for_branch.yul @@ -13,8 +13,9 @@ y := 8 mstore(x, 0) } +// ==== +// step: redundantAssignEliminator // ---- -// redundantAssignEliminator // { // let x // let y diff --git a/test/libyul/yulOptimizerTests/redundantAssignEliminator/for_break.yul b/test/libyul/yulOptimizerTests/redundantAssignEliminator/for_break.yul index 8919a0309..9a5ce0fef 100644 --- a/test/libyul/yulOptimizerTests/redundantAssignEliminator/for_break.yul +++ b/test/libyul/yulOptimizerTests/redundantAssignEliminator/for_break.yul @@ -12,8 +12,9 @@ } mstore(x, 0x42) } +// ==== +// step: redundantAssignEliminator // ---- -// redundantAssignEliminator // { // let x // x := 1 diff --git a/test/libyul/yulOptimizerTests/redundantAssignEliminator/for_continue.yul b/test/libyul/yulOptimizerTests/redundantAssignEliminator/for_continue.yul index e21b76a77..7242bd37b 100644 --- a/test/libyul/yulOptimizerTests/redundantAssignEliminator/for_continue.yul +++ b/test/libyul/yulOptimizerTests/redundantAssignEliminator/for_continue.yul @@ -15,8 +15,9 @@ } x := 3 } +// ==== +// step: redundantAssignEliminator // ---- -// redundantAssignEliminator // { // let x // for { diff --git a/test/libyul/yulOptimizerTests/redundantAssignEliminator/for_continue_2.yul b/test/libyul/yulOptimizerTests/redundantAssignEliminator/for_continue_2.yul index ef1cac231..61138df4a 100644 --- a/test/libyul/yulOptimizerTests/redundantAssignEliminator/for_continue_2.yul +++ b/test/libyul/yulOptimizerTests/redundantAssignEliminator/for_continue_2.yul @@ -12,8 +12,9 @@ } mstore(x, 0x42) } +// ==== +// step: redundantAssignEliminator // ---- -// redundantAssignEliminator // { // let x // x := 1 diff --git a/test/libyul/yulOptimizerTests/redundantAssignEliminator/for_continue_3.yul b/test/libyul/yulOptimizerTests/redundantAssignEliminator/for_continue_3.yul index 246d97248..286be48dd 100644 --- a/test/libyul/yulOptimizerTests/redundantAssignEliminator/for_continue_3.yul +++ b/test/libyul/yulOptimizerTests/redundantAssignEliminator/for_continue_3.yul @@ -11,8 +11,9 @@ x := 3 } } +// ==== +// step: redundantAssignEliminator // ---- -// redundantAssignEliminator // { // let x // for { diff --git a/test/libyul/yulOptimizerTests/redundantAssignEliminator/for_decl_inside_break_continue.yul b/test/libyul/yulOptimizerTests/redundantAssignEliminator/for_decl_inside_break_continue.yul index bdf6a8ae9..70ace5f4b 100644 --- a/test/libyul/yulOptimizerTests/redundantAssignEliminator/for_decl_inside_break_continue.yul +++ b/test/libyul/yulOptimizerTests/redundantAssignEliminator/for_decl_inside_break_continue.yul @@ -18,8 +18,9 @@ } mstore(x, 0x42) } +// ==== +// step: redundantAssignEliminator // ---- -// redundantAssignEliminator // { // let x := 1 // for { diff --git a/test/libyul/yulOptimizerTests/redundantAssignEliminator/for_multi_break.yul b/test/libyul/yulOptimizerTests/redundantAssignEliminator/for_multi_break.yul index 3a5212641..6d5be5741 100644 --- a/test/libyul/yulOptimizerTests/redundantAssignEliminator/for_multi_break.yul +++ b/test/libyul/yulOptimizerTests/redundantAssignEliminator/for_multi_break.yul @@ -34,8 +34,9 @@ } mstore(x, 0x42) } +// ==== +// step: redundantAssignEliminator // ---- -// redundantAssignEliminator // { // let x := 1 // let y := 1 diff --git a/test/libyul/yulOptimizerTests/redundantAssignEliminator/for_nested.yul b/test/libyul/yulOptimizerTests/redundantAssignEliminator/for_nested.yul index f2393f817..067a999cc 100644 --- a/test/libyul/yulOptimizerTests/redundantAssignEliminator/for_nested.yul +++ b/test/libyul/yulOptimizerTests/redundantAssignEliminator/for_nested.yul @@ -31,8 +31,9 @@ } mstore(x, 0x42) } +// ==== +// step: redundantAssignEliminator // ---- -// redundantAssignEliminator // { // let x := 1 // let y := 1 diff --git a/test/libyul/yulOptimizerTests/redundantAssignEliminator/for_rerun.yul b/test/libyul/yulOptimizerTests/redundantAssignEliminator/for_rerun.yul index 65eb2838a..d9da624d6 100644 --- a/test/libyul/yulOptimizerTests/redundantAssignEliminator/for_rerun.yul +++ b/test/libyul/yulOptimizerTests/redundantAssignEliminator/for_rerun.yul @@ -10,8 +10,9 @@ } x := 3 } +// ==== +// step: redundantAssignEliminator // ---- -// redundantAssignEliminator // { // let x // x := 1 diff --git a/test/libyul/yulOptimizerTests/redundantAssignEliminator/for_stmnts_after_break_continue.yul b/test/libyul/yulOptimizerTests/redundantAssignEliminator/for_stmnts_after_break_continue.yul index a3cec65c1..aded61cda 100644 --- a/test/libyul/yulOptimizerTests/redundantAssignEliminator/for_stmnts_after_break_continue.yul +++ b/test/libyul/yulOptimizerTests/redundantAssignEliminator/for_stmnts_after_break_continue.yul @@ -22,8 +22,9 @@ } mstore(x, 0x42) } +// ==== +// step: redundantAssignEliminator // ---- -// redundantAssignEliminator // { // let x := 1 // let y := 1 diff --git a/test/libyul/yulOptimizerTests/redundantAssignEliminator/function.yul b/test/libyul/yulOptimizerTests/redundantAssignEliminator/function.yul index 5bb920ec3..444f73265 100644 --- a/test/libyul/yulOptimizerTests/redundantAssignEliminator/function.yul +++ b/test/libyul/yulOptimizerTests/redundantAssignEliminator/function.yul @@ -11,8 +11,9 @@ } r := 2 } +// ==== +// step: redundantAssignEliminator // ---- -// redundantAssignEliminator // { // let r // function f(x, y) -> a, b diff --git a/test/libyul/yulOptimizerTests/redundantAssignEliminator/if.yul b/test/libyul/yulOptimizerTests/redundantAssignEliminator/if.yul index 958bfc661..69c41c0be 100644 --- a/test/libyul/yulOptimizerTests/redundantAssignEliminator/if.yul +++ b/test/libyul/yulOptimizerTests/redundantAssignEliminator/if.yul @@ -9,8 +9,9 @@ // This enforces that none of the assignments above can be removed. mstore(0, d) } +// ==== +// step: redundantAssignEliminator // ---- -// redundantAssignEliminator // { // let c // let d diff --git a/test/libyul/yulOptimizerTests/redundantAssignEliminator/if_overwrite_all_branches.yul b/test/libyul/yulOptimizerTests/redundantAssignEliminator/if_overwrite_all_branches.yul index e47c31d1c..de9d4dc0a 100644 --- a/test/libyul/yulOptimizerTests/redundantAssignEliminator/if_overwrite_all_branches.yul +++ b/test/libyul/yulOptimizerTests/redundantAssignEliminator/if_overwrite_all_branches.yul @@ -10,8 +10,9 @@ d := 3 mstore(0, d) } +// ==== +// step: redundantAssignEliminator // ---- -// redundantAssignEliminator // { // let c // let d diff --git a/test/libyul/yulOptimizerTests/redundantAssignEliminator/if_used_in_one_branch.yul b/test/libyul/yulOptimizerTests/redundantAssignEliminator/if_used_in_one_branch.yul index 00065ed25..653446aae 100644 --- a/test/libyul/yulOptimizerTests/redundantAssignEliminator/if_used_in_one_branch.yul +++ b/test/libyul/yulOptimizerTests/redundantAssignEliminator/if_used_in_one_branch.yul @@ -10,8 +10,9 @@ d := 3 mstore(0, d) } +// ==== +// step: redundantAssignEliminator // ---- -// redundantAssignEliminator // { // let c // let d diff --git a/test/libyul/yulOptimizerTests/redundantAssignEliminator/multi_assign.yul b/test/libyul/yulOptimizerTests/redundantAssignEliminator/multi_assign.yul index 26bcfc725..918eb89df 100644 --- a/test/libyul/yulOptimizerTests/redundantAssignEliminator/multi_assign.yul +++ b/test/libyul/yulOptimizerTests/redundantAssignEliminator/multi_assign.yul @@ -8,8 +8,9 @@ x := 3 y := 4 } +// ==== +// step: redundantAssignEliminator // ---- -// redundantAssignEliminator // { // function f() -> a, b // { diff --git a/test/libyul/yulOptimizerTests/redundantAssignEliminator/multivar.yul b/test/libyul/yulOptimizerTests/redundantAssignEliminator/multivar.yul index cf6461268..b094f25b7 100644 --- a/test/libyul/yulOptimizerTests/redundantAssignEliminator/multivar.yul +++ b/test/libyul/yulOptimizerTests/redundantAssignEliminator/multivar.yul @@ -5,8 +5,9 @@ b := a a := b } +// ==== +// step: redundantAssignEliminator // ---- -// redundantAssignEliminator // { // let a := 2 // a := 7 diff --git a/test/libyul/yulOptimizerTests/redundantAssignEliminator/non_movable.yul b/test/libyul/yulOptimizerTests/redundantAssignEliminator/non_movable.yul index ae3e5226d..a5e697555 100644 --- a/test/libyul/yulOptimizerTests/redundantAssignEliminator/non_movable.yul +++ b/test/libyul/yulOptimizerTests/redundantAssignEliminator/non_movable.yul @@ -3,8 +3,9 @@ a := 0 a := mload(0) } +// ==== +// step: redundantAssignEliminator // ---- -// redundantAssignEliminator // { // let a // a := mload(0) diff --git a/test/libyul/yulOptimizerTests/redundantAssignEliminator/scopes.yul b/test/libyul/yulOptimizerTests/redundantAssignEliminator/scopes.yul index 702f854df..7d6afaf02 100644 --- a/test/libyul/yulOptimizerTests/redundantAssignEliminator/scopes.yul +++ b/test/libyul/yulOptimizerTests/redundantAssignEliminator/scopes.yul @@ -6,8 +6,9 @@ a := 2 } } +// ==== +// step: redundantAssignEliminator // ---- -// redundantAssignEliminator // { // let a // { diff --git a/test/libyul/yulOptimizerTests/redundantAssignEliminator/simple.yul b/test/libyul/yulOptimizerTests/redundantAssignEliminator/simple.yul index 913a76941..e05823ac8 100644 --- a/test/libyul/yulOptimizerTests/redundantAssignEliminator/simple.yul +++ b/test/libyul/yulOptimizerTests/redundantAssignEliminator/simple.yul @@ -3,8 +3,9 @@ a := 1 a := 2 } +// ==== +// step: redundantAssignEliminator // ---- -// redundantAssignEliminator // { // let a // } diff --git a/test/libyul/yulOptimizerTests/redundantAssignEliminator/switch_overwrite_in_all.yul b/test/libyul/yulOptimizerTests/redundantAssignEliminator/switch_overwrite_in_all.yul index 962655764..1df661d1a 100644 --- a/test/libyul/yulOptimizerTests/redundantAssignEliminator/switch_overwrite_in_all.yul +++ b/test/libyul/yulOptimizerTests/redundantAssignEliminator/switch_overwrite_in_all.yul @@ -7,8 +7,9 @@ default { x := 3 } mstore(x, 0) } +// ==== +// step: redundantAssignEliminator // ---- -// redundantAssignEliminator // { // let x // switch calldataload(0) diff --git a/test/libyul/yulOptimizerTests/redundantAssignEliminator/switch_overwrite_in_one.yul b/test/libyul/yulOptimizerTests/redundantAssignEliminator/switch_overwrite_in_one.yul index cbe859ed6..47bc9ff46 100644 --- a/test/libyul/yulOptimizerTests/redundantAssignEliminator/switch_overwrite_in_one.yul +++ b/test/libyul/yulOptimizerTests/redundantAssignEliminator/switch_overwrite_in_one.yul @@ -6,8 +6,9 @@ case 0 { x := 2 } mstore(x, 0) } +// ==== +// step: redundantAssignEliminator // ---- -// redundantAssignEliminator // { // let x // x := 1 diff --git a/test/libyul/yulOptimizerTests/redundantAssignEliminator/switch_overwrite_use_combination.yul b/test/libyul/yulOptimizerTests/redundantAssignEliminator/switch_overwrite_use_combination.yul index 1a3b26ebd..25c360531 100644 --- a/test/libyul/yulOptimizerTests/redundantAssignEliminator/switch_overwrite_use_combination.yul +++ b/test/libyul/yulOptimizerTests/redundantAssignEliminator/switch_overwrite_use_combination.yul @@ -7,8 +7,9 @@ default { mstore(x, 1) } mstore(x, 0) } +// ==== +// step: redundantAssignEliminator // ---- -// redundantAssignEliminator // { // let x // x := 1 diff --git a/test/libyul/yulOptimizerTests/redundantAssignEliminator/switch_unused.yul b/test/libyul/yulOptimizerTests/redundantAssignEliminator/switch_unused.yul index cc78b74d3..c45eb8423 100644 --- a/test/libyul/yulOptimizerTests/redundantAssignEliminator/switch_unused.yul +++ b/test/libyul/yulOptimizerTests/redundantAssignEliminator/switch_unused.yul @@ -5,8 +5,9 @@ switch calldataload(0) case 0 { mstore(0, 1) } } +// ==== +// step: redundantAssignEliminator // ---- -// redundantAssignEliminator // { // let x // switch calldataload(0) diff --git a/test/libyul/yulOptimizerTests/rematerialiser/branches_for1.yul b/test/libyul/yulOptimizerTests/rematerialiser/branches_for1.yul index 3160381f6..4117086d7 100644 --- a/test/libyul/yulOptimizerTests/rematerialiser/branches_for1.yul +++ b/test/libyul/yulOptimizerTests/rematerialiser/branches_for1.yul @@ -4,8 +4,9 @@ pop(a) } } +// ==== +// step: rematerialiser // ---- -// rematerialiser // { // let a := caller() // for { diff --git a/test/libyul/yulOptimizerTests/rematerialiser/branches_for2.yul b/test/libyul/yulOptimizerTests/rematerialiser/branches_for2.yul index eb092e956..79a318b04 100644 --- a/test/libyul/yulOptimizerTests/rematerialiser/branches_for2.yul +++ b/test/libyul/yulOptimizerTests/rematerialiser/branches_for2.yul @@ -6,8 +6,9 @@ } let x := a } +// ==== +// step: rematerialiser // ---- -// rematerialiser // { // let a := caller() // for { diff --git a/test/libyul/yulOptimizerTests/rematerialiser/branches_for_declared_in_init1.yul b/test/libyul/yulOptimizerTests/rematerialiser/branches_for_declared_in_init1.yul index e7c689ca1..a24341518 100644 --- a/test/libyul/yulOptimizerTests/rematerialiser/branches_for_declared_in_init1.yul +++ b/test/libyul/yulOptimizerTests/rematerialiser/branches_for_declared_in_init1.yul @@ -4,8 +4,9 @@ b := 1 pop(a) } } +// ==== +// step: rematerialiser // ---- -// rematerialiser // { // let b := 0 // for { diff --git a/test/libyul/yulOptimizerTests/rematerialiser/branches_for_declared_in_init2.yul b/test/libyul/yulOptimizerTests/rematerialiser/branches_for_declared_in_init2.yul index 80ee92332..27fe1b238 100644 --- a/test/libyul/yulOptimizerTests/rematerialiser/branches_for_declared_in_init2.yul +++ b/test/libyul/yulOptimizerTests/rematerialiser/branches_for_declared_in_init2.yul @@ -4,8 +4,9 @@ b := 1 pop(a) } } +// ==== +// step: rematerialiser // ---- -// rematerialiser // { // let b := 0 // for { diff --git a/test/libyul/yulOptimizerTests/rematerialiser/branches_if.yul b/test/libyul/yulOptimizerTests/rematerialiser/branches_if.yul index 2aff06d47..e664291f5 100644 --- a/test/libyul/yulOptimizerTests/rematerialiser/branches_if.yul +++ b/test/libyul/yulOptimizerTests/rematerialiser/branches_if.yul @@ -4,8 +4,9 @@ if b { pop(b) b := a } let c := b } +// ==== +// step: rematerialiser // ---- -// rematerialiser // { // let a := caller() // let b := address() diff --git a/test/libyul/yulOptimizerTests/rematerialiser/branches_switch.yul b/test/libyul/yulOptimizerTests/rematerialiser/branches_switch.yul index 8f70a79d9..71a3a2c75 100644 --- a/test/libyul/yulOptimizerTests/rematerialiser/branches_switch.yul +++ b/test/libyul/yulOptimizerTests/rematerialiser/branches_switch.yul @@ -6,8 +6,9 @@ default { let x := a let y := b b := a } pop(add(a, b)) } +// ==== +// step: rematerialiser // ---- -// rematerialiser // { // let a := 1 // let b := 2 diff --git a/test/libyul/yulOptimizerTests/rematerialiser/cheap_caller.yul b/test/libyul/yulOptimizerTests/rematerialiser/cheap_caller.yul index 7e99e4289..95733af88 100644 --- a/test/libyul/yulOptimizerTests/rematerialiser/cheap_caller.yul +++ b/test/libyul/yulOptimizerTests/rematerialiser/cheap_caller.yul @@ -6,8 +6,9 @@ mstore(add(a, a), mload(a)) sstore(a, sload(a)) } +// ==== +// step: rematerialiser // ---- -// rematerialiser // { // let a := caller() // mstore(caller(), caller()) diff --git a/test/libyul/yulOptimizerTests/rematerialiser/do_not_move_out_of_scope.yul b/test/libyul/yulOptimizerTests/rematerialiser/do_not_move_out_of_scope.yul index 891a5043b..074100d89 100644 --- a/test/libyul/yulOptimizerTests/rematerialiser/do_not_move_out_of_scope.yul +++ b/test/libyul/yulOptimizerTests/rematerialiser/do_not_move_out_of_scope.yul @@ -7,8 +7,9 @@ } let b := x } +// ==== +// step: rematerialiser // ---- -// rematerialiser // { // let x // { diff --git a/test/libyul/yulOptimizerTests/rematerialiser/do_remat_large_amounts_of_code_if_used_once.yul b/test/libyul/yulOptimizerTests/rematerialiser/do_remat_large_amounts_of_code_if_used_once.yul index e464d404a..cc009509f 100644 --- a/test/libyul/yulOptimizerTests/rematerialiser/do_remat_large_amounts_of_code_if_used_once.yul +++ b/test/libyul/yulOptimizerTests/rematerialiser/do_remat_large_amounts_of_code_if_used_once.yul @@ -2,8 +2,9 @@ let x := add(mul(calldataload(2), calldataload(4)), mul(2, calldatasize())) let b := x } +// ==== +// step: rematerialiser // ---- -// rematerialiser // { // let x := add(mul(calldataload(2), calldataload(4)), mul(2, calldatasize())) // let b := add(mul(calldataload(2), calldataload(4)), mul(2, calldatasize())) diff --git a/test/libyul/yulOptimizerTests/rematerialiser/for_break.yul b/test/libyul/yulOptimizerTests/rematerialiser/for_break.yul index f835e84ca..a86a35f9b 100644 --- a/test/libyul/yulOptimizerTests/rematerialiser/for_break.yul +++ b/test/libyul/yulOptimizerTests/rematerialiser/for_break.yul @@ -12,8 +12,9 @@ } mstore(a, b) } +// ==== +// step: rematerialiser // ---- -// rematerialiser // { // let a // let b diff --git a/test/libyul/yulOptimizerTests/rematerialiser/for_continue.yul b/test/libyul/yulOptimizerTests/rematerialiser/for_continue.yul index 96f65ddd5..4fd69a32b 100644 --- a/test/libyul/yulOptimizerTests/rematerialiser/for_continue.yul +++ b/test/libyul/yulOptimizerTests/rematerialiser/for_continue.yul @@ -14,8 +14,9 @@ } mstore(a, b) } +// ==== +// step: rematerialiser // ---- -// rematerialiser // { // let a // let b diff --git a/test/libyul/yulOptimizerTests/rematerialiser/for_continue_2.yul b/test/libyul/yulOptimizerTests/rematerialiser/for_continue_2.yul index a95d24add..7ad885476 100644 --- a/test/libyul/yulOptimizerTests/rematerialiser/for_continue_2.yul +++ b/test/libyul/yulOptimizerTests/rematerialiser/for_continue_2.yul @@ -19,8 +19,9 @@ } mstore(a, b) } +// ==== +// step: rematerialiser // ---- -// rematerialiser // { // let a // let b diff --git a/test/libyul/yulOptimizerTests/rematerialiser/for_continue_with_assignment_in_post.yul b/test/libyul/yulOptimizerTests/rematerialiser/for_continue_with_assignment_in_post.yul index 7620791c6..38424eb0a 100644 --- a/test/libyul/yulOptimizerTests/rematerialiser/for_continue_with_assignment_in_post.yul +++ b/test/libyul/yulOptimizerTests/rematerialiser/for_continue_with_assignment_in_post.yul @@ -23,8 +23,9 @@ let x := b // does not rematerialize as b may be either origin() or callvalue() (btw: not caller()) let y := c // does not rematerialize as c may be either origin() or caller() } +// ==== +// step: rematerialiser // ---- -// rematerialiser // { // let a // let b diff --git a/test/libyul/yulOptimizerTests/rematerialiser/large_constant.yul b/test/libyul/yulOptimizerTests/rematerialiser/large_constant.yul index 9c7c66f14..9f57a4739 100644 --- a/test/libyul/yulOptimizerTests/rematerialiser/large_constant.yul +++ b/test/libyul/yulOptimizerTests/rematerialiser/large_constant.yul @@ -4,8 +4,9 @@ let a := 0xffffffffffffffffffffff mstore(a, a) } +// ==== +// step: rematerialiser // ---- -// rematerialiser // { // let a := 0xffffffffffffffffffffff // mstore(a, a) diff --git a/test/libyul/yulOptimizerTests/rematerialiser/large_constant_used_once.yul b/test/libyul/yulOptimizerTests/rematerialiser/large_constant_used_once.yul index b8a861aad..6d388c19e 100644 --- a/test/libyul/yulOptimizerTests/rematerialiser/large_constant_used_once.yul +++ b/test/libyul/yulOptimizerTests/rematerialiser/large_constant_used_once.yul @@ -5,8 +5,9 @@ let a := 0xffffffffffffffffffffff mstore(0, a) } +// ==== +// step: rematerialiser // ---- -// rematerialiser // { // let a := 0xffffffffffffffffffffff // mstore(0, 0xffffffffffffffffffffff) diff --git a/test/libyul/yulOptimizerTests/rematerialiser/medium_sized_constant.yul b/test/libyul/yulOptimizerTests/rematerialiser/medium_sized_constant.yul index 98cdbd09c..ec79843b1 100644 --- a/test/libyul/yulOptimizerTests/rematerialiser/medium_sized_constant.yul +++ b/test/libyul/yulOptimizerTests/rematerialiser/medium_sized_constant.yul @@ -12,8 +12,9 @@ mstore(add(a, a), a) mstore(a, mload(a)) } +// ==== +// step: rematerialiser // ---- -// rematerialiser // { // let b := 2 // mstore(2, 2) diff --git a/test/libyul/yulOptimizerTests/rematerialiser/non_movable_function.yul b/test/libyul/yulOptimizerTests/rematerialiser/non_movable_function.yul index 9a041dfc0..663c70ca9 100644 --- a/test/libyul/yulOptimizerTests/rematerialiser/non_movable_function.yul +++ b/test/libyul/yulOptimizerTests/rematerialiser/non_movable_function.yul @@ -5,8 +5,9 @@ let c := a mstore(add(a, b), c) } +// ==== +// step: rematerialiser // ---- -// rematerialiser // { // function f(x) -> y // { diff --git a/test/libyul/yulOptimizerTests/rematerialiser/non_movable_instruction.yul b/test/libyul/yulOptimizerTests/rematerialiser/non_movable_instruction.yul index 8767abc95..0fb885604 100644 --- a/test/libyul/yulOptimizerTests/rematerialiser/non_movable_instruction.yul +++ b/test/libyul/yulOptimizerTests/rematerialiser/non_movable_instruction.yul @@ -4,8 +4,9 @@ let c := a mstore(add(a, b), c) } +// ==== +// step: rematerialiser // ---- -// rematerialiser // { // let a := 1 // let b := mload(1) diff --git a/test/libyul/yulOptimizerTests/rematerialiser/reassign.yul b/test/libyul/yulOptimizerTests/rematerialiser/reassign.yul index 471246587..fe3cf5812 100644 --- a/test/libyul/yulOptimizerTests/rematerialiser/reassign.yul +++ b/test/libyul/yulOptimizerTests/rematerialiser/reassign.yul @@ -6,8 +6,9 @@ let d := add(b, c) pop(a) pop(b) pop(c) pop(d) } +// ==== +// step: rematerialiser // ---- -// rematerialiser // { // let a := extcodesize(0) // let b := a diff --git a/test/libyul/yulOptimizerTests/rematerialiser/reassignment.yul b/test/libyul/yulOptimizerTests/rematerialiser/reassignment.yul index 13238780f..28709ac1f 100644 --- a/test/libyul/yulOptimizerTests/rematerialiser/reassignment.yul +++ b/test/libyul/yulOptimizerTests/rematerialiser/reassignment.yul @@ -5,8 +5,9 @@ let b := mload(a) pop(b) } +// ==== +// step: rematerialiser // ---- -// rematerialiser // { // let a := 1 // pop(1) diff --git a/test/libyul/yulOptimizerTests/rematerialiser/smoke.yul b/test/libyul/yulOptimizerTests/rematerialiser/smoke.yul index 2423db327..ae0286f90 100644 --- a/test/libyul/yulOptimizerTests/rematerialiser/smoke.yul +++ b/test/libyul/yulOptimizerTests/rematerialiser/smoke.yul @@ -1,5 +1,6 @@ {} +// ==== +// step: rematerialiser // ---- -// rematerialiser // { // } diff --git a/test/libyul/yulOptimizerTests/rematerialiser/trivial.yul b/test/libyul/yulOptimizerTests/rematerialiser/trivial.yul index d29ea98ad..35d4f0332 100644 --- a/test/libyul/yulOptimizerTests/rematerialiser/trivial.yul +++ b/test/libyul/yulOptimizerTests/rematerialiser/trivial.yul @@ -3,8 +3,9 @@ let b := a mstore(0, b) } +// ==== +// step: rematerialiser // ---- -// rematerialiser // { // let a := 1 // let b := 1 diff --git a/test/libyul/yulOptimizerTests/rematerialiser/update_asignment_remat.yul b/test/libyul/yulOptimizerTests/rematerialiser/update_asignment_remat.yul index 7d35fee04..076131cde 100644 --- a/test/libyul/yulOptimizerTests/rematerialiser/update_asignment_remat.yul +++ b/test/libyul/yulOptimizerTests/rematerialiser/update_asignment_remat.yul @@ -4,8 +4,9 @@ a := mul(a, 2) let b := a } +// ==== +// step: rematerialiser // ---- -// rematerialiser // { // let a := extcodesize(0) // a := mul(a, 2) diff --git a/test/libyul/yulOptimizerTests/splitJoin/control_flow.yul b/test/libyul/yulOptimizerTests/splitJoin/control_flow.yul index ad609c74b..a87fe4fd0 100644 --- a/test/libyul/yulOptimizerTests/splitJoin/control_flow.yul +++ b/test/libyul/yulOptimizerTests/splitJoin/control_flow.yul @@ -6,8 +6,9 @@ } } } +// ==== +// step: splitJoin // ---- -// splitJoin // { // if mul(add(calldataload(0), 2), 3) // { diff --git a/test/libyul/yulOptimizerTests/splitJoin/functions.yul b/test/libyul/yulOptimizerTests/splitJoin/functions.yul index 549fc5503..12bbe4cfb 100644 --- a/test/libyul/yulOptimizerTests/splitJoin/functions.yul +++ b/test/libyul/yulOptimizerTests/splitJoin/functions.yul @@ -8,8 +8,9 @@ sstore(b, mul(b, 2)) } } +// ==== +// step: splitJoin // ---- -// splitJoin // { // let x := f(0) // function f(y) -> r diff --git a/test/libyul/yulOptimizerTests/splitJoin/smoke.yul b/test/libyul/yulOptimizerTests/splitJoin/smoke.yul index 4b1330293..073663ff4 100644 --- a/test/libyul/yulOptimizerTests/splitJoin/smoke.yul +++ b/test/libyul/yulOptimizerTests/splitJoin/smoke.yul @@ -1,5 +1,6 @@ {} +// ==== +// step: splitJoin // ---- -// splitJoin // { // } diff --git a/test/libyul/yulOptimizerTests/ssaAndBack/for_loop.yul b/test/libyul/yulOptimizerTests/ssaAndBack/for_loop.yul index 18498e611..3fdf2a4c3 100644 --- a/test/libyul/yulOptimizerTests/ssaAndBack/for_loop.yul +++ b/test/libyul/yulOptimizerTests/ssaAndBack/for_loop.yul @@ -15,8 +15,9 @@ b := mload(a) } } +// ==== +// step: ssaAndBack // ---- -// ssaAndBack // { // for { // let a := mload(0) diff --git a/test/libyul/yulOptimizerTests/ssaAndBack/multi_assign.yul b/test/libyul/yulOptimizerTests/ssaAndBack/multi_assign.yul index 23c433d13..2dd2d98b0 100644 --- a/test/libyul/yulOptimizerTests/ssaAndBack/multi_assign.yul +++ b/test/libyul/yulOptimizerTests/ssaAndBack/multi_assign.yul @@ -6,8 +6,9 @@ a := mload(4) mstore(a, 0) } +// ==== +// step: ssaAndBack // ---- -// ssaAndBack // { // pop(mload(0)) // pop(mload(1)) diff --git a/test/libyul/yulOptimizerTests/ssaAndBack/multi_assign_if.yul b/test/libyul/yulOptimizerTests/ssaAndBack/multi_assign_if.yul index fd5981efc..fcdb64437 100644 --- a/test/libyul/yulOptimizerTests/ssaAndBack/multi_assign_if.yul +++ b/test/libyul/yulOptimizerTests/ssaAndBack/multi_assign_if.yul @@ -8,8 +8,9 @@ } mstore(a, 0) } +// ==== +// step: ssaAndBack // ---- -// ssaAndBack // { // let a := mload(0) // if mload(1) diff --git a/test/libyul/yulOptimizerTests/ssaAndBack/multi_assign_multi_var_if.yul b/test/libyul/yulOptimizerTests/ssaAndBack/multi_assign_multi_var_if.yul index b0b3efb54..b6eb0b6cf 100644 --- a/test/libyul/yulOptimizerTests/ssaAndBack/multi_assign_multi_var_if.yul +++ b/test/libyul/yulOptimizerTests/ssaAndBack/multi_assign_multi_var_if.yul @@ -9,8 +9,9 @@ } mstore(a, b) } +// ==== +// step: ssaAndBack // ---- -// ssaAndBack // { // let a := mload(0) // let b := mload(1) diff --git a/test/libyul/yulOptimizerTests/ssaAndBack/multi_assign_multi_var_switch.yul b/test/libyul/yulOptimizerTests/ssaAndBack/multi_assign_multi_var_switch.yul index 50f56b870..e747e8503 100644 --- a/test/libyul/yulOptimizerTests/ssaAndBack/multi_assign_multi_var_switch.yul +++ b/test/libyul/yulOptimizerTests/ssaAndBack/multi_assign_multi_var_switch.yul @@ -16,8 +16,9 @@ } mstore(a, b) } +// ==== +// step: ssaAndBack // ---- -// ssaAndBack // { // let a := mload(0) // let b := mload(1) diff --git a/test/libyul/yulOptimizerTests/ssaAndBack/multi_assign_switch.yul b/test/libyul/yulOptimizerTests/ssaAndBack/multi_assign_switch.yul index 1efbbde75..024254525 100644 --- a/test/libyul/yulOptimizerTests/ssaAndBack/multi_assign_switch.yul +++ b/test/libyul/yulOptimizerTests/ssaAndBack/multi_assign_switch.yul @@ -13,8 +13,9 @@ } mstore(a, 0) } +// ==== +// step: ssaAndBack // ---- -// ssaAndBack // { // let a := mload(0) // switch mload(1) diff --git a/test/libyul/yulOptimizerTests/ssaAndBack/simple.yul b/test/libyul/yulOptimizerTests/ssaAndBack/simple.yul index 912940c50..dacbc4484 100644 --- a/test/libyul/yulOptimizerTests/ssaAndBack/simple.yul +++ b/test/libyul/yulOptimizerTests/ssaAndBack/simple.yul @@ -3,8 +3,9 @@ a := mload(1) mstore(a, 0) } +// ==== +// step: ssaAndBack // ---- -// ssaAndBack // { // pop(mload(0)) // let a_2 := mload(1) diff --git a/test/libyul/yulOptimizerTests/ssaAndBack/single_assign_if.yul b/test/libyul/yulOptimizerTests/ssaAndBack/single_assign_if.yul index 5185245cc..04faa44dc 100644 --- a/test/libyul/yulOptimizerTests/ssaAndBack/single_assign_if.yul +++ b/test/libyul/yulOptimizerTests/ssaAndBack/single_assign_if.yul @@ -6,8 +6,9 @@ } mstore(a, 0) } +// ==== +// step: ssaAndBack // ---- -// ssaAndBack // { // let a := mload(0) // if mload(1) diff --git a/test/libyul/yulOptimizerTests/ssaAndBack/single_assign_switch.yul b/test/libyul/yulOptimizerTests/ssaAndBack/single_assign_switch.yul index e0e53b3fe..d31fb549a 100644 --- a/test/libyul/yulOptimizerTests/ssaAndBack/single_assign_switch.yul +++ b/test/libyul/yulOptimizerTests/ssaAndBack/single_assign_switch.yul @@ -9,8 +9,9 @@ } mstore(a, 0) } +// ==== +// step: ssaAndBack // ---- -// ssaAndBack // { // let a := mload(0) // switch mload(1) diff --git a/test/libyul/yulOptimizerTests/ssaAndBack/ssaReverse.yul b/test/libyul/yulOptimizerTests/ssaAndBack/ssaReverse.yul index d2ba64715..f14b1fe32 100644 --- a/test/libyul/yulOptimizerTests/ssaAndBack/ssaReverse.yul +++ b/test/libyul/yulOptimizerTests/ssaAndBack/ssaReverse.yul @@ -20,8 +20,9 @@ let a,b := abi_decode_t_bytes_calldata_ptr(mload(0),mload(1)) mstore(a,b) } +// ==== +// step: ssaAndBack // ---- -// ssaAndBack // { // function abi_decode_t_bytes_calldata_ptr(offset_12, end_13) -> arrayPos_14, length_15 // { diff --git a/test/libyul/yulOptimizerTests/ssaAndBack/two_vars.yul b/test/libyul/yulOptimizerTests/ssaAndBack/two_vars.yul index 9f2a046e1..1c246a754 100644 --- a/test/libyul/yulOptimizerTests/ssaAndBack/two_vars.yul +++ b/test/libyul/yulOptimizerTests/ssaAndBack/two_vars.yul @@ -7,8 +7,9 @@ b := mload(a) mstore(a, b) } +// ==== +// step: ssaAndBack // ---- -// ssaAndBack // { // let a_1 := mload(0) // let b_2 := mload(a_1) diff --git a/test/libyul/yulOptimizerTests/ssaPlusCleanup/control_structures.yul b/test/libyul/yulOptimizerTests/ssaPlusCleanup/control_structures.yul index d2408343b..c1df9b032 100644 --- a/test/libyul/yulOptimizerTests/ssaPlusCleanup/control_structures.yul +++ b/test/libyul/yulOptimizerTests/ssaPlusCleanup/control_structures.yul @@ -9,8 +9,9 @@ } } } +// ==== +// step: ssaPlusCleanup // ---- -// ssaPlusCleanup // { // function copy(from, to) -> length // { diff --git a/test/libyul/yulOptimizerTests/ssaPlusCleanup/multi_reassign.yul b/test/libyul/yulOptimizerTests/ssaPlusCleanup/multi_reassign.yul index ddb33aa01..105970c3c 100644 --- a/test/libyul/yulOptimizerTests/ssaPlusCleanup/multi_reassign.yul +++ b/test/libyul/yulOptimizerTests/ssaPlusCleanup/multi_reassign.yul @@ -5,8 +5,9 @@ a := 4 mstore(0, a) } +// ==== +// step: ssaPlusCleanup // ---- -// ssaPlusCleanup // { // let a_1 := 1 // let a := a_1 diff --git a/test/libyul/yulOptimizerTests/ssaPlusCleanup/multi_reassign_with_use.yul b/test/libyul/yulOptimizerTests/ssaPlusCleanup/multi_reassign_with_use.yul index 67a6c5d3e..6770fee2b 100644 --- a/test/libyul/yulOptimizerTests/ssaPlusCleanup/multi_reassign_with_use.yul +++ b/test/libyul/yulOptimizerTests/ssaPlusCleanup/multi_reassign_with_use.yul @@ -5,8 +5,9 @@ a := mload(add(a, 4)) mstore(0, a) } +// ==== +// step: ssaPlusCleanup // ---- -// ssaPlusCleanup // { // let a_1 := 1 // let a := a_1 diff --git a/test/libyul/yulOptimizerTests/ssaReverser/abi_example.yul b/test/libyul/yulOptimizerTests/ssaReverser/abi_example.yul index 923a42ba6..32e05ad35 100644 --- a/test/libyul/yulOptimizerTests/ssaReverser/abi_example.yul +++ b/test/libyul/yulOptimizerTests/ssaReverser/abi_example.yul @@ -19,8 +19,9 @@ } } } +// ==== +// step: ssaReverser // ---- -// ssaReverser // { // function abi_decode_t_bytes_calldata_ptr(offset_12, end_13) -> arrayPos_14, length_15 // { diff --git a/test/libyul/yulOptimizerTests/ssaReverser/simple.yul b/test/libyul/yulOptimizerTests/ssaReverser/simple.yul index eba1f5f18..03dab25f9 100644 --- a/test/libyul/yulOptimizerTests/ssaReverser/simple.yul +++ b/test/libyul/yulOptimizerTests/ssaReverser/simple.yul @@ -4,8 +4,9 @@ a := a_1 mstore(a_1, 0) } +// ==== +// step: ssaReverser // ---- -// ssaReverser // { // let a := mload(1) // a := mload(0) diff --git a/test/libyul/yulOptimizerTests/ssaTransform/branches.yul b/test/libyul/yulOptimizerTests/ssaTransform/branches.yul index c089fe708..c2fc3c774 100644 --- a/test/libyul/yulOptimizerTests/ssaTransform/branches.yul +++ b/test/libyul/yulOptimizerTests/ssaTransform/branches.yul @@ -7,8 +7,9 @@ a := add(a, 1) mstore(a, 1) } +// ==== +// step: ssaTransform // ---- -// ssaTransform // { // let a_1 := 1 // let a := a_1 diff --git a/test/libyul/yulOptimizerTests/ssaTransform/for_reassign_body.yul b/test/libyul/yulOptimizerTests/ssaTransform/for_reassign_body.yul index 416403465..b16257401 100644 --- a/test/libyul/yulOptimizerTests/ssaTransform/for_reassign_body.yul +++ b/test/libyul/yulOptimizerTests/ssaTransform/for_reassign_body.yul @@ -6,8 +6,9 @@ } mstore(0, a) } +// ==== +// step: ssaTransform // ---- -// ssaTransform // { // let a_1 := mload(0) // let a := a_1 diff --git a/test/libyul/yulOptimizerTests/ssaTransform/for_reassign_init.yul b/test/libyul/yulOptimizerTests/ssaTransform/for_reassign_init.yul index 821a5b2a6..8796453d0 100644 --- a/test/libyul/yulOptimizerTests/ssaTransform/for_reassign_init.yul +++ b/test/libyul/yulOptimizerTests/ssaTransform/for_reassign_init.yul @@ -6,8 +6,9 @@ } mstore(0, a) } +// ==== +// step: ssaTransform // ---- -// ssaTransform // { // let a_1 := mload(0) // let a := a_1 diff --git a/test/libyul/yulOptimizerTests/ssaTransform/for_reassign_post.yul b/test/libyul/yulOptimizerTests/ssaTransform/for_reassign_post.yul index 1fc075bc1..cd34f2c8d 100644 --- a/test/libyul/yulOptimizerTests/ssaTransform/for_reassign_post.yul +++ b/test/libyul/yulOptimizerTests/ssaTransform/for_reassign_post.yul @@ -6,8 +6,9 @@ } mstore(0, a) } +// ==== +// step: ssaTransform // ---- -// ssaTransform // { // let a_1 := mload(0) // let a := a_1 diff --git a/test/libyul/yulOptimizerTests/ssaTransform/for_simple.yul b/test/libyul/yulOptimizerTests/ssaTransform/for_simple.yul index 273d3811a..d5e1a5404 100644 --- a/test/libyul/yulOptimizerTests/ssaTransform/for_simple.yul +++ b/test/libyul/yulOptimizerTests/ssaTransform/for_simple.yul @@ -13,8 +13,9 @@ } a := add(a, 8) } +// ==== +// step: ssaTransform // ---- -// ssaTransform // { // let a_1 := mload(0) // let a := a_1 diff --git a/test/libyul/yulOptimizerTests/ssaTransform/function.yul b/test/libyul/yulOptimizerTests/ssaTransform/function.yul index 995d16cc7..16f5b03cd 100644 --- a/test/libyul/yulOptimizerTests/ssaTransform/function.yul +++ b/test/libyul/yulOptimizerTests/ssaTransform/function.yul @@ -6,8 +6,9 @@ a := add(a, d) } } +// ==== +// step: ssaTransform // ---- -// ssaTransform // { // function f(a, b) -> c, d // { diff --git a/test/libyul/yulOptimizerTests/ssaTransform/nested.yul b/test/libyul/yulOptimizerTests/ssaTransform/nested.yul index 49a769537..7f3af38c2 100644 --- a/test/libyul/yulOptimizerTests/ssaTransform/nested.yul +++ b/test/libyul/yulOptimizerTests/ssaTransform/nested.yul @@ -10,8 +10,9 @@ } a := add(b, a) } +// ==== +// step: ssaTransform // ---- -// ssaTransform // { // let a_1 := 1 // let a := a_1 diff --git a/test/libyul/yulOptimizerTests/ssaTransform/notransform.yul b/test/libyul/yulOptimizerTests/ssaTransform/notransform.yul index 297905c60..f42de9976 100644 --- a/test/libyul/yulOptimizerTests/ssaTransform/notransform.yul +++ b/test/libyul/yulOptimizerTests/ssaTransform/notransform.yul @@ -6,8 +6,9 @@ mstore(c, 0) c := add(a, b) } +// ==== +// step: ssaTransform // ---- -// ssaTransform // { // let a := 1 // let b := add(a, 2) diff --git a/test/libyul/yulOptimizerTests/ssaTransform/simple.yul b/test/libyul/yulOptimizerTests/ssaTransform/simple.yul index 6dbce7292..d23d07d82 100644 --- a/test/libyul/yulOptimizerTests/ssaTransform/simple.yul +++ b/test/libyul/yulOptimizerTests/ssaTransform/simple.yul @@ -4,8 +4,9 @@ a := 3 a := 4 } +// ==== +// step: ssaTransform // ---- -// ssaTransform // { // let a_1 := 1 // let a := a_1 diff --git a/test/libyul/yulOptimizerTests/ssaTransform/switch.yul b/test/libyul/yulOptimizerTests/ssaTransform/switch.yul index bc9b55bbb..404736923 100644 --- a/test/libyul/yulOptimizerTests/ssaTransform/switch.yul +++ b/test/libyul/yulOptimizerTests/ssaTransform/switch.yul @@ -8,8 +8,9 @@ default { a := add(a, 8) } mstore(0, a) } +// ==== +// step: ssaTransform // ---- -// ssaTransform // { // let a_1 := mload(0) // let a := a_1 diff --git a/test/libyul/yulOptimizerTests/ssaTransform/used.yul b/test/libyul/yulOptimizerTests/ssaTransform/used.yul index ad686ca11..ef104512b 100644 --- a/test/libyul/yulOptimizerTests/ssaTransform/used.yul +++ b/test/libyul/yulOptimizerTests/ssaTransform/used.yul @@ -14,8 +14,9 @@ a := 4 mstore(a, 0) } +// ==== +// step: ssaTransform // ---- -// ssaTransform // { // let a_1 := 1 // let a := a_1 diff --git a/test/libyul/yulOptimizerTests/stackCompressor/inlineInBlock.yul b/test/libyul/yulOptimizerTests/stackCompressor/inlineInBlock.yul index 4e594eee4..6c0ceef63 100644 --- a/test/libyul/yulOptimizerTests/stackCompressor/inlineInBlock.yul +++ b/test/libyul/yulOptimizerTests/stackCompressor/inlineInBlock.yul @@ -3,8 +3,9 @@ let y := calldataload(calldataload(9)) mstore(y, add(add(add(add(add(add(add(add(add(add(add(add(add(add(add(add(add(add(y, 1), 1), 1), 1), 1), 1), 1), 1), 1), 1), 1), 1), 1), 1), 1), 1), 1), 1)) } +// ==== +// step: stackCompressor // ---- -// stackCompressor // { // mstore(calldataload(calldataload(9)), add(add(add(add(add(add(add(add(add(add(add(add(add(add(add(add(add(add(calldataload(calldataload(9)), 1), 1), 1), 1), 1), 1), 1), 1), 1), 1), 1), 1), 1), 1), 1), 1), 1), 1)) // } diff --git a/test/libyul/yulOptimizerTests/stackCompressor/inlineInFunction.yul b/test/libyul/yulOptimizerTests/stackCompressor/inlineInFunction.yul index fc89a8f77..e74e788aa 100644 --- a/test/libyul/yulOptimizerTests/stackCompressor/inlineInFunction.yul +++ b/test/libyul/yulOptimizerTests/stackCompressor/inlineInFunction.yul @@ -5,8 +5,9 @@ mstore(y, add(add(add(add(add(add(add(add(add(add(add(add(add(add(add(add(add(add(y, 1), 1), 1), 1), 1), 1), 1), 1), 1), 1), 1), 1), 1), 1), 1), 1), 1), 1)) } } +// ==== +// step: stackCompressor // ---- -// stackCompressor // { // let x := 8 // function f() diff --git a/test/libyul/yulOptimizerTests/stackCompressor/noInline.yul b/test/libyul/yulOptimizerTests/stackCompressor/noInline.yul index d35726934..e70bb9dc3 100644 --- a/test/libyul/yulOptimizerTests/stackCompressor/noInline.yul +++ b/test/libyul/yulOptimizerTests/stackCompressor/noInline.yul @@ -2,8 +2,9 @@ let x := 8 function f() { let y := 9 } } +// ==== +// step: stackCompressor // ---- -// stackCompressor // { // let x := 8 // function f() diff --git a/test/libyul/yulOptimizerTests/structuralSimplifier/bugfix_visit_after_change.yul b/test/libyul/yulOptimizerTests/structuralSimplifier/bugfix_visit_after_change.yul index a68984b8b..4f4d445ac 100644 --- a/test/libyul/yulOptimizerTests/structuralSimplifier/bugfix_visit_after_change.yul +++ b/test/libyul/yulOptimizerTests/structuralSimplifier/bugfix_visit_after_change.yul @@ -6,8 +6,9 @@ x := 1 } } +// ==== +// step: structuralSimplifier // ---- -// structuralSimplifier // { // let x := 0 // } diff --git a/test/libyul/yulOptimizerTests/structuralSimplifier/empty_if_movable_condition.yul b/test/libyul/yulOptimizerTests/structuralSimplifier/empty_if_movable_condition.yul index ee1975e71..98adbb596 100644 --- a/test/libyul/yulOptimizerTests/structuralSimplifier/empty_if_movable_condition.yul +++ b/test/libyul/yulOptimizerTests/structuralSimplifier/empty_if_movable_condition.yul @@ -1,6 +1,7 @@ { let a := mload(0) if a {} } +// ==== +// step: structuralSimplifier // ---- -// structuralSimplifier // { // let a := mload(0) // pop(a) diff --git a/test/libyul/yulOptimizerTests/structuralSimplifier/empty_if_non_movable_condition.yul b/test/libyul/yulOptimizerTests/structuralSimplifier/empty_if_non_movable_condition.yul index 5977297be..70257e03a 100644 --- a/test/libyul/yulOptimizerTests/structuralSimplifier/empty_if_non_movable_condition.yul +++ b/test/libyul/yulOptimizerTests/structuralSimplifier/empty_if_non_movable_condition.yul @@ -1,6 +1,7 @@ { if mload(0) {} } +// ==== +// step: structuralSimplifier // ---- -// structuralSimplifier // { // pop(mload(0)) // } diff --git a/test/libyul/yulOptimizerTests/structuralSimplifier/for_false_condition.sol b/test/libyul/yulOptimizerTests/structuralSimplifier/for_false_condition.sol index b881a0a30..5c4faebf2 100644 --- a/test/libyul/yulOptimizerTests/structuralSimplifier/for_false_condition.sol +++ b/test/libyul/yulOptimizerTests/structuralSimplifier/for_false_condition.sol @@ -3,8 +3,9 @@ let b := a } } +// ==== +// step: structuralSimplifier // ---- -// structuralSimplifier // { // let a := 42 // } diff --git a/test/libyul/yulOptimizerTests/structuralSimplifier/if_false_condition.yul b/test/libyul/yulOptimizerTests/structuralSimplifier/if_false_condition.yul index 0895b1bbd..59dbcaf2c 100644 --- a/test/libyul/yulOptimizerTests/structuralSimplifier/if_false_condition.yul +++ b/test/libyul/yulOptimizerTests/structuralSimplifier/if_false_condition.yul @@ -1,5 +1,6 @@ { if 0 { mstore(0, 0) } } +// ==== +// step: structuralSimplifier // ---- -// structuralSimplifier // { // } diff --git a/test/libyul/yulOptimizerTests/structuralSimplifier/if_multi_unassigned_condition.yul b/test/libyul/yulOptimizerTests/structuralSimplifier/if_multi_unassigned_condition.yul index 0ece5dbdb..efd21db5f 100644 --- a/test/libyul/yulOptimizerTests/structuralSimplifier/if_multi_unassigned_condition.yul +++ b/test/libyul/yulOptimizerTests/structuralSimplifier/if_multi_unassigned_condition.yul @@ -3,8 +3,9 @@ if x { mstore(0, 0) } if y { mstore(0, 0) } } +// ==== +// step: structuralSimplifier // ---- -// structuralSimplifier // { // let x, y // } diff --git a/test/libyul/yulOptimizerTests/structuralSimplifier/if_true_condition.yul b/test/libyul/yulOptimizerTests/structuralSimplifier/if_true_condition.yul index ca9cba06d..962eff9e2 100644 --- a/test/libyul/yulOptimizerTests/structuralSimplifier/if_true_condition.yul +++ b/test/libyul/yulOptimizerTests/structuralSimplifier/if_true_condition.yul @@ -1,6 +1,7 @@ { if 1 { mstore(0, 0) } } +// ==== +// step: structuralSimplifier // ---- -// structuralSimplifier // { // mstore(0, 0) // } diff --git a/test/libyul/yulOptimizerTests/structuralSimplifier/if_unassigned_condition.yul b/test/libyul/yulOptimizerTests/structuralSimplifier/if_unassigned_condition.yul index a327a8829..aefdb7869 100644 --- a/test/libyul/yulOptimizerTests/structuralSimplifier/if_unassigned_condition.yul +++ b/test/libyul/yulOptimizerTests/structuralSimplifier/if_unassigned_condition.yul @@ -2,8 +2,9 @@ let x if x { mstore(0, 0) } } +// ==== +// step: structuralSimplifier // ---- -// structuralSimplifier // { // let x // } diff --git a/test/libyul/yulOptimizerTests/structuralSimplifier/nested.yul b/test/libyul/yulOptimizerTests/structuralSimplifier/nested.yul index 169a84d1d..5fe6bdce4 100644 --- a/test/libyul/yulOptimizerTests/structuralSimplifier/nested.yul +++ b/test/libyul/yulOptimizerTests/structuralSimplifier/nested.yul @@ -1,6 +1,7 @@ { if 1 { if 1 { for { mstore(0, 0) } 0 {} { mstore(2, 3) } if 0 { mstore(1, 2) } } } } +// ==== +// step: structuralSimplifier // ---- -// structuralSimplifier // { // mstore(0, 0) // } diff --git a/test/libyul/yulOptimizerTests/structuralSimplifier/switch_inline.yul b/test/libyul/yulOptimizerTests/structuralSimplifier/switch_inline.yul index bca6d481c..2476afc94 100644 --- a/test/libyul/yulOptimizerTests/structuralSimplifier/switch_inline.yul +++ b/test/libyul/yulOptimizerTests/structuralSimplifier/switch_inline.yul @@ -4,8 +4,9 @@ case 0 { y := 8 } case 1 { y := 9 } } +// ==== +// step: structuralSimplifier // ---- -// structuralSimplifier // { // let y := 200 // { diff --git a/test/libyul/yulOptimizerTests/structuralSimplifier/switch_inline_match_default.yul b/test/libyul/yulOptimizerTests/structuralSimplifier/switch_inline_match_default.yul index 5ffcf16a5..edc9cb379 100644 --- a/test/libyul/yulOptimizerTests/structuralSimplifier/switch_inline_match_default.yul +++ b/test/libyul/yulOptimizerTests/structuralSimplifier/switch_inline_match_default.yul @@ -5,8 +5,9 @@ case 1 { y := 9 } default { y := 10 } } +// ==== +// step: structuralSimplifier // ---- -// structuralSimplifier // { // let y := 200 // { diff --git a/test/libyul/yulOptimizerTests/structuralSimplifier/switch_inline_no_match.yul b/test/libyul/yulOptimizerTests/structuralSimplifier/switch_inline_no_match.yul index 2006b49c7..04b473600 100644 --- a/test/libyul/yulOptimizerTests/structuralSimplifier/switch_inline_no_match.yul +++ b/test/libyul/yulOptimizerTests/structuralSimplifier/switch_inline_no_match.yul @@ -4,8 +4,9 @@ case 0 { y := 8 } case 1 { y := 9 } } +// ==== +// step: structuralSimplifier // ---- -// structuralSimplifier // { // let y := 200 // } diff --git a/test/libyul/yulOptimizerTests/structuralSimplifier/switch_inline_no_match_mixed.yul b/test/libyul/yulOptimizerTests/structuralSimplifier/switch_inline_no_match_mixed.yul index 8d90ca1f0..9c9fd5eba 100644 --- a/test/libyul/yulOptimizerTests/structuralSimplifier/switch_inline_no_match_mixed.yul +++ b/test/libyul/yulOptimizerTests/structuralSimplifier/switch_inline_no_match_mixed.yul @@ -5,8 +5,9 @@ case "" { y := 8 } case 1 { y := 9 } } +// ==== +// step: structuralSimplifier // ---- -// structuralSimplifier // { // let y := 200 // } diff --git a/test/libyul/yulOptimizerTests/structuralSimplifier/switch_no_remove_empty_case.yul b/test/libyul/yulOptimizerTests/structuralSimplifier/switch_no_remove_empty_case.yul index f6e99cd48..a09a5510b 100644 --- a/test/libyul/yulOptimizerTests/structuralSimplifier/switch_no_remove_empty_case.yul +++ b/test/libyul/yulOptimizerTests/structuralSimplifier/switch_no_remove_empty_case.yul @@ -5,8 +5,9 @@ case 1 { y := 9 } default { y := 100 } } +// ==== +// step: structuralSimplifier // ---- -// structuralSimplifier // { // let y := 200 // switch calldataload(0) diff --git a/test/libyul/yulOptimizerTests/structuralSimplifier/switch_only_default.yul b/test/libyul/yulOptimizerTests/structuralSimplifier/switch_only_default.yul index 7ca815a70..a9f3aea69 100644 --- a/test/libyul/yulOptimizerTests/structuralSimplifier/switch_only_default.yul +++ b/test/libyul/yulOptimizerTests/structuralSimplifier/switch_only_default.yul @@ -1,8 +1,9 @@ { switch mload(0) default { mstore(1, 2) } } +// ==== +// step: structuralSimplifier // ---- -// structuralSimplifier // { // pop(mload(0)) // { diff --git a/test/libyul/yulOptimizerTests/structuralSimplifier/switch_remove_empty_all.yul b/test/libyul/yulOptimizerTests/structuralSimplifier/switch_remove_empty_all.yul index 14043b2d0..d8febde88 100644 --- a/test/libyul/yulOptimizerTests/structuralSimplifier/switch_remove_empty_all.yul +++ b/test/libyul/yulOptimizerTests/structuralSimplifier/switch_remove_empty_all.yul @@ -10,8 +10,9 @@ case 1 { } default { } } +// ==== +// step: structuralSimplifier // ---- -// structuralSimplifier // { // let y := 200 // pop(add(y, 4)) diff --git a/test/libyul/yulOptimizerTests/structuralSimplifier/switch_remove_empty_case.yul b/test/libyul/yulOptimizerTests/structuralSimplifier/switch_remove_empty_case.yul index f1a09eb8a..9cbae83ba 100644 --- a/test/libyul/yulOptimizerTests/structuralSimplifier/switch_remove_empty_case.yul +++ b/test/libyul/yulOptimizerTests/structuralSimplifier/switch_remove_empty_case.yul @@ -5,8 +5,9 @@ case 1 { y := 9 } case 2 { y := 10 } } +// ==== +// step: structuralSimplifier // ---- -// structuralSimplifier // { // let y := 200 // switch calldataload(0) diff --git a/test/libyul/yulOptimizerTests/structuralSimplifier/switch_remove_empty_cases.yul b/test/libyul/yulOptimizerTests/structuralSimplifier/switch_remove_empty_cases.yul index d90a0e173..5ffdcb1ee 100644 --- a/test/libyul/yulOptimizerTests/structuralSimplifier/switch_remove_empty_cases.yul +++ b/test/libyul/yulOptimizerTests/structuralSimplifier/switch_remove_empty_cases.yul @@ -5,8 +5,9 @@ case 1 { y := 9 } default { } } +// ==== +// step: structuralSimplifier // ---- -// structuralSimplifier // { // let y := 200 // if eq(1, calldataload(0)) diff --git a/test/libyul/yulOptimizerTests/structuralSimplifier/switch_remove_empty_default_case.yul b/test/libyul/yulOptimizerTests/structuralSimplifier/switch_remove_empty_default_case.yul index 158cd013e..1c9f64a21 100644 --- a/test/libyul/yulOptimizerTests/structuralSimplifier/switch_remove_empty_default_case.yul +++ b/test/libyul/yulOptimizerTests/structuralSimplifier/switch_remove_empty_default_case.yul @@ -5,8 +5,9 @@ case 2 { y := 10 } default { } } +// ==== +// step: structuralSimplifier // ---- -// structuralSimplifier // { // let y := 200 // switch calldataload(0) diff --git a/test/libyul/yulOptimizerTests/structuralSimplifier/switch_to_if.yul b/test/libyul/yulOptimizerTests/structuralSimplifier/switch_to_if.yul index e015dc1f3..97a4ab181 100644 --- a/test/libyul/yulOptimizerTests/structuralSimplifier/switch_to_if.yul +++ b/test/libyul/yulOptimizerTests/structuralSimplifier/switch_to_if.yul @@ -1,8 +1,9 @@ { switch calldataload(0) case 2 { mstore(0, 0) } } +// ==== +// step: structuralSimplifier // ---- -// structuralSimplifier // { // if eq(2, calldataload(0)) // { diff --git a/test/libyul/yulOptimizerTests/unusedPruner/functions.yul b/test/libyul/yulOptimizerTests/unusedPruner/functions.yul index ec9cdda83..44a15b152 100644 --- a/test/libyul/yulOptimizerTests/unusedPruner/functions.yul +++ b/test/libyul/yulOptimizerTests/unusedPruner/functions.yul @@ -2,7 +2,8 @@ function f() { let a := 1 } function g() { f() } } +// ==== +// step: unusedPruner // ---- -// unusedPruner // { // } diff --git a/test/libyul/yulOptimizerTests/unusedPruner/intermediate_assignment.yul b/test/libyul/yulOptimizerTests/unusedPruner/intermediate_assignment.yul index 4ed6dd2c5..1c1397061 100644 --- a/test/libyul/yulOptimizerTests/unusedPruner/intermediate_assignment.yul +++ b/test/libyul/yulOptimizerTests/unusedPruner/intermediate_assignment.yul @@ -3,8 +3,9 @@ a := 4 let b := 1 } +// ==== +// step: unusedPruner // ---- -// unusedPruner // { // let a := 1 // a := 4 diff --git a/test/libyul/yulOptimizerTests/unusedPruner/intermediate_multi_assignment.yul b/test/libyul/yulOptimizerTests/unusedPruner/intermediate_multi_assignment.yul index 94d101e9b..744c58df6 100644 --- a/test/libyul/yulOptimizerTests/unusedPruner/intermediate_multi_assignment.yul +++ b/test/libyul/yulOptimizerTests/unusedPruner/intermediate_multi_assignment.yul @@ -4,8 +4,9 @@ a := f() b := 1 } +// ==== +// step: unusedPruner // ---- -// unusedPruner // { // let a, b // function f() -> x diff --git a/test/libyul/yulOptimizerTests/unusedPruner/multi_assign.yul b/test/libyul/yulOptimizerTests/unusedPruner/multi_assign.yul index a14dc28ce..35120111b 100644 --- a/test/libyul/yulOptimizerTests/unusedPruner/multi_assign.yul +++ b/test/libyul/yulOptimizerTests/unusedPruner/multi_assign.yul @@ -4,8 +4,9 @@ function f() -> x, y { } a, b := f() } +// ==== +// step: unusedPruner // ---- -// unusedPruner // { // let a // let b diff --git a/test/libyul/yulOptimizerTests/unusedPruner/multi_assignments.yul b/test/libyul/yulOptimizerTests/unusedPruner/multi_assignments.yul index fe94edb8f..01e573199 100644 --- a/test/libyul/yulOptimizerTests/unusedPruner/multi_assignments.yul +++ b/test/libyul/yulOptimizerTests/unusedPruner/multi_assignments.yul @@ -3,8 +3,9 @@ x := 1 y := 2 } +// ==== +// step: unusedPruner // ---- -// unusedPruner // { // let x, y // x := 1 diff --git a/test/libyul/yulOptimizerTests/unusedPruner/multi_declarations.yul b/test/libyul/yulOptimizerTests/unusedPruner/multi_declarations.yul index 3cf35007b..c7a8285de 100644 --- a/test/libyul/yulOptimizerTests/unusedPruner/multi_declarations.yul +++ b/test/libyul/yulOptimizerTests/unusedPruner/multi_declarations.yul @@ -1,7 +1,8 @@ { let x, y } +// ==== +// step: unusedPruner // ---- -// unusedPruner // { // } diff --git a/test/libyul/yulOptimizerTests/unusedPruner/multi_declare.yul b/test/libyul/yulOptimizerTests/unusedPruner/multi_declare.yul index adabac87b..afa27ea8a 100644 --- a/test/libyul/yulOptimizerTests/unusedPruner/multi_declare.yul +++ b/test/libyul/yulOptimizerTests/unusedPruner/multi_declare.yul @@ -2,8 +2,9 @@ function f() -> x, y { } let a, b := f() } +// ==== +// step: unusedPruner // ---- -// unusedPruner // { // function f() -> x, y // { diff --git a/test/libyul/yulOptimizerTests/unusedPruner/multi_partial_assignments.yul b/test/libyul/yulOptimizerTests/unusedPruner/multi_partial_assignments.yul index 5db0ade9a..67d692f70 100644 --- a/test/libyul/yulOptimizerTests/unusedPruner/multi_partial_assignments.yul +++ b/test/libyul/yulOptimizerTests/unusedPruner/multi_partial_assignments.yul @@ -2,8 +2,9 @@ let x, y x := 1 } +// ==== +// step: unusedPruner // ---- -// unusedPruner // { // let x, y // x := 1 diff --git a/test/libyul/yulOptimizerTests/unusedPruner/pop.yul b/test/libyul/yulOptimizerTests/unusedPruner/pop.yul index 542070f9f..76cb497b6 100644 --- a/test/libyul/yulOptimizerTests/unusedPruner/pop.yul +++ b/test/libyul/yulOptimizerTests/unusedPruner/pop.yul @@ -2,7 +2,8 @@ let a := 1 pop(a) } +// ==== +// step: unusedPruner // ---- -// unusedPruner // { // } diff --git a/test/libyul/yulOptimizerTests/unusedPruner/smoke.yul b/test/libyul/yulOptimizerTests/unusedPruner/smoke.yul index ca2ed9422..c29765b3d 100644 --- a/test/libyul/yulOptimizerTests/unusedPruner/smoke.yul +++ b/test/libyul/yulOptimizerTests/unusedPruner/smoke.yul @@ -1,5 +1,6 @@ { } +// ==== +// step: unusedPruner // ---- -// unusedPruner // { // } diff --git a/test/libyul/yulOptimizerTests/unusedPruner/trivial.yul b/test/libyul/yulOptimizerTests/unusedPruner/trivial.yul index 9b4cf9fdb..1297b2633 100644 --- a/test/libyul/yulOptimizerTests/unusedPruner/trivial.yul +++ b/test/libyul/yulOptimizerTests/unusedPruner/trivial.yul @@ -3,8 +3,9 @@ let b := 1 mstore(0, 1) } +// ==== +// step: unusedPruner // ---- -// unusedPruner // { // mstore(0, 1) // } diff --git a/test/libyul/yulOptimizerTests/varDeclInitializer/ambiguous.yul b/test/libyul/yulOptimizerTests/varDeclInitializer/ambiguous.yul index 5e2d60c25..054d0b53c 100644 --- a/test/libyul/yulOptimizerTests/varDeclInitializer/ambiguous.yul +++ b/test/libyul/yulOptimizerTests/varDeclInitializer/ambiguous.yul @@ -11,8 +11,9 @@ let b := 2 let x, y := f() } +// ==== +// step: varDeclInitializer // ---- -// varDeclInitializer // { // function f() -> x, y // { diff --git a/test/libyul/yulOptimizerTests/varDeclInitializer/inside_func.yul b/test/libyul/yulOptimizerTests/varDeclInitializer/inside_func.yul index 16428d7e9..f9510e32f 100644 --- a/test/libyul/yulOptimizerTests/varDeclInitializer/inside_func.yul +++ b/test/libyul/yulOptimizerTests/varDeclInitializer/inside_func.yul @@ -8,8 +8,9 @@ let r r := 4 } +// ==== +// step: varDeclInitializer // ---- -// varDeclInitializer // { // function f() -> x, y // { diff --git a/test/libyul/yulOptimizerTests/varDeclInitializer/multi.yul b/test/libyul/yulOptimizerTests/varDeclInitializer/multi.yul index 02d731aff..4911a6bd2 100644 --- a/test/libyul/yulOptimizerTests/varDeclInitializer/multi.yul +++ b/test/libyul/yulOptimizerTests/varDeclInitializer/multi.yul @@ -3,8 +3,9 @@ let a let b } +// ==== +// step: varDeclInitializer // ---- -// varDeclInitializer // { // let x := 0 // let y := 0 diff --git a/test/libyul/yulOptimizerTests/varDeclInitializer/multi_assign.yul b/test/libyul/yulOptimizerTests/varDeclInitializer/multi_assign.yul index 2e14fe707..fac0eaa06 100644 --- a/test/libyul/yulOptimizerTests/varDeclInitializer/multi_assign.yul +++ b/test/libyul/yulOptimizerTests/varDeclInitializer/multi_assign.yul @@ -7,8 +7,9 @@ let s := 3 let t } +// ==== +// step: varDeclInitializer // ---- -// varDeclInitializer // { // function f() -> x, y // { diff --git a/test/libyul/yulOptimizerTests/varDeclInitializer/simple.yul b/test/libyul/yulOptimizerTests/varDeclInitializer/simple.yul index 2a9bbe42c..819081fc1 100644 --- a/test/libyul/yulOptimizerTests/varDeclInitializer/simple.yul +++ b/test/libyul/yulOptimizerTests/varDeclInitializer/simple.yul @@ -1,8 +1,9 @@ { let a } +// ==== +// step: varDeclInitializer // ---- -// varDeclInitializer // { // let a := 0 // } diff --git a/test/libyul/yulOptimizerTests/varNameCleaner/builtins.yul b/test/libyul/yulOptimizerTests/varNameCleaner/builtins.yul index f72203714..af7d62ccc 100644 --- a/test/libyul/yulOptimizerTests/varNameCleaner/builtins.yul +++ b/test/libyul/yulOptimizerTests/varNameCleaner/builtins.yul @@ -1,8 +1,9 @@ { let datasize_256 := 1 } +// ==== +// step: varNameCleaner // ---- -// varNameCleaner // { // let datasize_1 := 1 // } diff --git a/test/libyul/yulOptimizerTests/varNameCleaner/function_names.yul b/test/libyul/yulOptimizerTests/varNameCleaner/function_names.yul index c336cd813..f4f2b76c8 100644 --- a/test/libyul/yulOptimizerTests/varNameCleaner/function_names.yul +++ b/test/libyul/yulOptimizerTests/varNameCleaner/function_names.yul @@ -3,8 +3,9 @@ function f() { let f_1 } let f_10 } +// ==== +// step: varNameCleaner // ---- -// varNameCleaner // { // let f_1 // function f() diff --git a/test/libyul/yulOptimizerTests/varNameCleaner/function_parameters.yul b/test/libyul/yulOptimizerTests/varNameCleaner/function_parameters.yul index 510efddd0..6f1d1817c 100644 --- a/test/libyul/yulOptimizerTests/varNameCleaner/function_parameters.yul +++ b/test/libyul/yulOptimizerTests/varNameCleaner/function_parameters.yul @@ -8,8 +8,9 @@ } let f_10 } +// ==== +// step: varNameCleaner // ---- -// varNameCleaner // { // let f_1 // function f(x) -> x_1, y diff --git a/test/libyul/yulOptimizerTests/varNameCleaner/function_scopes.yul b/test/libyul/yulOptimizerTests/varNameCleaner/function_scopes.yul index 8afd8e5e1..866e7a3df 100644 --- a/test/libyul/yulOptimizerTests/varNameCleaner/function_scopes.yul +++ b/test/libyul/yulOptimizerTests/varNameCleaner/function_scopes.yul @@ -2,8 +2,9 @@ function f() { let x_1 := 0 } function g() { let x_2 := 0 } } +// ==== +// step: varNameCleaner // ---- -// varNameCleaner // { // function f() // { diff --git a/test/libyul/yulOptimizerTests/varNameCleaner/name_stripping.yul b/test/libyul/yulOptimizerTests/varNameCleaner/name_stripping.yul index f3e0b789d..4104c9567 100644 --- a/test/libyul/yulOptimizerTests/varNameCleaner/name_stripping.yul +++ b/test/libyul/yulOptimizerTests/varNameCleaner/name_stripping.yul @@ -4,8 +4,9 @@ let a_4312 := 0xdeadbeef let _42 := 21718 } +// ==== +// step: varNameCleaner // ---- -// varNameCleaner // { // let a := 1 // let a_1 := 2 diff --git a/test/libyul/yulOptimizerTests/varNameCleaner/reshuffling-inverse.yul b/test/libyul/yulOptimizerTests/varNameCleaner/reshuffling-inverse.yul index 6818a88f3..d96a7b0be 100644 --- a/test/libyul/yulOptimizerTests/varNameCleaner/reshuffling-inverse.yul +++ b/test/libyul/yulOptimizerTests/varNameCleaner/reshuffling-inverse.yul @@ -4,8 +4,9 @@ let x_2 := 3 let x_1 := 4 } +// ==== +// step: varNameCleaner // ---- -// varNameCleaner // { // let x := 1 // let x_1 := 2 diff --git a/test/libyul/yulOptimizerTests/varNameCleaner/reshuffling.yul b/test/libyul/yulOptimizerTests/varNameCleaner/reshuffling.yul index 40898b78f..e1132ad8b 100644 --- a/test/libyul/yulOptimizerTests/varNameCleaner/reshuffling.yul +++ b/test/libyul/yulOptimizerTests/varNameCleaner/reshuffling.yul @@ -3,8 +3,9 @@ let x_2 := 2 let x_3 := 3 } +// ==== +// step: varNameCleaner // ---- -// varNameCleaner // { // let x := 1 // let x_1 := 2 diff --git a/test/tools/isoltest.cpp b/test/tools/isoltest.cpp index 1269f5e80..efc319871 100644 --- a/test/tools/isoltest.cpp +++ b/test/tools/isoltest.cpp @@ -126,7 +126,7 @@ TestTool::Result TestTool::process() try { m_test = m_testCaseCreator(TestCase::Config{m_path.string(), m_ipcPath, m_evmVersion}); - if (m_test->supportedForEVMVersion(m_evmVersion)) + if (m_test->validateSettings(m_evmVersion)) success = m_test->run(outputMessages, " ", m_formatted); else { @@ -164,6 +164,7 @@ TestTool::Result TestTool::process() AnsiColorized(cout, m_formatted, {BOLD, CYAN}) << " Contract:" << endl; m_test->printSource(cout, " ", m_formatted); + m_test->printUpdatedSettings(cout, " ", m_formatted); cout << endl << outputMessages.str() << endl; return Result::Failure; @@ -193,6 +194,7 @@ TestTool::Request TestTool::handleResponse(bool _exception) cout << endl; ofstream file(m_path.string(), ios::trunc); m_test->printSource(file); + m_test->printUpdatedSettings(file); file << "// ----" << endl; m_test->printUpdatedExpectations(file, "// "); return Request::Rerun;