[libstdc++][testsuite] XFAIL tests relying on long double-to-string conversions on...
authorKyrylo Tkachov <kyrylo.tkachov@arm.com>
Mon, 12 Dec 2016 15:47:47 +0000 (15:47 +0000)
committerKyrylo Tkachov <ktkachov@gcc.gnu.org>
Mon, 12 Dec 2016 15:47:47 +0000 (15:47 +0000)
    * lib/target-supports.exp
    (check_effective_target_newlib_broken_long_double_io): New check.
    (check_effective_target_frexpl): Likewise.

    * testsuite/21_strings/basic_string/numeric_conversions/char/stod.cc:
    XFAIL run if newlib_broken_long_double_io.
    * testsuite/21_strings/basic_string/numeric_conversions/wchar_t/stod.cc:
    Likewise.
    * testsuite/21_strings/basic_string/numeric_conversions/wchar_t/stold.cc:
    Likewise.
    * testsuite/27_io/basic_ostream/inserters_arithmetic/char/hexfloat.cc:
    Likewise.

From-SVN: r243558

gcc/testsuite/ChangeLog
gcc/testsuite/lib/target-supports.exp
libstdc++-v3/ChangeLog
libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/char/stod.cc
libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/char/stold.cc
libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/wchar_t/stod.cc
libstdc++-v3/testsuite/21_strings/basic_string/numeric_conversions/wchar_t/stold.cc
libstdc++-v3/testsuite/27_io/basic_ostream/inserters_arithmetic/char/hexfloat.cc

index 588c51bd1409eaae557316bbe69bbd11a83c8cb9..35db8198c28a42f7e49541458a4d82bb9860c5de 100644 (file)
@@ -1,3 +1,9 @@
+2016-12-12  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
+
+       * lib/target-supports.exp
+       (check_effective_target_newlib_broken_long_double_io): New check.
+       (check_effective_target_frexpl): Likewise.
+
 2016-12-12  Marek Polacek  <polacek@redhat.com>
 
        PR middle-end/78716
index 0fc0bafa67d8d34ec74ce2d1d7a2323a375615cc..c3110dc3d72ec34e01d87dcd3fc3b6671de9d332 100644 (file)
@@ -6765,6 +6765,17 @@ proc check_effective_target_newlib {} {
     }]
 }
 
+# Some newlib versions don't provide a frexpl and instead depend
+# on frexp to implement long double conversions in their printf-like
+# functions.  This leads to broken results.  Detect such versions here.
+
+proc check_effective_target_newlib_broken_long_double_io {} {
+  if { [is-effective-target newlib] && ![is-effective-target frexpl] } {
+       return 1
+  }
+  return 0
+}
+
 # Return true if this is NOT a Bionic target.
 
 proc check_effective_target_non_bionic {} {
@@ -7380,6 +7391,21 @@ proc check_effective_target_pow10 { } {
     } "-lm" ]
 }
 
+# Return 1 if frexpl function exists.
+
+proc check_effective_target_frexpl { } {
+    return [check_runtime frexpl {
+       #include <math.h>
+       int main () {
+       long double x;
+       int y;
+       x = frexpl (5.0, &y);
+       return 0;
+       }
+    } "-lm" ]
+}
+
+
 # Return 1 if issignaling function exists.
 proc check_effective_target_issignaling {} {
     return [check_runtime issignaling {
index 1a6f871c4bad7f2c8f3d8668e9a7964eeca72ef3..b2cd76c96bb5b7ca0a9ab7050d5910efb1014663 100644 (file)
@@ -1,3 +1,14 @@
+2016-12-12  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
+
+       * testsuite/21_strings/basic_string/numeric_conversions/char/stod.cc:
+       XFAIL run if newlib_broken_long_double_io.
+       * testsuite/21_strings/basic_string/numeric_conversions/wchar_t/stod.cc:
+       Likewise.
+       * testsuite/21_strings/basic_string/numeric_conversions/wchar_t/stold.cc:
+       Likewise.
+       * testsuite/27_io/basic_ostream/inserters_arithmetic/char/hexfloat.cc:
+       Likewise.
+
 2016-12-12  Jonathan Wakely  <jwakely@redhat.com>
 
        * testsuite/experimental/filesystem/operations/is_empty.cc:
index 7e7c1347eab51abef73865073dbb4129db71af48..088641130075add8346948f286cfc63de6637721 100644 (file)
@@ -1,5 +1,6 @@
 // { dg-do run { target c++11 } }
 // { dg-require-string-conversions "" }
+// { dg-xfail-run-if "broken long double IO" { newlib_broken_long_double_io  }  "*" "" }
 
 // 2008-06-15  Paolo Carlini  <paolo.carlini@oracle.com>
 
index 15a4dcaddb46dc62df9f7c51c3c07c73823fccff..df39a50b9c8964f70db17a07caaf0f8a48eddbcf 100644 (file)
@@ -1,5 +1,6 @@
 // { dg-do run { target c++11 } }
 // { dg-require-string-conversions "" }
+// { dg-xfail-run-if "broken long double IO" { newlib_broken_long_double_io  }  "*" "" }
 
 // 2008-06-15  Paolo Carlini  <paolo.carlini@oracle.com>
 
index 81735dd186617c0fe96c2334e5fab2cef6a07d4e..259dc65024833af576b5cba44942e996c41c1b0d 100644 (file)
@@ -1,5 +1,7 @@
 // { dg-do run { target c++11 } }
 // { dg-require-string-conversions "" }
+// { dg-xfail-run-if "broken long double IO" { newlib_broken_long_double_io  }  "*" "" }
+
 // 2008-06-15  Paolo Carlini  <paolo.carlini@oracle.com>
 
 // Copyright (C) 2008-2016 Free Software Foundation, Inc.
index 82b8c8bb84658d5b30b69fffbf7066940e44a460..3a95010945b25317619f34458905d540076a407a 100644 (file)
@@ -1,5 +1,7 @@
 // { dg-do run { target c++11 } }
 // { dg-require-string-conversions "" }
+// { dg-xfail-run-if "broken long double IO" { newlib_broken_long_double_io  }  "*" "" }
+
 // 2008-06-15  Paolo Carlini  <paolo.carlini@oracle.com>
 
 // Copyright (C) 2008-2016 Free Software Foundation, Inc.
index 364bc56d2faac10c19c673d1adcd0e7e986a777f..839037917c959905a11774854bb1ceb88c5559a4 100644 (file)
@@ -1,6 +1,7 @@
 // { dg-do run { target c++11 } }
 // { dg-require-string-conversions "" }
 // { dg-xfail-run-if "PR libstdc++/64054" { *-*-solaris* } }
+// { dg-xfail-run-if "broken long double IO" { newlib_broken_long_double_io  }  "*" "" }
 
 // 2014-03-27 RĂ¼diger Sonderfeld
 // test the hexadecimal floating point inserters (facet num_put)