[builtins] Re-enable x86-only long double tests

Summary:
In r81552, the HAS_80_BIT_LONG_DOUBLE macro was added to the unit test
only version of int_lib.h. One month later in r85260 the duplicate
int_lib.h was removed, but the tests still passed because we don't build
with -Werror.

This is the minimal change to bring it back, and I decided to put the
configuration macro next to our 128-bit integer support macro.

Reviewers: joerg, compnerd, mstorsjo

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D53838

llvm-svn: 345645
This commit is contained in:
Reid Kleckner 2018-10-30 20:51:27 +00:00
parent 900678227c
commit 96b823418d
2 changed files with 13 additions and 1 deletions

View File

@ -137,6 +137,18 @@ typedef struct
#endif /* _YUGA_LITTLE_ENDIAN */
} uqwords;
/* Check if the target supports 80 bit extended precision long doubles.
* Notably, on x86 Windows, MSVC only provides a 64-bit long double, but GCC
* still makes it 80 bits. Clang will match whatever compiler it is trying to
* be compatible with.
*/
#if ((defined(__i386__) || defined(__x86_64__)) && !defined(_MSC_VER)) || \
defined(__m68k__) || defined(__ia64__)
#define HAS_80_BIT_LONG_DOUBLE 1
#else
#define HAS_80_BIT_LONG_DOUBLE 0
#endif
typedef union
{
uqwords u;

View File

@ -26,7 +26,7 @@
// gggg gggg gggg gggg gggg gggg gggg gggg | gggg gggg gggg gggg seee eeee eeee eeee |
// 1mmm mmmm mmmm mmmm mmmm mmmm mmmm mmmm | mmmm mmmm mmmm mmmm mmmm mmmm mmmm mmmm
COMPILER_RT_ABI di_int __sfixxfdi(long double a);
COMPILER_RT_ABI di_int __fixxfdi(long double a);
int test__fixxfdi(long double a, di_int expected)
{