Skip to content

Commit 8c4cd6c

Browse files
committed
[libcxx] [test] Fix the condition for long double hex formatting
This test currently hardcodes which environments have got 80 bit long doubles on x86_64; add a check for the actual size of the long doubles as well. This allows waiving this part of the test, if we have x86_64 setups in any of these environments, configured for a nonstandard size of long doubles.
1 parent f04bfbc commit 8c4cd6c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

libcxx/test/std/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_long_double.hex.pass.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1846,11 +1846,11 @@ void test1() {
18461846
void test2() {
18471847
std::locale lc = std::locale::classic();
18481848
std::locale lg(lc, new my_numpunct);
1849-
#if (defined(__APPLE__) || defined(TEST_HAS_GLIBC) || defined(__MINGW32__)) && defined(__x86_64__)
1849+
#if (defined(__APPLE__) || defined(TEST_HAS_GLIBC) || defined(__MINGW32__)) && defined(__x86_64__) && \
1850+
__LDBL_MANT_DIG__ == 64
18501851
// This test is failing on FreeBSD, possibly due to different representations
18511852
// of the floating point numbers.
1852-
// This test is failing in MSVC environments, where long double is equal to regular
1853-
// double, and instead of "0x9.32c05a44p+27", this prints "0x1.26580b4880000p+30".
1853+
// This test assumes that long doubles are x87 80 bit long doubles.
18541854
const my_facet f(1);
18551855
char str[200];
18561856
{

0 commit comments

Comments
 (0)