Enable asan workaround in optimizer test for gcc as well.

This commit is contained in:
Daniel Kirchner 2019-08-09 15:55:32 +02:00
parent 6956ea1e9e
commit 77729023a8

View File

@ -487,11 +487,14 @@ BOOST_AUTO_TEST_CASE(constant_optimization_early_exit)
double duration = std::chrono::duration<double>(std::chrono::steady_clock::now() - start).count(); double duration = std::chrono::duration<double>(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. // Since run time on an ASan build is not really realistic, we disable this test for those builds.
size_t maxDuration = 20; size_t maxDuration = 20;
#if defined(__has_feature) #if !defined(__SANITIZE_ADDRESS__) && defined(__has_feature)
#if __has_feature(address_sanitizer) #if __has_feature(address_sanitizer)
#define __SANITIZE_ADDRESS__ 1
#endif
#endif
#if __SANITIZE_ADDRESS__
maxDuration = size_t(-1); maxDuration = size_t(-1);
BOOST_TEST_MESSAGE("Disabled constant optimizer run time check for address sanitizer build."); BOOST_TEST_MESSAGE("Disabled constant optimizer run time check for address sanitizer build.");
#endif
#endif #endif
BOOST_CHECK_MESSAGE(duration <= maxDuration, "Compilation of constants took longer than 20 seconds."); BOOST_CHECK_MESSAGE(duration <= maxDuration, "Compilation of constants took longer than 20 seconds.");
compareVersions("hexEncodeTest(address)", u256(0x123456789)); compareVersions("hexEncodeTest(address)", u256(0x123456789));