diff options
author | Andres Noetzli <andres.noetzli@gmail.com> | 2018-10-17 21:21:00 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-17 21:21:00 -0700 |
commit | 62ed33cb855dc2c86d1fe4342b5cc6217e03910f (patch) | |
tree | 95362b97fe35947a2e6113ec67aec3e49e5aa62f /test | |
parent | f1a4096e579b101642c5a47eb5c8e90476ccc81a (diff) |
Show if ASAN build in --show-config (#2650)
This commit extends `--show-config` to show whether the current build is
an ASAN build or not. This is done by moving a detection that was
previously done for the unit tests into base/configuration_private.h.
In addition to being convenient, this allows us to easily exclude
regression tests from ASAN builds.
Diffstat (limited to 'test')
-rw-r--r-- | test/unit/memory.h | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/test/unit/memory.h b/test/unit/memory.h index a4d650b3b..8f4eca371 100644 --- a/test/unit/memory.h +++ b/test/unit/memory.h @@ -36,6 +36,7 @@ #include <sys/resource.h> #include <sys/time.h> +#include "base/configuration_private.h" #include "base/cvc4_assert.h" // Conditionally define CVC4_MEMORY_LIMITING_DISABLED. @@ -43,29 +44,15 @@ # define CVC4_MEMORY_LIMITING_DISABLED 1 # define CVC4_MEMORY_LIMITING_DISABLED_REASON "setrlimit() is broken on Mac." #else /* __APPLE__ */ -// Clang test -# if defined(__has_feature) -# if __has_feature(address_sanitizer) -# define _IS_ASAN_BUILD -# endif /* __has_feature(address_sanitizer) */ -# endif /* defined(__has_feature) */ - -// GCC test -# if defined(__SANITIZE_ADDRESS__) -# define _IS_ASAN_BUILD -# endif /* defined(__SANITIZE_ADDRESS__) */ // Tests cannot expect bad_alloc to be thrown due to limit memory using // setrlimit when ASAN is enable. ASAN instead aborts on mmap failures. -# if defined(_IS_ASAN_BUILD) +# if IS_ASAN_BUILD # define CVC4_MEMORY_LIMITING_DISABLED 1 # define CVC4_MEMORY_LIMITING_DISABLED_REASON "ASAN's mmap failures abort." -# undef _IS_ASAN_BUILD -# endif /* defined(_IS_ASAN_BUILD) */ +# endif #endif - - namespace CVC4 { namespace test { |