PR libstdc++/37624
* testsuite/22_locale/num_get/get/char/10.cc: Skip long double case
when strtold is not available.
* testsuite/22_locale/num_get/get/wchar_t/10.cc: Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@140602
138bc75d-0d04-0410-961f-
82ee72b054a4
+2008-09-23 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR libstdc++/37624
+ * testsuite/22_locale/num_get/get/char/10.cc: Skip long double case
+ when strtold is not available.
+ * testsuite/22_locale/num_get/get/wchar_t/10.cc: Likewise.
+
2008-09-23 Benjamin Kosnik <bkoz@redhat.com>
PR libstdc++/37391 continued.
const num_get<char>& ng = use_facet<num_get<char> >(iss.getloc());
ios_base::iostate err = ios_base::goodbit;
iterator_type end;
- float f = 0.0f;
- double d = 0.0;
- long double ld = 0.0l;
- float f1 = 1.0f;
- double d1 = 3.0;
- long double ld1 = 6.0l;
-
+ float f = 1.0f;
+ double d = 1.0;
+ long double ld = 1.0l;
+
iss.str("1e.");
err = ios_base::goodbit;
end = ng.get(iss.rdbuf(), 0, iss, err, f);
iss.clear();
err = ios_base::goodbit;
end = ng.get(iss.rdbuf(), 0, iss, err, ld);
- VERIFY( err == ios_base::failbit );
VERIFY( *end == ' ' );
+
+ // libstdc++/37624. We can't always obtain the required behavior
+ // when sscanf is involved, because of, e.g., glibc/1765.
+#if defined(_GLIBCXX_HAVE_STRTOLD) && !defined(_GLIBCXX_HAVE_BROKEN_STRTOLD)
+ VERIFY( err == ios_base::failbit );
VERIFY( ld == 0.0l );
+#endif
}
int main()
const num_get<wchar_t>& ng = use_facet<num_get<wchar_t> >(iss.getloc());
ios_base::iostate err = ios_base::goodbit;
iterator_type end;
- float f = 0.0f;
- double d = 0.0;
- long double ld = 0.0l;
- float f1 = 1.0f;
- double d1 = 3.0;
- long double ld1 = 6.0l;
+ float f = 1.0f;
+ double d = 1.0;
+ long double ld = 1.0l;
iss.str(L"1e.");
err = ios_base::goodbit;
iss.clear();
err = ios_base::goodbit;
end = ng.get(iss.rdbuf(), 0, iss, err, ld);
- VERIFY( err == ios_base::failbit );
VERIFY( *end == L' ' );
+
+ // libstdc++/37624. We can't always obtain the required behavior
+ // when sscanf is involved, because of, e.g., glibc/1765.
+#if defined(_GLIBCXX_HAVE_STRTOLD) && !defined(_GLIBCXX_HAVE_BROKEN_STRTOLD)
+ VERIFY( err == ios_base::failbit );
VERIFY( ld == 0.0l );
+#endif
}
int main()