Skip to content

Commit

Permalink
[libc++][PowerPC] Fix a test case failure when compiled with libcxx
Browse files Browse the repository at this point in the history
The test case is not ran unless libcxx is used, and a macro
may be undefined. This patch checks for the definition of the
macro before using it.

Fixes http://llvm.org/PR51430

Differential Revision: https://reviews.llvm.org/D108352
  • Loading branch information
Albion Fung authored and ldionne committed Aug 20, 2021
1 parent b1efefa commit 4bef7a8
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -92,7 +92,7 @@ void fp_test()
assert(d0 < d1); // sanity checking
assert(d1 < d2); // sanity checking

#if defined(__PPC__) && __LONG_DOUBLE_128__ && !__LONG_DOUBLE_IEEE128__
#if defined(__PPC__) && __LONG_DOUBLE_128__ && !(defined(__LONG_DOUBLE_IEEE128__) && __LONG_DOUBLE_IEEE128__)
// For 128 bit long double implemented as 2 doubles on PowerPC,
// nextafterl() of libm gives imprecise results which fails the
// midpoint() tests below. So skip the test for this case.
Expand Down

0 comments on commit 4bef7a8

Please sign in to comment.