mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Run tests with both ABIV2 and Yul optimizer.
This commit is contained in:
parent
44fc658aa0
commit
c0ce540e26
@ -203,7 +203,7 @@ do
|
||||
force_abiv2_flag=""
|
||||
if [[ "$abiv2" == "yes" ]]
|
||||
then
|
||||
force_abiv2_flag="--abiencoderv2"
|
||||
force_abiv2_flag="--abiencoderv2 --optimize-yul"
|
||||
fi
|
||||
printTask "--> Running tests using "$optimize" --evm-version "$vm" $force_abiv2_flag..."
|
||||
|
||||
|
@ -37,6 +37,7 @@ struct CommonOptions: boost::noncopyable
|
||||
boost::filesystem::path ipcPath;
|
||||
boost::filesystem::path testPath;
|
||||
bool optimize = false;
|
||||
bool optimizeYul = false;
|
||||
bool disableIPC = false;
|
||||
bool disableSMT = false;
|
||||
|
||||
|
@ -57,10 +57,14 @@ ExecutionFramework::ExecutionFramework():
|
||||
ExecutionFramework::ExecutionFramework(string const& _ipcPath, langutil::EVMVersion _evmVersion):
|
||||
m_rpc(RPCSession::instance(_ipcPath)),
|
||||
m_evmVersion(_evmVersion),
|
||||
m_optimiserSettings(dev::test::Options::get().optimize ? solidity::OptimiserSettings::standard() : solidity::OptimiserSettings::minimal()),
|
||||
m_optimiserSettings(solidity::OptimiserSettings::minimal()),
|
||||
m_showMessages(dev::test::Options::get().showMessages),
|
||||
m_sender(m_rpc.account(0))
|
||||
{
|
||||
if (dev::test::Options::get().optimizeYul)
|
||||
m_optimiserSettings = solidity::OptimiserSettings::full();
|
||||
else if (dev::test::Options::get().optimize)
|
||||
m_optimiserSettings = solidity::OptimiserSettings::standard();
|
||||
m_rpc.test_rewindToBlock(0);
|
||||
}
|
||||
|
||||
|
@ -52,6 +52,7 @@ Options::Options()
|
||||
|
||||
options.add_options()
|
||||
("optimize", po::bool_switch(&optimize), "enables optimization")
|
||||
("optimize-yul", po::bool_switch(&optimizeYul), "enables Yul optimization")
|
||||
("abiencoderv2", po::bool_switch(&useABIEncoderV2), "enables abi encoder v2")
|
||||
("show-messages", po::bool_switch(&showMessages), "enables message output");
|
||||
|
||||
|
@ -72,7 +72,12 @@ BOOST_AUTO_TEST_CASE(string_storage)
|
||||
CHECK_GAS(133899, 130591, 100);
|
||||
// This is only correct on >=Constantinople.
|
||||
else if (Options::get().useABIEncoderV2)
|
||||
CHECK_GAS(151283, 136003, 100);
|
||||
{
|
||||
if (Options::get().optimizeYul)
|
||||
CHECK_GAS(151283, 128285, 100);
|
||||
else
|
||||
CHECK_GAS(151283, 136003, 100);
|
||||
}
|
||||
else
|
||||
CHECK_GAS(126689, 120159, 100);
|
||||
if (Options::get().evmVersion() >= EVMVersion::byzantium())
|
||||
@ -82,7 +87,12 @@ BOOST_AUTO_TEST_CASE(string_storage)
|
||||
CHECK_GAS(21551, 21526, 20);
|
||||
// This is only correct on >=Constantinople.
|
||||
else if (Options::get().useABIEncoderV2)
|
||||
CHECK_GAS(21713, 21635, 20);
|
||||
{
|
||||
if (Options::get().optimizeYul)
|
||||
CHECK_GAS(21713, 21567, 20);
|
||||
else
|
||||
CHECK_GAS(21713, 21635, 20);
|
||||
}
|
||||
else
|
||||
CHECK_GAS(21546, 21526, 20);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user