Skip to content

Commit

Permalink
MemoryGuardTest: Respect EVM version selected on the command line
Browse files Browse the repository at this point in the history
  • Loading branch information
cameel authored and aarlt committed Jan 22, 2024
1 parent 0aef651 commit ccef99e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion test/libsolidity/MemoryGuardTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

#include <test/libsolidity/MemoryGuardTest.h>

#include <test/Common.h>
#include <test/libyul/Common.h>
#include <libsolidity/codegen/ir/Common.h>
#include <libsolutil/Algorithms.h>
Expand All @@ -35,6 +36,7 @@ using namespace solidity::util::formatting;
using namespace solidity::langutil;
using namespace solidity::frontend;
using namespace solidity::frontend::test;
using namespace solidity::test;
using namespace yul;

void MemoryGuardTest::setupCompiler(CompilerStack& _compiler)
Expand All @@ -59,7 +61,7 @@ TestCase::TestResult MemoryGuardTest::run(std::ostream& _stream, std::string con
ErrorList errors;
auto [object, analysisInfo] = yul::test::parse(
compiler().yulIR(contractName),
EVMDialect::strictAssemblyForEVMObjects({}),
EVMDialect::strictAssemblyForEVMObjects(CommonOptions::get().evmVersion()),
errors
);

Expand Down
4 changes: 2 additions & 2 deletions test/libsolidity/MemoryGuardTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ namespace solidity::frontend::test

using solidity::test::SyntaxTestError;

class MemoryGuardTest: public AnalysisFramework, public TestCase
class MemoryGuardTest: public AnalysisFramework, public EVMVersionRestrictedTestCase
{
public:
static std::unique_ptr<TestCase> create(Config const& _config)
{
return std::make_unique<MemoryGuardTest>(_config.filename);
}
MemoryGuardTest(std::string const& _filename): TestCase(_filename)
MemoryGuardTest(std::string const& _filename): EVMVersionRestrictedTestCase(_filename)
{
m_source = m_reader.source();
m_expectation = m_reader.simpleExpectations();
Expand Down

0 comments on commit ccef99e

Please sign in to comment.