Merge pull request #9805 from ethereum/develop

Merge develop into breaking.
This commit is contained in:
chriseth
2020-09-14 20:48:03 +02:00
committed by GitHub
538 changed files with 3805 additions and 1959 deletions
+2
View File
@@ -30,6 +30,7 @@
#include <libsolidity/parsing/Parser.h>
#include <libsolidity/analysis/DeclarationTypeChecker.h>
#include <libsolidity/analysis/NameAndTypeResolver.h>
#include <libsolidity/analysis/Scoper.h>
#include <libsolidity/codegen/Compiler.h>
#include <libsolidity/ast/AST.h>
#include <libsolidity/analysis/TypeChecker.h>
@@ -59,6 +60,7 @@ evmasm::AssemblyItems compileContract(std::shared_ptr<CharStream> _sourceCode)
BOOST_REQUIRE_NO_THROW(sourceUnit = parser.parse(make_shared<Scanner>(_sourceCode)));
BOOST_CHECK(!!sourceUnit);
Scoper::assignScopes(*sourceUnit);
GlobalContext globalContext;
NameAndTypeResolver resolver(globalContext, solidity::test::CommonOptions::get().evmVersion(), errorReporter);
DeclarationTypeChecker declarationTypeChecker(errorReporter, solidity::test::CommonOptions::get().evmVersion());
+164 -125
View File
@@ -39,8 +39,8 @@ using namespace boost::unit_test;
namespace fs = boost::filesystem;
SemanticTest::SemanticTest(string const& _filename, langutil::EVMVersion _evmVersion, bool enforceViaYul):
SolidityExecutionFramework(_evmVersion),
SemanticTest::SemanticTest(string const& _filename, langutil::EVMVersion _evmVersion, vector<boost::filesystem::path> const& _vmPaths, bool enforceViaYul):
SolidityExecutionFramework(_evmVersion, _vmPaths),
EVMVersionRestrictedTestCase(_filename),
m_sources(m_reader.sources()),
m_lineOffset(m_reader.lineNumber()),
@@ -72,6 +72,21 @@ SemanticTest::SemanticTest(string const& _filename, langutil::EVMVersion _evmVer
else
BOOST_THROW_EXCEPTION(runtime_error("Invalid compileViaYul value: " + choice + "."));
string compileToEwasm = m_reader.stringSetting("compileToEwasm", "false");
if (compileToEwasm == "also")
m_runWithEwasm = true;
else if (compileToEwasm == "false")
m_runWithEwasm = false;
else
BOOST_THROW_EXCEPTION(runtime_error("Invalid compileToEwasm value: " + compileToEwasm + "."));
if (m_runWithEwasm && !m_runWithYul)
BOOST_THROW_EXCEPTION(runtime_error("Invalid compileToEwasm value: " + compileToEwasm + ", compileViaYul need to be enabled."));
// run ewasm tests only, if an ewasm evmc vm was defined
if (m_runWithEwasm && !m_supportsEwasm)
m_runWithEwasm = false;
m_runWithABIEncoderV1Only = m_reader.boolSetting("ABIEncoderV1Only", false);
if (m_runWithABIEncoderV1Only && solidity::test::CommonOptions::get().useABIEncoderV2)
m_shouldRun = false;
@@ -88,156 +103,180 @@ SemanticTest::SemanticTest(string const& _filename, langutil::EVMVersion _evmVer
TestCase::TestResult SemanticTest::run(ostream& _stream, string const& _linePrefix, bool _formatted)
{
TestResult result = TestResult::Success;
bool compileViaYul = m_runWithYul || m_enforceViaYul;
for (bool compileViaYul: set<bool>{!m_runWithoutYul, m_runWithYul || m_enforceViaYul})
if (m_runWithoutYul)
result = runTest(_stream, _linePrefix, _formatted, false, false);
if (compileViaYul && result == TestResult::Success)
result = runTest(_stream, _linePrefix, _formatted, true, false);
if (m_runWithEwasm && result == TestResult::Success)
result = runTest(_stream, _linePrefix, _formatted, true, true);
return result;
}
TestCase::TestResult SemanticTest::runTest(ostream& _stream, string const& _linePrefix, bool _formatted, bool _compileViaYul, bool _compileToEwasm)
{
try
{
try
bool success = true;
if (_compileViaYul && _compileToEwasm)
selectVM(evmc_capabilities::EVMC_CAPABILITY_EWASM);
else
selectVM(evmc_capabilities::EVMC_CAPABILITY_EVM1);
reset();
m_compileViaYul = _compileViaYul;
if (_compileToEwasm)
{
reset();
bool success = true;
soltestAssert(m_compileViaYul, "");
m_compileToEwasm = _compileToEwasm;
}
m_compileViaYul = compileViaYul;
m_compileViaYulCanBeSet = false;
m_compileViaYulCanBeSet = false;
if (compileViaYul)
AnsiColorized(_stream, _formatted, {BOLD, CYAN}) << _linePrefix << "Running via Yul:" << endl;
if (_compileViaYul)
AnsiColorized(_stream, _formatted, {BOLD, CYAN}) << _linePrefix << "Running via Yul:" << endl;
for (auto& test: m_tests)
test.reset();
for (auto& test: m_tests)
test.reset();
map<string, solidity::test::Address> libraries;
map<string, solidity::test::Address> libraries;
bool constructed = false;
bool constructed = false;
for (auto& test: m_tests)
for (auto& test: m_tests)
{
if (constructed)
{
if (constructed)
{
soltestAssert(!test.call().isLibrary, "Libraries have to be deployed before any other call.");
soltestAssert(!test.call().isConstructor, "Constructor has to be the first function call expect for library deployments.");
}
else if (test.call().isLibrary)
soltestAssert(!test.call().isLibrary, "Libraries have to be deployed before any other call.");
soltestAssert(
!test.call().isConstructor,
"Constructor has to be the first function call expect for library deployments.");
}
else if (test.call().isLibrary)
{
soltestAssert(
deploy(test.call().signature, 0, {}, libraries) && m_transactionSuccessful,
"Failed to deploy library " + test.call().signature);
libraries[test.call().signature] = m_contractAddress;
continue;
}
else
{
if (test.call().isConstructor)
deploy("", test.call().value.value, test.call().arguments.rawBytes(), libraries);
else
soltestAssert(deploy("", 0, bytes(), libraries), "Failed to deploy contract.");
constructed = true;
}
if (test.call().isConstructor)
{
if (m_transactionSuccessful == test.call().expectations.failure)
success = false;
test.setFailure(!m_transactionSuccessful);
test.setRawBytes(bytes());
}
else
{
bytes output;
if (test.call().useCallWithoutSignature)
output = callLowLevel(test.call().arguments.rawBytes(), test.call().value.value);
else
{
soltestAssert(
deploy(test.call().signature, 0, {}, libraries) && m_transactionSuccessful,
"Failed to deploy library " + test.call().signature
m_allowNonExistingFunctions || m_compiler.methodIdentifiers(m_compiler.lastContractName())
.isMember(test.call().signature),
"The function " + test.call().signature + " is not known to the compiler");
output = callContractFunctionWithValueNoEncoding(
test.call().signature, test.call().value.value, test.call().arguments.rawBytes()
);
libraries[test.call().signature] = m_contractAddress;
continue;
}
else
{
if (test.call().isConstructor)
deploy("", test.call().value.value, test.call().arguments.rawBytes(), libraries);
else
soltestAssert(deploy("", 0, bytes(), libraries), "Failed to deploy contract.");
constructed = true;
}
if (test.call().isConstructor)
{
if (m_transactionSuccessful == test.call().expectations.failure)
success = false;
if ((m_transactionSuccessful == test.call().expectations.failure)
|| (output != test.call().expectations.rawBytes()))
success = false;
test.setFailure(!m_transactionSuccessful);
test.setRawBytes(bytes());
}
else
{
bytes output;
if (test.call().useCallWithoutSignature)
output = callLowLevel(test.call().arguments.rawBytes(), test.call().value.value);
else
{
soltestAssert(
m_allowNonExistingFunctions || m_compiler.methodIdentifiers(m_compiler.lastContractName()).isMember(test.call().signature),
"The function " + test.call().signature + " is not known to the compiler"
);
output = callContractFunctionWithValueNoEncoding(
test.call().signature,
test.call().value.value,
test.call().arguments.rawBytes()
);
}
if ((m_transactionSuccessful == test.call().expectations.failure) || (output != test.call().expectations.rawBytes()))
success = false;
test.setFailure(!m_transactionSuccessful);
test.setRawBytes(std::move(output));
test.setContractABI(m_compiler.contractABI(m_compiler.lastContractName()));
}
test.setFailure(!m_transactionSuccessful);
test.setRawBytes(std::move(output));
test.setContractABI(m_compiler.contractABI(m_compiler.lastContractName()));
}
}
if (success && !m_runWithYul && compileViaYul)
if (success && !m_runWithYul && _compileViaYul)
{
m_compileViaYulCanBeSet = true;
AnsiColorized(_stream, _formatted, {BOLD, YELLOW}) <<
_linePrefix << endl <<
_linePrefix << "Test can pass via Yul and marked with compileViaYul: false." << endl;
return TestResult::Failure;
}
if (!success && (m_runWithYul || !_compileViaYul))
{
AnsiColorized(_stream, _formatted, {BOLD, CYAN}) << _linePrefix << "Expected result:" << endl;
for (auto const& test: m_tests)
{
m_compileViaYulCanBeSet = true;
AnsiColorized(_stream, _formatted, {BOLD, YELLOW}) << _linePrefix << endl << _linePrefix
<< "Test can pass via Yul and marked with compileViaYul: false." << endl;
return TestResult::Failure;
ErrorReporter errorReporter;
_stream << test.format(errorReporter, _linePrefix, false, _formatted) << endl;
_stream << errorReporter.format(_linePrefix, _formatted);
}
if (!success && (m_runWithYul || !compileViaYul))
_stream << endl;
AnsiColorized(_stream, _formatted, {BOLD, CYAN}) << _linePrefix << "Obtained result:" << endl;
for (auto const& test: m_tests)
{
AnsiColorized(_stream, _formatted, {BOLD, CYAN}) << _linePrefix << "Expected result:" << endl;
for (auto const& test: m_tests)
{
ErrorReporter errorReporter;
_stream << test.format(errorReporter, _linePrefix, false, _formatted) << endl;
_stream << errorReporter.format(_linePrefix, _formatted);
}
ErrorReporter errorReporter;
_stream << test.format(errorReporter, _linePrefix, true, _formatted) << endl;
_stream << errorReporter.format(_linePrefix, _formatted);
}
AnsiColorized(_stream, _formatted, {BOLD, RED})
<< _linePrefix << endl
<< _linePrefix << "Attention: Updates on the test will apply the detected format displayed." << endl;
if (_compileViaYul && m_runWithoutYul)
{
_stream << _linePrefix << endl << _linePrefix;
AnsiColorized(_stream, _formatted, {RED_BACKGROUND}) << "Note that the test passed without Yul.";
_stream << endl;
AnsiColorized(_stream, _formatted, {BOLD, CYAN}) << _linePrefix << "Obtained result:" << endl;
for (auto const& test: m_tests)
{
ErrorReporter errorReporter;
_stream << test.format(errorReporter, _linePrefix, true, _formatted) << endl;
_stream << errorReporter.format(_linePrefix, _formatted);
}
AnsiColorized(_stream, _formatted, {BOLD, RED}) << _linePrefix << endl << _linePrefix
<< "Attention: Updates on the test will apply the detected format displayed." << endl;
if (compileViaYul && m_runWithoutYul)
{
_stream << _linePrefix << endl << _linePrefix;
AnsiColorized(_stream, _formatted, {RED_BACKGROUND})
<< "Note that the test passed without Yul.";
_stream << endl;
}
else if (!compileViaYul && m_runWithYul)
AnsiColorized(_stream, _formatted, {BOLD, YELLOW}) << _linePrefix << endl << _linePrefix
<< "Note that the test also has to pass via Yul." << endl;
return TestResult::Failure;
}
else if (!_compileViaYul && m_runWithYul)
AnsiColorized(_stream, _formatted, {BOLD, YELLOW})
<< _linePrefix << endl
<< _linePrefix << "Note that the test also has to pass via Yul." << endl;
return TestResult::Failure;
}
catch (WhiskersError const&)
{
// this is an error in Whiskers template, so should be thrown anyway
}
catch (WhiskersError const&)
{
// this is an error in Whiskers template, so should be thrown anyway
throw;
}
catch (YulException const&)
{
// this should be an error in yul compilation or translation
throw;
}
catch (boost::exception const&)
{
if (!_compileViaYul || m_runWithYul)
throw;
}
catch (YulException const&)
{
// this should be an error in yul compilation or translation
}
catch (std::exception const&)
{
if (!_compileViaYul || m_runWithYul)
throw;
}
catch (boost::exception const&)
{
if (compileViaYul && !m_runWithYul)
continue;
}
catch (...)
{
if (!_compileViaYul || m_runWithYul)
throw;
}
catch (std::exception const&)
{
if (compileViaYul && !m_runWithYul)
continue;
throw;
}
catch (...)
{
if (compileViaYul && !m_runWithYul)
continue;
throw;
}
}
return TestResult::Success;
+4 -2
View File
@@ -40,9 +40,9 @@ class SemanticTest: public SolidityExecutionFramework, public EVMVersionRestrict
{
public:
static std::unique_ptr<TestCase> create(Config const& _options)
{ return std::make_unique<SemanticTest>(_options.filename, _options.evmVersion, _options.enforceCompileViaYul); }
{ return std::make_unique<SemanticTest>(_options.filename, _options.evmVersion, _options.vmPaths, _options.enforceCompileViaYul); }
explicit SemanticTest(std::string const& _filename, langutil::EVMVersion _evmVersion, bool _enforceViaYul = false);
explicit SemanticTest(std::string const& _filename, langutil::EVMVersion _evmVersion, std::vector<boost::filesystem::path> const& _vmPaths, bool _enforceViaYul = false);
TestResult run(std::ostream& _stream, std::string const& _linePrefix = "", bool _formatted = false) override;
void printSource(std::ostream &_stream, std::string const& _linePrefix = "", bool _formatted = false) const override;
@@ -59,10 +59,12 @@ public:
/// Returns true if deployment was successful, false otherwise.
bool deploy(std::string const& _contractName, u256 const& _value, bytes const& _arguments, std::map<std::string, solidity::test::Address> const& _libraries = {});
private:
TestResult runTest(std::ostream& _stream, std::string const& _linePrefix, bool _formatted, bool _compileViaYul, bool _compileToEwasm);
SourceMap m_sources;
std::size_t m_lineOffset;
std::vector<TestFunctionCall> m_tests;
bool m_runWithYul = false;
bool m_runWithEwasm = false;
bool m_runWithoutYul = true;
bool m_enforceViaYul = false;
bool m_runWithABIEncoderV1Only = false;
+127 -13
View File
@@ -48,18 +48,38 @@ using namespace solidity::util;
using namespace solidity::test;
using namespace solidity::langutil;
#define ALSO_VIA_YUL(CODE) \
{ \
{ CODE } \
reset(); \
m_compileViaYul = true; \
{ CODE } \
#define ALSO_VIA_YUL(CODE) \
{ \
m_doEwasmTestrun = true; \
\
m_compileViaYul = false; \
m_compileToEwasm = false; \
{ CODE } \
\
m_compileViaYul = true; \
reset(); \
{ CODE } \
\
if (m_doEwasmTestrun) \
{ \
m_compileToEwasm = true; \
reset(); \
{ CODE } \
} \
}
#define DISABLE_EWASM_TESTRUN() \
{ m_doEwasmTestrun = false; }
namespace solidity::frontend::test
{
BOOST_FIXTURE_TEST_SUITE(SolidityEndToEndTest, SolidityExecutionFramework)
struct SolidityEndToEndTestExecutionFramework: public SolidityExecutionFramework
{
bool m_doEwasmTestrun = false;
};
BOOST_FIXTURE_TEST_SUITE(SolidityEndToEndTest, SolidityEndToEndTestExecutionFramework)
int constexpr roundTo32(int _num)
{
@@ -115,6 +135,8 @@ BOOST_AUTO_TEST_CASE(recursive_calls)
}
)";
ALSO_VIA_YUL(
DISABLE_EWASM_TESTRUN()
compileAndRun(sourceCode);
function<u256(u256)> recursive_calls_cpp = [&recursive_calls_cpp](u256 const& n) -> u256
{
@@ -140,6 +162,8 @@ BOOST_AUTO_TEST_CASE(while_loop)
}
)";
ALSO_VIA_YUL(
DISABLE_EWASM_TESTRUN()
compileAndRun(sourceCode);
auto while_loop_cpp = [](u256 const& n) -> u256
@@ -168,6 +192,8 @@ BOOST_AUTO_TEST_CASE(do_while_loop)
}
)";
ALSO_VIA_YUL(
DISABLE_EWASM_TESTRUN()
compileAndRun(sourceCode);
auto do_while_loop_cpp = [](u256 const& n) -> u256
@@ -213,6 +239,8 @@ BOOST_AUTO_TEST_CASE(do_while_loop_multiple_local_vars)
}
)";
ALSO_VIA_YUL(
DISABLE_EWASM_TESTRUN()
compileAndRun(sourceCode);
auto do_while = [](u256 n) -> u256
@@ -263,6 +291,8 @@ BOOST_AUTO_TEST_CASE(nested_loops)
}
)";
ALSO_VIA_YUL(
DISABLE_EWASM_TESTRUN()
compileAndRun(sourceCode);
auto nested_loops_cpp = [](u256 n) -> u256
@@ -329,6 +359,8 @@ BOOST_AUTO_TEST_CASE(nested_loops_multiple_local_vars)
}
)";
ALSO_VIA_YUL(
DISABLE_EWASM_TESTRUN()
compileAndRun(sourceCode);
auto nested_loops_cpp = [](u256 n) -> u256
@@ -383,6 +415,8 @@ BOOST_AUTO_TEST_CASE(for_loop_multiple_local_vars)
}
)";
ALSO_VIA_YUL(
DISABLE_EWASM_TESTRUN()
compileAndRun(sourceCode);
auto for_loop = [](u256 n) -> u256
@@ -444,6 +478,8 @@ BOOST_AUTO_TEST_CASE(nested_for_loop_multiple_local_vars)
}
)";
ALSO_VIA_YUL(
DISABLE_EWASM_TESTRUN()
compileAndRun(sourceCode);
auto for_loop = [](u256 n) -> u256
@@ -484,6 +520,8 @@ BOOST_AUTO_TEST_CASE(for_loop)
}
)";
ALSO_VIA_YUL(
DISABLE_EWASM_TESTRUN()
compileAndRun(sourceCode);
auto for_loop_cpp = [](u256 const& n) -> u256
@@ -512,6 +550,8 @@ BOOST_AUTO_TEST_CASE(for_loop_empty)
}
)";
ALSO_VIA_YUL(
DISABLE_EWASM_TESTRUN()
compileAndRun(sourceCode);
auto for_loop_empty_cpp = []() -> u256
@@ -542,6 +582,8 @@ BOOST_AUTO_TEST_CASE(for_loop_simple_init_expr)
}
)";
ALSO_VIA_YUL(
DISABLE_EWASM_TESTRUN()
compileAndRun(sourceCode);
auto for_loop_simple_init_expr_cpp = [](u256 const& n) -> u256
@@ -665,6 +707,8 @@ BOOST_AUTO_TEST_CASE(many_local_variables)
}
)";
ALSO_VIA_YUL(
DISABLE_EWASM_TESTRUN()
compileAndRun(sourceCode);
auto f = [](u256 const& x1, u256 const& x2, u256 const& x3) -> u256
{
@@ -689,6 +733,8 @@ BOOST_AUTO_TEST_CASE(short_circuiting)
}
)";
ALSO_VIA_YUL(
DISABLE_EWASM_TESTRUN()
compileAndRun(sourceCode);
auto short_circuiting_cpp = [](u256 n) -> u256
@@ -801,6 +847,8 @@ BOOST_AUTO_TEST_CASE(compound_assign)
}
)";
ALSO_VIA_YUL(
DISABLE_EWASM_TESTRUN()
compileAndRun(sourceCode);
u256 value1;
@@ -863,6 +911,8 @@ BOOST_AUTO_TEST_CASE(mapping_state)
map<u160, bool> m_voted;
};
ALSO_VIA_YUL(
DISABLE_EWASM_TESTRUN()
compileAndRun(sourceCode);
Ballot ballot;
@@ -936,6 +986,8 @@ BOOST_AUTO_TEST_CASE(mapping_state_inc_dec)
return --table[value++];
};
ALSO_VIA_YUL(
DISABLE_EWASM_TESTRUN()
compileAndRun(sourceCode);
value = 0;
table.clear();
@@ -962,6 +1014,8 @@ BOOST_AUTO_TEST_CASE(multi_level_mapping)
else return table[_x][_y] = _z;
};
ALSO_VIA_YUL(
DISABLE_EWASM_TESTRUN()
compileAndRun(sourceCode);
table.clear();
@@ -998,6 +1052,8 @@ BOOST_AUTO_TEST_CASE(constructor)
};
ALSO_VIA_YUL(
DISABLE_EWASM_TESTRUN()
compileAndRun(sourceCode);
testContractAgainstCpp("get(uint256)", get, u256(6));
testContractAgainstCpp("get(uint256)", get, u256(7));
@@ -1016,12 +1072,12 @@ BOOST_AUTO_TEST_CASE(blockchain)
}
}
)";
m_evmHost->tx_context.block_coinbase = EVMHost::convertToEVMC(Address("0x1212121212121212121212121212121212121212"));
m_evmHost->newBlock();
m_evmHost->newBlock();
m_evmHost->newBlock();
m_evmHost->newBlock();
m_evmHost->newBlock();
m_evmcHost->tx_context.block_coinbase = EVMHost::convertToEVMC(Address("0x1212121212121212121212121212121212121212"));
m_evmcHost->newBlock();
m_evmcHost->newBlock();
m_evmcHost->newBlock();
m_evmcHost->newBlock();
m_evmcHost->newBlock();
compileAndRun(sourceCode, 27);
ABI_CHECK(callContractFunctionWithValue("someInfo()", 28), encodeArgs(28, u256("0x1212121212121212121212121212121212121212"), 7));
}
@@ -1038,6 +1094,8 @@ BOOST_AUTO_TEST_CASE(send_ether)
}
)";
ALSO_VIA_YUL(
DISABLE_EWASM_TESTRUN()
u256 amount(250);
compileAndRun(sourceCode, amount + 1);
u160 address(23);
@@ -1070,6 +1128,8 @@ BOOST_AUTO_TEST_CASE(transfer_ether)
}
)";
ALSO_VIA_YUL(
DISABLE_EWASM_TESTRUN()
compileAndRun(sourceCode, 0, "B");
u160 const nonPayableRecipient = m_contractAddress;
compileAndRun(sourceCode, 0, "C");
@@ -1110,6 +1170,8 @@ BOOST_AUTO_TEST_CASE(log0)
}
)";
ALSO_VIA_YUL(
DISABLE_EWASM_TESTRUN()
compileAndRun(sourceCode);
callContractFunction("a()");
BOOST_REQUIRE_EQUAL(numLogs(), 1);
@@ -1129,6 +1191,8 @@ BOOST_AUTO_TEST_CASE(log1)
}
)";
ALSO_VIA_YUL(
DISABLE_EWASM_TESTRUN()
compileAndRun(sourceCode);
callContractFunction("a()");
BOOST_REQUIRE_EQUAL(numLogs(), 1);
@@ -1149,6 +1213,8 @@ BOOST_AUTO_TEST_CASE(log2)
}
)";
ALSO_VIA_YUL(
DISABLE_EWASM_TESTRUN()
compileAndRun(sourceCode);
callContractFunction("a()");
BOOST_REQUIRE_EQUAL(numLogs(), 1);
@@ -1170,6 +1236,8 @@ BOOST_AUTO_TEST_CASE(log3)
}
)";
ALSO_VIA_YUL(
DISABLE_EWASM_TESTRUN()
compileAndRun(sourceCode);
callContractFunction("a()");
BOOST_REQUIRE_EQUAL(numLogs(), 1);
@@ -1191,6 +1259,8 @@ BOOST_AUTO_TEST_CASE(log4)
}
)";
ALSO_VIA_YUL(
DISABLE_EWASM_TESTRUN()
compileAndRun(sourceCode);
callContractFunction("a()");
BOOST_REQUIRE_EQUAL(numLogs(), 1);
@@ -1212,6 +1282,8 @@ BOOST_AUTO_TEST_CASE(log_in_constructor)
}
)";
ALSO_VIA_YUL(
DISABLE_EWASM_TESTRUN()
compileAndRun(sourceCode);
BOOST_REQUIRE_EQUAL(numLogs(), 1);
BOOST_CHECK_EQUAL(logAddress(0), m_contractAddress);
@@ -1235,6 +1307,8 @@ BOOST_AUTO_TEST_CASE(selfdestruct)
u256 amount(130);
u160 address(23);
ALSO_VIA_YUL(
DISABLE_EWASM_TESTRUN()
compileAndRun(sourceCode, amount);
ABI_CHECK(callContractFunction("a(address)", address), bytes());
BOOST_CHECK(!addressHasCode(m_contractAddress));
@@ -1665,6 +1739,8 @@ BOOST_AUTO_TEST_CASE(gaslimit)
}
)";
ALSO_VIA_YUL(
DISABLE_EWASM_TESTRUN()
compileAndRun(sourceCode);
auto result = callContractFunction("f()");
ABI_CHECK(result, encodeArgs(gasLimit()));
@@ -1681,6 +1757,8 @@ BOOST_AUTO_TEST_CASE(gasprice)
}
)";
ALSO_VIA_YUL(
DISABLE_EWASM_TESTRUN()
compileAndRun(sourceCode);
ABI_CHECK(callContractFunction("f()"), encodeArgs(gasPrice()));
)
@@ -1772,6 +1850,8 @@ BOOST_AUTO_TEST_CASE(event)
}
)";
ALSO_VIA_YUL(
DISABLE_EWASM_TESTRUN()
compileAndRun(sourceCode);
u256 value(18);
u256 id(0x1234);
@@ -1800,6 +1880,8 @@ BOOST_AUTO_TEST_CASE(event_emit)
}
)";
ALSO_VIA_YUL(
DISABLE_EWASM_TESTRUN()
compileAndRun(sourceCode);
u256 value(18);
u256 id(0x1234);
@@ -1826,6 +1908,8 @@ BOOST_AUTO_TEST_CASE(event_no_arguments)
)";
ALSO_VIA_YUL(
DISABLE_EWASM_TESTRUN()
compileAndRun(sourceCode);
callContractFunction("deposit()");
BOOST_REQUIRE_EQUAL(numLogs(), 1);
@@ -1850,6 +1934,8 @@ BOOST_AUTO_TEST_CASE(event_access_through_base_name_emit)
}
)";
ALSO_VIA_YUL(
DISABLE_EWASM_TESTRUN()
compileAndRun(sourceCode);
callContractFunction("f()");
BOOST_REQUIRE_EQUAL(numLogs(), 1);
@@ -1889,6 +1975,8 @@ BOOST_AUTO_TEST_CASE(events_with_same_name)
u160 const c_loggedAddress = m_contractAddress;
ALSO_VIA_YUL(
DISABLE_EWASM_TESTRUN()
compileAndRun(sourceCode);
ABI_CHECK(callContractFunction("deposit()"), encodeArgs(u256(1)));
BOOST_REQUIRE_EQUAL(numLogs(), 1);
@@ -1950,6 +2038,8 @@ BOOST_AUTO_TEST_CASE(events_with_same_name_inherited_emit)
u160 const c_loggedAddress = m_contractAddress;
ALSO_VIA_YUL(
DISABLE_EWASM_TESTRUN()
compileAndRun(sourceCode);
ABI_CHECK(callContractFunction("deposit()"), encodeArgs(u256(1)));
BOOST_REQUIRE_EQUAL(numLogs(), 1);
@@ -1985,6 +2075,8 @@ BOOST_AUTO_TEST_CASE(event_anonymous)
}
)";
ALSO_VIA_YUL(
DISABLE_EWASM_TESTRUN()
compileAndRun(sourceCode);
callContractFunction("deposit()");
BOOST_REQUIRE_EQUAL(numLogTopics(0), 0);
@@ -2002,6 +2094,8 @@ BOOST_AUTO_TEST_CASE(event_anonymous_with_topics)
}
)";
ALSO_VIA_YUL(
DISABLE_EWASM_TESTRUN()
compileAndRun(sourceCode);
u256 value(18);
u256 id(0x1234);
@@ -2028,6 +2122,8 @@ BOOST_AUTO_TEST_CASE(event_lots_of_data)
}
)";
ALSO_VIA_YUL(
DISABLE_EWASM_TESTRUN()
compileAndRun(sourceCode);
u256 value(18);
u256 id(0x1234);
@@ -2247,6 +2343,8 @@ BOOST_AUTO_TEST_CASE(event_dynamic_array_storage)
}
)";
ALSO_VIA_YUL(
DISABLE_EWASM_TESTRUN()
compileAndRun(sourceCode);
u256 x(42);
callContractFunction("createEvent(uint256)", x);
@@ -2276,6 +2374,8 @@ BOOST_AUTO_TEST_CASE(event_dynamic_array_storage_v2)
}
)";
ALSO_VIA_YUL(
DISABLE_EWASM_TESTRUN()
compileAndRun(sourceCode);
u256 x(42);
callContractFunction("createEvent(uint256)", x);
@@ -2365,6 +2465,8 @@ BOOST_AUTO_TEST_CASE(empty_name_input_parameter_with_named_one)
}
)";
ALSO_VIA_YUL(
DISABLE_EWASM_TESTRUN()
compileAndRun(sourceCode);
BOOST_CHECK(callContractFunction("f(uint256,uint256)", 5, 9) != encodeArgs(5, 8));
ABI_CHECK(callContractFunction("f(uint256,uint256)", 5, 9), encodeArgs(9, 8));
@@ -2987,6 +3089,8 @@ BOOST_AUTO_TEST_CASE(fixed_array_cleanup)
}
)";
ALSO_VIA_YUL(
DISABLE_EWASM_TESTRUN()
compileAndRun(sourceCode);
BOOST_CHECK(storageEmpty(m_contractAddress));
ABI_CHECK(callContractFunction("fill()"), bytes());
@@ -3010,6 +3114,8 @@ BOOST_AUTO_TEST_CASE(short_fixed_array_cleanup)
}
)";
ALSO_VIA_YUL(
DISABLE_EWASM_TESTRUN()
compileAndRun(sourceCode);
BOOST_CHECK(storageEmpty(m_contractAddress));
ABI_CHECK(callContractFunction("fill()"), bytes());
@@ -3037,6 +3143,8 @@ BOOST_AUTO_TEST_CASE(dynamic_array_cleanup)
}
)";
ALSO_VIA_YUL(
DISABLE_EWASM_TESTRUN()
compileAndRun(sourceCode);
BOOST_CHECK(storageEmpty(m_contractAddress));
ABI_CHECK(callContractFunction("fill()"), bytes());
@@ -4305,6 +4413,8 @@ BOOST_AUTO_TEST_CASE(string_as_mapping_key)
};
ALSO_VIA_YUL(
DISABLE_EWASM_TESTRUN()
compileAndRun(sourceCode, 0, "Test");
for (unsigned i = 0; i < strings.size(); i++)
ABI_CHECK(callContractFunction(
@@ -5415,6 +5525,8 @@ BOOST_AUTO_TEST_CASE(no_nonpayable_circumvention_by_modifier)
}
)";
ALSO_VIA_YUL(
DISABLE_EWASM_TESTRUN()
compileAndRun(sourceCode);
ABI_CHECK(callContractFunctionWithValue("f()", 27), encodeArgs());
BOOST_CHECK_EQUAL(balanceAt(m_contractAddress), 0);
@@ -5527,6 +5639,8 @@ BOOST_AUTO_TEST_CASE(contracts_separated_with_comment)
contract C2 {}
)";
ALSO_VIA_YUL(
DISABLE_EWASM_TESTRUN()
compileAndRun(sourceCode, 0, "C1");
compileAndRun(sourceCode, 0, "C2");
)
+31 -28
View File
@@ -43,6 +43,7 @@ bytes SolidityExecutionFramework::multiSourceCompileContract(
entry.second = addPreamble(entry.second);
m_compiler.reset();
m_compiler.enableEwasmGeneration(m_compileToEwasm);
m_compiler.setSources(sourcesWithPreamble);
m_compiler.setLibraries(_libraryAddresses);
m_compiler.setRevertStringBehaviour(m_revertStrings);
@@ -63,38 +64,40 @@ bytes SolidityExecutionFramework::multiSourceCompileContract(
evmasm::LinkerObject obj;
if (m_compileViaYul)
{
// Try compiling twice: If the first run fails due to stack errors, forcefully enable
// the optimizer.
for (bool forceEnableOptimizer: {false, true})
if (m_compileToEwasm)
obj = m_compiler.ewasmObject(contractName);
else
{
OptimiserSettings optimiserSettings = m_optimiserSettings;
if (!forceEnableOptimizer && !optimiserSettings.runYulOptimiser)
// Try compiling twice: If the first run fails due to stack errors, forcefully enable
// the optimizer.
for (bool forceEnableOptimizer: {false, true})
{
// Enable some optimizations on the first run
optimiserSettings.runYulOptimiser = true;
optimiserSettings.yulOptimiserSteps = "uljmul jmul";
}
else if (forceEnableOptimizer)
optimiserSettings = OptimiserSettings::full();
OptimiserSettings optimiserSettings = m_optimiserSettings;
if (!forceEnableOptimizer && !optimiserSettings.runYulOptimiser)
{
// Enable some optimizations on the first run
optimiserSettings.runYulOptimiser = true;
optimiserSettings.yulOptimiserSteps = "uljmul jmul";
}
else if (forceEnableOptimizer)
optimiserSettings = OptimiserSettings::full();
yul::AssemblyStack asmStack(
m_evmVersion,
yul::AssemblyStack::Language::StrictAssembly,
optimiserSettings
);
bool analysisSuccessful = asmStack.parseAndAnalyze("", m_compiler.yulIROptimized(contractName));
solAssert(analysisSuccessful, "Code that passed analysis in CompilerStack can't have errors");
yul::AssemblyStack
asmStack(m_evmVersion, yul::AssemblyStack::Language::StrictAssembly, optimiserSettings);
bool analysisSuccessful = asmStack.parseAndAnalyze("", m_compiler.yulIROptimized(contractName));
solAssert(analysisSuccessful, "Code that passed analysis in CompilerStack can't have errors");
try
{
asmStack.optimize();
obj = std::move(*asmStack.assemble(yul::AssemblyStack::Machine::EVM).bytecode);
break;
}
catch (...)
{
if (forceEnableOptimizer || optimiserSettings == OptimiserSettings::full())
throw;
try
{
asmStack.optimize();
obj = std::move(*asmStack.assemble(yul::AssemblyStack::Machine::EVM).bytecode);
break;
}
catch (...)
{
if (forceEnableOptimizer || optimiserSettings == OptimiserSettings::full())
throw;
}
}
}
}
@@ -43,8 +43,8 @@ class SolidityExecutionFramework: public solidity::test::ExecutionFramework
public:
SolidityExecutionFramework(): m_showMetadata(solidity::test::CommonOptions::get().showMetadata) {}
explicit SolidityExecutionFramework(langutil::EVMVersion _evmVersion):
ExecutionFramework(_evmVersion), m_showMetadata(solidity::test::CommonOptions::get().showMetadata)
explicit SolidityExecutionFramework(langutil::EVMVersion _evmVersion, std::vector<boost::filesystem::path> const& _vmPaths):
ExecutionFramework(_evmVersion, _vmPaths), m_showMetadata(solidity::test::CommonOptions::get().showMetadata)
{}
bytes const& compileAndRunWithoutCheck(
@@ -76,8 +76,10 @@ public:
/// the latter only if it is required.
static std::string addPreamble(std::string const& _sourceCode);
protected:
solidity::frontend::CompilerStack m_compiler;
bool m_compileViaYul = false;
bool m_compileToEwasm = false;
bool m_showMetadata = false;
RevertStrings m_revertStrings = RevertStrings::Default;
};
@@ -26,6 +26,7 @@
#include <liblangutil/Scanner.h>
#include <libsolidity/parsing/Parser.h>
#include <libsolidity/analysis/NameAndTypeResolver.h>
#include <libsolidity/analysis/Scoper.h>
#include <libsolidity/analysis/DeclarationTypeChecker.h>
#include <libsolidity/codegen/CompilerContext.h>
#include <libsolidity/codegen/ExpressionCompiler.h>
@@ -117,6 +118,7 @@ bytes compileFirstExpression(
ErrorList errors;
ErrorReporter errorReporter(errors);
GlobalContext globalContext;
Scoper::assignScopes(*sourceUnit);
NameAndTypeResolver resolver(globalContext, solidity::test::CommonOptions::get().evmVersion(), errorReporter);
resolver.registerDeclarations(*sourceUnit);
BOOST_REQUIRE_MESSAGE(resolver.resolveNamesAndTypes(*sourceUnit), "Resolving names failed");
@@ -17,9 +17,9 @@ contract C {
// optimize-yul: true
// ----
// creation:
// codeDepositCost: 614600
// executionCost: 651
// totalCost: 615251
// codeDepositCost: 597000
// executionCost: 632
// totalCost: 597632
// external:
// a(): 1029
// b(uint256): 2084
@@ -12,5 +12,7 @@ contract c {
}
}
// ====
// compileViaYul: also
// ----
// test() -> 1, 2, 3, 4
@@ -0,0 +1,16 @@
contract C {
uint8[33] a;
uint32[9] b;
uint120[3] c;
function f() public returns (uint8, uint32, uint120) {
a[32] = 1; a[31] = 2; a[30] = 3;
b[0] = 1; b[1] = 2; b[2] = 3;
c[2] = 3; c[1] = 1;
return (a[32], b[1], c[2]);
}
}
// ====
// compileViaYul: also
// ----
// f() -> 1, 2, 3
@@ -8,4 +8,4 @@ contract C {
}
}
// ----
// Warning 2529: (82-89): Empty array "pop" detected here
// Warning 2529: (82-89): Empty array "pop" detected here.
@@ -8,4 +8,4 @@ contract C {
}
}
// ----
// Warning 2529: (82-89): Empty array "pop" detected here
// Warning 2529: (82-89): Empty array "pop" detected here.
@@ -8,5 +8,5 @@ contract C {
}
}
// ----
// Warning 2529: (82-89): Empty array "pop" detected here
// Warning 2529: (93-100): Empty array "pop" detected here
// Warning 2529: (82-89): Empty array "pop" detected here.
// Warning 2529: (93-100): Empty array "pop" detected here.
@@ -8,4 +8,4 @@ contract C {
}
}
// ----
// Warning 2529: (94-101): Empty array "pop" detected here
// Warning 2529: (94-101): Empty array "pop" detected here.
@@ -11,4 +11,4 @@ contract C {
}
}
// ----
// Warning 2529: (122-129): Empty array "pop" detected here
// Warning 2529: (122-129): Empty array "pop" detected here.
@@ -11,4 +11,4 @@ contract C {
}
}
// ----
// Warning 2529: (127-134): Empty array "pop" detected here
// Warning 2529: (127-134): Empty array "pop" detected here.
@@ -13,4 +13,4 @@ contract C {
}
}
// ----
// Warning 2529: (82-89): Empty array "pop" detected here
// Warning 2529: (82-89): Empty array "pop" detected here.
@@ -10,4 +10,4 @@ contract C {
}
}
// ----
// Warning 6328: (153-176): Assertion violation happens here
// Warning 6328: (153-176): Assertion violation happens here.
@@ -14,6 +14,6 @@ contract C {
}
}
// ----
// Warning 6328: (198-224): Assertion violation happens here
// Warning 6328: (228-254): Assertion violation happens here
// Warning 6328: (258-281): Assertion violation happens here
// Warning 6328: (198-224): Assertion violation happens here.
// Warning 6328: (228-254): Assertion violation happens here.
// Warning 6328: (258-281): Assertion violation happens here.
@@ -16,7 +16,7 @@ contract C {
}
}
// ----
// Warning 6328: (222-248): Assertion violation happens here
// Warning 6328: (252-278): Assertion violation happens here
// Warning 6328: (282-305): Assertion violation happens here
// Warning 6328: (309-335): Assertion violation happens here
// Warning 6328: (222-248): Assertion violation happens here.
// Warning 6328: (252-278): Assertion violation happens here.
// Warning 6328: (282-305): Assertion violation happens here.
// Warning 6328: (309-335): Assertion violation happens here.
@@ -7,4 +7,4 @@ contract C {
}
}
// ----
// Warning 2529: (82-89): Empty array "pop" detected here
// Warning 2529: (82-89): Empty array "pop" detected here.
@@ -9,4 +9,4 @@ contract C {
}
}
// ----
// Warning 2529: (111-121): Empty array "pop" detected here
// Warning 2529: (111-121): Empty array "pop" detected here.
@@ -7,4 +7,4 @@ contract C {
}
}
// ----
// Warning 2529: (76-83): Empty array "pop" detected here
// Warning 2529: (76-83): Empty array "pop" detected here.
@@ -11,4 +11,4 @@ contract C {
}
}
// ----
// Warning 2529: (150-157): Empty array "pop" detected here
// Warning 2529: (150-157): Empty array "pop" detected here.
@@ -10,5 +10,5 @@ contract C {
}
}
// ----
// Warning 3944: (162-177): Underflow (resulting value less than 0) happens here
// Warning 6328: (150-184): Assertion violation happens here
// Warning 3944: (162-177): Underflow (resulting value less than 0) happens here.
// Warning 6328: (150-184): Assertion violation happens here.
@@ -8,5 +8,5 @@ contract C {
}
}
// ----
// Warning 6328: (113-139): Assertion violation happens here
// Warning 6328: (143-189): Assertion violation happens here
// Warning 6328: (113-139): Assertion violation happens here.
// Warning 6328: (143-189): Assertion violation happens here.
@@ -10,6 +10,6 @@ contract C {
}
}
// ----
// Warning 6328: (122-148): Assertion violation happens here
// Warning 6328: (202-218): Assertion violation happens here
// Warning 6328: (222-278): Assertion violation happens here
// Warning 6328: (122-148): Assertion violation happens here.
// Warning 6328: (202-218): Assertion violation happens here.
// Warning 6328: (222-278): Assertion violation happens here.
@@ -12,5 +12,5 @@ contract C {
}
}
// ----
// Warning 3944: (217-232): Underflow (resulting value less than 0) happens here
// Warning 6328: (205-239): Assertion violation happens here
// Warning 3944: (217-232): Underflow (resulting value less than 0) happens here.
// Warning 6328: (205-239): Assertion violation happens here.
@@ -12,4 +12,4 @@ contract C {
}
}
// ----
// Warning 6328: (167-188): Assertion violation happens here
// Warning 6328: (167-188): Assertion violation happens here.
@@ -18,6 +18,6 @@ contract C {
}
}
// ----
// Warning 6328: (193-217): Assertion violation happens here
// Warning 6328: (309-333): Assertion violation happens here
// Warning 6328: (419-436): Assertion violation happens here
// Warning 6328: (193-217): Assertion violation happens here.
// Warning 6328: (309-333): Assertion violation happens here.
// Warning 6328: (419-436): Assertion violation happens here.
@@ -9,4 +9,4 @@ contract C {
}
}
// ----
// Warning 6328: (111-144): Assertion violation happens here
// Warning 6328: (111-144): Assertion violation happens here.
@@ -8,4 +8,4 @@ contract C {
}
}
// ----
// Warning 6328: (94-124): Assertion violation happens here
// Warning 6328: (94-124): Assertion violation happens here.
@@ -15,4 +15,4 @@ contract C {
}
}
// ----
// Warning 6328: (184-213): Assertion violation happens here
// Warning 6328: (184-213): Assertion violation happens here.
@@ -53,4 +53,4 @@ contract MyConc{
// ----
// Warning 2519: (773-792): This declaration shadows an existing declaration.
// Warning 2018: (1009-1086): Function state mutability can be restricted to view
// Warning 4984: (985-1002): Overflow (resulting value larger than 2**256 - 1) happens here
// Warning 4984: (985-1002): Overflow (resulting value larger than 2**256 - 1) happens here.
@@ -15,4 +15,4 @@ contract c {
}
}
// ----
// Warning 6328: (227-236): Assertion violation happens here
// Warning 6328: (227-236): Assertion violation happens here.
@@ -17,5 +17,5 @@ contract c {
}
}
// ----
// Warning 6328: (202-218): Assertion violation happens here
// Warning 6328: (242-252): Assertion violation happens here
// Warning 6328: (202-218): Assertion violation happens here.
// Warning 6328: (242-252): Assertion violation happens here.
@@ -15,4 +15,4 @@ contract c {
}
}
// ----
// Warning 6328: (225-235): Assertion violation happens here
// Warning 6328: (225-235): Assertion violation happens here.
@@ -15,4 +15,4 @@ contract c {
}
}
// ----
// Warning 6328: (225-235): Assertion violation happens here
// Warning 6328: (225-235): Assertion violation happens here.
@@ -24,4 +24,4 @@ contract c {
}
}
// ----
// Warning 6328: (360-370): Assertion violation happens here
// Warning 6328: (360-370): Assertion violation happens here.
@@ -15,4 +15,4 @@ contract c {
}
}
// ----
// Warning 6328: (225-235): Assertion violation happens here
// Warning 6328: (225-235): Assertion violation happens here.
@@ -9,4 +9,4 @@ contract C {
}
}
// ----
// Warning 6328: (159-173): Assertion violation happens here
// Warning 6328: (159-173): Assertion violation happens here.
@@ -9,4 +9,4 @@ contract C {
}
}
// ----
// Warning 6328: (159-173): Assertion violation happens here
// Warning 6328: (159-173): Assertion violation happens here.
@@ -9,4 +9,4 @@ contract C {
}
}
// ----
// Warning 6328: (161-175): Assertion violation happens here
// Warning 6328: (161-175): Assertion violation happens here.
@@ -17,4 +17,4 @@ contract C {
}
}
// ----
// Warning 6328: (200-214): Assertion violation happens here
// Warning 6328: (200-214): Assertion violation happens here.
@@ -26,4 +26,4 @@ contract C {
}
}
// ----
// Warning 6328: (423-445): Assertion violation happens here
// Warning 6328: (423-445): Assertion violation happens here.
@@ -28,4 +28,4 @@ contract C {
}
}
// ----
// Warning 6328: (431-453): Assertion violation happens here
// Warning 6328: (431-453): Assertion violation happens here.
@@ -34,5 +34,5 @@ contract C {
}
}
// ----
// Warning 6328: (528-565): Assertion violation happens here
// Warning 6328: (528-565): Assertion violation happens here.
// Warning 5084: (544-554): Type conversion is not yet fully supported and might yield false positives.
@@ -29,4 +29,4 @@ contract C {
}
}
// ----
// Warning 6328: (299-313): Assertion violation happens here
// Warning 6328: (299-313): Assertion violation happens here.
@@ -42,6 +42,6 @@ contract C {
}
}
// ----
// Warning 6328: (452-466): Assertion violation happens here
// Warning 6328: (470-496): Assertion violation happens here
// Warning 6328: (452-466): Assertion violation happens here.
// Warning 6328: (470-496): Assertion violation happens here.
// Warning 5084: (92-102): Type conversion is not yet fully supported and might yield false positives.
@@ -34,6 +34,6 @@ contract C {
}
}
// ----
// Warning 6328: (381-395): Assertion violation happens here
// Warning 6328: (399-425): Assertion violation happens here
// Warning 6328: (381-395): Assertion violation happens here.
// Warning 6328: (399-425): Assertion violation happens here.
// Warning 5084: (116-126): Type conversion is not yet fully supported and might yield false positives.
@@ -38,6 +38,6 @@ contract C {
}
}
// ----
// Warning 6328: (435-461): Assertion violation happens here
// Warning 6328: (594-631): Assertion violation happens here
// Warning 6328: (435-461): Assertion violation happens here.
// Warning 6328: (594-631): Assertion violation happens here.
// Warning 5084: (610-620): Type conversion is not yet fully supported and might yield false positives.
@@ -18,5 +18,5 @@ contract C {
}
}
// ----
// Warning 6328: (189-203): Assertion violation happens here
// Warning 2661: (146-149): Overflow (resulting value larger than 2**256 - 1) happens here
// Warning 6328: (189-203): Assertion violation happens here.
// Warning 2661: (146-149): Overflow (resulting value larger than 2**256 - 1) happens here.
@@ -25,4 +25,4 @@ contract C {
}
}
// ----
// Warning 6328: (286-303): Assertion violation happens here
// Warning 6328: (286-303): Assertion violation happens here.
@@ -23,4 +23,4 @@ contract C {
}
}
// ----
// Warning 6328: (256-273): Assertion violation happens here
// Warning 6328: (256-273): Assertion violation happens here.
@@ -27,4 +27,4 @@ contract C {
}
}
// ----
// Warning 6328: (307-321): Assertion violation happens here
// Warning 6328: (307-321): Assertion violation happens here.
@@ -13,4 +13,4 @@ contract A is C {
}
}
// ----
// Warning 6328: (152-166): Assertion violation happens here
// Warning 6328: (152-166): Assertion violation happens here.
@@ -4,4 +4,4 @@ contract A is C { constructor() C(2) { assert(a == 2); } }
contract B is C { constructor() C(3) { assert(a == 3); } }
contract J is C { constructor() C(3) { assert(a == 4); } }
// ----
// Warning 6328: (243-257): Assertion violation happens here
// Warning 6328: (243-257): Assertion violation happens here.
@@ -19,6 +19,6 @@ contract A is B {
}
}
// ----
// Warning 4984: (203-208): Overflow (resulting value larger than 2**256 - 1) happens here
// Warning 4984: (244-249): Overflow (resulting value larger than 2**256 - 1) happens here
// Warning 6328: (232-250): Assertion violation happens here
// Warning 4984: (203-208): Overflow (resulting value larger than 2**256 - 1) happens here.
// Warning 4984: (244-249): Overflow (resulting value larger than 2**256 - 1) happens here.
// Warning 6328: (232-250): Assertion violation happens here.
@@ -18,6 +18,6 @@ contract A is B {
}
}
// ----
// Warning 4984: (198-203): Overflow (resulting value larger than 2**256 - 1) happens here
// Warning 4984: (207-212): Overflow (resulting value larger than 2**256 - 1) happens here
// Warning 4984: (230-235): Overflow (resulting value larger than 2**256 - 1) happens here
// Warning 4984: (198-203): Overflow (resulting value larger than 2**256 - 1) happens here.
// Warning 4984: (207-212): Overflow (resulting value larger than 2**256 - 1) happens here.
// Warning 4984: (230-235): Overflow (resulting value larger than 2**256 - 1) happens here.
@@ -25,6 +25,6 @@ contract A is B2, B1 {
}
}
// ----
// Warning 4984: (200-205): Overflow (resulting value larger than 2**256 - 1) happens here
// Warning 4984: (314-319): Overflow (resulting value larger than 2**256 - 1) happens here
// Warning 6328: (302-320): Assertion violation happens here
// Warning 4984: (200-205): Overflow (resulting value larger than 2**256 - 1) happens here.
// Warning 4984: (314-319): Overflow (resulting value larger than 2**256 - 1) happens here.
// Warning 6328: (302-320): Assertion violation happens here.
@@ -25,6 +25,6 @@ contract A is B2, B1 {
}
}
// ----
// Warning 4984: (200-205): Overflow (resulting value larger than 2**256 - 1) happens here
// Warning 4984: (314-319): Overflow (resulting value larger than 2**256 - 1) happens here
// Warning 6328: (302-320): Assertion violation happens here
// Warning 4984: (200-205): Overflow (resulting value larger than 2**256 - 1) happens here.
// Warning 4984: (314-319): Overflow (resulting value larger than 2**256 - 1) happens here.
// Warning 6328: (302-320): Assertion violation happens here.
@@ -27,7 +27,7 @@ contract A is B2, B1 {
}
}
// ----
// Warning 4984: (160-165): Overflow (resulting value larger than 2**256 - 1) happens here
// Warning 4984: (225-230): Overflow (resulting value larger than 2**256 - 1) happens here
// Warning 4984: (241-246): Overflow (resulting value larger than 2**256 - 1) happens here
// Warning 6328: (334-350): Assertion violation happens here
// Warning 4984: (160-165): Overflow (resulting value larger than 2**256 - 1) happens here.
// Warning 4984: (225-230): Overflow (resulting value larger than 2**256 - 1) happens here.
// Warning 4984: (241-246): Overflow (resulting value larger than 2**256 - 1) happens here.
// Warning 6328: (334-350): Assertion violation happens here.
@@ -20,4 +20,4 @@ contract A is B, B2 {
}
// ----
// Warning 5667: (164-170): Unused function parameter. Remove or comment out the variable name to silence this warning.
// Warning 6328: (194-208): Assertion violation happens here
// Warning 6328: (194-208): Assertion violation happens here.
@@ -19,4 +19,4 @@ contract A is B {
}
// ----
// Warning 5667: (194-200): Unused function parameter. Remove or comment out the variable name to silence this warning.
// Warning 6328: (224-238): Assertion violation happens here
// Warning 6328: (224-238): Assertion violation happens here.
@@ -17,4 +17,4 @@ contract A is B {
}
// ----
// Warning 5667: (138-144): Unused function parameter. Remove or comment out the variable name to silence this warning.
// Warning 6328: (172-186): Assertion violation happens here
// Warning 6328: (172-186): Assertion violation happens here.
@@ -16,4 +16,4 @@ contract A is B {
}
// ----
// Warning 5667: (138-144): Unused function parameter. Remove or comment out the variable name to silence this warning.
// Warning 6328: (150-164): Assertion violation happens here
// Warning 6328: (150-164): Assertion violation happens here.
@@ -27,4 +27,4 @@ contract A is B {
}
// ----
// Warning 5667: (254-260): Unused function parameter. Remove or comment out the variable name to silence this warning.
// Warning 6328: (284-298): Assertion violation happens here
// Warning 6328: (284-298): Assertion violation happens here.
@@ -32,4 +32,4 @@ contract A is B {
}
// ----
// Warning 5667: (296-302): Unused function parameter. Remove or comment out the variable name to silence this warning.
// Warning 6328: (357-372): Assertion violation happens here
// Warning 6328: (357-372): Assertion violation happens here.
@@ -25,5 +25,5 @@ contract A is B {
}
}
// ----
// Warning 4984: (247-252): Overflow (resulting value larger than 2**256 - 1) happens here
// Warning 6328: (328-342): Assertion violation happens here
// Warning 4984: (247-252): Overflow (resulting value larger than 2**256 - 1) happens here.
// Warning 6328: (328-342): Assertion violation happens here.
@@ -23,4 +23,4 @@ contract B is C {
contract A is B {
}
// ----
// Warning 6328: (266-280): Assertion violation happens here
// Warning 6328: (266-280): Assertion violation happens here.
@@ -14,4 +14,4 @@ contract A is C {
}
}
// ----
// Warning 6328: (188-202): Assertion violation happens here
// Warning 6328: (188-202): Assertion violation happens here.
@@ -13,5 +13,5 @@ contract A is C {
}
}
// ----
// Warning 6328: (134-148): Assertion violation happens here
// Warning 6328: (152-168): Assertion violation happens here
// Warning 6328: (134-148): Assertion violation happens here.
// Warning 6328: (152-168): Assertion violation happens here.
@@ -13,4 +13,4 @@ contract C {
}
}
// ----
// Warning 6328: (141-155): Assertion violation happens here
// Warning 6328: (141-155): Assertion violation happens here.
@@ -13,4 +13,4 @@ contract C {
}
}
// ----
// Warning 6328: (145-159): Assertion violation happens here
// Warning 6328: (145-159): Assertion violation happens here.
@@ -15,4 +15,4 @@ contract C is B {
}
}
// ----
// Warning 6328: (165-179): Assertion violation happens here
// Warning 6328: (165-179): Assertion violation happens here.
@@ -13,5 +13,5 @@ contract C {
}
}
// ----
// Warning 4984: (115-120): Overflow (resulting value larger than 2**256 - 1) happens here
// Warning 6328: (162-176): Assertion violation happens here
// Warning 4984: (115-120): Overflow (resulting value larger than 2**256 - 1) happens here.
// Warning 6328: (162-176): Assertion violation happens here.
@@ -9,4 +9,4 @@ contract C {
}
}
// ----
// Warning 6328: (116-132): Assertion violation happens here
// Warning 6328: (116-132): Assertion violation happens here.
@@ -16,4 +16,4 @@ contract C
}
}
// ----
// Warning 6328: (209-223): Assertion violation happens here
// Warning 6328: (209-223): Assertion violation happens here.
@@ -24,5 +24,5 @@ contract C
}
// ----
// Warning 6328: (209-223): Assertion violation happens here
// Warning 6328: (321-335): Assertion violation happens here
// Warning 6328: (209-223): Assertion violation happens here.
// Warning 6328: (321-335): Assertion violation happens here.
@@ -18,4 +18,4 @@ contract C
}
}
// ----
// Warning 6328: (261-277): Assertion violation happens here
// Warning 6328: (261-277): Assertion violation happens here.
@@ -17,4 +17,5 @@ contract C
}
}
// ----
// Warning 4661: (297-321): Assertion violation happens here
// Warning 1218: (297-321): Error trying to invoke SMT solver.
// Warning 4661: (297-321): Assertion violation happens here.
@@ -16,4 +16,4 @@ contract D
}
}
// ----
// Warning 6328: (191-206): Assertion violation happens here
// Warning 6328: (191-206): Assertion violation happens here.
@@ -12,4 +12,4 @@ contract C
}
// ----
// Warning 6328: (161-174): Assertion violation happens here
// Warning 6328: (161-174): Assertion violation happens here.
@@ -16,4 +16,4 @@ contract C
}
// ----
// Warning 6328: (229-242): Assertion violation happens here
// Warning 6328: (229-242): Assertion violation happens here.
@@ -12,4 +12,4 @@ contract C
}
// ----
// Warning 6328: (163-176): Assertion violation happens here
// Warning 6328: (163-176): Assertion violation happens here.
@@ -17,5 +17,5 @@ contract C
}
}
// ----
// Warning 6328: (245-261): Assertion violation happens here
// Warning 6328: (245-261): Assertion violation happens here.
// Warning 8364: (228-229): Assertion checker does not yet implement type type(library L)
@@ -13,4 +13,4 @@ contract C
}
// ----
// Warning 6328: (144-157): Assertion violation happens here
// Warning 6328: (144-157): Assertion violation happens here.
@@ -14,4 +14,4 @@ contract C
}
// ----
// Warning 6328: (152-165): Assertion violation happens here
// Warning 6328: (152-165): Assertion violation happens here.
@@ -17,4 +17,4 @@ contract A is B {
}
}
// ----
// Warning 6328: (254-268): Assertion violation happens here
// Warning 6328: (254-268): Assertion violation happens here.
@@ -21,4 +21,4 @@ contract A is B {
}
}
// ----
// Warning 6328: (274-288): Assertion violation happens here
// Warning 6328: (274-288): Assertion violation happens here.
@@ -21,5 +21,5 @@ contract C{
}
// ----
// Warning 5667: (70-76): Unused function parameter. Remove or comment out the variable name to silence this warning.
// Warning 2661: (156-159): Overflow (resulting value larger than 2**256 - 1) happens here
// Warning 4144: (238-241): Underflow (resulting value less than 0) happens here
// Warning 2661: (156-159): Overflow (resulting value larger than 2**256 - 1) happens here.
// Warning 4144: (238-241): Underflow (resulting value less than 0) happens here.
@@ -21,10 +21,10 @@ contract C{
}
// ----
// Warning 5667: (70-76): Unused function parameter. Remove or comment out the variable name to silence this warning.
// Warning 6328: (138-152): Assertion violation happens here
// Warning 6328: (170-184): Assertion violation happens here
// Warning 6328: (220-234): Assertion violation happens here
// Warning 6328: (245-259): Assertion violation happens here
// Warning 6328: (82-96): Assertion violation happens here
// Warning 2661: (156-159): Overflow (resulting value larger than 2**256 - 1) happens here
// Warning 4144: (238-241): Underflow (resulting value less than 0) happens here
// Warning 6328: (138-152): Assertion violation happens here.
// Warning 6328: (170-184): Assertion violation happens here.
// Warning 6328: (220-234): Assertion violation happens here.
// Warning 6328: (245-259): Assertion violation happens here.
// Warning 6328: (82-96): Assertion violation happens here.
// Warning 2661: (156-159): Overflow (resulting value larger than 2**256 - 1) happens here.
// Warning 4144: (238-241): Underflow (resulting value less than 0) happens here.
@@ -17,5 +17,5 @@ contract C is A {
}
}
// ----
// Warning 4144: (100-103): Underflow (resulting value less than 0) happens here
// Warning 4144: (100-103): Underflow (resulting value less than 0) happens here
// Warning 4144: (100-103): Underflow (resulting value less than 0) happens here.
// Warning 4144: (100-103): Underflow (resulting value less than 0) happens here.
@@ -17,8 +17,8 @@ contract C is A {
}
}
// ----
// Warning 6328: (82-96): Assertion violation happens here
// Warning 6328: (148-162): Assertion violation happens here
// Warning 6328: (180-194): Assertion violation happens here
// Warning 4144: (100-103): Underflow (resulting value less than 0) happens here
// Warning 4144: (100-103): Underflow (resulting value less than 0) happens here
// Warning 6328: (82-96): Assertion violation happens here.
// Warning 6328: (148-162): Assertion violation happens here.
// Warning 6328: (180-194): Assertion violation happens here.
// Warning 4144: (100-103): Underflow (resulting value less than 0) happens here.
// Warning 4144: (100-103): Underflow (resulting value less than 0) happens here.
@@ -21,7 +21,7 @@ contract C{
}
// ----
// Warning 5667: (70-76): Unused function parameter. Remove or comment out the variable name to silence this warning.
// Warning 2661: (156-159): Overflow (resulting value larger than 2**256 - 1) happens here
// Warning 2661: (163-166): Overflow (resulting value larger than 2**256 - 1) happens here
// Warning 2661: (234-237): Overflow (resulting value larger than 2**256 - 1) happens here
// Warning 4144: (234-237): Underflow (resulting value less than 0) happens here
// Warning 2661: (156-159): Overflow (resulting value larger than 2**256 - 1) happens here.
// Warning 2661: (163-166): Overflow (resulting value larger than 2**256 - 1) happens here.
// Warning 2661: (234-237): Overflow (resulting value larger than 2**256 - 1) happens here.
// Warning 4144: (234-237): Underflow (resulting value less than 0) happens here.
@@ -21,10 +21,10 @@ contract C{
}
// ----
// Warning 5667: (70-76): Unused function parameter. Remove or comment out the variable name to silence this warning.
// Warning 6328: (138-152): Assertion violation happens here
// Warning 6328: (184-198): Assertion violation happens here
// Warning 6328: (82-96): Assertion violation happens here
// Warning 2661: (156-159): Overflow (resulting value larger than 2**256 - 1) happens here
// Warning 2661: (163-166): Overflow (resulting value larger than 2**256 - 1) happens here
// Warning 2661: (234-237): Overflow (resulting value larger than 2**256 - 1) happens here
// Warning 4144: (234-237): Underflow (resulting value less than 0) happens here
// Warning 6328: (138-152): Assertion violation happens here.
// Warning 6328: (184-198): Assertion violation happens here.
// Warning 6328: (82-96): Assertion violation happens here.
// Warning 2661: (156-159): Overflow (resulting value larger than 2**256 - 1) happens here.
// Warning 2661: (163-166): Overflow (resulting value larger than 2**256 - 1) happens here.
// Warning 2661: (234-237): Overflow (resulting value larger than 2**256 - 1) happens here.
// Warning 4144: (234-237): Underflow (resulting value less than 0) happens here.
@@ -19,7 +19,7 @@ contract C {
}
}
// ----
// Warning 6328: (136-155): Assertion violation happens here
// Warning 4984: (229-234): Overflow (resulting value larger than 2**256 - 1) happens here
// Warning 6328: (136-155): Assertion violation happens here.
// Warning 4984: (229-234): Overflow (resulting value larger than 2**256 - 1) happens here.
// Warning 4984: (327-332): Overflow (resulting value larger than 2**256 - 1) happens here.
// Warning 8364: (300-302): Assertion checker does not yet implement type type(library l1)
@@ -14,4 +14,4 @@ contract C
}
}
// ----
// Warning 6328: (227-243): Assertion violation happens here
// Warning 6328: (227-243): Assertion violation happens here.
@@ -15,4 +15,4 @@ contract C
}
}
// ----
// Warning 6328: (263-279): Assertion violation happens here
// Warning 6328: (263-279): Assertion violation happens here.
@@ -21,4 +21,4 @@ contract C
}
// ----
// Warning 2319: (160-166): This declaration shadows a builtin symbol.
// Warning 6328: (268-282): Assertion violation happens here
// Warning 6328: (268-282): Assertion violation happens here.

Some files were not shown because too many files have changed in this diff Show More