mirror of
https://github.com/cuberite/polarssl.git
synced 2025-09-08 23:03:06 -04:00
Detect enabled GCC/Clang sanitizers
Occasionally we want tests to take advantage of sanitizers, or work around them. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This commit is contained in:
parent
b9c70581a0
commit
c3a9bdb2b5
@ -19,6 +19,21 @@
|
|||||||
#include MBEDTLS_CONFIG_FILE
|
#include MBEDTLS_CONFIG_FILE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(__SANITIZE_ADDRESS__) /* gcc -fsanitize=address */
|
||||||
|
# define MBEDTLS_TEST_HAVE_ASAN
|
||||||
|
#endif
|
||||||
|
#if defined(__has_feature)
|
||||||
|
# if __has_feature(address_sanitizer) /* clang -fsanitize=address */
|
||||||
|
# define MBEDTLS_TEST_HAVE_ASAN
|
||||||
|
# endif
|
||||||
|
# if __has_feature(memory_sanitizer) /* clang -fsanitize=memory */
|
||||||
|
# define MBEDTLS_TEST_HAVE_MSAN
|
||||||
|
# endif
|
||||||
|
# if __has_feature(thread_sanitizer) /* clang -fsanitize=thread */
|
||||||
|
# define MBEDTLS_TEST_HAVE_TSAN
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(MBEDTLS_THREADING_C) && defined(MBEDTLS_THREADING_PTHREAD) && \
|
#if defined(MBEDTLS_THREADING_C) && defined(MBEDTLS_THREADING_PTHREAD) && \
|
||||||
defined(MBEDTLS_TEST_HOOKS)
|
defined(MBEDTLS_TEST_HOOKS)
|
||||||
#define MBEDTLS_TEST_MUTEX_USAGE
|
#define MBEDTLS_TEST_MUTEX_USAGE
|
||||||
|
Loading…
x
Reference in New Issue
Block a user