From 77729023a847dba28ed7536246d8ffbdfb27bc66 Mon Sep 17 00:00:00 2001 From: Daniel Kirchner Date: Fri, 9 Aug 2019 15:55:32 +0200 Subject: [PATCH] Enable asan workaround in optimizer test for gcc as well. --- test/libsolidity/SolidityOptimizer.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/test/libsolidity/SolidityOptimizer.cpp b/test/libsolidity/SolidityOptimizer.cpp index 0ed102f03..9f8a2e144 100644 --- a/test/libsolidity/SolidityOptimizer.cpp +++ b/test/libsolidity/SolidityOptimizer.cpp @@ -487,11 +487,14 @@ BOOST_AUTO_TEST_CASE(constant_optimization_early_exit) double duration = std::chrono::duration(std::chrono::steady_clock::now() - start).count(); // Since run time on an ASan build is not really realistic, we disable this test for those builds. size_t maxDuration = 20; -#if defined(__has_feature) +#if !defined(__SANITIZE_ADDRESS__) && defined(__has_feature) #if __has_feature(address_sanitizer) +#define __SANITIZE_ADDRESS__ 1 +#endif +#endif +#if __SANITIZE_ADDRESS__ maxDuration = size_t(-1); BOOST_TEST_MESSAGE("Disabled constant optimizer run time check for address sanitizer build."); -#endif #endif BOOST_CHECK_MESSAGE(duration <= maxDuration, "Compilation of constants took longer than 20 seconds."); compareVersions("hexEncodeTest(address)", u256(0x123456789));