diff --git a/libcxx/test/std/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_double.hex.pass.cpp b/libcxx/test/std/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_double.hex.pass.cpp index 21efa978abdccc..946c26398fcb83 100644 --- a/libcxx/test/std/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_double.hex.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_double.hex.pass.cpp @@ -12,10 +12,7 @@ // iter_type put(iter_type s, ios_base& iob, char_type fill, double v) const; -// With the Microsoft UCRT, printf("%a", 0.0) produces "0x0.0000000000000p+0" -// while other C runtimes produce just "0x0p+0". -// https://developercommunity.visualstudio.com/t/Printf-formatting-of-float-as-hex-prints/1660844 -// XFAIL: msvc +// XFAIL: win32-broken-printf-a-precision // XFAIL: LIBCXX-AIX-FIXME diff --git a/libcxx/test/std/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_long_double.hex.pass.cpp b/libcxx/test/std/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_long_double.hex.pass.cpp index c97c9a0c403695..a195c34e5f8e80 100644 --- a/libcxx/test/std/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_long_double.hex.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_long_double.hex.pass.cpp @@ -12,10 +12,7 @@ // iter_type put(iter_type s, ios_base& iob, char_type fill, long double v) const; -// With the Microsoft UCRT, printf("%a", 0.0) produces "0x0.0000000000000p+0" -// while other C runtimes produce just "0x0p+0". -// https://developercommunity.visualstudio.com/t/Printf-formatting-of-float-as-hex-prints/1660844 -// XFAIL: msvc +// XFAIL: win32-broken-printf-a-precision // XFAIL: LIBCXX-AIX-FIXME diff --git a/libcxx/utils/libcxx/test/features.py b/libcxx/utils/libcxx/test/features.py index e978875d543f35..97cdb0349885d6 100644 --- a/libcxx/utils/libcxx/test/features.py +++ b/libcxx/utils/libcxx/test/features.py @@ -263,6 +263,26 @@ def _mingwSupportsModules(cfg): """, ), ), + # Check for a Windows UCRT bug (not fixed upstream yet). + # With UCRT, printf("%a", 0.0) produces "0x0.0000000000000p+0", + # while other C runtimes produce just "0x0p+0". + # https://developercommunity.visualstudio.com/t/Printf-formatting-of-float-as-hex-prints/1660844 + Feature( + name="win32-broken-printf-a-precision", + when=lambda cfg: "_WIN32" in compilerMacros(cfg) + and not programSucceeds( + cfg, + """ + #include + #include + int main(int, char**) { + char buf[100]; + snprintf(buf, sizeof(buf), "%a", 0.0); + return strcmp(buf, "0x0p+0"); + } + """, + ), + ), # Check for Glibc < 2.27, where the ru_RU.UTF-8 locale had # mon_decimal_point == ".", which our tests don't handle. Feature( diff --git a/libcxxabi/test/test_demangle.pass.cpp b/libcxxabi/test/test_demangle.pass.cpp index fe5598991b831b..ab783cf9d96f22 100644 --- a/libcxxabi/test/test_demangle.pass.cpp +++ b/libcxxabi/test/test_demangle.pass.cpp @@ -17,6 +17,8 @@ // 80-bit format, and this demangling test is failing on it. // XFAIL: LIBCXX-ANDROID-FIXME && target={{i686|x86_64}}-{{.+}}-android{{.*}} +// XFAIL: win32-broken-printf-a-precision + #include "support/timer.h" #include #include