| 1 | #ifndef SANITIZER_TEST_DEFINES_H |
| 2 | #define SANITIZER_TEST_DEFINES_H |
| 3 | |
| 4 | #if defined(_MSC_VER) && !defined(__clang__) |
| 5 | # include <intrin.h> |
| 6 | |
| 7 | # define ATTRIBUTE_NOINLINE __declspec(noinline) |
| 8 | # define ATTRIBUTE_ALIGNED(x) __declspec(align(x)) |
| 9 | # define ATTRIBUTE_NO_SANITIZE_ADDRESS __declspec(no_sanitize_address) |
| 10 | # define ATTRIBUTE_USED /* FIXME: Is there a __declspec used? */ |
| 11 | # define ATTRIBUTE_ALWAYS_INLINE __forceinline |
| 12 | # define VOLATILE volatile |
| 13 | # define EXTRACT_RETURN_ADDRESS _ReturnAddress() |
| 14 | # define ASM_CAUSE_SIDE_EFFECT(dest) __asm { mov eax, dest} |
| 15 | # define MULTIPLE_ATTRIBUTE_DECL(a, b) __declspec(a b) |
| 16 | |
| 17 | #else |
| 18 | |
| 19 | # define ATTRIBUTE_NOINLINE __attribute__((noinline)) |
| 20 | # define ATTRIBUTE_ALIGNED(x) __attribute__((aligned(x))) |
| 21 | # define ATTRIBUTE_NO_SANITIZE_ADDRESS __attribute__((no_sanitize_address)) |
| 22 | # define ATTRIBUTE_USED __attribute__((used)) |
| 23 | # define ATTRIBUTE_ALWAYS_INLINE __attribute__((always_inline)) |
| 24 | # define INLINE_ASM(x) __asm__(x) |
| 25 | # define VOLATILE __volatile__ |
| 26 | # define \ |
| 27 | __builtin_extract_return_addr(__builtin_return_address(0)) |
| 28 | # define ASM_CAUSE_SIDE_EFFECT(dest) \ |
| 29 | __asm__ __volatile__("" : : "r"(dest) : "memory"); |
| 30 | # define MULTIPLE_ATTRIBUTE_DECL(a, b) __attribute__((a, b)) |
| 31 | |
| 32 | #endif // _MSC_VER |
| 33 | |
| 34 | #endif // SANITIZER_TEST_DEFINES |
| 35 | |