aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2018-09-03 15:54:28 +0100
committerJonathan Wakely <redi@gcc.gnu.org>2018-09-03 15:54:28 +0100
commitd4baef5be801769686d79735f08959c05555ff91 (patch)
tree23e67cdd1422bd8e8798ae7805310887ce0b4c4a /libstdc++-v3
parent339e6723c9c2c062933c17eec128407a0778d99d (diff)
downloadgcc-d4baef5be801769686d79735f08959c05555ff91.zip
gcc-d4baef5be801769686d79735f08959c05555ff91.tar.gz
gcc-d4baef5be801769686d79735f08959c05555ff91.tar.bz2
PR libstdc++/78179 run long double tests separately
Split the long double testing into a separate file, so that we can XFAIL targets where the long double precision doesn't meet the expected tolerances. The float and double tests are still expefted to PASS for all targets. PR libstdc++/78179 * testsuite/26_numerics/headers/cmath/hypot-long-double.cc: New test that runs the long double part of hypot.cc. * testsuite/26_numerics/headers/cmath/hypot.cc: Disable long double tests unless TEST_HYPOT_LONG_DOUBLE is defined. From-SVN: r264063
Diffstat (limited to 'libstdc++-v3')
-rw-r--r--libstdc++-v3/ChangeLog6
-rw-r--r--libstdc++-v3/testsuite/26_numerics/headers/cmath/hypot-long-double.cc25
-rw-r--r--libstdc++-v3/testsuite/26_numerics/headers/cmath/hypot.cc5
3 files changed, 35 insertions, 1 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 9fddb1e..998ea63 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,5 +1,11 @@
2018-09-03 Jonathan Wakely <jwakely@redhat.com>
+ PR libstdc++/78179
+ * testsuite/26_numerics/headers/cmath/hypot-long-double.cc: New test
+ that runs the long double part of hypot.cc.
+ * testsuite/26_numerics/headers/cmath/hypot.cc: Disable long double
+ tests unless TEST_HYPOT_LONG_DOUBLE is defined.
+
* include/bits/stl_vector.h (vector::_Temporary_value::_M_ptr):
Return raw pointer not allocator's pointer type.
(vector::_Temporary_value::_M_val): Use _M_ptr.
diff --git a/libstdc++-v3/testsuite/26_numerics/headers/cmath/hypot-long-double.cc b/libstdc++-v3/testsuite/26_numerics/headers/cmath/hypot-long-double.cc
new file mode 100644
index 0000000..8a05473
--- /dev/null
+++ b/libstdc++-v3/testsuite/26_numerics/headers/cmath/hypot-long-double.cc
@@ -0,0 +1,25 @@
+// Copyright (C) 2016-2018 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// { dg-options "-std=gnu++17" }
+// { dg-do run { target c++17 } }
+// { dg-xfail-run-if "PR 78179" { powerpc-ibm-aix* hppa-*-linux* nios2-*-* } }
+
+// Run the long double tests from hypot.cc separately, because they fail on a
+// number of targets. See PR libstdc++/78179 for details.
+#define TEST_HYPOT_LONG_DOUBLE
+#include "hypot.cc"
diff --git a/libstdc++-v3/testsuite/26_numerics/headers/cmath/hypot.cc b/libstdc++-v3/testsuite/26_numerics/headers/cmath/hypot.cc
index 69840c8..36c7553 100644
--- a/libstdc++-v3/testsuite/26_numerics/headers/cmath/hypot.cc
+++ b/libstdc++-v3/testsuite/26_numerics/headers/cmath/hypot.cc
@@ -17,7 +17,6 @@
// { dg-options "-std=gnu++17" }
// { dg-do run { target c++17 } }
-// { dg-xfail-run-if "AIX long double" { powerpc-ibm-aix* } }
#include <cmath>
#include <type_traits>
@@ -126,9 +125,13 @@ const long double toler3 = 1e-16l;
void
test01()
{
+ // See hypot-long-double.cc for this macro
+#ifndef TEST_HYPOT_LONG_DOUBLE
test(data1, toler1);
test(data2, toler2);
+#else
test(data3, toler3);
+#endif
}
int