diff options
| author | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2013-01-14 15:12:26 +0000 |
|---|---|---|
| committer | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2013-01-14 15:12:26 +0000 |
| commit | 99d91289b6a4fe9382044636f2ebc9407da75833 (patch) | |
| tree | 789db12af8b6ccad7ee8092367e2edc85defeb19 /compiler-rt/lib/asan/tests/asan_test_utils.h | |
| parent | e2e6e6a3d584c5f84be06903e3b8044c0491e5d9 (diff) | |
| download | bcm5719-llvm-99d91289b6a4fe9382044636f2ebc9407da75833.tar.gz bcm5719-llvm-99d91289b6a4fe9382044636f2ebc9407da75833.zip | |
Move large part of asan_test_utils.h to sanitizer_common.
Move my_rand() to the common header.
This lets us avoid the use of rand_r in sanitizer_common tests.
There is no rand_r on Android.
llvm-svn: 172421
Diffstat (limited to 'compiler-rt/lib/asan/tests/asan_test_utils.h')
| -rw-r--r-- | compiler-rt/lib/asan/tests/asan_test_utils.h | 48 |
1 files changed, 1 insertions, 47 deletions
diff --git a/compiler-rt/lib/asan/tests/asan_test_utils.h b/compiler-rt/lib/asan/tests/asan_test_utils.h index f810438fc31..6ed9f90df90 100644 --- a/compiler-rt/lib/asan/tests/asan_test_utils.h +++ b/compiler-rt/lib/asan/tests/asan_test_utils.h @@ -20,53 +20,7 @@ # undef INCLUDED_FROM_ASAN_TEST_UTILS_H #endif -#if defined(_WIN32) -typedef unsigned __int8 uint8_t; -typedef unsigned __int16 uint16_t; -typedef unsigned __int32 uint32_t; -typedef unsigned __int64 uint64_t; -typedef __int8 int8_t; -typedef __int16 int16_t; -typedef __int32 int32_t; -typedef __int64 int64_t; -# define NOINLINE __declspec(noinline) -# define USED -#else // defined(_WIN32) -# define NOINLINE __attribute__((noinline)) -# define USED __attribute__((used)) -#endif // defined(_WIN32) - -#if !defined(__has_feature) -#define __has_feature(x) 0 -#endif - -#if __has_feature(address_sanitizer) || defined(__SANITIZE_ADDRESS__) -# define ATTRIBUTE_NO_ADDRESS_SAFETY_ANALYSIS \ - __attribute__((no_address_safety_analysis)) -#else -# define ATTRIBUTE_NO_ADDRESS_SAFETY_ANALYSIS -#endif - -#if __LP64__ || defined(_WIN64) -# define SANITIZER_WORDSIZE 64 -#else -# define SANITIZER_WORDSIZE 32 -#endif - -// Make the compiler thinks that something is going on there. -inline void break_optimization(void *arg) { - __asm__ __volatile__("" : : "r" (arg) : "memory"); -} - -// This function returns its parameter but in such a way that compiler -// can not prove it. -template<class T> -NOINLINE -static T Ident(T t) { - T ret = t; - break_optimization(&ret); - return ret; -} +#include "sanitizer_common/tests/sanitizer_test_utils.h" // Check that pthread_create/pthread_join return success. #define PTHREAD_CREATE(a, b, c, d) ASSERT_EQ(0, pthread_create(a, b, c, d)) |

