Rerun SolidityEndToEndTest.cpp tests on stack errors.

This commit is contained in:
Daniel Kirchner 2021-09-14 16:58:40 +02:00
parent a8f7c69c47
commit 4bd7e2a0a9

View File

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