mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-02-21 06:40:50 +00: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
9e80a91f27
commit
fa8ec2611e
@ -20,6 +20,21 @@
|
|||||||
|
|
||||||
#include "mbedtls/build_info.h"
|
#include "mbedtls/build_info.h"
|
||||||
|
|
||||||
|
#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