[libcxx-commits] [libcxx] 4bef7a8 - [libc++][PowerPC] Fix a test case failure when compiled with libcxx

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Fri Aug 20 10:24:18 PDT 2021


Author: Albion Fung
Date: 2021-08-20T13:24:13-04:00
New Revision: 4bef7a8ff169d6f9a0a253105576ac8a68430702

URL: https://github.com/llvm/llvm-project/commit/4bef7a8ff169d6f9a0a253105576ac8a68430702
DIFF: https://github.com/llvm/llvm-project/commit/4bef7a8ff169d6f9a0a253105576ac8a68430702.diff

LOG: [libc++][PowerPC] Fix a test case failure when compiled with libcxx

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

Added: 
    

Modified: 
    libcxx/test/std/numerics/numeric.ops/numeric.ops.midpoint/midpoint.float.pass.cpp

Removed: 
    


################################################################################
diff  --git a/libcxx/test/std/numerics/numeric.ops/numeric.ops.midpoint/midpoint.float.pass.cpp b/libcxx/test/std/numerics/numeric.ops/numeric.ops.midpoint/midpoint.float.pass.cpp
index 5cbc40a3578e..4247e2b9e231 100644
--- a/libcxx/test/std/numerics/numeric.ops/numeric.ops.midpoint/midpoint.float.pass.cpp
+++ b/libcxx/test/std/numerics/numeric.ops/numeric.ops.midpoint/midpoint.float.pass.cpp
@@ -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.


        


More information about the libcxx-commits mailing list