Rerun SolidityEndToEndTest.cpp tests on stack errors.

This commit is contained in:
Daniel Kirchner 2021-09-14 16:58:40 +02:00 committed by Kamil Śliwak
parent bc6d10f11d
commit b9db435684

View File

@ -35,6 +35,8 @@
#include <libsolutil/Keccak256.h>
#include <libsolutil/ErrorCodes.h>
#include <libyul/Exceptions.h>
#include <boost/test/unit_test.hpp>
#include <range/v3/view/transform.hpp>
@ -54,13 +56,29 @@ using namespace solidity::langutil;
#define ALSO_VIA_YUL(CODE) \
{ \
m_compileViaYul = false; \
{ CODE } \
RUN_AND_RERUN_WITH_OPTIMIZER_ON_STACK_ERROR(CODE) \
\
m_compileViaYul = true; \
reset(); \
{ CODE } \
RUN_AND_RERUN_WITH_OPTIMIZER_ON_STACK_ERROR(CODE) \
}
#define RUN_AND_RERUN_WITH_OPTIMIZER_ON_STACK_ERROR(CODE) \
{ \
try \
{ CODE } \
catch (yul::StackTooDeepError const&) \
{ \
if (m_optimiserSettings == OptimiserSettings::full()) \
throw; \
\
reset(); \
m_optimiserSettings = OptimiserSettings::full(); \
{ CODE } \
} \
}
namespace solidity::frontend::test
{