Skip to content

Commit 788dc6b

Browse files
committed
Remove canEnableViaYul logic and default to compiling also via yul.
1 parent e93ad30 commit 788dc6b

File tree

2 files changed

+4
-24
lines changed

2 files changed

+4
-24
lines changed

test/libsolidity/SemanticTest.cpp

Lines changed: 4 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ SemanticTest::SemanticTest(
7171
if (m_runWithABIEncoderV1Only && !solidity::test::CommonOptions::get().useABIEncoderV1)
7272
m_shouldRun = false;
7373

74-
string compileViaYul = m_reader.stringSetting("compileViaYul", "default");
74+
string compileViaYul = m_reader.stringSetting("compileViaYul", "also");
7575
if (m_runWithABIEncoderV1Only && compileViaYul != "false")
7676
BOOST_THROW_EXCEPTION(runtime_error(
7777
"ABIEncoderV1Only tests cannot be run via yul, "
@@ -345,7 +345,6 @@ TestCase::TestResult SemanticTest::runTest(
345345
m_compileToEwasm = _isEwasmRun;
346346
}
347347

348-
m_canEnableYulRun = false;
349348
m_canEnableEwasmRun = false;
350349

351350
if (_isYulRun)
@@ -465,18 +464,6 @@ TestCase::TestResult SemanticTest::runTest(
465464
success &= test.call().expectedSideEffects == test.call().actualSideEffects;
466465
}
467466

468-
if (!m_testCaseWantsYulRun && _isYulRun)
469-
{
470-
m_canEnableYulRun = success;
471-
string message = success ?
472-
"Test can pass via Yul, but marked with \"compileViaYul: false.\"" :
473-
"Test compiles via Yul, but it gives different test results.";
474-
AnsiColorized(_stream, _formatted, {BOLD, success ? YELLOW : MAGENTA}) <<
475-
_linePrefix << endl <<
476-
_linePrefix << message << endl;
477-
return TestResult::Failure;
478-
}
479-
480467
// Right now we have sometimes different test results in Yul vs. Ewasm.
481468
// The main reason is that Ewasm just returns a failure in some cases.
482469
// TODO: If Ewasm support got fully implemented, we could implement this in the same way as above.
@@ -654,25 +641,19 @@ void SemanticTest::printUpdatedExpectations(ostream& _stream, string const&) con
654641
void SemanticTest::printUpdatedSettings(ostream& _stream, string const& _linePrefix)
655642
{
656643
auto& settings = m_reader.settings();
657-
if (settings.empty() && !m_canEnableYulRun)
644+
if (settings.empty() && !m_canEnableEwasmRun)
658645
return;
659646

660647
_stream << _linePrefix << "// ====" << endl;
661648
if (m_canEnableEwasmRun)
662649
{
663-
soltestAssert(m_canEnableYulRun || m_testCaseWantsYulRun, "");
664-
string compileViaYul = m_reader.stringSetting("compileViaYul", "");
665-
if (!compileViaYul.empty())
666-
_stream << _linePrefix << "// compileViaYul: " << compileViaYul << "\n";
650+
soltestAssert(m_testCaseWantsYulRun, "");
667651
_stream << _linePrefix << "// compileToEwasm: also\n";
668652
}
669-
else if (m_canEnableYulRun)
670-
_stream << _linePrefix << "// compileViaYul: also\n";
671653

672654
for (auto const& [settingName, settingValue]: settings)
673655
if (
674-
!(settingName == "compileToEwasm" && m_canEnableEwasmRun) &&
675-
!(settingName == "compileViaYul" && (m_canEnableYulRun || m_canEnableEwasmRun))
656+
!(settingName == "compileToEwasm" && m_canEnableEwasmRun)
676657
)
677658
_stream << _linePrefix << "// " << settingName << ": " << settingValue<< endl;
678659
}

test/libsolidity/SemanticTest.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ class SemanticTest: public SolidityExecutionFramework, public EVMVersionRestrict
101101
bool m_enforceCompileToEwasm = false;
102102
bool m_runWithABIEncoderV1Only = false;
103103
bool m_allowNonExistingFunctions = false;
104-
bool m_canEnableYulRun = false;
105104
bool m_canEnableEwasmRun = false;
106105
bool m_gasCostFailure = false;
107106
bool m_enforceGasCost = false;

0 commit comments

Comments
 (0)