[llvm-branch-commits] [libcxx] 23ba373 - [libc++][PowerPC] Fix a test case failure when compiled with libcxx

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


Author: Albion Fung
Date: 2021-08-20T13:24:44-04:00
New Revision: 23ba3732246a418e52d6d9ca17b45816ade4dc6d

URL: https://github.com/llvm/llvm-project/commit/23ba3732246a418e52d6d9ca17b45816ade4dc6d
DIFF: https://github.com/llvm/llvm-project/commit/23ba3732246a418e52d6d9ca17b45816ade4dc6d.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

(cherry picked from commit 4bef7a8ff169d6f9a0a253105576ac8a68430702)

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 llvm-branch-commits mailing list