From 40aad416cfe76095d9b216093996cdcaaa6b7f17 Mon Sep 17 00:00:00 2001 From: rodiazet Date: Mon, 3 Feb 2025 11:54:12 +0100 Subject: [PATCH 1/2] Enable default test running for EOF --- test/TestCase.cpp | 2 +- test/libsolidity/SemanticTest.cpp | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/test/TestCase.cpp b/test/TestCase.cpp index 9505a2caafe5..104bd1bdeefb 100644 --- a/test/TestCase.cpp +++ b/test/TestCase.cpp @@ -150,7 +150,7 @@ void EVMVersionRestrictedTestCase::processBytecodeFormatSetting() // EOF only available since Prague solAssert(!eofVersion.has_value() ||solidity::test::CommonOptions::get().evmVersion() >= langutil::EVMVersion::prague()); - std::string bytecodeFormatString = m_reader.stringSetting("bytecodeFormat", "legacy"); + std::string bytecodeFormatString = m_reader.stringSetting("bytecodeFormat", "legacy,>=EOFv1"); if (bytecodeFormatString == "legacy,>=EOFv1" || bytecodeFormatString == ">=EOFv1,legacy") return; diff --git a/test/libsolidity/SemanticTest.cpp b/test/libsolidity/SemanticTest.cpp index b0bdb95cb9c4..0c3f2f3bcbdd 100644 --- a/test/libsolidity/SemanticTest.cpp +++ b/test/libsolidity/SemanticTest.cpp @@ -91,7 +91,9 @@ SemanticTest::SemanticTest( if (m_runWithABIEncoderV1Only && !solidity::test::CommonOptions::get().useABIEncoderV1) m_shouldRun = false; - std::string compileViaYul = m_reader.stringSetting("compileViaYul", "also"); + auto const eofEnabled = solidity::test::CommonOptions::get().eofVersion().has_value(); + std::string compileViaYul = m_reader.stringSetting("compileViaYul", eofEnabled ? "true" : "also"); + if (m_runWithABIEncoderV1Only && compileViaYul != "false") BOOST_THROW_EXCEPTION(std::runtime_error( "ABIEncoderV1Only tests cannot be run via yul, " From 055561815b35c77ef71cc143027431f03566115d Mon Sep 17 00:00:00 2001 From: rodiazet Date: Mon, 3 Feb 2025 11:54:12 +0100 Subject: [PATCH 2/2] Omit running semantic and syntax tests when compileViaYul is false and EFO enabled. --- test/libsolidity/SemanticTest.cpp | 3 +++ test/libsolidity/SyntaxTest.cpp | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/test/libsolidity/SemanticTest.cpp b/test/libsolidity/SemanticTest.cpp index 0c3f2f3bcbdd..1b66dd60fffb 100644 --- a/test/libsolidity/SemanticTest.cpp +++ b/test/libsolidity/SemanticTest.cpp @@ -94,6 +94,9 @@ SemanticTest::SemanticTest( auto const eofEnabled = solidity::test::CommonOptions::get().eofVersion().has_value(); std::string compileViaYul = m_reader.stringSetting("compileViaYul", eofEnabled ? "true" : "also"); + if (compileViaYul == "false" && eofEnabled) + m_shouldRun = false; + if (m_runWithABIEncoderV1Only && compileViaYul != "false") BOOST_THROW_EXCEPTION(std::runtime_error( "ABIEncoderV1Only tests cannot be run via yul, " diff --git a/test/libsolidity/SyntaxTest.cpp b/test/libsolidity/SyntaxTest.cpp index 4fd3df7cfc6f..8944710542a5 100644 --- a/test/libsolidity/SyntaxTest.cpp +++ b/test/libsolidity/SyntaxTest.cpp @@ -53,6 +53,10 @@ SyntaxTest::SyntaxTest( m_compileViaYul = m_reader.stringSetting("compileViaYul", eofEnabled ? "true" : "false"); if (!util::contains(compileViaYulAllowedValues, m_compileViaYul)) BOOST_THROW_EXCEPTION(std::runtime_error("Invalid compileViaYul value: " + m_compileViaYul + ".")); + + if (m_compileViaYul == "false" && eofEnabled) + m_shouldRun = false; + m_optimiseYul = m_reader.boolSetting("optimize-yul", true); static std::map const pipelineStages = {