diff --git a/compiler-rt/lib/builtins/fp_lib.h b/compiler-rt/lib/builtins/fp_lib.h --- a/compiler-rt/lib/builtins/fp_lib.h +++ b/compiler-rt/lib/builtins/fp_lib.h @@ -26,6 +26,15 @@ #include #include +#if (defined(SINGLE_PRECISION) + defined(DOUBLE_PRECISION) + \ + defined(QUAD_PRECISION)) != 1 +#error Exactly one of SINGLE_PRECISION, DOUBLE_PRECISION or QUAD_PRECISION must be defined. +// Now, turn on some arbitrary one of the three precision settings (except for +// QUAD_PRECISION that has some specific requirements), so fp_*_impl.inc files +// could be validated by clang-tidy in a more meaningful way. +#define SINGLE_PRECISION +#endif + // x86_64 FreeBSD prior v9.3 define fixed-width types incorrectly in // 32-bit mode. #if defined(__FreeBSD__) && defined(__i386__) @@ -195,6 +204,8 @@ #undef Word_FullMask #endif // __LDBL_MANT_DIG__ == 113 && __SIZEOF_INT128__ #else +// Should never be reached due to the check for precison-related macro +// at the top of this file. Recheck it here just in case... #error SINGLE_PRECISION, DOUBLE_PRECISION or QUAD_PRECISION must be defined. #endif