xref: /netbsd-src/external/gpl3/gcc.old/dist/libsanitizer/ubsan/ubsan_platform.h (revision 8ecbf5f02b752fcb7debe1a8fab1dc82602bc760)
1 //===-- ubsan_platform.h ----------------------------------------*- C++ -*-===//
2 //
3 // This file is distributed under the University of Illinois Open Source
4 // License. See LICENSE.TXT for details.
5 //
6 //===----------------------------------------------------------------------===//
7 //
8 // Defines the platforms which UBSan is supported at.
9 //
10 //===----------------------------------------------------------------------===//
11 #ifndef UBSAN_PLATFORM_H
12 #define UBSAN_PLATFORM_H
13 
14 #ifndef CAN_SANITIZE_UB
15 // Other platforms should be easy to add, and probably work as-is.
16 #if (defined(__linux__) || defined(__FreeBSD__) || defined(__APPLE__) ||       \
17      defined(__NetBSD__)) &&                                                   \
18     (defined(__x86_64__) || defined(__i386__) || defined(__arm__) ||           \
19      defined(__aarch64__) || defined(__mips__) || defined(__powerpc64__) ||    \
20      defined(__powerpc__) || defined(__hppa__) || defined(__m68k__) || \
21      defined(__mc68010__) || defined(__powerpc64__) || defined(__sparc__) || \
22      defined(__alpha__) || defined(__vax__) || defined(__sh3__) || \
23      defined(__ia64__) || \
24      defined(__s390__))
25 # define CAN_SANITIZE_UB 1
26 #elif defined(_WIN32) || defined(__Fuchsia__)
27 # define CAN_SANITIZE_UB 1
28 #else
29 # define CAN_SANITIZE_UB 0
30 #endif
31 #endif //CAN_SANITIZE_UB
32 
33 #endif
34