diff --git a/libcxx/test/std/time/time.cal/time.cal.mdlast/ostream.pass.cpp b/libcxx/test/std/time/time.cal/time.cal.mdlast/ostream.pass.cpp --- a/libcxx/test/std/time/time.cal/time.cal.mdlast/ostream.pass.cpp +++ b/libcxx/test/std/time/time.cal/time.cal.mdlast/ostream.pass.cpp @@ -6,8 +6,6 @@ // //===----------------------------------------------------------------------===// -// XFAIL: LIBCXX-FREEBSD-FIXME - // UNSUPPORTED: c++03, c++11, c++14, c++17 // UNSUPPORTED: no-localization // UNSUPPORTED: GCC-ALWAYS_INLINE-FIXME @@ -108,7 +106,7 @@ TEST_EQUAL(stream_fr_FR_locale(std::chrono::month_day_last{std::chrono::month{1}}), SV("janv./last")); TEST_EQUAL(stream_fr_FR_locale(std::chrono::month_day_last{std::chrono::month{2}}), SV("févr./last")); TEST_EQUAL(stream_fr_FR_locale(std::chrono::month_day_last{std::chrono::month{3}}), SV("mars/last")); -# if defined(_WIN32) || defined(_AIX) +# if defined(_WIN32) || defined(_AIX) || defined(__FreeBSD__) TEST_EQUAL(stream_fr_FR_locale(std::chrono::month_day_last{std::chrono::month{4}}), SV("avr./last")); # else TEST_EQUAL(stream_fr_FR_locale(std::chrono::month_day_last{std::chrono::month{4}}), SV("avril/last")); diff --git a/libcxx/test/std/time/time.cal/time.cal.month/time.cal.month.nonmembers/ostream.pass.cpp b/libcxx/test/std/time/time.cal/time.cal.month/time.cal.month.nonmembers/ostream.pass.cpp --- a/libcxx/test/std/time/time.cal/time.cal.month/time.cal.month.nonmembers/ostream.pass.cpp +++ b/libcxx/test/std/time/time.cal/time.cal.month/time.cal.month.nonmembers/ostream.pass.cpp @@ -6,8 +6,6 @@ // //===----------------------------------------------------------------------===// -// XFAIL: LIBCXX-FREEBSD-FIXME - // UNSUPPORTED: c++03, c++11, c++14, c++17 // UNSUPPORTED: no-localization // UNSUPPORTED: GCC-ALWAYS_INLINE-FIXME @@ -104,7 +102,7 @@ TEST_EQUAL(stream_fr_FR_locale(std::chrono::month{1}), SV("janv.")); TEST_EQUAL(stream_fr_FR_locale(std::chrono::month{2}), SV("févr.")); TEST_EQUAL(stream_fr_FR_locale(std::chrono::month{3}), SV("mars")); -# if defined(_WIN32) || defined(_AIX) +# if defined(_WIN32) || defined(_AIX) || defined(__FreeBSD__) TEST_EQUAL(stream_fr_FR_locale(std::chrono::month{4}), SV("avr.")); # else TEST_EQUAL(stream_fr_FR_locale(std::chrono::month{4}), SV("avril")); diff --git a/libcxx/test/std/time/time.cal/time.cal.mwd/time.cal.mwd.nonmembers/ostream.pass.cpp b/libcxx/test/std/time/time.cal/time.cal.mwd/time.cal.mwd.nonmembers/ostream.pass.cpp --- a/libcxx/test/std/time/time.cal/time.cal.mwd/time.cal.mwd.nonmembers/ostream.pass.cpp +++ b/libcxx/test/std/time/time.cal/time.cal.mwd/time.cal.mwd.nonmembers/ostream.pass.cpp @@ -6,8 +6,6 @@ // //===----------------------------------------------------------------------===// -// XFAIL: LIBCXX-FREEBSD-FIXME - // UNSUPPORTED: c++03, c++11, c++14, c++17 // UNSUPPORTED: no-localization // UNSUPPORTED: GCC-ALWAYS_INLINE-FIXME @@ -175,7 +173,7 @@ TEST_EQUAL(stream_fr_FR_locale(std::chrono::month_weekday{ std::chrono::month{3}, std::chrono::weekday_indexed{std::chrono::weekday{3}, 3}}), SV("mars/mer.[3]")); -# if defined(_WIN32) || defined(_AIX) +# if defined(_WIN32) || defined(_AIX) || defined(__FreeBSD__) TEST_EQUAL(stream_fr_FR_locale(std::chrono::month_weekday{ std::chrono::month{4}, std::chrono::weekday_indexed{std::chrono::weekday{4}, 4}}), SV("avr./jeu.[4]")); diff --git a/libcxx/test/std/time/time.cal/time.cal.mwdlast/time.cal.mwdlast.nonmembers/ostream.pass.cpp b/libcxx/test/std/time/time.cal/time.cal.mwdlast/time.cal.mwdlast.nonmembers/ostream.pass.cpp --- a/libcxx/test/std/time/time.cal/time.cal.mwdlast/time.cal.mwdlast.nonmembers/ostream.pass.cpp +++ b/libcxx/test/std/time/time.cal/time.cal.mwdlast/time.cal.mwdlast.nonmembers/ostream.pass.cpp @@ -6,8 +6,6 @@ // //===----------------------------------------------------------------------===// -// XFAIL: LIBCXX-FREEBSD-FIXME - // UNSUPPORTED: c++03, c++11, c++14, c++17 // UNSUPPORTED: no-localization // UNSUPPORTED: GCC-ALWAYS_INLINE-FIXME @@ -172,15 +170,15 @@ TEST_EQUAL(stream_fr_FR_locale(std::chrono::month_weekday_last{ std::chrono::month{3}, std::chrono::weekday_last{std::chrono::weekday{2}}}), SV("mars/mar.[last]")); -# if defined(_WIN32) || defined(_AIX) +# if defined(_WIN32) || defined(_AIX) || defined(__FreeBSD__) TEST_EQUAL(stream_fr_FR_locale(std::chrono::month_weekday_last{ std::chrono::month{4}, std::chrono::weekday_last{std::chrono::weekday{3}}}), SV("avr./mer.[last]")); -# else // defined(_WIN32) || defined(_AIX) +# else // defined(_WIN32) || defined(_AIX) || defined(__FreeBSD__) TEST_EQUAL(stream_fr_FR_locale(std::chrono::month_weekday_last{ std::chrono::month{4}, std::chrono::weekday_last{std::chrono::weekday{3}}}), SV("avril/mer.[last]")); -# endif // defined(_WIN32) || defined(_AIX) +# endif // defined(_WIN32) || defined(_AIX) || defined(__FreeBSD__) TEST_EQUAL(stream_fr_FR_locale(std::chrono::month_weekday_last{ std::chrono::month{5}, std::chrono::weekday_last{std::chrono::weekday{4}}}), SV("mai/jeu.[last]")); diff --git a/libcxx/test/std/time/time.cal/time.cal.ym/time.cal.ym.nonmembers/ostream.pass.cpp b/libcxx/test/std/time/time.cal/time.cal.ym/time.cal.ym.nonmembers/ostream.pass.cpp --- a/libcxx/test/std/time/time.cal/time.cal.ym/time.cal.ym.nonmembers/ostream.pass.cpp +++ b/libcxx/test/std/time/time.cal/time.cal.ym/time.cal.ym.nonmembers/ostream.pass.cpp @@ -6,8 +6,6 @@ // //===----------------------------------------------------------------------===// -// XFAIL: LIBCXX-FREEBSD-FIXME - // UNSUPPORTED: c++03, c++11, c++14, c++17 // UNSUPPORTED: no-localization // UNSUPPORTED: GCC-ALWAYS_INLINE-FIXME @@ -135,13 +133,13 @@ SV("-32767/févr.")); TEST_EQUAL(stream_fr_FR_locale(std::chrono::year_month{std::chrono::year{0}, std::chrono::month{3}}), SV("0000/mars")); -# if defined(_WIN32) || defined(_AIX) +# if defined(_WIN32) || defined(_AIX) || defined(__FreeBSD__) TEST_EQUAL(stream_fr_FR_locale(std::chrono::year_month{std::chrono::year{1970}, std::chrono::month{4}}), SV("1970/avr.")); -# else // defined(_WIN32) || defined(_AIX) +# else // defined(_WIN32) || defined(_AIX) || defined(__FreeBSD__) TEST_EQUAL(stream_fr_FR_locale(std::chrono::year_month{std::chrono::year{1970}, std::chrono::month{4}}), SV("1970/avril")); -# endif // defined(_WIN32) || defined(_AIX) +# endif // defined(_WIN32) || defined(_AIX) || defined(__FreeBSD__) TEST_EQUAL(stream_fr_FR_locale(std::chrono::year_month{std::chrono::year{32'767}, std::chrono::month{5}}), SV("32767/mai")); TEST_EQUAL(stream_fr_FR_locale(std::chrono::year_month{std::chrono::year{0}, std::chrono::month{6}}), diff --git a/libcxx/test/std/time/time.cal/time.cal.ymdlast/time.cal.ymdlast.nonmembers/ostream.pass.cpp b/libcxx/test/std/time/time.cal/time.cal.ymdlast/time.cal.ymdlast.nonmembers/ostream.pass.cpp --- a/libcxx/test/std/time/time.cal/time.cal.ymdlast/time.cal.ymdlast.nonmembers/ostream.pass.cpp +++ b/libcxx/test/std/time/time.cal/time.cal.ymdlast/time.cal.ymdlast.nonmembers/ostream.pass.cpp @@ -6,8 +6,6 @@ // //===----------------------------------------------------------------------===// -// XFAIL: LIBCXX-FREEBSD-FIXME - // UNSUPPORTED: c++03, c++11, c++14, c++17 // UNSUPPORTED: no-localization // UNSUPPORTED: GCC-ALWAYS_INLINE-FIXME @@ -166,15 +164,15 @@ TEST_EQUAL(stream_fr_FR_locale(std::chrono::year_month_day_last{ std::chrono::year{0}, std::chrono::month_day_last{std::chrono::month{3}}}), SV("0000/mars/last")); -# if defined(_WIN32) || defined(_AIX) +# if defined(_WIN32) || defined(_AIX) || defined(__FreeBSD__) TEST_EQUAL(stream_fr_FR_locale(std::chrono::year_month_day_last{ std::chrono::year{1970}, std::chrono::month_day_last{std::chrono::month{4}}}), SV("1970/avr./last")); -# else // defined(_WIN32) || defined(_AIX) +# else // defined(_WIN32) || defined(_AIX) || defined(__FreeBSD__) TEST_EQUAL(stream_fr_FR_locale(std::chrono::year_month_day_last{ std::chrono::year{1970}, std::chrono::month_day_last{std::chrono::month{4}}}), SV("1970/avril/last")); -# endif // defined(_WIN32) || defined(_AIX) +# endif // defined(_WIN32) || defined(_AIX) || defined(__FreeBSD__) TEST_EQUAL(stream_fr_FR_locale(std::chrono::year_month_day_last{ std::chrono::year{32'767}, std::chrono::month_day_last{std::chrono::month{5}}}), SV("32767/mai/last")); diff --git a/libcxx/test/std/time/time.syn/formatter.hh_mm_ss.pass.cpp b/libcxx/test/std/time/time.syn/formatter.hh_mm_ss.pass.cpp --- a/libcxx/test/std/time/time.syn/formatter.hh_mm_ss.pass.cpp +++ b/libcxx/test/std/time/time.syn/formatter.hh_mm_ss.pass.cpp @@ -9,8 +9,6 @@ // UNSUPPORTED: no-localization // UNSUPPORTED: GCC-ALWAYS_INLINE-FIXME -// XFAIL: LIBCXX-FREEBSD-FIXME - // XFAIL: availability-fp_to_chars-missing // REQUIRES: locale.fr_FR.UTF-8 @@ -188,7 +186,7 @@ "%r='00:00:00'\t" #elif defined(_AIX) "%r='12:00:00 AM'\t" -#elif defined(__APPLE__) +#elif defined(__APPLE__) || defined(__FreeBSD__) "%r=''\t" #else "%r='12:00:00 '\t" @@ -218,7 +216,7 @@ "%r='23:31:30'\t" #elif defined(_AIX) "%r='11:31:30 PM'\t" -#elif defined(__APPLE__) +#elif defined(__APPLE__) || defined(__FreeBSD__) "%r=''\t" #else "%r='11:31:30 '\t" @@ -248,7 +246,7 @@ "%r='03:02:01'\t" #elif defined(_AIX) "%r='03:02:01 AM'\t" -#elif defined(__APPLE__) +#elif defined(__APPLE__) || defined(__FreeBSD__) "%r=''\t" #else "%r='03:02:01 '\t" @@ -278,7 +276,7 @@ "%r='01:01:01'\t" #elif defined(_AIX) "%r='01:01:01 AM'\t" -#elif defined(__APPLE__) +#elif defined(__APPLE__) || defined(__FreeBSD__) "%r=''\t" #else "%r='01:01:01 '\t" @@ -290,7 +288,7 @@ std::chrono::hh_mm_ss(std::chrono::duration(3661.123456))); // Use supplied locale (ja_JP). This locale has a different alternate. -#if defined(__APPLE__) || defined(_AIX) || defined(_WIN32) +#if defined(__APPLE__) || defined(_AIX) || defined(_WIN32) || defined(__FreeBSD__) check(loc, SV("%H='00'\t" "%OH='00'\t" @@ -307,8 +305,12 @@ # endif "%R='00:00'\t" "%T='00:00:00'\t" -# if defined(__APPLE__) +# if defined(__APPLE__) || defined(__FreeBSD__) +# if defined(__APPLE__) "%r='12:00:00 AM'\t" +# else + "%r='12:00:00 午前'\t" +# endif "%X='00時00分00秒'\t" "%EX='00時00分00秒'\t" # elif defined(_WIN32) @@ -340,8 +342,12 @@ # endif "%R='23:31'\t" "%T='23:31:30.123'\t" -# if defined(__APPLE__) +# if defined(__APPLE__) || defined(__FreeBSD__) +# if defined(__APPLE__) "%r='11:31:30 PM'\t" +# else + "%r='11:31:30 午後'\t" +# endif "%X='23時31分30秒'\t" "%EX='23時31分30秒'\t" # elif defined(_WIN32) @@ -373,8 +379,12 @@ # endif "%R='03:02'\t" "%T='03:02:01.123456789012'\t" -# if defined(__APPLE__) +# if defined(__APPLE__) || defined(__FreeBSD__) +# if defined(__APPLE__) "%r='03:02:01 AM'\t" +# else + "%r='03:02:01 午前'\t" +# endif "%X='03時02分01秒'\t" "%EX='03時02分01秒'\t" # elif defined(_WIN32) @@ -406,8 +416,12 @@ # endif "%R='01:01'\t" "%T='01:01:01'\t" -# if defined(__APPLE__) +# if defined(__APPLE__) || defined(__FreeBSD__) +# if defined(__APPLE__) "%r='01:01:01 AM'\t" +# else + "%r='01:01:01 午前'\t" +# endif "%X='01時01分01秒'\t" "%EX='01時01分01秒'\t" # elif defined(_WIN32) diff --git a/libcxx/test/std/time/time.syn/formatter.day.pass.cpp b/libcxx/test/std/time/time.syn/formatter.day.pass.cpp --- a/libcxx/test/std/time/time.syn/formatter.day.pass.cpp +++ b/libcxx/test/std/time/time.syn/formatter.day.pass.cpp @@ -5,8 +5,6 @@ // //===----------------------------------------------------------------------===// -// XFAIL: LIBCXX-FREEBSD-FIXME - // UNSUPPORTED: c++03, c++11, c++14, c++17 // UNSUPPORTED: no-localization // UNSUPPORTED: GCC-ALWAYS_INLINE-FIXME @@ -96,7 +94,7 @@ #endif // Use supplied locale (ja_JP). This locale has a different alternate on some platforms. -#if defined(__APPLE__) || defined(_AIX) || defined(_WIN32) +#if defined(__APPLE__) || defined(_AIX) || defined(_WIN32) || defined(__FreeBSD__) # if defined(_WIN32) check(loc, SV("%d=''\t%Od=''\t%e=''\t%Oe=''\n"), lfmt, 0d); # else @@ -111,12 +109,12 @@ # else check(SV("%d='255'\t%Od='255'\t%e='255'\t%Oe='255'\n"), fmt, 255d); # endif -#else // defined(__APPLE__) || defined(_AIX) || defined(_WIN32) +#else // defined(__APPLE__) || defined(_AIX) || defined(_WIN32) || defined(__FreeBSD__) check(loc, SV("%d='00'\t%Od='〇'\t%e=' 0'\t%Oe='〇'\n"), lfmt, 0d); check(loc, SV("%d='01'\t%Od='一'\t%e=' 1'\t%Oe='一'\n"), lfmt, 1d); check(loc, SV("%d='31'\t%Od='三十一'\t%e='31'\t%Oe='三十一'\n"), lfmt, 31d); check(loc, SV("%d='255'\t%Od='255'\t%e='255'\t%Oe='255'\n"), lfmt, 255d); -#endif // defined(__APPLE__) || defined(_AIX) || defined(_WIN32) +#endif // defined(__APPLE__) || defined(_AIX) || defined(_WIN32) || defined(__FreeBSD__) std::locale::global(std::locale::classic()); } diff --git a/libcxx/test/std/time/time.syn/formatter.duration.pass.cpp b/libcxx/test/std/time/time.syn/formatter.duration.pass.cpp --- a/libcxx/test/std/time/time.syn/formatter.duration.pass.cpp +++ b/libcxx/test/std/time/time.syn/formatter.duration.pass.cpp @@ -5,8 +5,6 @@ // //===----------------------------------------------------------------------===// -// XFAIL: LIBCXX-FREEBSD-FIXME - // UNSUPPORTED: c++03, c++11, c++14, c++17 // UNSUPPORTED: no-localization // UNSUPPORTED: GCC-ALWAYS_INLINE-FIXME @@ -247,7 +245,7 @@ "%r='00:00:00'\t" #elif defined(_AIX) "%r='12:00:00 AM'\t" -#elif defined(__APPLE__) +#elif defined(__APPLE__) || defined(__FreeBSD__) "%r=''\t" #else "%r='12:00:00 '\t" @@ -280,7 +278,7 @@ "%r='11:59:59'\t" #elif defined(_AIX) "%r='11:59:59 AM'\t" -#elif defined(__APPLE__) +#elif defined(__APPLE__) || defined(__FreeBSD__) "%r=''\t" #else "%r='11:59:59 '\t" @@ -313,7 +311,7 @@ "%r='12:00:00'\t" #elif defined(_AIX) "%r='12:00:00 PM'\t" -#elif defined(__APPLE__) +#elif defined(__APPLE__) || defined(__FreeBSD__) "%r=''\t" #else "%r='12:00:00 '\t" @@ -344,7 +342,7 @@ "%T='23:59:59'\t" #if defined(_AIX) "%r='11:59:59 PM'\t" -#elif defined(__APPLE__) +#elif defined(__APPLE__) || defined(__FreeBSD__) "%r=''\t" #elif defined(_WIN32) "%r='23:59:59'\t" @@ -379,7 +377,7 @@ "%r='00:00:00'\t" #elif defined(_AIX) "%r='12:00:00 AM'\t" -#elif defined(__APPLE__) +#elif defined(__APPLE__) || defined(__FreeBSD__) "%r=''\t" #elif defined(_WIN32) "%r='12:00:00'\t" @@ -396,7 +394,7 @@ std::chrono::duration>(7)); // Use supplied locale (ja_JP). This locale has a different alternate. -#if defined(__APPLE__) || defined(_AIX) || defined(_WIN32) +#if defined(__APPLE__) || defined(_AIX) || defined(_WIN32) || defined(__FreeBSD__) check(loc, SV("%H='00'\t" "%OH='00'\t" @@ -413,8 +411,12 @@ # endif "%R='00:00'\t" "%T='00:00:00'\t" -# if defined(__APPLE__) +# if defined(__APPLE__) || defined(__FreeBSD__) +# if defined(__APPLE__) "%r='12:00:00 AM'\t" +# else + "%r='12:00:00 午前'\t" +# endif "%X='00時00分00秒'\t" "%EX='00時00分00秒'\t" # elif defined(_WIN32) @@ -449,8 +451,12 @@ # endif "%R='11:59'\t" "%T='11:59:59'\t" -# if defined(__APPLE__) +# if defined(__APPLE__) || defined(__FreeBSD__) +# if defined(__APPLE__) "%r='11:59:59 AM'\t" +# else + "%r='11:59:59 午前'\t" +# endif "%X='11時59分59秒'\t" "%EX='11時59分59秒'\t" # elif defined(_WIN32) @@ -485,8 +491,12 @@ # endif "%R='12:00'\t" "%T='12:00:00'\t" -# if defined(__APPLE__) +# if defined(__APPLE__) || defined(__FreeBSD__) +# if defined(__APPLE__) "%r='12:00:00 PM'\t" +# else + "%r='12:00:00 午後'\t" +# endif "%X='12時00分00秒'\t" "%EX='12時00分00秒'\t" # else @@ -521,8 +531,12 @@ # endif "%R='23:59'\t" "%T='23:59:59'\t" -# if defined(__APPLE__) +# if defined(__APPLE__) || defined(__FreeBSD__) +# if defined(__APPLE__) "%r='11:59:59 PM'\t" +# else + "%r='11:59:59 午後'\t" +# endif "%X='23時59分59秒'\t" "%EX='23時59分59秒'\t" # else @@ -557,8 +571,12 @@ # endif "%R='00:00'\t" "%T='00:00:00'\t" -# if defined(__APPLE__) +# if defined(__APPLE__) || defined(__FreeBSD__) +# if defined(__APPLE__) "%r='12:00:00 AM'\t" +# else + "%r='12:00:00 午前'\t" +# endif "%X='00時00分00秒'\t" "%EX='00時00分00秒'\t" # elif defined(_WIN32) @@ -786,7 +804,7 @@ "%T='23:59:59'\t" #if defined(_AIX) "%r='11:59:59 PM'\t" -#elif defined(__APPLE__) +#elif defined(__APPLE__) || defined(__FreeBSD__) "%r=''\t" #elif defined(_WIN32) "%r='23:59:59'\t" @@ -803,7 +821,7 @@ -(23h + 59min + 59s)); // Use supplied locale (ja_JP). This locale has a different alternate. -#if defined(__APPLE__) || defined(_AIX) || defined(_WIN32) +#if defined(__APPLE__) || defined(_AIX) || defined(_WIN32) || defined(__FreeBSD__) check(loc, SV("-%H='23'\t" "%OH='23'\t" @@ -820,8 +838,12 @@ # endif "%R='23:59'\t" "%T='23:59:59'\t" -# if defined(__APPLE__) +# if defined(__APPLE__) || defined(__FreeBSD__) +# if defined(__APPLE__) "%r='11:59:59 PM'\t" +# else + "%r='11:59:59 午後'\t" +# endif "%X='23時59分59秒'\t" "%EX='23時59分59秒'\t" # elif defined(_WIN32) @@ -839,7 +861,7 @@ "\n"), lfmt, -(23h + 59min + 59s)); -#else // defined(__APPLE__) || defined(_AIX) || defined(_WIN32) +#else // defined(__APPLE__) || defined(_AIX) || defined(_WIN32)|| defined(__FreeBSD__) check(loc, SV("-%H='23'\t" "%OH='二十三'\t" @@ -861,7 +883,7 @@ "\n"), lfmt, -(23h + 59min + 59s)); -#endif // defined(__APPLE__) || defined(_AIX) || defined(_WIN32) +#endif // defined(__APPLE__) || defined(_AIX) || defined(_WIN32)|| defined(__FreeBSD__) std::locale::global(std::locale::classic()); } @@ -1014,7 +1036,8 @@ check(loc, SV("00.011"), SV("{:L%S}"), std::chrono::duration(11.123456789)); check(loc, SV("01"), SV("{:L%S}"), std::chrono::duration(61.123456789)); -#if defined(__APPLE__) || defined(_AIX) || defined(_WIN32) +#if defined(__APPLE__) || defined(_AIX) || defined(_WIN32) || defined(__FreeBSD__) + check(SV("00.000000001"), SV("{:%OS}"), 1ns); check(SV("00.000000501"), SV("{:%OS}"), 501ns); check(SV("00.000001000"), SV("{:%OS}"), 1000ns); @@ -1030,7 +1053,8 @@ check(SV("00.001"), SV("{:%OS}"), std::chrono::duration(1.123456789)); check(SV("00.011"), SV("{:%OS}"), std::chrono::duration(11.123456789)); check(SV("01"), SV("{:%OS}"), std::chrono::duration(61.123456789)); -#else // defined(__APPLE__) || defined(_AIX) || defined(_WIN32) +#else // defined(__APPLE__) || defined(_AIX) || defined(_WIN32)|| defined(__FreeBSD__) + check(loc, SV("〇.000000001"), SV("{:L%OS}"), 1ns); check(loc, SV("〇.000000501"), SV("{:L%OS}"), 501ns); check(loc, SV("〇.000001000"), SV("{:L%OS}"), 1000ns); @@ -1046,7 +1070,7 @@ check(loc, SV("〇.001"), SV("{:L%OS}"), std::chrono::duration(1.123456789)); check(loc, SV("〇.011"), SV("{:L%OS}"), std::chrono::duration(11.123456789)); check(loc, SV("一"), SV("{:L%OS}"), std::chrono::duration(61.123456789)); -#endif // defined(__APPLE__) || defined(_AIX) || defined(_WIN32) +#endif // defined(__APPLE__) || defined(_AIX) || defined(_WIN32)|| defined(__FreeBSD__) check(loc, SV("01:05:06.000000001"), SV("{:L%T}"), 1h + 5min + 6s + 1ns); check(loc, SV("01:05:06.000000501"), SV("{:L%T}"), 1h + 5min + 6s + 501ns); diff --git a/libcxx/test/std/time/time.syn/formatter.file_time.pass.cpp b/libcxx/test/std/time/time.syn/formatter.file_time.pass.cpp --- a/libcxx/test/std/time/time.syn/formatter.file_time.pass.cpp +++ b/libcxx/test/std/time/time.syn/formatter.file_time.pass.cpp @@ -9,8 +9,6 @@ // UNSUPPORTED: no-localization // UNSUPPORTED: GCC-ALWAYS_INLINE-FIXME -// XFAIL: LIBCXX-FREEBSD-FIXME - // TODO FMT This test should not require std::to_chars(floating-point) // XFAIL: availability-fp_to_chars-missing @@ -109,7 +107,8 @@ file_seconds(1'234'567'890s)); // 23:31:30 UTC on Friday, 13 February 2009 // Use supplied locale (ja_JP). This locale has a different alternate. -#if defined(_WIN32) || defined(__APPLE__) || defined(_AIX) +#if defined(_WIN32) || defined(__APPLE__) || defined(_AIX) || defined(__FreeBSD__) + check(loc, SV("%C='19'\t%EC='19'\t%y='70'\t%Oy='70'\t%Ey='70'\t%Y='1970'\t%EY='1970'\n"), lfmt, @@ -119,7 +118,8 @@ SV("%C='20'\t%EC='20'\t%y='09'\t%Oy='09'\t%Ey='09'\t%Y='2009'\t%EY='2009'\n"), lfmt, file_seconds(1'234'567'890s)); // 23:31:30 UTC on Friday, 13 February 2009 -#else // defined(_WIN32) || defined(__APPLE__) || defined(_AIX) +#else // defined(_WIN32) || defined(__APPLE__) || defined(_AIX)|| defined(__FreeBSD__) + check(loc, SV("%C='19'\t%EC='昭和'\t%y='70'\t%Oy='七十'\t%Ey='45'\t%Y='1970'\t%EY='昭和45年'\n"), lfmt, @@ -129,7 +129,7 @@ SV("%C='20'\t%EC='平成'\t%y='09'\t%Oy='九'\t%Ey='21'\t%Y='2009'\t%EY='平成21年'\n"), lfmt, file_seconds(1'234'567'890s)); // 23:31:30 UTC on Friday, 13 February 2009 -#endif // defined(_WIN32) || defined(__APPLE__) || defined(_AIX) +#endif // defined(_WIN32) || defined(__APPLE__) || defined(_AIX)|| defined(__FreeBSD__) std::locale::global(std::locale::classic()); } @@ -199,6 +199,16 @@ SV("%b=' 5'\t%h=' 5'\t%B='5月'\t%m='05'\t%Om='05'\n"), lfmt, file_seconds(2'000'000'000s)); // 03:33:20 UTC on Wednesday, 18 May 2033 +#elif defined(__FreeBSD__) // _WIN32 + check(loc, + SV("%b=' 1月'\t%h=' 1月'\t%B='1月'\t%m='01'\t%Om='01'\n"), + lfmt, + file_seconds(0s)); // 00:00:00 UTC Thursday, 1 January 1970 + + check(loc, + SV("%b=' 5月'\t%h=' 5月'\t%B='5月'\t%m='05'\t%Om='05'\n"), + lfmt, + file_seconds(2'000'000'000s)); // 03:33:20 UTC on Wednesday, 18 May 2033 #else // _WIN32 check(loc, SV("%b=' 1月'\t%h=' 1月'\t%B='1月'\t%m='01'\t%Om='一'\n"), @@ -241,7 +251,7 @@ file_seconds(1'234'567'890s)); // 23:31:30 UTC on Friday, 13 February 2009 // Use supplied locale (ja_JP). This locale has a different alternate. -#if defined(_WIN32) || defined(__APPLE__) || defined(_AIX) +#if defined(_WIN32) || defined(__APPLE__) || defined(_AIX) || defined(__FreeBSD__) check(loc, SV("%d='01'\t%Od='01'\t%e=' 1'\t%Oe=' 1'\n"), lfmt, @@ -251,7 +261,7 @@ SV("%d='13'\t%Od='13'\t%e='13'\t%Oe='13'\n"), lfmt, file_seconds(1'234'567'890s)); // 23:31:30 UTC on Friday, 13 February 2009 -#else // _WIN32 +#else // defined(_WIN32) || defined(__APPLE__) || defined(_AIX) || defined(__FreeBSD__) check(loc, SV("%d='01'\t%Od='一'\t%e=' 1'\t%Oe='一'\n"), lfmt, @@ -262,7 +272,7 @@ lfmt, file_seconds(1'234'567'890s)); // 23:31:30 UTC on Friday, 13 February 2009 -#endif // _WIN32 +#endif // defined(_WIN32) || defined(__APPLE__) || defined(_AIX) || defined(__FreeBSD__) std::locale::global(std::locale::classic()); } @@ -309,7 +319,7 @@ // Use supplied locale (ja_JP). // This locale has a different alternate, but not on all platforms -#if defined(_WIN32) || defined(__APPLE__) || defined(_AIX) +#if defined(_WIN32) || defined(__APPLE__) || defined(_AIX) || defined(__FreeBSD__) check(loc, SV("%a='木'\t%A='木曜日'\t%u='4'\t%Ou='4'\t%w='4'\t%Ow='4'\n"), lfmt, @@ -319,7 +329,7 @@ SV("%a='日'\t%A='日曜日'\t%u='7'\t%Ou='7'\t%w='0'\t%Ow='0'\n"), lfmt, file_seconds(4'294'967'295s)); // 06:28:15 UTC on Sunday, 7 February 2106 -#else // defined(_WIN32) || defined(__APPLE__) || defined(_AIX) +#else // defined(_WIN32) || defined(__APPLE__) || defined(_AIX) || defined(__FreeBSD__) check(loc, SV("%a='木'\t%A='木曜日'\t%u='4'\t%Ou='四'\t%w='4'\t%Ow='四'\n"), lfmt, @@ -329,7 +339,7 @@ SV("%a='日'\t%A='日曜日'\t%u='7'\t%Ou='七'\t%w='0'\t%Ow='〇'\n"), lfmt, file_seconds(4'294'967'295s)); // 06:28:15 UTC on Sunday, 7 February 2106 -#endif // defined(_WIN32) || defined(__APPLE__) || defined(_AIX) +#endif // defined(_WIN32) || defined(__APPLE__) || defined(_AIX) || defined(__FreeBSD__) std::locale::global(std::locale::classic()); } @@ -387,7 +397,7 @@ file_seconds(2'000'000'000s)); // 03:33:20 UTC on Wednesday, 18 May 2033 // Use supplied locale (ja_JP). This locale has a different alternate. -#if defined(_WIN32) || defined(__APPLE__) || defined(_AIX) +#if defined(_WIN32) || defined(__APPLE__) || defined(_AIX) || defined(__FreeBSD__) check(loc, SV("%U='00'\t%OU='00'\t%W='00'\t%OW='00'\n"), lfmt, @@ -397,7 +407,7 @@ SV("%U='20'\t%OU='20'\t%W='20'\t%OW='20'\n"), lfmt, file_seconds(2'000'000'000s)); // 03:33:20 UTC on Wednesday, 18 May 2033 -#else // defined(_WIN32) || defined(__APPLE__) || defined(_AIX) +#else // defined(_WIN32) || defined(__APPLE__) || defined(_AIX) || defined(__FreeBSD__) check(loc, SV("%U='00'\t%OU='〇'\t%W='00'\t%OW='〇'\n"), lfmt, @@ -407,7 +417,7 @@ SV("%U='20'\t%OU='二十'\t%W='20'\t%OW='二十'\n"), lfmt, file_seconds(2'000'000'000s)); // 03:33:20 UTC on Wednesday, 18 May 2033 -#endif // defined(_WIN32) || defined(__APPLE__) || defined(_AIX) +#endif // defined(_WIN32) || defined(__APPLE__) || defined(_AIX) || defined(__FreeBSD__) std::locale::global(std::locale::classic()); } @@ -438,7 +448,7 @@ file_seconds(1'234'567'890s)); // 23:31:30 UTC on Friday, 13 February 2009 // Use supplied locale (ja_JP). This locale has a different alternate. -#if defined(_WIN32) || defined(__APPLE__) || defined(_AIX) +#if defined(_WIN32) || defined(__APPLE__) || defined(_AIX) || defined(__FreeBSD__) check(loc, SV("%g='70'\t%G='1970'\t%V='01'\t%OV='01'\n"), lfmt, @@ -448,7 +458,7 @@ SV("%g='09'\t%G='2009'\t%V='07'\t%OV='07'\n"), lfmt, file_seconds(1'234'567'890s)); // 23:31:30 UTC on Friday, 13 February 2009 -#else // defined(_WIN32) || defined(__APPLE__) || defined(_AIX) +#else // defined(_WIN32) || defined(__APPLE__) || defined(_AIX) || defined(__FreeBSD__) check(loc, SV("%g='70'\t%G='1970'\t%V='01'\t%OV='一'\n"), lfmt, @@ -458,7 +468,7 @@ SV("%g='09'\t%G='2009'\t%V='07'\t%OV='七'\n"), lfmt, file_seconds(1'234'567'890s)); // 23:31:30 UTC on Friday, 13 February 2009 -#endif // defined(_WIN32) || defined(__APPLE__) || defined(_AIX) +#endif // defined(_WIN32) || defined(__APPLE__) || defined(_AIX) || defined(__FreeBSD__) std::locale::global(std::locale::classic()); } @@ -483,7 +493,7 @@ file_seconds(1'234'567'890s)); // 23:31:30 UTC on Friday, 13 February 2009 // Use the global locale (fr_FR) -#if defined(__APPLE__) +#if defined(__APPLE__) || defined(__FreeBSD__) check(SV("%D='01/01/70'\t%F='1970-01-01'\t%x='01.01.1970'\t%Ex='01.01.1970'\n"), lfmt, file_seconds(0s)); // 00:00:00 UTC Thursday, 1 January 1970 @@ -502,7 +512,7 @@ #endif // Use supplied locale (ja_JP). This locale has a different alternate. -#if defined(_WIN32) || defined(__APPLE__) || defined(_AIX) +#if defined(_WIN32) || defined(__APPLE__) || defined(_AIX) || defined(__FreeBSD__) check(loc, SV("%D='01/01/70'\t%F='1970-01-01'\t%x='1970/01/01'\t%Ex='1970/01/01'\n"), lfmt, @@ -512,7 +522,7 @@ SV("%D='02/13/09'\t%F='2009-02-13'\t%x='2009/02/13'\t%Ex='2009/02/13'\n"), lfmt, file_seconds(1'234'567'890s)); // 23:31:30 UTC on Friday, 13 February 2009 -#else // defined(_WIN32) || defined(__APPLE__) || defined(_AIX) +#else // defined(_WIN32) || defined(__APPLE__) || defined(_AIX) || defined(__FreeBSD__) check(loc, SV("%D='01/01/70'\t%F='1970-01-01'\t%x='1970年01月01日'\t%Ex='昭和45年01月01日'\n"), lfmt, @@ -522,7 +532,7 @@ SV("%D='02/13/09'\t%F='2009-02-13'\t%x='2009年02月13日'\t%Ex='平成21年02月13日'\n"), lfmt, file_seconds(1'234'567'890s)); // 23:31:30 UTC on Friday, 13 February 2009 -#endif // defined(_WIN32) || defined(__APPLE__) || defined(_AIX) +#endif // defined(_WIN32) || defined(__APPLE__) || defined(_AIX) || defined(__FreeBSD__) std::locale::global(std::locale::classic()); } @@ -626,7 +636,7 @@ "%r='00:00:00'\t" #elif defined(_AIX) "%r='12:00:00 AM'\t" -#elif defined(__APPLE__) +#elif defined(__APPLE__) || defined(__FreeBSD__) "%r=''\t" #else "%r='12:00:00 '\t" @@ -656,7 +666,7 @@ "%r='23:31:30'\t" #elif defined(_AIX) "%r='11:31:30 PM'\t" -#elif defined(__APPLE__) +#elif defined(__APPLE__) || defined(__FreeBSD__) "%r=''\t" #elif defined(_WIN32) "%r='23:31:30 '\t" @@ -671,7 +681,7 @@ 1'234'567'890'123ms)); // 23:31:30 UTC on Friday, 13 February 2009 // Use supplied locale (ja_JP). This locale has a different alternate.a -#if defined(__APPLE__) || defined(_AIX) || defined(_WIN32) +#if defined(__APPLE__) || defined(_AIX) || defined(_WIN32) || defined(__FreeBSD__) check(loc, SV("%H='00'\t" "%OH='00'\t" @@ -688,8 +698,12 @@ # endif "%R='00:00'\t" "%T='00:00:00'\t" -# if defined(__APPLE__) +# if defined(__APPLE__) || defined(__FreeBSD__) +# if defined(__APPLE__) "%r='12:00:00 AM'\t" +# else + "%r='12:00:00 午前'\t" +# endif "%X='00時00分00秒'\t" "%EX='00時00分00秒'\t" # elif defined(_WIN32) @@ -721,8 +735,12 @@ # endif "%R='23:31'\t" "%T='23:31:30.123'\t" -# if defined(__APPLE__) +# if defined(__APPLE__) || defined(__FreeBSD__) +# if defined(__APPLE__) "%r='11:31:30 PM'\t" +# else + "%r='11:31:30 午後'\t" +# endif "%X='23時31分30秒'\t" "%EX='23時31分30秒'\t" # elif defined(_WIN32) @@ -737,7 +755,7 @@ "\n"), lfmt, std::chrono::hh_mm_ss(23h + 31min + 30s + 123ms)); -#else // defined(__APPLE__) || defined(_AIX) || defined(_WIN32) +#else // defined(__APPLE__) || defined(_AIX) || defined(_WIN32) || defined(__FreeBSD__) check(loc, SV("%H='00'\t" "%OH='〇'\t" @@ -776,7 +794,7 @@ lfmt, std::chrono::sys_time( 1'234'567'890'123ms)); // 23:31:30 UTC on Friday, 13 February 2009 -#endif // defined(__APPLE__) || defined(_AIX) || defined(_WIN32) +#endif // defined(__APPLE__) || defined(_AIX) || defined(_WIN32) || defined(__FreeBSD__) std::locale::global(std::locale::classic()); } @@ -811,6 +829,8 @@ SV("%c='Jeu 1 jan 00:00:00 1970'\t%Ec='Jeu 1 jan 00:00:00 1970'\n"), #elif defined(_WIN32) SV("%c='01/01/1970 00:00:00'\t%Ec='01/01/1970 00:00:00'\n"), +#elif defined(__FreeBSD__) + SV("%c='jeu. 1 janv. 00:00:00 1970'\t%Ec='jeu. 1 janv. 00:00:00 1970'\n"), #else SV("%c='jeu. 01 janv. 1970 00:00:00'\t%Ec='jeu. 01 janv. 1970 00:00:00'\n"), #endif @@ -827,6 +847,8 @@ SV("%c='Ven 13 fév 23:31:30 2009'\t%Ec='Ven 13 fév 23:31:30 2009'\n"), #elif defined(_WIN32) SV("%c='13/02/2009 23:31:30'\t%Ec='13/02/2009 23:31:30'\n"), +#elif defined(__FreeBSD__) + SV("%c='ven. 13 févr. 23:31:30 2009'\t%Ec='ven. 13 févr. 23:31:30 2009'\n"), #else SV("%c='ven. 13 févr. 2009 23:31:30'\t%Ec='ven. 13 févr. 2009 23:31:30'\n"), #endif @@ -834,7 +856,7 @@ file_seconds(1'234'567'890s)); // 23:31:30 UTC on Friday, 13 February 2009 // Use supplied locale (ja_JP). This locale has a different alternate.a -#if defined(__APPLE__) +#if defined(__APPLE__) || defined(__FreeBSD__) check(loc, SV("%c='木 1/ 1 00:00:00 1970'\t%Ec='木 1/ 1 00:00:00 1970'\n"), lfmt, @@ -843,7 +865,7 @@ SV("%c='金 2/13 23:31:30 2009'\t%Ec='金 2/13 23:31:30 2009'\n"), lfmt, file_seconds(1'234'567'890s)); // 23:31:30 UTC on Friday, 13 February 2009 -#elif defined(_AIX) // __APPLE__ +#elif defined(_AIX) // defined(__APPLE__)|| defined(__FreeBSD__) check(loc, SV("%c='1970年01月 1日 00:00:00 UTC'\t%Ec='1970年01月 1日 00:00:00 UTC'\n"), lfmt, @@ -852,7 +874,7 @@ SV("%c='2009年02月13日 23:31:30 UTC'\t%Ec='2009年02月13日 23:31:30 UTC'\n"), lfmt, file_seconds(1'234'567'890s)); // 23:31:30 UTC on Friday, 13 February 2009 -#elif defined(_WIN32) // __APPLE__ +#elif defined(_WIN32) // defined(__APPLE__)|| defined(__FreeBSD__) check(loc, SV("%c='1970/01/01 0:00:00'\t%Ec='1970/01/01 0:00:00'\n"), lfmt, @@ -861,7 +883,7 @@ SV("%c='2009/02/13 23:31:30'\t%Ec='2009/02/13 23:31:30'\n"), lfmt, std::chrono::sys_seconds(1'234'567'890s)); // 23:31:30 UTC on Friday, 13 February 2009 -#else // __APPLE__ +#else // defined(__APPLE__)|| defined(__FreeBSD__) check(loc, SV("%c='1970年01月01日 00時00分00秒'\t%Ec='昭和45年01月01日 00時00分00秒'\n"), lfmt, @@ -871,7 +893,7 @@ SV("%c='2009年02月13日 23時31分30秒'\t%Ec='平成21年02月13日 23時31分30秒'\n"), lfmt, file_seconds(1'234'567'890s)); // 23:31:30 UTC on Friday, 13 February 2009 -#endif // __APPLE__ +#endif // defined(__APPLE__)|| defined(__FreeBSD__) std::locale::global(std::locale::classic()); } @@ -920,10 +942,17 @@ file_seconds(0s)); // 00:00:00 UTC Thursday, 1 January 1970 // Use supplied locale (ja_JP). This locale has a different alternate.a +# if defined(__FreeBSD__) + check(loc, + SV("%z='+0000'\t%Ez='+0000'\t%Oz='+0000'\t%Z='UTC'\n"), + lfmt, + file_seconds(0s)); // 00:00:00 UTC Thursday, 1 January 1970 +# else check(loc, SV("%z='+0000'\t%Ez='+0000'\t%Oz='+〇'\t%Z='UTC'\n"), lfmt, file_seconds(0s)); // 00:00:00 UTC Thursday, 1 January 1970 +# endif # endif // defined(_AIX) std::locale::global(std::locale::classic()); #endif // !defined(__APPLE__) && !defined(_WIN32) diff --git a/libcxx/test/std/time/time.syn/formatter.local_time.pass.cpp b/libcxx/test/std/time/time.syn/formatter.local_time.pass.cpp --- a/libcxx/test/std/time/time.syn/formatter.local_time.pass.cpp +++ b/libcxx/test/std/time/time.syn/formatter.local_time.pass.cpp @@ -9,8 +9,6 @@ // UNSUPPORTED: no-localization // UNSUPPORTED: GCC-ALWAYS_INLINE-FIXME -// XFAIL: LIBCXX-FREEBSD-FIXME - // TODO FMT This test should not require std::to_chars(floating-point) // XFAIL: availability-fp_to_chars-missing @@ -103,7 +101,7 @@ std::chrono::local_seconds(1'234'567'890s)); // 23:31:30 UTC on Friday, 13 February 2009 // Use supplied locale (ja_JP). This locale has a different alternate. -#if defined(_WIN32) || defined(__APPLE__) || defined(_AIX) +#if defined(_WIN32) || defined(__APPLE__) || defined(_AIX) || defined(__FreeBSD__) check(loc, SV("%C='19'\t%EC='19'\t%y='70'\t%Oy='70'\t%Ey='70'\t%Y='1970'\t%EY='1970'\n"), lfmt, @@ -113,7 +111,7 @@ SV("%C='20'\t%EC='20'\t%y='09'\t%Oy='09'\t%Ey='09'\t%Y='2009'\t%EY='2009'\n"), lfmt, std::chrono::local_seconds(1'234'567'890s)); // 23:31:30 UTC on Friday, 13 February 2009 -#else // defined(_WIN32) || defined(__APPLE__) || defined(_AIX) +#else // defined(_WIN32) || defined(__APPLE__) || defined(_AIX)||defined(__FreeBSD__) check(loc, SV("%C='19'\t%EC='昭和'\t%y='70'\t%Oy='七十'\t%Ey='45'\t%Y='1970'\t%EY='昭和45年'\n"), lfmt, @@ -123,7 +121,7 @@ SV("%C='20'\t%EC='平成'\t%y='09'\t%Oy='九'\t%Ey='21'\t%Y='2009'\t%EY='平成21年'\n"), lfmt, std::chrono::local_seconds(1'234'567'890s)); // 23:31:30 UTC on Friday, 13 February 2009 -#endif // defined(_WIN32) || defined(__APPLE__) || defined(_AIX) +#endif // defined(_WIN32) || defined(__APPLE__) || defined(_AIX)||defined(__FreeBSD__) std::locale::global(std::locale::classic()); } @@ -193,6 +191,16 @@ SV("%b=' 5'\t%h=' 5'\t%B='5月'\t%m='05'\t%Om='05'\n"), lfmt, std::chrono::local_seconds(2'000'000'000s)); // 03:33:20 UTC on Wednesday, 18 May 2033 +#elif defined(__FreeBSD__) // _WIN32 + check(loc, + SV("%b=' 1月'\t%h=' 1月'\t%B='1月'\t%m='01'\t%Om='01'\n"), + lfmt, + std::chrono::local_seconds(0s)); // 00:00:00 UTC Thursday, 1 January 1970 + + check(loc, + SV("%b=' 5月'\t%h=' 5月'\t%B='5月'\t%m='05'\t%Om='05'\n"), + lfmt, + std::chrono::local_seconds(2'000'000'000s)); // 03:33:20 UTC on Wednesday, 18 May 2033 #else // _WIN32 check(loc, SV("%b=' 1月'\t%h=' 1月'\t%B='1月'\t%m='01'\t%Om='一'\n"), @@ -237,7 +245,7 @@ std::chrono::local_seconds(1'234'567'890s)); // 23:31:30 UTC on Friday, 13 February 2009 // Use supplied locale (ja_JP). This locale has a different alternate. -#if defined(_WIN32) || defined(__APPLE__) || defined(_AIX) +#if defined(_WIN32) || defined(__APPLE__) || defined(_AIX) || defined(__FreeBSD__) check(loc, SV("%d='01'\t%Od='01'\t%e=' 1'\t%Oe=' 1'\n"), lfmt, @@ -247,7 +255,7 @@ SV("%d='13'\t%Od='13'\t%e='13'\t%Oe='13'\n"), lfmt, std::chrono::local_seconds(1'234'567'890s)); // 23:31:30 UTC on Friday, 13 February 2009 -#else // _WIN32 +#else // defined(_WIN32) || defined(__APPLE__) || defined(_AIX) || defined(__FreeBSD__) check(loc, SV("%d='01'\t%Od='一'\t%e=' 1'\t%Oe='一'\n"), lfmt, @@ -258,7 +266,7 @@ lfmt, std::chrono::local_seconds(1'234'567'890s)); // 23:31:30 UTC on Friday, 13 February 2009 -#endif // _WIN32 +#endif // defined(_WIN32) || defined(__APPLE__) || defined(_AIX) || defined(__FreeBSD__) std::locale::global(std::locale::classic()); } @@ -305,7 +313,7 @@ // Use supplied locale (ja_JP). // This locale has a different alternate, but not on all platforms -#if defined(_WIN32) || defined(__APPLE__) || defined(_AIX) +#if defined(_WIN32) || defined(__APPLE__) || defined(_AIX) || defined(__FreeBSD__) check(loc, SV("%a='木'\t%A='木曜日'\t%u='4'\t%Ou='4'\t%w='4'\t%Ow='4'\n"), lfmt, @@ -315,7 +323,7 @@ SV("%a='日'\t%A='日曜日'\t%u='7'\t%Ou='7'\t%w='0'\t%Ow='0'\n"), lfmt, std::chrono::local_seconds(4'294'967'295s)); // 06:28:15 UTC on Sunday, 7 February 2106 -#else // defined(_WIN32) || defined(__APPLE__) || defined(_AIX) +#else // defined(_WIN32) || defined(__APPLE__) || defined(_AIX) || defined(__FreeBSD__) check(loc, SV("%a='木'\t%A='木曜日'\t%u='4'\t%Ou='四'\t%w='4'\t%Ow='四'\n"), lfmt, @@ -325,7 +333,7 @@ SV("%a='日'\t%A='日曜日'\t%u='7'\t%Ou='七'\t%w='0'\t%Ow='〇'\n"), lfmt, std::chrono::local_seconds(4'294'967'295s)); // 06:28:15 UTC on Sunday, 7 February 2106 -#endif // defined(_WIN32) || defined(__APPLE__) || defined(_AIX) +#endif // defined(_WIN32) || defined(__APPLE__) || defined(_AIX) || defined(__FreeBSD__) std::locale::global(std::locale::classic()); } @@ -388,7 +396,7 @@ std::chrono::local_seconds(2'000'000'000s)); // 03:33:20 UTC on Wednesday, 18 May 2033 // Use supplied locale (ja_JP). This locale has a different alternate. -#if defined(_WIN32) || defined(__APPLE__) || defined(_AIX) +#if defined(_WIN32) || defined(__APPLE__) || defined(_AIX) || defined(__FreeBSD__) check(loc, SV("%U='00'\t%OU='00'\t%W='00'\t%OW='00'\n"), lfmt, @@ -398,7 +406,7 @@ SV("%U='20'\t%OU='20'\t%W='20'\t%OW='20'\n"), lfmt, std::chrono::local_seconds(2'000'000'000s)); // 03:33:20 UTC on Wednesday, 18 May 2033 -#else // defined(_WIN32) || defined(__APPLE__) || defined(_AIX) +#else // defined(_WIN32) || defined(__APPLE__) || defined(_AIX) || defined(__FreeBSD__) check(loc, SV("%U='00'\t%OU='〇'\t%W='00'\t%OW='〇'\n"), lfmt, @@ -408,7 +416,7 @@ SV("%U='20'\t%OU='二十'\t%W='20'\t%OW='二十'\n"), lfmt, std::chrono::local_seconds(2'000'000'000s)); // 03:33:20 UTC on Wednesday, 18 May 2033 -#endif // defined(_WIN32) || defined(__APPLE__) || defined(_AIX) +#endif // defined(_WIN32) || defined(__APPLE__) || defined(_AIX) || defined(__FreeBSD__) std::locale::global(std::locale::classic()); } @@ -441,7 +449,7 @@ std::chrono::local_seconds(1'234'567'890s)); // 23:31:30 UTC on Friday, 13 February 2009 // Use supplied locale (ja_JP). This locale has a different alternate. -#if defined(_WIN32) || defined(__APPLE__) || defined(_AIX) +#if defined(_WIN32) || defined(__APPLE__) || defined(_AIX) || defined(__FreeBSD__) check(loc, SV("%g='70'\t%G='1970'\t%V='01'\t%OV='01'\n"), lfmt, @@ -451,7 +459,7 @@ SV("%g='09'\t%G='2009'\t%V='07'\t%OV='07'\n"), lfmt, std::chrono::local_seconds(1'234'567'890s)); // 23:31:30 UTC on Friday, 13 February 2009 -#else // defined(_WIN32) || defined(__APPLE__) || defined(_AIX) +#else // defined(_WIN32) || defined(__APPLE__) || defined(_AIX) || defined(__FreeBSD__) check(loc, SV("%g='70'\t%G='1970'\t%V='01'\t%OV='一'\n"), lfmt, @@ -461,7 +469,7 @@ SV("%g='09'\t%G='2009'\t%V='07'\t%OV='七'\n"), lfmt, std::chrono::local_seconds(1'234'567'890s)); // 23:31:30 UTC on Friday, 13 February 2009 -#endif // defined(_WIN32) || defined(__APPLE__) || defined(_AIX) +#endif // defined(_WIN32) || defined(__APPLE__) || defined(_AIX) || defined(__FreeBSD__) std::locale::global(std::locale::classic()); } @@ -486,7 +494,7 @@ std::chrono::local_seconds(1'234'567'890s)); // 23:31:30 UTC on Friday, 13 February 2009 // Use the global locale (fr_FR) -#if defined(__APPLE__) +#if defined(__APPLE__) || defined(__FreeBSD__) check(SV("%D='01/01/70'\t%F='1970-01-01'\t%x='01.01.1970'\t%Ex='01.01.1970'\n"), lfmt, std::chrono::local_seconds(0s)); // 00:00:00 UTC Thursday, 1 January 1970 @@ -505,7 +513,7 @@ #endif // Use supplied locale (ja_JP). This locale has a different alternate. -#if defined(_WIN32) || defined(__APPLE__) || defined(_AIX) +#if defined(_WIN32) || defined(__APPLE__) || defined(_AIX) || defined(__FreeBSD__) check(loc, SV("%D='01/01/70'\t%F='1970-01-01'\t%x='1970/01/01'\t%Ex='1970/01/01'\n"), lfmt, @@ -515,7 +523,7 @@ SV("%D='02/13/09'\t%F='2009-02-13'\t%x='2009/02/13'\t%Ex='2009/02/13'\n"), lfmt, std::chrono::local_seconds(1'234'567'890s)); // 23:31:30 UTC on Friday, 13 February 2009 -#else // defined(_WIN32) || defined(__APPLE__) || defined(_AIX) +#else // defined(_WIN32) || defined(__APPLE__) || defined(_AIX) || defined(__FreeBSD__) check(loc, SV("%D='01/01/70'\t%F='1970-01-01'\t%x='1970年01月01日'\t%Ex='昭和45年01月01日'\n"), lfmt, @@ -525,7 +533,7 @@ SV("%D='02/13/09'\t%F='2009-02-13'\t%x='2009年02月13日'\t%Ex='平成21年02月13日'\n"), lfmt, std::chrono::local_seconds(1'234'567'890s)); // 23:31:30 UTC on Friday, 13 February 2009 -#endif // defined(_WIN32) || defined(__APPLE__) || defined(_AIX) +#endif // defined(_WIN32) || defined(__APPLE__) || defined(_AIX) || defined(__FreeBSD__) std::locale::global(std::locale::classic()); } @@ -629,7 +637,7 @@ "%r='00:00:00'\t" #elif defined(_AIX) "%r='12:00:00 AM'\t" -#elif defined(__APPLE__) +#elif defined(__APPLE__) || defined(__FreeBSD__) "%r=''\t" #else "%r='12:00:00 '\t" @@ -659,7 +667,7 @@ "%r='23:31:30'\t" #elif defined(_AIX) "%r='11:31:30 PM'\t" -#elif defined(__APPLE__) +#elif defined(__APPLE__) || defined(__FreeBSD__) "%r=''\t" #else "%r='11:31:30 '\t" @@ -672,7 +680,7 @@ 1'234'567'890'123ms)); // 23:31:30 UTC on Friday, 13 February 2009 // Use supplied locale (ja_JP). This locale has a different alternate.a -#if defined(__APPLE__) || defined(_AIX) || defined(_WIN32) +#if defined(__APPLE__) || defined(_AIX) || defined(_WIN32) || defined(__FreeBSD__) check(loc, SV("%H='00'\t" "%OH='00'\t" @@ -689,8 +697,12 @@ # endif "%R='00:00'\t" "%T='00:00:00'\t" -# if defined(__APPLE__) +# if defined(__APPLE__) || defined(__FreeBSD__) +# if defined(__APPLE__) "%r='12:00:00 AM'\t" +# else + "%r='12:00:00 午前'\t" +# endif "%X='00時00分00秒'\t" "%EX='00時00分00秒'\t" # elif defined(_WIN32) @@ -722,8 +734,12 @@ # endif "%R='23:31'\t" "%T='23:31:30.123'\t" -# if defined(__APPLE__) +# if defined(__APPLE__) || defined(__FreeBSD__) +# if defined(__APPLE__) "%r='11:31:30 PM'\t" +# else + "%r='11:31:30 午後'\t" +# endif "%X='23時31分30秒'\t" "%EX='23時31分30秒'\t" # elif defined(_WIN32) @@ -738,7 +754,7 @@ "\n"), lfmt, std::chrono::hh_mm_ss(23h + 31min + 30s + 123ms)); -#else // defined(__APPLE__) || defined(_AIX) || defined(_WIN32) +#else // defined(__APPLE__) || defined(_AIX) || defined(_WIN32) || defined(__FreeBSD__) check(loc, SV("%H='00'\t" "%OH='〇'\t" @@ -777,7 +793,7 @@ lfmt, std::chrono::local_time( 1'234'567'890'123ms)); // 23:31:30 UTC on Friday, 13 February 2009 -#endif // defined(__APPLE__) || defined(_AIX) || defined(_WIN32) +#endif // defined(__APPLE__) || defined(_AIX) || defined(_WIN32) || defined(__FreeBSD__) std::locale::global(std::locale::classic()); } @@ -812,6 +828,8 @@ SV("%c='Jeu 1 jan 00:00:00 1970'\t%Ec='Jeu 1 jan 00:00:00 1970'\n"), #elif defined(_WIN32) SV("%c='01/01/1970 00:00:00'\t%Ec='01/01/1970 00:00:00'\n"), +#elif defined(__FreeBSD__) + SV("%c='jeu. 1 janv. 00:00:00 1970'\t%Ec='jeu. 1 janv. 00:00:00 1970'\n"), #else SV("%c='jeu. 01 janv. 1970 00:00:00'\t%Ec='jeu. 01 janv. 1970 00:00:00'\n"), #endif @@ -828,6 +846,8 @@ SV("%c='Ven 13 fév 23:31:30 2009'\t%Ec='Ven 13 fév 23:31:30 2009'\n"), #elif defined(_WIN32) SV("%c='13/02/2009 23:31:30'\t%Ec='13/02/2009 23:31:30'\n"), +#elif defined(__FreeBSD__) + SV("%c='ven. 13 févr. 23:31:30 2009'\t%Ec='ven. 13 févr. 23:31:30 2009'\n"), #else SV("%c='ven. 13 févr. 2009 23:31:30'\t%Ec='ven. 13 févr. 2009 23:31:30'\n"), #endif @@ -835,7 +855,7 @@ std::chrono::local_seconds(1'234'567'890s)); // 23:31:30 UTC on Friday, 13 February 2009 // Use supplied locale (ja_JP). This locale has a different alternate.a -#if defined(__APPLE__) +#if defined(__APPLE__) || defined(__FreeBSD__) check(loc, SV("%c='木 1/ 1 00:00:00 1970'\t%Ec='木 1/ 1 00:00:00 1970'\n"), lfmt, @@ -844,7 +864,7 @@ SV("%c='金 2/13 23:31:30 2009'\t%Ec='金 2/13 23:31:30 2009'\n"), lfmt, std::chrono::local_seconds(1'234'567'890s)); // 23:31:30 UTC on Friday, 13 February 2009 -#elif defined(_AIX) // __APPLE__ +#elif defined(_AIX) // defined(__APPLE__)|| defined(__FreeBSD__) check(loc, SV("%c='1970年01月 1日 00:00:00 UTC'\t%Ec='1970年01月 1日 00:00:00 UTC'\n"), lfmt, @@ -853,7 +873,7 @@ SV("%c='2009年02月13日 23:31:30 UTC'\t%Ec='2009年02月13日 23:31:30 UTC'\n"), lfmt, std::chrono::local_seconds(1'234'567'890s)); // 23:31:30 UTC on Friday, 13 February 2009 -#elif defined(_WIN32) // __APPLE__ +#elif defined(_WIN32) // defined(__APPLE__)|| defined(__FreeBSD__) check(loc, SV("%c='1970/01/01 0:00:00'\t%Ec='1970/01/01 0:00:00'\n"), lfmt, @@ -862,7 +882,7 @@ SV("%c='2009/02/13 23:31:30'\t%Ec='2009/02/13 23:31:30'\n"), lfmt, std::chrono::sys_seconds(1'234'567'890s)); // 23:31:30 UTC on Friday, 13 February 2009 -#else // __APPLE__ +#else // defined(__APPLE__)|| defined(__FreeBSD__) check(loc, SV("%c='1970年01月01日 00時00分00秒'\t%Ec='昭和45年01月01日 00時00分00秒'\n"), lfmt, @@ -872,7 +892,7 @@ SV("%c='2009年02月13日 23時31分30秒'\t%Ec='平成21年02月13日 23時31分30秒'\n"), lfmt, std::chrono::local_seconds(1'234'567'890s)); // 23:31:30 UTC on Friday, 13 February 2009 -#endif // __APPLE__ +#endif // defined(__APPLE__)|| defined(__FreeBSD__) std::locale::global(std::locale::classic()); } diff --git a/libcxx/test/std/time/time.syn/formatter.month.pass.cpp b/libcxx/test/std/time/time.syn/formatter.month.pass.cpp --- a/libcxx/test/std/time/time.syn/formatter.month.pass.cpp +++ b/libcxx/test/std/time/time.syn/formatter.month.pass.cpp @@ -5,8 +5,6 @@ // //===----------------------------------------------------------------------===// -// XFAIL: LIBCXX-FREEBSD-FIXME - // UNSUPPORTED: c++03, c++11, c++14, c++17 // UNSUPPORTED: no-localization // UNSUPPORTED: GCC-ALWAYS_INLINE-FIXME @@ -101,7 +99,7 @@ check(SV("%b='janv.'\t%B='janvier'\t%h='janv.'\t%m='01'\t%Om='01'\n"), lfmt, std::chrono::January); check(SV("%b='févr.'\t%B='février'\t%h='févr.'\t%m='02'\t%Om='02'\n"), lfmt, std::chrono::February); check(SV("%b='mars'\t%B='mars'\t%h='mars'\t%m='03'\t%Om='03'\n"), lfmt, std::chrono::March); -# if defined(_WIN32) || defined(_AIX) +# if defined(_WIN32) || defined(_AIX) || defined(__FreeBSD__) check(SV("%b='avr.'\t%B='avril'\t%h='avr.'\t%m='04'\t%Om='04'\n"), lfmt, std::chrono::April); # else check(SV("%b='avril'\t%B='avril'\t%h='avril'\t%m='04'\t%Om='04'\n"), lfmt, std::chrono::April); @@ -143,6 +141,19 @@ check(loc, SV("%b='10月'\t%B='10月'\t%h='10月'\t%m='10'\t%Om='10'\n"), lfmt, std::chrono::October); check(loc, SV("%b='11月'\t%B='11月'\t%h='11月'\t%m='11'\t%Om='11'\n"), lfmt, std::chrono::November); check(loc, SV("%b='12月'\t%B='12月'\t%h='12月'\t%m='12'\t%Om='12'\n"), lfmt, std::chrono::December); +#elif defined(__FreeBSD__) // defined(_WIN32) + check(loc, SV("%b=' 1月'\t%B='1月'\t%h=' 1月'\t%m='01'\t%Om='01'\n"), lfmt, std::chrono::January); + check(loc, SV("%b=' 2月'\t%B='2月'\t%h=' 2月'\t%m='02'\t%Om='02'\n"), lfmt, std::chrono::February); + check(loc, SV("%b=' 3月'\t%B='3月'\t%h=' 3月'\t%m='03'\t%Om='03'\n"), lfmt, std::chrono::March); + check(loc, SV("%b=' 4月'\t%B='4月'\t%h=' 4月'\t%m='04'\t%Om='04'\n"), lfmt, std::chrono::April); + check(loc, SV("%b=' 5月'\t%B='5月'\t%h=' 5月'\t%m='05'\t%Om='05'\n"), lfmt, std::chrono::May); + check(loc, SV("%b=' 6月'\t%B='6月'\t%h=' 6月'\t%m='06'\t%Om='06'\n"), lfmt, std::chrono::June); + check(loc, SV("%b=' 7月'\t%B='7月'\t%h=' 7月'\t%m='07'\t%Om='07'\n"), lfmt, std::chrono::July); + check(loc, SV("%b=' 8月'\t%B='8月'\t%h=' 8月'\t%m='08'\t%Om='08'\n"), lfmt, std::chrono::August); + check(loc, SV("%b=' 9月'\t%B='9月'\t%h=' 9月'\t%m='09'\t%Om='09'\n"), lfmt, std::chrono::September); + check(loc, SV("%b='10月'\t%B='10月'\t%h='10月'\t%m='10'\t%Om='10'\n"), lfmt, std::chrono::October); + check(loc, SV("%b='11月'\t%B='11月'\t%h='11月'\t%m='11'\t%Om='11'\n"), lfmt, std::chrono::November); + check(loc, SV("%b='12月'\t%B='12月'\t%h='12月'\t%m='12'\t%Om='12'\n"), lfmt, std::chrono::December); #elif defined(__APPLE__) // defined(_WIN32) check(loc, SV("%b=' 1'\t%B='1月'\t%h=' 1'\t%m='01'\t%Om='01'\n"), lfmt, std::chrono::January); check(loc, SV("%b=' 2'\t%B='2月'\t%h=' 2'\t%m='02'\t%Om='02'\n"), lfmt, std::chrono::February); diff --git a/libcxx/test/std/time/time.syn/formatter.month_day.pass.cpp b/libcxx/test/std/time/time.syn/formatter.month_day.pass.cpp --- a/libcxx/test/std/time/time.syn/formatter.month_day.pass.cpp +++ b/libcxx/test/std/time/time.syn/formatter.month_day.pass.cpp @@ -5,8 +5,6 @@ // //===----------------------------------------------------------------------===// -// XFAIL: LIBCXX-FREEBSD-FIXME - // UNSUPPORTED: c++03, c++11, c++14, c++17 // UNSUPPORTED: no-localization // UNSUPPORTED: GCC-ALWAYS_INLINE-FIXME @@ -234,11 +232,11 @@ lfmt, std::chrono::month_day{std::chrono::March, std::chrono::day{9}}); check( -# if defined(_WIN32) || defined(_AIX) +# if defined(_WIN32) || defined(_AIX) || defined(__FreeBSD__) SV("%b='avr.'\t%B='avril'\t%h='avr.'\t%m='04'\t%Om='04'\t%d='10'\t%e='10'\t%Od='10'\t%Oe='10'\n"), -# else // defined(_WIN32) || defined(_AIX) +# else // defined(_WIN32) || defined(_AIX) || defined(__FreeBSD__) SV("%b='avril'\t%B='avril'\t%h='avril'\t%m='04'\t%Om='04'\t%d='10'\t%e='10'\t%Od='10'\t%Oe='10'\n"), -# endif // defined(_WIN32) || defined(_AIX) +# endif // defined(_WIN32) || defined(_AIX) || defined(__FreeBSD__) lfmt, std::chrono::month_day{std::chrono::April, std::chrono::day{10}}); check(SV("%b='mai'\t%B='mai'\t%h='mai'\t%m='05'\t%Om='05'\t%d='28'\t%e='28'\t%Od='28'\t%Oe='28'\n"), @@ -390,6 +388,55 @@ SV("%b='12月'\t%B='12月'\t%h='12月'\t%m='12'\t%Om='12'\t%d='55'\t%e='55'\t%Od='55'\t%Oe='55'\n"), lfmt, std::chrono::month_day{std::chrono::December, std::chrono::day{255}}); +#elif defined(__FreeBSD__) // defined(_WIN32) + check(loc, + SV("%b=' 1月'\t%B='1月'\t%h=' 1月'\t%m='01'\t%Om='01'\t%d='00'\t%e=' 0'\t%Od='00'\t%Oe=' 0'\n"), + lfmt, + std::chrono::month_day{std::chrono::January, std::chrono::day{0}}); + check(loc, + SV("%b=' 2月'\t%B='2月'\t%h=' 2月'\t%m='02'\t%Om='02'\t%d='01'\t%e=' 1'\t%Od='01'\t%Oe=' 1'\n"), + lfmt, + std::chrono::month_day{std::chrono::February, std::chrono::day{1}}); + check(loc, + SV("%b=' 3月'\t%B='3月'\t%h=' 3月'\t%m='03'\t%Om='03'\t%d='09'\t%e=' 9'\t%Od='09'\t%Oe=' 9'\n"), + lfmt, + std::chrono::month_day{std::chrono::March, std::chrono::day{9}}); + check(loc, + SV("%b=' 4月'\t%B='4月'\t%h=' 4月'\t%m='04'\t%Om='04'\t%d='10'\t%e='10'\t%Od='10'\t%Oe='10'\n"), + lfmt, + std::chrono::month_day{std::chrono::April, std::chrono::day{10}}); + check(loc, + SV("%b=' 5月'\t%B='5月'\t%h=' 5月'\t%m='05'\t%Om='05'\t%d='28'\t%e='28'\t%Od='28'\t%Oe='28'\n"), + lfmt, + std::chrono::month_day{std::chrono::May, std::chrono::day{28}}); + check(loc, + SV("%b=' 6月'\t%B='6月'\t%h=' 6月'\t%m='06'\t%Om='06'\t%d='29'\t%e='29'\t%Od='29'\t%Oe='29'\n"), + lfmt, + std::chrono::month_day{std::chrono::June, std::chrono::day{29}}); + check(loc, + SV("%b=' 7月'\t%B='7月'\t%h=' 7月'\t%m='07'\t%Om='07'\t%d='30'\t%e='30'\t%Od='30'\t%Oe='30'\n"), + lfmt, + std::chrono::month_day{std::chrono::July, std::chrono::day{30}}); + check(loc, + SV("%b=' 8月'\t%B='8月'\t%h=' 8月'\t%m='08'\t%Om='08'\t%d='31'\t%e='31'\t%Od='31'\t%Oe='31'\n"), + lfmt, + std::chrono::month_day{std::chrono::August, std::chrono::day{31}}); + check(loc, + SV("%b=' 9月'\t%B='9月'\t%h=' 9月'\t%m='09'\t%Om='09'\t%d='32'\t%e='32'\t%Od='32'\t%Oe='32'\n"), + lfmt, + std::chrono::month_day{std::chrono::September, std::chrono::day{32}}); + check(loc, + SV("%b='10月'\t%B='10月'\t%h='10月'\t%m='10'\t%Om='10'\t%d='99'\t%e='99'\t%Od='99'\t%Oe='99'\n"), + lfmt, + std::chrono::month_day{std::chrono::October, std::chrono::day{99}}); + check(loc, + SV("%b='11月'\t%B='11月'\t%h='11月'\t%m='11'\t%Om='11'\t%d='100'\t%e='100'\t%Od='100'\t%Oe='100'\n"), + lfmt, + std::chrono::month_day{std::chrono::November, std::chrono::day{100}}); + check(loc, + SV("%b='12月'\t%B='12月'\t%h='12月'\t%m='12'\t%Om='12'\t%d='255'\t%e='255'\t%Od='255'\t%Oe='255'\n"), + lfmt, + std::chrono::month_day{std::chrono::December, std::chrono::day{255}}); #elif defined(__APPLE__) // defined(_WIN32) check(loc, SV("%b=' 1'\t%B='1月'\t%h=' 1'\t%m='01'\t%Om='01'\t%d='00'\t%e=' 0'\t%Od='00'\t%Oe=' 0'\n"), diff --git a/libcxx/test/std/time/time.syn/formatter.month_day_last.pass.cpp b/libcxx/test/std/time/time.syn/formatter.month_day_last.pass.cpp --- a/libcxx/test/std/time/time.syn/formatter.month_day_last.pass.cpp +++ b/libcxx/test/std/time/time.syn/formatter.month_day_last.pass.cpp @@ -5,8 +5,6 @@ // //===----------------------------------------------------------------------===// -// XFAIL: LIBCXX-FREEBSD-FIXME - // UNSUPPORTED: c++03, c++11, c++14, c++17 // UNSUPPORTED: no-localization // UNSUPPORTED: GCC-ALWAYS_INLINE-FIXME @@ -159,11 +157,11 @@ lfmt, std::chrono::month_day_last{std::chrono::March}); check( -# if defined(_WIN32) || defined(_AIX) +# if defined(_WIN32) || defined(_AIX) || defined(__FreeBSD__) SV("%b='avr.'\t%B='avril'\t%h='avr.'\t%m='04'\t%Om='04'\n"), -# else // defined(_WIN32) || defined(_AIX) +# else // defined(_WIN32) || defined(_AIX) || defined(__FreeBSD__) SV("%b='avril'\t%B='avril'\t%h='avril'\t%m='04'\t%Om='04'\n"), -# endif // defined(_WIN32) || defined(_AIX) +# endif // defined(_WIN32) || defined(_AIX) || defined(__FreeBSD__) lfmt, std::chrono::month_day_last{std::chrono::April}); check(SV("%b='mai'\t%B='mai'\t%h='mai'\t%m='05'\t%Om='05'\n"), lfmt, std::chrono::month_day_last{std::chrono::May}); @@ -316,6 +314,55 @@ SV("%b='12月'\t%B='12月'\t%h='12月'\t%m='12'\t%Om='12'\n"), lfmt, std::chrono::month_day_last{std::chrono::December}); +#elif defined(__FreeBSD__) // defined(_WIN32) + check(loc, + SV("%b=' 1月'\t%B='1月'\t%h=' 1月'\t%m='01'\t%Om='01'\n"), + lfmt, + std::chrono::month_day_last{std::chrono::January}); + check(loc, + SV("%b=' 2月'\t%B='2月'\t%h=' 2月'\t%m='02'\t%Om='02'\n"), + lfmt, + std::chrono::month_day_last{std::chrono::February}); + check(loc, + SV("%b=' 3月'\t%B='3月'\t%h=' 3月'\t%m='03'\t%Om='03'\n"), + lfmt, + std::chrono::month_day_last{std::chrono::March}); + check(loc, + SV("%b=' 4月'\t%B='4月'\t%h=' 4月'\t%m='04'\t%Om='04'\n"), + lfmt, + std::chrono::month_day_last{std::chrono::April}); + check(loc, + SV("%b=' 5月'\t%B='5月'\t%h=' 5月'\t%m='05'\t%Om='05'\n"), + lfmt, + std::chrono::month_day_last{std::chrono::May}); + check(loc, + SV("%b=' 6月'\t%B='6月'\t%h=' 6月'\t%m='06'\t%Om='06'\n"), + lfmt, + std::chrono::month_day_last{std::chrono::June}); + check(loc, + SV("%b=' 7月'\t%B='7月'\t%h=' 7月'\t%m='07'\t%Om='07'\n"), + lfmt, + std::chrono::month_day_last{std::chrono::July}); + check(loc, + SV("%b=' 8月'\t%B='8月'\t%h=' 8月'\t%m='08'\t%Om='08'\n"), + lfmt, + std::chrono::month_day_last{std::chrono::August}); + check(loc, + SV("%b=' 9月'\t%B='9月'\t%h=' 9月'\t%m='09'\t%Om='09'\n"), + lfmt, + std::chrono::month_day_last{std::chrono::September}); + check(loc, + SV("%b='10月'\t%B='10月'\t%h='10月'\t%m='10'\t%Om='10'\n"), + lfmt, + std::chrono::month_day_last{std::chrono::October}); + check(loc, + SV("%b='11月'\t%B='11月'\t%h='11月'\t%m='11'\t%Om='11'\n"), + lfmt, + std::chrono::month_day_last{std::chrono::November}); + check(loc, + SV("%b='12月'\t%B='12月'\t%h='12月'\t%m='12'\t%Om='12'\n"), + lfmt, + std::chrono::month_day_last{std::chrono::December}); #else // defined(_WIN32) check(loc, SV("%b=' 1月'\t%B='1月'\t%h=' 1月'\t%m='01'\t%Om='一'\n"), diff --git a/libcxx/test/std/time/time.syn/formatter.month_weekday.pass.cpp b/libcxx/test/std/time/time.syn/formatter.month_weekday.pass.cpp --- a/libcxx/test/std/time/time.syn/formatter.month_weekday.pass.cpp +++ b/libcxx/test/std/time/time.syn/formatter.month_weekday.pass.cpp @@ -5,8 +5,6 @@ // //===----------------------------------------------------------------------===// -// XFAIL: LIBCXX-FREEBSD-FIXME - // UNSUPPORTED: c++03, c++11, c++14, c++17 // UNSUPPORTED: no-localization // UNSUPPORTED: GCC-ALWAYS_INLINE-FIXME @@ -272,11 +270,11 @@ lfmt, std::chrono::month_weekday{std::chrono::March, std::chrono::weekday_indexed{std::chrono::weekday{0}, 1}}); check( -# if defined(_WIN32) || defined(_AIX) +# if defined(_WIN32) || defined(_AIX) || defined(__FreeBSD__) SV("%b='avr.'\t%B='avril'\t%h='avr.'\t%m='04'\t%Om='04'\n"), -# else // defined(_WIN32) || defined(_AIX) +# else // defined(_WIN32) || defined(_AIX) || defined(__FreeBSD__) SV("%b='avril'\t%B='avril'\t%h='avril'\t%m='04'\t%Om='04'\n"), -# endif // defined(_WIN32) || defined(_AIX) +# endif // defined(_WIN32) || defined(_AIX) || defined(__FreeBSD__) lfmt, std::chrono::month_weekday{std::chrono::April, std::chrono::weekday_indexed{std::chrono::weekday{0}, 1}}); check(SV("%b='mai'\t%B='mai'\t%h='mai'\t%m='05'\t%Om='05'\n"), @@ -453,6 +451,55 @@ SV("%b='12月'\t%B='12月'\t%h='12月'\t%m='12'\t%Om='12'\n"), lfmt, std::chrono::month_weekday{std::chrono::December, std::chrono::weekday_indexed{std::chrono::weekday{0}, 1}}); +#elif defined(__FreeBSD__) // _WIN32 + check(loc, + SV("%b=' 1月'\t%B='1月'\t%h=' 1月'\t%m='01'\t%Om='01'\n"), + lfmt, + std::chrono::month_weekday{std::chrono::January, std::chrono::weekday_indexed{std::chrono::weekday{0}, 1}}); + check(loc, + SV("%b=' 2月'\t%B='2月'\t%h=' 2月'\t%m='02'\t%Om='02'\n"), + lfmt, + std::chrono::month_weekday{std::chrono::February, std::chrono::weekday_indexed{std::chrono::weekday{0}, 1}}); + check(loc, + SV("%b=' 3月'\t%B='3月'\t%h=' 3月'\t%m='03'\t%Om='03'\n"), + lfmt, + std::chrono::month_weekday{std::chrono::March, std::chrono::weekday_indexed{std::chrono::weekday{0}, 1}}); + check(loc, + SV("%b=' 4月'\t%B='4月'\t%h=' 4月'\t%m='04'\t%Om='04'\n"), + lfmt, + std::chrono::month_weekday{std::chrono::April, std::chrono::weekday_indexed{std::chrono::weekday{0}, 1}}); + check(loc, + SV("%b=' 5月'\t%B='5月'\t%h=' 5月'\t%m='05'\t%Om='05'\n"), + lfmt, + std::chrono::month_weekday{std::chrono::May, std::chrono::weekday_indexed{std::chrono::weekday{0}, 1}}); + check(loc, + SV("%b=' 6月'\t%B='6月'\t%h=' 6月'\t%m='06'\t%Om='06'\n"), + lfmt, + std::chrono::month_weekday{std::chrono::June, std::chrono::weekday_indexed{std::chrono::weekday{0}, 1}}); + check(loc, + SV("%b=' 7月'\t%B='7月'\t%h=' 7月'\t%m='07'\t%Om='07'\n"), + lfmt, + std::chrono::month_weekday{std::chrono::July, std::chrono::weekday_indexed{std::chrono::weekday{0}, 1}}); + check(loc, + SV("%b=' 8月'\t%B='8月'\t%h=' 8月'\t%m='08'\t%Om='08'\n"), + lfmt, + std::chrono::month_weekday{std::chrono::August, std::chrono::weekday_indexed{std::chrono::weekday{0}, 1}}); + check(loc, + SV("%b=' 9月'\t%B='9月'\t%h=' 9月'\t%m='09'\t%Om='09'\n"), + lfmt, + std::chrono::month_weekday{std::chrono::September, std::chrono::weekday_indexed{std::chrono::weekday{0}, 1}}); + check(loc, + SV("%b='10月'\t%B='10月'\t%h='10月'\t%m='10'\t%Om='10'\n"), + lfmt, + std::chrono::month_weekday{std::chrono::October, std::chrono::weekday_indexed{std::chrono::weekday{0}, 1}}); + check(loc, + SV("%b='11月'\t%B='11月'\t%h='11月'\t%m='11'\t%Om='11'\n"), + lfmt, + std::chrono::month_weekday{std::chrono::November, std::chrono::weekday_indexed{std::chrono::weekday{0}, 1}}); + check(loc, + SV("%b='12月'\t%B='12月'\t%h='12月'\t%m='12'\t%Om='12'\n"), + lfmt, + std::chrono::month_weekday{std::chrono::December, std::chrono::weekday_indexed{std::chrono::weekday{0}, 1}}); #else // _WIN32 check(loc, SV("%b=' 1月'\t%B='1月'\t%h=' 1月'\t%m='01'\t%Om='一'\n"), @@ -598,7 +645,7 @@ // Use supplied locale (ja_JP). // This locale has a different alternate, but not on all platforms -#if defined(_WIN32) || defined(__APPLE__) || defined(_AIX) +#if defined(_WIN32) || defined(__APPLE__) || defined(_AIX) || defined(__FreeBSD__) check(loc, SV("%u='7'\t%Ou='7'\t%w='0'\t%Ow='0'\t%a='日'\t%A='日曜日'\n"), lfmt, @@ -631,7 +678,7 @@ SV("%u='7'\t%Ou='7'\t%w='0'\t%Ow='0'\t%a='日'\t%A='日曜日'\n"), lfmt, std::chrono::month_weekday{std::chrono::January, std::chrono::weekday_indexed{std::chrono::weekday{7}, 1}}); -#else // defined(_WIN32) || defined(__APPLE__) || defined(_AIX) +#else // defined(_WIN32) || defined(__APPLE__) || defined(_AIX) || defined(__FreeBSD__) check(loc, SV("%u='7'\t%Ou='七'\t%w='0'\t%Ow='〇'\t%a='日'\t%A='日曜日'\n"), lfmt, @@ -664,7 +711,7 @@ SV("%u='7'\t%Ou='七'\t%w='0'\t%Ow='〇'\t%a='日'\t%A='日曜日'\n"), lfmt, std::chrono::month_weekday{std::chrono::January, std::chrono::weekday_indexed{std::chrono::weekday{7}, 1}}); -#endif // defined(_WIN32) || defined(__APPLE__) || defined(_AIX) +#endif // defined(_WIN32) || defined(__APPLE__) || defined(_AIX) || defined(__FreeBSD__) std::locale::global(std::locale::classic()); } diff --git a/libcxx/test/std/time/time.syn/formatter.sys_time.pass.cpp b/libcxx/test/std/time/time.syn/formatter.sys_time.pass.cpp --- a/libcxx/test/std/time/time.syn/formatter.sys_time.pass.cpp +++ b/libcxx/test/std/time/time.syn/formatter.sys_time.pass.cpp @@ -9,8 +9,6 @@ // UNSUPPORTED: no-localization // UNSUPPORTED: GCC-ALWAYS_INLINE-FIXME -// XFAIL: LIBCXX-FREEBSD-FIXME - // TODO FMT This test should not require std::to_chars(floating-point) // XFAIL: availability-fp_to_chars-missing @@ -102,7 +100,7 @@ std::chrono::sys_seconds(1'234'567'890s)); // 23:31:30 UTC on Friday, 13 February 2009 // Use supplied locale (ja_JP). This locale has a different alternate. -#if defined(_WIN32) || defined(__APPLE__) || defined(_AIX) +#if defined(_WIN32) || defined(__APPLE__) || defined(_AIX) || defined(__FreeBSD__) check(loc, SV("%C='19'\t%EC='19'\t%y='70'\t%Oy='70'\t%Ey='70'\t%Y='1970'\t%EY='1970'\n"), lfmt, @@ -112,7 +110,7 @@ SV("%C='20'\t%EC='20'\t%y='09'\t%Oy='09'\t%Ey='09'\t%Y='2009'\t%EY='2009'\n"), lfmt, std::chrono::sys_seconds(1'234'567'890s)); // 23:31:30 UTC on Friday, 13 February 2009 -#else // defined(_WIN32) || defined(__APPLE__) || defined(_AIX) +#else // defined(_WIN32) || defined(__APPLE__) || defined(_AIX)||defined(__FreeBSD__) check(loc, SV("%C='19'\t%EC='昭和'\t%y='70'\t%Oy='七十'\t%Ey='45'\t%Y='1970'\t%EY='昭和45年'\n"), lfmt, @@ -122,7 +120,7 @@ SV("%C='20'\t%EC='平成'\t%y='09'\t%Oy='九'\t%Ey='21'\t%Y='2009'\t%EY='平成21年'\n"), lfmt, std::chrono::sys_seconds(1'234'567'890s)); // 23:31:30 UTC on Friday, 13 February 2009 -#endif // defined(_WIN32) || defined(__APPLE__) || defined(_AIX) +#endif // defined(_WIN32) || defined(__APPLE__) || defined(_AIX)||defined(__FreeBSD__) std::locale::global(std::locale::classic()); } @@ -192,6 +190,16 @@ SV("%b=' 5'\t%h=' 5'\t%B='5月'\t%m='05'\t%Om='05'\n"), lfmt, std::chrono::sys_seconds(2'000'000'000s)); // 03:33:20 UTC on Wednesday, 18 May 2033 +#elif defined(__FreeBSD__) // _WIN32 + check(loc, + SV("%b=' 1月'\t%h=' 1月'\t%B='1月'\t%m='01'\t%Om='01'\n"), + lfmt, + std::chrono::sys_seconds(0s)); // 00:00:00 UTC Thursday, 1 January 1970 + + check(loc, + SV("%b=' 5月'\t%h=' 5月'\t%B='5月'\t%m='05'\t%Om='05'\n"), + lfmt, + std::chrono::sys_seconds(2'000'000'000s)); // 03:33:20 UTC on Wednesday, 18 May 2033 #else // _WIN32 check(loc, SV("%b=' 1月'\t%h=' 1月'\t%B='1月'\t%m='01'\t%Om='一'\n"), @@ -236,7 +244,7 @@ std::chrono::sys_seconds(1'234'567'890s)); // 23:31:30 UTC on Friday, 13 February 2009 // Use supplied locale (ja_JP). This locale has a different alternate. -#if defined(_WIN32) || defined(__APPLE__) || defined(_AIX) +#if defined(_WIN32) || defined(__APPLE__) || defined(_AIX) || defined(__FreeBSD__) check(loc, SV("%d='01'\t%Od='01'\t%e=' 1'\t%Oe=' 1'\n"), lfmt, @@ -246,7 +254,7 @@ SV("%d='13'\t%Od='13'\t%e='13'\t%Oe='13'\n"), lfmt, std::chrono::sys_seconds(1'234'567'890s)); // 23:31:30 UTC on Friday, 13 February 2009 -#else // _WIN32 +#else // defined(_WIN32) || defined(__APPLE__) || defined(_AIX) || defined(__FreeBSD__) check(loc, SV("%d='01'\t%Od='一'\t%e=' 1'\t%Oe='一'\n"), lfmt, @@ -257,7 +265,7 @@ lfmt, std::chrono::sys_seconds(1'234'567'890s)); // 23:31:30 UTC on Friday, 13 February 2009 -#endif // _WIN32 +#endif // defined(_WIN32) || defined(__APPLE__) || defined(_AIX) || defined(__FreeBSD__) std::locale::global(std::locale::classic()); } @@ -304,7 +312,7 @@ // Use supplied locale (ja_JP). // This locale has a different alternate, but not on all platforms -#if defined(_WIN32) || defined(__APPLE__) || defined(_AIX) +#if defined(_WIN32) || defined(__APPLE__) || defined(_AIX) || defined(__FreeBSD__) check(loc, SV("%a='木'\t%A='木曜日'\t%u='4'\t%Ou='4'\t%w='4'\t%Ow='4'\n"), lfmt, @@ -314,7 +322,7 @@ SV("%a='日'\t%A='日曜日'\t%u='7'\t%Ou='7'\t%w='0'\t%Ow='0'\n"), lfmt, std::chrono::sys_seconds(4'294'967'295s)); // 06:28:15 UTC on Sunday, 7 February 2106 -#else // defined(_WIN32) || defined(__APPLE__) || defined(_AIX) +#else // defined(_WIN32) || defined(__APPLE__) || defined(_AIX) || defined(__FreeBSD__) check(loc, SV("%a='木'\t%A='木曜日'\t%u='4'\t%Ou='四'\t%w='4'\t%Ow='四'\n"), lfmt, @@ -324,7 +332,7 @@ SV("%a='日'\t%A='日曜日'\t%u='7'\t%Ou='七'\t%w='0'\t%Ow='〇'\n"), lfmt, std::chrono::sys_seconds(4'294'967'295s)); // 06:28:15 UTC on Sunday, 7 February 2106 -#endif // defined(_WIN32) || defined(__APPLE__) || defined(_AIX) +#endif // defined(_WIN32) || defined(__APPLE__) || defined(_AIX) || defined(__FreeBSD__) std::locale::global(std::locale::classic()); } @@ -385,7 +393,7 @@ std::chrono::sys_seconds(2'000'000'000s)); // 03:33:20 UTC on Wednesday, 18 May 2033 // Use supplied locale (ja_JP). This locale has a different alternate. -#if defined(_WIN32) || defined(__APPLE__) || defined(_AIX) +#if defined(_WIN32) || defined(__APPLE__) || defined(_AIX) || defined(__FreeBSD__) check(loc, SV("%U='00'\t%OU='00'\t%W='00'\t%OW='00'\n"), lfmt, @@ -395,7 +403,7 @@ SV("%U='20'\t%OU='20'\t%W='20'\t%OW='20'\n"), lfmt, std::chrono::sys_seconds(2'000'000'000s)); // 03:33:20 UTC on Wednesday, 18 May 2033 -#else // defined(_WIN32) || defined(__APPLE__) || defined(_AIX) +#else // defined(_WIN32) || defined(__APPLE__) || defined(_AIX) || defined(__FreeBSD__) check(loc, SV("%U='00'\t%OU='〇'\t%W='00'\t%OW='〇'\n"), lfmt, @@ -405,7 +413,7 @@ SV("%U='20'\t%OU='二十'\t%W='20'\t%OW='二十'\n"), lfmt, std::chrono::sys_seconds(2'000'000'000s)); // 03:33:20 UTC on Wednesday, 18 May 2033 -#endif // defined(_WIN32) || defined(__APPLE__) || defined(_AIX) +#endif // defined(_WIN32) || defined(__APPLE__) || defined(_AIX) || defined(__FreeBSD__) std::locale::global(std::locale::classic()); } @@ -438,7 +446,7 @@ std::chrono::sys_seconds(1'234'567'890s)); // 23:31:30 UTC on Friday, 13 February 2009 // Use supplied locale (ja_JP). This locale has a different alternate. -#if defined(_WIN32) || defined(__APPLE__) || defined(_AIX) +#if defined(_WIN32) || defined(__APPLE__) || defined(_AIX) || defined(__FreeBSD__) check(loc, SV("%g='70'\t%G='1970'\t%V='01'\t%OV='01'\n"), lfmt, @@ -448,7 +456,7 @@ SV("%g='09'\t%G='2009'\t%V='07'\t%OV='07'\n"), lfmt, std::chrono::sys_seconds(1'234'567'890s)); // 23:31:30 UTC on Friday, 13 February 2009 -#else // defined(_WIN32) || defined(__APPLE__) || defined(_AIX) +#else // defined(_WIN32) || defined(__APPLE__) || defined(_AIX) || defined(__FreeBSD__) check(loc, SV("%g='70'\t%G='1970'\t%V='01'\t%OV='一'\n"), lfmt, @@ -458,7 +466,7 @@ SV("%g='09'\t%G='2009'\t%V='07'\t%OV='七'\n"), lfmt, std::chrono::sys_seconds(1'234'567'890s)); // 23:31:30 UTC on Friday, 13 February 2009 -#endif // defined(_WIN32) || defined(__APPLE__) || defined(_AIX) +#endif // defined(_WIN32) || defined(__APPLE__) || defined(_AIX) || defined(__FreeBSD__) std::locale::global(std::locale::classic()); } @@ -483,7 +491,7 @@ std::chrono::sys_seconds(1'234'567'890s)); // 23:31:30 UTC on Friday, 13 February 2009 // Use the global locale (fr_FR) -#if defined(__APPLE__) +#if defined(__APPLE__) || defined(__FreeBSD__) check(SV("%D='01/01/70'\t%F='1970-01-01'\t%x='01.01.1970'\t%Ex='01.01.1970'\n"), lfmt, std::chrono::sys_seconds(0s)); // 00:00:00 UTC Thursday, 1 January 1970 @@ -502,7 +510,7 @@ #endif // Use supplied locale (ja_JP). This locale has a different alternate. -#if defined(_WIN32) || defined(__APPLE__) || defined(_AIX) +#if defined(_WIN32) || defined(__APPLE__) || defined(_AIX) || defined(__FreeBSD__) check(loc, SV("%D='01/01/70'\t%F='1970-01-01'\t%x='1970/01/01'\t%Ex='1970/01/01'\n"), lfmt, @@ -512,7 +520,7 @@ SV("%D='02/13/09'\t%F='2009-02-13'\t%x='2009/02/13'\t%Ex='2009/02/13'\n"), lfmt, std::chrono::sys_seconds(1'234'567'890s)); // 23:31:30 UTC on Friday, 13 February 2009 -#else // defined(_WIN32) || defined(__APPLE__) || defined(_AIX) +#else // defined(_WIN32) || defined(__APPLE__) || defined(_AIX) || defined(__FreeBSD__) check(loc, SV("%D='01/01/70'\t%F='1970-01-01'\t%x='1970年01月01日'\t%Ex='昭和45年01月01日'\n"), lfmt, @@ -522,7 +530,7 @@ SV("%D='02/13/09'\t%F='2009-02-13'\t%x='2009年02月13日'\t%Ex='平成21年02月13日'\n"), lfmt, std::chrono::sys_seconds(1'234'567'890s)); // 23:31:30 UTC on Friday, 13 February 2009 -#endif // defined(_WIN32) || defined(__APPLE__) || defined(_AIX) +#endif // defined(_WIN32) || defined(__APPLE__) || defined(_AIX) || defined(__FreeBSD__) std::locale::global(std::locale::classic()); } @@ -626,7 +634,7 @@ "%r='00:00:00'\t" #elif defined(_AIX) "%r='12:00:00 AM'\t" -#elif defined(__APPLE__) +#elif defined(__APPLE__) || defined(__FreeBSD__) "%r=''\t" #else "%r='12:00:00 '\t" @@ -656,7 +664,7 @@ "%r='23:31:30'\t" #elif defined(_AIX) "%r='11:31:30 PM'\t" -#elif defined(__APPLE__) +#elif defined(__APPLE__) || defined(__FreeBSD__) "%r=''\t" #else "%r='11:31:30 '\t" @@ -669,7 +677,7 @@ 1'234'567'890'123ms)); // 23:31:30 UTC on Friday, 13 February 2009 // Use supplied locale (ja_JP). This locale has a different alternate. -#if defined(__APPLE__) || defined(_AIX) || defined(_WIN32) +#if defined(__APPLE__) || defined(_AIX) || defined(_WIN32) || defined(__FreeBSD__) check(loc, SV("%H='00'\t" "%OH='00'\t" @@ -686,8 +694,12 @@ # endif "%R='00:00'\t" "%T='00:00:00'\t" -# if defined(__APPLE__) +# if defined(__APPLE__) || defined(__FreeBSD__) +# if defined(__APPLE__) "%r='12:00:00 AM'\t" +# else + "%r='12:00:00 午前'\t" +# endif "%X='00時00分00秒'\t" "%EX='00時00分00秒'\t" # elif defined(_WIN32) @@ -719,8 +731,12 @@ # endif "%R='23:31'\t" "%T='23:31:30.123'\t" -# if defined(__APPLE__) +# if defined(__APPLE__) || defined(__FreeBSD__) +# if defined(__APPLE__) "%r='11:31:30 PM'\t" +# else + "%r='11:31:30 午後'\t" +# endif "%X='23時31分30秒'\t" "%EX='23時31分30秒'\t" # elif defined(_WIN32) @@ -735,7 +751,7 @@ "\n"), lfmt, std::chrono::hh_mm_ss(23h + 31min + 30s + 123ms)); -#else // defined(__APPLE__) || defined(_AIX) || defined(_WIN32) +#else // defined(__APPLE__) || defined(_AIX) || defined(_WIN32) || defined(__FreeBSD__) check(loc, SV("%H='00'\t" "%OH='〇'\t" @@ -774,7 +790,7 @@ lfmt, std::chrono::sys_time( 1'234'567'890'123ms)); // 23:31:30 UTC on Friday, 13 February 2009 -#endif // defined(__APPLE__) || defined(_AIX) || defined(_WIN32) +#endif // defined(__APPLE__) || defined(_AIX) || defined(_WIN32) || defined(__FreeBSD__) std::locale::global(std::locale::classic()); } @@ -809,6 +825,8 @@ SV("%c='Jeu 1 jan 00:00:00 1970'\t%Ec='Jeu 1 jan 00:00:00 1970'\n"), #elif defined(_WIN32) SV("%c='01/01/1970 00:00:00'\t%Ec='01/01/1970 00:00:00'\n"), +#elif defined(__FreeBSD__) + SV("%c='jeu. 1 janv. 00:00:00 1970'\t%Ec='jeu. 1 janv. 00:00:00 1970'\n"), #else SV("%c='jeu. 01 janv. 1970 00:00:00'\t%Ec='jeu. 01 janv. 1970 00:00:00'\n"), #endif @@ -825,6 +843,8 @@ SV("%c='Ven 13 fév 23:31:30 2009'\t%Ec='Ven 13 fév 23:31:30 2009'\n"), #elif defined(_WIN32) SV("%c='13/02/2009 23:31:30'\t%Ec='13/02/2009 23:31:30'\n"), +#elif defined(__FreeBSD__) + SV("%c='ven. 13 févr. 23:31:30 2009'\t%Ec='ven. 13 févr. 23:31:30 2009'\n"), #else SV("%c='ven. 13 févr. 2009 23:31:30'\t%Ec='ven. 13 févr. 2009 23:31:30'\n"), #endif @@ -832,7 +852,7 @@ std::chrono::sys_seconds(1'234'567'890s)); // 23:31:30 UTC on Friday, 13 February 2009 // Use supplied locale (ja_JP). This locale has a different alternate.a -#if defined(__APPLE__) +#if defined(__APPLE__) || defined(__FreeBSD__) check(loc, SV("%c='木 1/ 1 00:00:00 1970'\t%Ec='木 1/ 1 00:00:00 1970'\n"), lfmt, @@ -841,7 +861,7 @@ SV("%c='金 2/13 23:31:30 2009'\t%Ec='金 2/13 23:31:30 2009'\n"), lfmt, std::chrono::sys_seconds(1'234'567'890s)); // 23:31:30 UTC on Friday, 13 February 2009 -#elif defined(_AIX) // __APPLE__ +#elif defined(_AIX) // defined(__APPLE__)|| defined(__FreeBSD__) check(loc, SV("%c='1970年01月 1日 00:00:00 UTC'\t%Ec='1970年01月 1日 00:00:00 UTC'\n"), lfmt, @@ -850,7 +870,7 @@ SV("%c='2009年02月13日 23:31:30 UTC'\t%Ec='2009年02月13日 23:31:30 UTC'\n"), lfmt, std::chrono::sys_seconds(1'234'567'890s)); // 23:31:30 UTC on Friday, 13 February 2009 -#elif defined(_WIN32) // __APPLE__ +#elif defined(_WIN32) // defined(__APPLE__)|| defined(__FreeBSD__) check(loc, SV("%c='1970/01/01 0:00:00'\t%Ec='1970/01/01 0:00:00'\n"), lfmt, @@ -859,7 +879,7 @@ SV("%c='2009/02/13 23:31:30'\t%Ec='2009/02/13 23:31:30'\n"), lfmt, std::chrono::sys_seconds(1'234'567'890s)); // 23:31:30 UTC on Friday, 13 February 2009 -#else // __APPLE__ +#else // defined(__APPLE__)|| defined(__FreeBSD__) check(loc, SV("%c='1970年01月01日 00時00分00秒'\t%Ec='昭和45年01月01日 00時00分00秒'\n"), lfmt, @@ -869,7 +889,7 @@ SV("%c='2009年02月13日 23時31分30秒'\t%Ec='平成21年02月13日 23時31分30秒'\n"), lfmt, std::chrono::sys_seconds(1'234'567'890s)); // 23:31:30 UTC on Friday, 13 February 2009 -#endif // __APPLE__ +#endif // defined(__APPLE__)|| defined(__FreeBSD__) std::locale::global(std::locale::classic()); } @@ -918,10 +938,17 @@ std::chrono::sys_seconds(0s)); // 00:00:00 UTC Thursday, 1 January 1970 // Use supplied locale (ja_JP). This locale has a different alternate.a +# if defined(__FreeBSD__) + check(loc, + SV("%z='+0000'\t%Ez='+0000'\t%Oz='+0000'\t%Z='UTC'\n"), + lfmt, + std::chrono::sys_seconds(0s)); // 00:00:00 UTC Thursday, 1 January 1970 +# else check(loc, SV("%z='+0000'\t%Ez='+0000'\t%Oz='+〇'\t%Z='UTC'\n"), lfmt, std::chrono::sys_seconds(0s)); // 00:00:00 UTC Thursday, 1 January 1970 +# endif # endif // defined(_AIX) std::locale::global(std::locale::classic()); #endif // !defined(__APPLE__) && !defined(_WIN32) diff --git a/libcxx/test/std/time/time.syn/formatter.weekday.pass.cpp b/libcxx/test/std/time/time.syn/formatter.weekday.pass.cpp --- a/libcxx/test/std/time/time.syn/formatter.weekday.pass.cpp +++ b/libcxx/test/std/time/time.syn/formatter.weekday.pass.cpp @@ -5,8 +5,6 @@ // //===----------------------------------------------------------------------===// -// XFAIL: LIBCXX-FREEBSD-FIXME - // UNSUPPORTED: c++03, c++11, c++14, c++17 // UNSUPPORTED: no-localization // UNSUPPORTED: GCC-ALWAYS_INLINE-FIXME @@ -93,7 +91,7 @@ // Use supplied locale (ja_JP). // This locale has a different alternate, but not on all platforms -#if defined(_WIN32) || defined(__APPLE__) || defined(_AIX) +#if defined(_WIN32) || defined(__APPLE__) || defined(_AIX) || defined(__FreeBSD__) check(loc, SV("%u='7'\t%Ou='7'\t%w='0'\t%Ow='0'\t%a='日'\t%A='日曜日'\n"), lfmt, std::chrono::weekday(0)); check(loc, SV("%u='1'\t%Ou='1'\t%w='1'\t%Ow='1'\t%a='月'\t%A='月曜日'\n"), lfmt, std::chrono::weekday(1)); check(loc, SV("%u='2'\t%Ou='2'\t%w='2'\t%Ow='2'\t%a='火'\t%A='火曜日'\n"), lfmt, std::chrono::weekday(2)); @@ -130,7 +128,7 @@ const std::locale loc(LOCALE_ja_JP_UTF_8); std::locale::global(std::locale(LOCALE_fr_FR_UTF_8)); -#if defined(__APPLE__) +#if defined(__APPLE__) || defined(__FreeBSD__) // Non localized output using C-locale check(SV("%u='8'\t%Ou='8'\t%w='8'\t%Ow='8'\n"), fmt, std::chrono::weekday(8)); check(SV("%u='255'\t%Ou='255'\t%w='255'\t%Ow='255'\n"), fmt, std::chrono::weekday(255)); @@ -142,7 +140,7 @@ // Use supplied locale (ja_JP). This locale has a different alternate. check(loc, SV("%u='8'\t%Ou='8'\t%w='8'\t%Ow='8'\n"), lfmt, std::chrono::weekday(8)); check(loc, SV("%u='255'\t%Ou='255'\t%w='255'\t%Ow='255'\n"), lfmt, std::chrono::weekday(255)); -#elif defined(_AIX) // defined(__APPLE__) +#elif defined(_AIX) // defined(__APPLE__) || defined(__FreeBSD__) // Non localized output using C-locale check(SV("%u='8'\t%Ou='8'\t%w='8'\t%Ow='8'\n"), fmt, std::chrono::weekday(8)); check(SV("%u='5'\t%Ou='5'\t%w='5'\t%Ow='5'\n"), fmt, std::chrono::weekday(255)); @@ -154,7 +152,7 @@ // Use supplied locale (ja_JP). This locale has a different alternate. check(loc, SV("%u='8'\t%Ou='8'\t%w='8'\t%Ow='8'\n"), lfmt, std::chrono::weekday(8)); check(loc, SV("%u='5'\t%Ou='5'\t%w='5'\t%Ow='5'\n"), lfmt, std::chrono::weekday(255)); -#elif defined(_WIN32) // defined(__APPLE__) +#elif defined(_WIN32) // defined(__APPLE__) || defined(__FreeBSD__) // Non localized output using C-locale check(SV("%u=''\t%Ou=''\t%w=''\t%Ow=''\n"), fmt, std::chrono::weekday(8)); check(SV("%u=''\t%Ou=''\t%w=''\t%Ow=''\n"), fmt, std::chrono::weekday(255)); @@ -166,7 +164,7 @@ // Use supplied locale (ja_JP). This locale has a different alternate. check(loc, SV("%u=''\t%Ou=''\t%w=''\t%Ow=''\n"), lfmt, std::chrono::weekday(8)); check(loc, SV("%u=''\t%Ou=''\t%w=''\t%Ow=''\n"), lfmt, std::chrono::weekday(255)); -#else // defined(__APPLE__) +#else // defined(__APPLE__) || defined(__FreeBSD__) // Non localized output using C-locale check(SV("%u='1'\t%Ou='1'\t%w='8'\t%Ow='8'\n"), fmt, std::chrono::weekday(8)); check(SV("%u='3'\t%Ou='3'\t%w='255'\t%Ow='255'\n"), fmt, std::chrono::weekday(255)); @@ -178,7 +176,7 @@ // Use supplied locale (ja_JP). This locale has a different alternate. check(loc, SV("%u='1'\t%Ou='一'\t%w='8'\t%Ow='八'\n"), lfmt, std::chrono::weekday(8)); check(loc, SV("%u='3'\t%Ou='三'\t%w='255'\t%Ow='255'\n"), lfmt, std::chrono::weekday(255)); -#endif // defined(__APPLE__) +#endif // defined(__APPLE__) || defined(__FreeBSD__) std::locale::global(std::locale::classic()); } diff --git a/libcxx/test/std/time/time.syn/formatter.weekday_index.pass.cpp b/libcxx/test/std/time/time.syn/formatter.weekday_index.pass.cpp --- a/libcxx/test/std/time/time.syn/formatter.weekday_index.pass.cpp +++ b/libcxx/test/std/time/time.syn/formatter.weekday_index.pass.cpp @@ -5,8 +5,6 @@ // //===----------------------------------------------------------------------===// -// XFAIL: LIBCXX-FREEBSD-FIXME - // UNSUPPORTED: c++03, c++11, c++14, c++17 // UNSUPPORTED: no-localization // UNSUPPORTED: GCC-ALWAYS_INLINE-FIXME @@ -157,7 +155,7 @@ // Use supplied locale (ja_JP). // This locale has a different alternate, but not on all platforms -#if defined(_WIN32) || defined(__APPLE__) || defined(_AIX) +#if defined(_WIN32) || defined(__APPLE__) || defined(_AIX) || defined(__FreeBSD__) check(loc, SV("%u='7'\t%Ou='7'\t%w='0'\t%Ow='0'\t%a='日'\t%A='日曜日'\n"), lfmt, @@ -190,7 +188,7 @@ SV("%u='7'\t%Ou='7'\t%w='0'\t%Ow='0'\t%a='日'\t%A='日曜日'\n"), lfmt, std::chrono::weekday_indexed{std::chrono::weekday(7), 7}); -#else // defined(_WIN32) || defined(__APPLE__) || defined(_AIX) +#else // defined(_WIN32) || defined(__APPLE__) || defined(_AIX) || defined(__FreeBSD__) check(loc, SV("%u='7'\t%Ou='七'\t%w='0'\t%Ow='〇'\t%a='日'\t%A='日曜日'\n"), lfmt, @@ -223,7 +221,7 @@ SV("%u='7'\t%Ou='七'\t%w='0'\t%Ow='〇'\t%a='日'\t%A='日曜日'\n"), lfmt, std::chrono::weekday_indexed{std::chrono::weekday(7), 7}); -#endif // defined(_WIN32) || defined(__APPLE__) || defined(_AIX) +#endif // defined(_WIN32) || defined(__APPLE__) || defined(_AIX) || defined(__FreeBSD__) std::locale::global(std::locale::classic()); } @@ -250,7 +248,7 @@ { // Invalid weekday, can't test %a and %A constexpr std::basic_string_view fmt = SV("{:%%u='%u'%t%%Ou='%Ou'%t%%w='%w'%t%%Ow='%Ow'%n}"); constexpr std::basic_string_view lfmt = SV("{:L%%u='%u'%t%%Ou='%Ou'%t%%w='%w'%t%%Ow='%Ow'%n}"); -#if defined(__APPLE__) +#if defined(__APPLE__) || defined(__FreeBSD__) // Non localized output using C-locale check(SV("%u='8'\t%Ou='8'\t%w='8'\t%Ow='8'\n"), fmt, std::chrono::weekday_indexed{std::chrono::weekday(8), 0}); check(SV("%u='8'\t%Ou='8'\t%w='8'\t%Ow='8'\n"), fmt, std::chrono::weekday_indexed{std::chrono::weekday(8), 1}); @@ -284,7 +282,7 @@ SV("%u='255'\t%Ou='255'\t%w='255'\t%Ow='255'\n"), lfmt, std::chrono::weekday_indexed{std::chrono::weekday(255), 1}); -#elif defined(_WIN32) // defined(__APPLE__) +#elif defined(_WIN32) // defined(__APPLE__) || defined(__FreeBSD__) // Non localized output using C-locale check(SV("%u=''\t%Ou=''\t%w=''\t%Ow=''\n"), fmt, std::chrono::weekday_indexed{std::chrono::weekday(8), 0}); check(SV("%u=''\t%Ou=''\t%w=''\t%Ow=''\n"), fmt, std::chrono::weekday_indexed{std::chrono::weekday(8), 1}); @@ -302,7 +300,7 @@ check(loc, SV("%u=''\t%Ou=''\t%w=''\t%Ow=''\n"), lfmt, std::chrono::weekday_indexed{std::chrono::weekday(8), 1}); check(loc, SV("%u=''\t%Ou=''\t%w=''\t%Ow=''\n"), lfmt, std::chrono::weekday_indexed{std::chrono::weekday(255), 0}); check(loc, SV("%u=''\t%Ou=''\t%w=''\t%Ow=''\n"), lfmt, std::chrono::weekday_indexed{std::chrono::weekday(255), 1}); -#elif defined(_AIX) // defined(__APPLE__) +#elif defined(_AIX) // defined(__APPLE__) || defined(__FreeBSD__) // Non localized output using C-locale check(SV("%u='8'\t%Ou='8'\t%w='8'\t%Ow='8'\n"), fmt, std::chrono::weekday_indexed{std::chrono::weekday(8), 0}); check(SV("%u='8'\t%Ou='8'\t%w='8'\t%Ow='8'\n"), fmt, std::chrono::weekday_indexed{std::chrono::weekday(8), 1}); @@ -328,7 +326,7 @@ SV("%u='5'\t%Ou='5'\t%w='5'\t%Ow='5'\n"), lfmt, std::chrono::weekday_indexed{std::chrono::weekday(255), 1}); -#else // defined(__APPLE__) +#else // defined(__APPLE__) || defined(__FreeBSD__) // Non localized output using C-locale check(SV("%u='1'\t%Ou='1'\t%w='8'\t%Ow='8'\n"), fmt, std::chrono::weekday_indexed{std::chrono::weekday(8), 0}); check(SV("%u='1'\t%Ou='1'\t%w='8'\t%Ow='8'\n"), fmt, std::chrono::weekday_indexed{std::chrono::weekday(8), 1}); @@ -362,7 +360,7 @@ SV("%u='3'\t%Ou='三'\t%w='255'\t%Ow='255'\n"), lfmt, std::chrono::weekday_indexed{std::chrono::weekday(255), 1}); -#endif // defined(__APPLE__) +#endif // defined(__APPLE__) || defined(__FreeBSD__) } { // Valid weekday, tests %a and %A diff --git a/libcxx/test/std/time/time.syn/formatter.weekday_last.pass.cpp b/libcxx/test/std/time/time.syn/formatter.weekday_last.pass.cpp --- a/libcxx/test/std/time/time.syn/formatter.weekday_last.pass.cpp +++ b/libcxx/test/std/time/time.syn/formatter.weekday_last.pass.cpp @@ -5,8 +5,6 @@ // //===----------------------------------------------------------------------===// -// XFAIL: LIBCXX-FREEBSD-FIXME - // UNSUPPORTED: c++03, c++11, c++14, c++17 // UNSUPPORTED: no-localization // UNSUPPORTED: GCC-ALWAYS_INLINE-FIXME @@ -140,7 +138,7 @@ // Use supplied locale (ja_JP). // This locale has a different alternate, but not on all platforms -#if defined(_WIN32) || defined(__APPLE__) || defined(_AIX) +#if defined(_WIN32) || defined(__APPLE__) || defined(_AIX) || defined(__FreeBSD__) check(loc, SV("%u='7'\t%Ou='7'\t%w='0'\t%Ow='0'\t%a='日'\t%A='日曜日'\n"), lfmt, @@ -173,7 +171,7 @@ SV("%u='7'\t%Ou='7'\t%w='0'\t%Ow='0'\t%a='日'\t%A='日曜日'\n"), lfmt, std::chrono::weekday_last{std::chrono::weekday(7)}); -#else // defined(_WIN32) || defined(__APPLE__) || defined(_AIX) +#else // defined(_WIN32) || defined(__APPLE__) || defined(_AIX) || defined(__FreeBSD__) check(loc, SV("%u='7'\t%Ou='七'\t%w='0'\t%Ow='〇'\t%a='日'\t%A='日曜日'\n"), lfmt, @@ -206,7 +204,7 @@ SV("%u='7'\t%Ou='七'\t%w='0'\t%Ow='〇'\t%a='日'\t%A='日曜日'\n"), lfmt, std::chrono::weekday_last{std::chrono::weekday(7)}); -#endif // defined(_WIN32) || defined(__APPLE__) || defined(_AIX) +#endif // defined(_WIN32) || defined(__APPLE__) || defined(_AIX) || defined(__FreeBSD__) std::locale::global(std::locale::classic()); } @@ -233,7 +231,7 @@ const std::locale loc(LOCALE_ja_JP_UTF_8); std::locale::global(std::locale(LOCALE_fr_FR_UTF_8)); -#if defined(__APPLE__) +#if defined(__APPLE__) || defined(__FreeBSD__) // Non localized output using C-locale check(SV("%u='8'\t%Ou='8'\t%w='8'\t%Ow='8'\n"), fmt, std::chrono::weekday_last{std::chrono::weekday(8)}); check(SV("%u='255'\t%Ou='255'\t%w='255'\t%Ow='255'\n"), fmt, std::chrono::weekday_last{std::chrono::weekday(255)}); @@ -248,7 +246,7 @@ SV("%u='255'\t%Ou='255'\t%w='255'\t%Ow='255'\n"), lfmt, std::chrono::weekday_last{std::chrono::weekday(255)}); -#elif defined(_WIN32) // defined(__APPLE__) +#elif defined(_WIN32) // defined(__APPLE__) || defined(__FreeBSD__) // Non localized output using C-locale check(SV("%u=''\t%Ou=''\t%w=''\t%Ow=''\n"), fmt, std::chrono::weekday_last{std::chrono::weekday(8)}); check(SV("%u=''\t%Ou=''\t%w=''\t%Ow=''\n"), fmt, std::chrono::weekday_last{std::chrono::weekday(255)}); @@ -260,7 +258,7 @@ // Use supplied locale (ja_JP). This locale has a different alternate. check(loc, SV("%u=''\t%Ou=''\t%w=''\t%Ow=''\n"), lfmt, std::chrono::weekday_last{std::chrono::weekday(8)}); check(loc, SV("%u=''\t%Ou=''\t%w=''\t%Ow=''\n"), lfmt, std::chrono::weekday_last{std::chrono::weekday(255)}); -#elif defined(_AIX) // defined(__APPLE__) +#elif defined(_AIX) // defined(__APPLE__) || defined(__FreeBSD__) // Non localized output using C-locale check(SV("%u='8'\t%Ou='8'\t%w='8'\t%Ow='8'\n"), fmt, std::chrono::weekday_last{std::chrono::weekday(8)}); check(SV("%u='5'\t%Ou='5'\t%w='5'\t%Ow='5'\n"), fmt, std::chrono::weekday_last{std::chrono::weekday(255)}); @@ -272,7 +270,7 @@ // Use supplied locale (ja_JP). This locale has a different alternate. check(loc, SV("%u='8'\t%Ou='8'\t%w='8'\t%Ow='8'\n"), lfmt, std::chrono::weekday_last{std::chrono::weekday(8)}); check(loc, SV("%u='5'\t%Ou='5'\t%w='5'\t%Ow='5'\n"), lfmt, std::chrono::weekday_last{std::chrono::weekday(255)}); -#else // defined(__APPLE__) +#else // defined(__APPLE__) || defined(__FreeBSD__) // Non localized output using C-locale check(SV("%u='1'\t%Ou='1'\t%w='8'\t%Ow='8'\n"), fmt, std::chrono::weekday_last{std::chrono::weekday(8)}); check(SV("%u='3'\t%Ou='3'\t%w='255'\t%Ow='255'\n"), fmt, std::chrono::weekday_last{std::chrono::weekday(255)}); @@ -284,7 +282,7 @@ // Use supplied locale (ja_JP). This locale has a different alternate. check(loc, SV("%u='1'\t%Ou='一'\t%w='8'\t%Ow='八'\n"), lfmt, std::chrono::weekday_last{std::chrono::weekday(8)}); check(loc, SV("%u='3'\t%Ou='三'\t%w='255'\t%Ow='255'\n"), lfmt, std::chrono::weekday_last{std::chrono::weekday(255)}); -#endif // defined(__APPLE__) +#endif // defined(__APPLE__) || defined(__FreeBSD__) std::locale::global(std::locale::classic()); } diff --git a/libcxx/test/std/time/time.syn/formatter.year.pass.cpp b/libcxx/test/std/time/time.syn/formatter.year.pass.cpp --- a/libcxx/test/std/time/time.syn/formatter.year.pass.cpp +++ b/libcxx/test/std/time/time.syn/formatter.year.pass.cpp @@ -5,8 +5,6 @@ // //===----------------------------------------------------------------------===// -// XFAIL: LIBCXX-FREEBSD-FIXME - // UNSUPPORTED: c++03, c++11, c++14, c++17 // UNSUPPORTED: no-localization // UNSUPPORTED: GCC-ALWAYS_INLINE-FIXME @@ -83,7 +81,7 @@ // Non localized output using C-locale check(SV("%C='00'\t" -#if defined(__APPLE__) || defined(_WIN32) +#if defined(__APPLE__) || defined(_WIN32) || defined(__FreeBSD__) "%EC='00'\t" #else "%EC='0'\t" @@ -92,7 +90,7 @@ "%Ey='00'\t" "%Oy='00'\t" "%Y='0000'\t" -#if defined(__APPLE__) || defined(_WIN32) +#if defined(__APPLE__) || defined(_WIN32) || defined(__FreeBSD__) "%EY='0000'\t" #elif defined(_AIX) "%EY=''\t" @@ -127,7 +125,7 @@ // Use the global locale (fr_FR) check(SV("%C='00'\t" -#if defined(__APPLE__) || defined(_WIN32) +#if defined(__APPLE__) || defined(_WIN32) || defined(__FreeBSD__) "%EC='00'\t" #else "%EC='0'\t" @@ -136,7 +134,7 @@ "%Ey='00'\t" "%Oy='00'\t" "%Y='0000'\t" -#if defined(__APPLE__) || defined(_WIN32) +#if defined(__APPLE__) || defined(_WIN32) || defined(__FreeBSD__) "%EY='0000'\t" #elif defined(_AIX) "%EY=''\t" @@ -170,10 +168,10 @@ std::chrono::year{2038}); // Use supplied locale (ja_JP). This locale has a different alternate. -#if defined(__APPLE__) || defined(_AIX) || defined(_WIN32) +#if defined(__APPLE__) || defined(_AIX) || defined(_WIN32) || defined(__FreeBSD__) check(SV("%C='00'\t" -# if defined(__APPLE__) || defined(_WIN32) +# if defined(__APPLE__) || defined(_WIN32) || defined(__FreeBSD__) "%EC='00'\t" # else "%EC='0'\t" @@ -213,7 +211,7 @@ lfmt, std::chrono::year{2038}); -#else // defined(__APPLE__) || defined(_AIX) || defined(_WIN32) +#else // defined(__APPLE__) || defined(_AIX) || defined(_WIN32) || defined(__FreeBSD__) check(loc, SV("%C='00'\t" "%EC='紀元前'\t" @@ -260,7 +258,7 @@ "\n"), lfmt, std::chrono::year{2038}); -#endif // defined(__APPLE__) || defined(_AIX) || defined(_WIN32) +#endif // defined(__APPLE__) || defined(_AIX) || defined(_WIN32) || defined(__FreeBSD__) std::locale::global(std::locale::classic()); } diff --git a/libcxx/test/std/time/time.syn/formatter.year_month.pass.cpp b/libcxx/test/std/time/time.syn/formatter.year_month.pass.cpp --- a/libcxx/test/std/time/time.syn/formatter.year_month.pass.cpp +++ b/libcxx/test/std/time/time.syn/formatter.year_month.pass.cpp @@ -5,8 +5,6 @@ // //===----------------------------------------------------------------------===// -// XFAIL: LIBCXX-FREEBSD-FIXME - // UNSUPPORTED: c++03, c++11, c++14, c++17 // UNSUPPORTED: no-localization // UNSUPPORTED: GCC-ALWAYS_INLINE-FIXME @@ -189,17 +187,17 @@ #endif // defined(_WIN32) "%y='70'\t" "%Y='1970'\t" -#if defined(__APPLE__) || defined(_AIX) || defined(_WIN32) +#if defined(__APPLE__) || defined(_AIX) || defined(_WIN32) || defined(__FreeBSD__) "%EC='19'\t" "%Ey='70'\t" "%EY='1970'\t" "%Oy='70'\t" -#else // defined(__APPLE__) || defined(_AIX) || defined(_WIN32) +#else // defined(__APPLE__) || defined(_AIX) || defined(_WIN32) || defined(__FreeBSD__) "%EC='昭和'\t" "%Ey='45'\t" "%EY='昭和45年'\t" "%Oy='七十'\t" -#endif // defined(__APPLE__) || defined(_AIX) || defined(_WIN32) +#endif // defined(__APPLE__) || defined(_AIX) || defined(_WIN32) || defined(__FreeBSD__) "\n"), lfmt, std::chrono::year_month{std::chrono::year{1970}, std::chrono::January}); @@ -229,17 +227,17 @@ #endif // defined(_WIN32) "%y='04'\t" "%Y='2004'\t" -#if defined(__APPLE__) || defined(_AIX) || defined(_WIN32) +#if defined(__APPLE__) || defined(_AIX) || defined(_WIN32) || defined(__FreeBSD__) "%EC='20'\t" "%Ey='04'\t" "%EY='2004'\t" "%Oy='04'\t" -#else // defined(__APPLE__) || defined(_AIX) || defined(_WIN32) +#else // defined(__APPLE__) || defined(_AIX) || defined(_WIN32) || defined(__FreeBSD__) "%EC='平成'\t" "%Ey='16'\t" "%EY='平成16年'\t" "%Oy='四'\t" -#endif // defined(__APPLE__) || defined(_AIX) || defined(_WIN32) +#endif // defined(__APPLE__) || defined(_AIX) || defined(_WIN32) || defined(__FreeBSD__) "\n"), lfmt, std::chrono::year_month{std::chrono::year{2004}, std::chrono::May}); diff --git a/libcxx/test/std/time/time.syn/formatter.year_month_day.pass.cpp b/libcxx/test/std/time/time.syn/formatter.year_month_day.pass.cpp --- a/libcxx/test/std/time/time.syn/formatter.year_month_day.pass.cpp +++ b/libcxx/test/std/time/time.syn/formatter.year_month_day.pass.cpp @@ -5,8 +5,6 @@ // //===----------------------------------------------------------------------===// -// XFAIL: LIBCXX-FREEBSD-FIXME - // UNSUPPORTED: c++03, c++11, c++14, c++17 // UNSUPPORTED: no-localization // UNSUPPORTED: GCC-ALWAYS_INLINE-FIXME @@ -543,11 +541,11 @@ lfmt, std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::March, std::chrono::day{9}}); check( -# if defined(_WIN32) || defined(_AIX) +# if defined(_WIN32) || defined(_AIX) || defined(__FreeBSD__) SV("%b='avr.'\t%B='avril'\t%h='avr.'\t%m='04'\t%Om='04'\t%d='10'\t%e='10'\t%Od='10'\t%Oe='10'\n"), -# else // defined(_WIN32) || defined(_AIX) +# else // defined(_WIN32) || defined(_AIX) || defined(__FreeBSD__) SV("%b='avril'\t%B='avril'\t%h='avril'\t%m='04'\t%Om='04'\t%d='10'\t%e='10'\t%Od='10'\t%Oe='10'\n"), -# endif // defined(_WIN32) || defined(_AIX) +# endif // defined(_WIN32) || defined(_AIX) || defined(__FreeBSD__) lfmt, std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::April, std::chrono::day{10}}); check(SV("%b='mai'\t%B='mai'\t%h='mai'\t%m='05'\t%Om='05'\t%d='28'\t%e='28'\t%Od='28'\t%Oe='28'\n"), @@ -699,6 +697,55 @@ SV("%b='12月'\t%B='12月'\t%h='12月'\t%m='12'\t%Om='12'\t%d='55'\t%e='55'\t%Od='55'\t%Oe='55'\n"), lfmt, std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::December, std::chrono::day{255}}); +#elif defined(__FreeBSD__) // defined(_WIN32) + check(loc, + SV("%b=' 1月'\t%B='1月'\t%h=' 1月'\t%m='01'\t%Om='01'\t%d='00'\t%e=' 0'\t%Od='00'\t%Oe=' 0'\n"), + lfmt, + std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::January, std::chrono::day{0}}); + check(loc, + SV("%b=' 2月'\t%B='2月'\t%h=' 2月'\t%m='02'\t%Om='02'\t%d='01'\t%e=' 1'\t%Od='01'\t%Oe=' 1'\n"), + lfmt, + std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::February, std::chrono::day{1}}); + check(loc, + SV("%b=' 3月'\t%B='3月'\t%h=' 3月'\t%m='03'\t%Om='03'\t%d='09'\t%e=' 9'\t%Od='09'\t%Oe=' 9'\n"), + lfmt, + std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::March, std::chrono::day{9}}); + check(loc, + SV("%b=' 4月'\t%B='4月'\t%h=' 4月'\t%m='04'\t%Om='04'\t%d='10'\t%e='10'\t%Od='10'\t%Oe='10'\n"), + lfmt, + std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::April, std::chrono::day{10}}); + check(loc, + SV("%b=' 5月'\t%B='5月'\t%h=' 5月'\t%m='05'\t%Om='05'\t%d='28'\t%e='28'\t%Od='28'\t%Oe='28'\n"), + lfmt, + std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::May, std::chrono::day{28}}); + check(loc, + SV("%b=' 6月'\t%B='6月'\t%h=' 6月'\t%m='06'\t%Om='06'\t%d='29'\t%e='29'\t%Od='29'\t%Oe='29'\n"), + lfmt, + std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::June, std::chrono::day{29}}); + check(loc, + SV("%b=' 7月'\t%B='7月'\t%h=' 7月'\t%m='07'\t%Om='07'\t%d='30'\t%e='30'\t%Od='30'\t%Oe='30'\n"), + lfmt, + std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::July, std::chrono::day{30}}); + check(loc, + SV("%b=' 8月'\t%B='8月'\t%h=' 8月'\t%m='08'\t%Om='08'\t%d='31'\t%e='31'\t%Od='31'\t%Oe='31'\n"), + lfmt, + std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::August, std::chrono::day{31}}); + check(loc, + SV("%b=' 9月'\t%B='9月'\t%h=' 9月'\t%m='09'\t%Om='09'\t%d='32'\t%e='32'\t%Od='32'\t%Oe='32'\n"), + lfmt, + std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::September, std::chrono::day{32}}); + check(loc, + SV("%b='10月'\t%B='10月'\t%h='10月'\t%m='10'\t%Om='10'\t%d='99'\t%e='99'\t%Od='99'\t%Oe='99'\n"), + lfmt, + std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::October, std::chrono::day{99}}); + check(loc, + SV("%b='11月'\t%B='11月'\t%h='11月'\t%m='11'\t%Om='11'\t%d='100'\t%e='100'\t%Od='100'\t%Oe='100'\n"), + lfmt, + std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::November, std::chrono::day{100}}); + check(loc, + SV("%b='12月'\t%B='12月'\t%h='12月'\t%m='12'\t%Om='12'\t%d='255'\t%e='255'\t%Od='255'\t%Oe='255'\n"), + lfmt, + std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::December, std::chrono::day{255}}); #elif defined(__APPLE__) // defined(_WIN32) check(loc, SV("%b=' 1'\t%B='1月'\t%h=' 1'\t%m='01'\t%Om='01'\t%d='00'\t%e=' 0'\t%Od='00'\t%Oe=' 0'\n"), @@ -935,14 +982,14 @@ "%V='01'\t" "%w='4'\t" "%W='00'\t" -#if defined(__APPLE__) +#if defined(__APPLE__) || defined(__FreeBSD__) "%x='01.01.1970'\t" #else "%x='01/01/1970'\t" #endif "%y='70'\t" "%Y='1970'\t" -#if defined(__APPLE__) +#if defined(__APPLE__) || defined(__FreeBSD__) "%Ex='01.01.1970'\t" #else "%Ex='01/01/1970'\t" @@ -972,14 +1019,14 @@ "%V='22'\t" "%w='6'\t" "%W='21'\t" -#if defined(__APPLE__) +#if defined(__APPLE__) || defined(__FreeBSD__) "%x='29.05.2004'\t" #else "%x='29/05/2004'\t" #endif "%y='04'\t" "%Y='2004'\t" -#if defined(__APPLE__) +#if defined(__APPLE__) || defined(__FreeBSD__) "%Ex='29.05.2004'\t" #else "%Ex='29/05/2004'\t" @@ -1011,14 +1058,14 @@ "%V='01'\t" "%w='4'\t" "%W='00'\t" -#if defined(__APPLE__) || defined(_AIX) || defined(_WIN32) +#if defined(__APPLE__) || defined(_AIX) || defined(_WIN32) || defined(__FreeBSD__) "%x='1970/01/01'\t" -#else // defined(__APPLE__) || defined(_AIX) || defined(_WIN32) +#else // defined(__APPLE__) || defined(_AIX) || defined(_WIN32) || defined(__FreeBSD__) "%x='1970年01月01日'\t" -#endif // defined(__APPLE__) || defined(_AIX) || defined(_WIN32) +#endif // defined(__APPLE__) || defined(_AIX) || defined(_WIN32) || defined(__FreeBSD__) "%y='70'\t" "%Y='1970'\t" -#if defined(__APPLE__) || defined(_AIX) || defined(_WIN32) +#if defined(__APPLE__) || defined(_AIX) || defined(_WIN32) || defined(__FreeBSD__) "%Ex='1970/01/01'\t" "%EC='19'\t" "%Ey='70'\t" @@ -1029,7 +1076,7 @@ "%Ow='4'\t" "%OW='00'\t" "%Oy='70'\t" -#else // defined(__APPLE__) || defined(_AIX) || defined(_WIN32) +#else // defined(__APPLE__) || defined(_AIX) || defined(_WIN32) || defined(__FreeBSD__) "%Ex='昭和45年01月01日'\t" "%EC='昭和'\t" "%Ey='45'\t" @@ -1040,7 +1087,7 @@ "%Ow='四'\t" "%OW='〇'\t" "%Oy='七十'\t" -#endif // defined(__APPLE__) || defined(_AIX) || defined(_WIN32) +#endif // defined(__APPLE__) || defined(_AIX) || defined(_WIN32) || defined(__FreeBSD__) "\n"), lfmt, std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::January, std::chrono::day{1}}); @@ -1058,14 +1105,14 @@ "%V='22'\t" "%w='6'\t" "%W='21'\t" -#if defined(__APPLE__) || defined(_AIX) || defined(_WIN32) +#if defined(__APPLE__) || defined(_AIX) || defined(_WIN32) || defined(__FreeBSD__) "%x='2004/05/29'\t" -#else // defined(__APPLE__) || defined(_AIX) || defined(_WIN32) +#else // defined(__APPLE__) || defined(_AIX) || defined(_WIN32) || defined(__FreeBSD__) "%x='2004年05月29日'\t" -#endif // defined(__APPLE__) || defined(_AIX) || defined(_WIN32) +#endif // defined(__APPLE__) || defined(_AIX) || defined(_WIN32) || defined(__FreeBSD__) "%y='04'\t" "%Y='2004'\t" -#if defined(__APPLE__) || defined(_AIX) || defined(_WIN32) +#if defined(__APPLE__) || defined(_AIX) || defined(_WIN32) || defined(__FreeBSD__) "%Ex='2004/05/29'\t" "%EC='20'\t" "%Ey='04'\t" @@ -1076,7 +1123,7 @@ "%Ow='6'\t" "%OW='21'\t" "%Oy='04'\t" -#else // defined(__APPLE__) || defined(_AIX) || defined(_WIN32) +#else // defined(__APPLE__) || defined(_AIX) || defined(_WIN32) || defined(__FreeBSD__) "%Ex='平成16年05月29日'\t" "%EC='平成'\t" "%Ey='16'\t" @@ -1087,7 +1134,7 @@ "%Ow='六'\t" "%OW='二十一'\t" "%Oy='四'\t" -#endif // defined(__APPLE__) || defined(_AIX) || defined(_WIN32) +#endif // defined(__APPLE__) || defined(_AIX) || defined(_WIN32) || defined(__FreeBSD__) "\n"), lfmt, std::chrono::year_month_day{std::chrono::year{2004}, std::chrono::May, std::chrono::day{29}}); diff --git a/libcxx/test/std/time/time.syn/formatter.year_month_day_last.pass.cpp b/libcxx/test/std/time/time.syn/formatter.year_month_day_last.pass.cpp --- a/libcxx/test/std/time/time.syn/formatter.year_month_day_last.pass.cpp +++ b/libcxx/test/std/time/time.syn/formatter.year_month_day_last.pass.cpp @@ -5,8 +5,6 @@ // //===----------------------------------------------------------------------===// -// XFAIL: LIBCXX-FREEBSD-FIXME - // UNSUPPORTED: c++03, c++11, c++14, c++17 // UNSUPPORTED: no-localization // UNSUPPORTED: GCC-ALWAYS_INLINE-FIXME @@ -347,11 +345,11 @@ lfmt, std::chrono::year_month_day_last{std::chrono::year{1970}, std::chrono::month_day_last{std::chrono::March}}); check( -# if defined(_WIN32) || defined(_AIX) +# if defined(_WIN32) || defined(_AIX) || defined(__FreeBSD__) SV("%b='avr.'\t%B='avril'\t%h='avr.'\t%m='04'\t%Om='04'\t%d='30'\t%e='30'\t%Od='30'\t%Oe='30'\n"), -# else // defined(_WIN32) || defined(_AIX) +# else // defined(_WIN32) || defined(_AIX) || defined(__FreeBSD__) SV("%b='avril'\t%B='avril'\t%h='avril'\t%m='04'\t%Om='04'\t%d='30'\t%e='30'\t%Od='30'\t%Oe='30'\n"), -# endif // defined(_WIN32) || defined(_AIX) +# endif // defined(_WIN32) || defined(_AIX) || defined(__FreeBSD__) lfmt, std::chrono::year_month_day_last{std::chrono::year{1970}, std::chrono::month_day_last{std::chrono::April}}); check(SV("%b='mai'\t%B='mai'\t%h='mai'\t%m='05'\t%Om='05'\t%d='31'\t%e='31'\t%Od='31'\t%Oe='31'\n"), @@ -479,6 +477,55 @@ SV("%b='12月'\t%B='12月'\t%h='12月'\t%m='12'\t%Om='12'\t%d='31'\t%e='31'\t%Od='31'\t%Oe='31'\n"), lfmt, std::chrono::year_month_day_last{std::chrono::year{1970}, std::chrono::month_day_last{std::chrono::December}}); +#elif defined(__FreeBSD__) // defined(_WIN32) + check(loc, + SV("%b=' 1月'\t%B='1月'\t%h=' 1月'\t%m='01'\t%Om='01'\t%d='31'\t%e='31'\t%Od='31'\t%Oe='31'\n"), + lfmt, + std::chrono::year_month_day_last{std::chrono::year{1970}, std::chrono::month_day_last{std::chrono::January}}); + check(loc, + SV("%b=' 2月'\t%B='2月'\t%h=' 2月'\t%m='02'\t%Om='02'\t%d='28'\t%e='28'\t%Od='28'\t%Oe='28'\n"), + lfmt, + std::chrono::year_month_day_last{std::chrono::year{1970}, std::chrono::month_day_last{std::chrono::February}}); + check(loc, + SV("%b=' 3月'\t%B='3月'\t%h=' 3月'\t%m='03'\t%Om='03'\t%d='31'\t%e='31'\t%Od='31'\t%Oe='31'\n"), + lfmt, + std::chrono::year_month_day_last{std::chrono::year{1970}, std::chrono::month_day_last{std::chrono::March}}); + check(loc, + SV("%b=' 4月'\t%B='4月'\t%h=' 4月'\t%m='04'\t%Om='04'\t%d='30'\t%e='30'\t%Od='30'\t%Oe='30'\n"), + lfmt, + std::chrono::year_month_day_last{std::chrono::year{1970}, std::chrono::month_day_last{std::chrono::April}}); + check(loc, + SV("%b=' 5月'\t%B='5月'\t%h=' 5月'\t%m='05'\t%Om='05'\t%d='31'\t%e='31'\t%Od='31'\t%Oe='31'\n"), + lfmt, + std::chrono::year_month_day_last{std::chrono::year{1970}, std::chrono::month_day_last{std::chrono::May}}); + check(loc, + SV("%b=' 6月'\t%B='6月'\t%h=' 6月'\t%m='06'\t%Om='06'\t%d='30'\t%e='30'\t%Od='30'\t%Oe='30'\n"), + lfmt, + std::chrono::year_month_day_last{std::chrono::year{1970}, std::chrono::month_day_last{std::chrono::June}}); + check(loc, + SV("%b=' 7月'\t%B='7月'\t%h=' 7月'\t%m='07'\t%Om='07'\t%d='31'\t%e='31'\t%Od='31'\t%Oe='31'\n"), + lfmt, + std::chrono::year_month_day_last{std::chrono::year{1970}, std::chrono::month_day_last{std::chrono::July}}); + check(loc, + SV("%b=' 8月'\t%B='8月'\t%h=' 8月'\t%m='08'\t%Om='08'\t%d='31'\t%e='31'\t%Od='31'\t%Oe='31'\n"), + lfmt, + std::chrono::year_month_day_last{std::chrono::year{1970}, std::chrono::month_day_last{std::chrono::August}}); + check(loc, + SV("%b=' 9月'\t%B='9月'\t%h=' 9月'\t%m='09'\t%Om='09'\t%d='30'\t%e='30'\t%Od='30'\t%Oe='30'\n"), + lfmt, + std::chrono::year_month_day_last{std::chrono::year{1970}, std::chrono::month_day_last{std::chrono::September}}); + check(loc, + SV("%b='10月'\t%B='10月'\t%h='10月'\t%m='10'\t%Om='10'\t%d='31'\t%e='31'\t%Od='31'\t%Oe='31'\n"), + lfmt, + std::chrono::year_month_day_last{std::chrono::year{1970}, std::chrono::month_day_last{std::chrono::October}}); + check(loc, + SV("%b='11月'\t%B='11月'\t%h='11月'\t%m='11'\t%Om='11'\t%d='30'\t%e='30'\t%Od='30'\t%Oe='30'\n"), + lfmt, + std::chrono::year_month_day_last{std::chrono::year{1970}, std::chrono::month_day_last{std::chrono::November}}); + check(loc, + SV("%b='12月'\t%B='12月'\t%h='12月'\t%m='12'\t%Om='12'\t%d='31'\t%e='31'\t%Od='31'\t%Oe='31'\n"), + lfmt, + std::chrono::year_month_day_last{std::chrono::year{1970}, std::chrono::month_day_last{std::chrono::December}}); #elif defined(__APPLE__) // defined(_WIN32) check(loc, SV("%b=' 1'\t%B='1月'\t%h=' 1'\t%m='01'\t%Om='01'\t%d='31'\t%e='31'\t%Od='31'\t%Oe='31'\n"), @@ -715,14 +762,14 @@ "%V='05'\t" "%w='6'\t" "%W='04'\t" -#if defined(__APPLE__) +#if defined(__APPLE__) || defined(__FreeBSD__) "%x='31.01.1970'\t" #else "%x='31/01/1970'\t" #endif "%y='70'\t" "%Y='1970'\t" -#if defined(__APPLE__) +#if defined(__APPLE__) || defined(__FreeBSD__) "%Ex='31.01.1970'\t" #else "%Ex='31/01/1970'\t" @@ -752,14 +799,14 @@ "%V='23'\t" "%w='1'\t" "%W='22'\t" -#if defined(__APPLE__) +#if defined(__APPLE__) || defined(__FreeBSD__) "%x='31.05.2004'\t" #else "%x='31/05/2004'\t" #endif "%y='04'\t" "%Y='2004'\t" -#if defined(__APPLE__) +#if defined(__APPLE__) || defined(__FreeBSD__) "%Ex='31.05.2004'\t" #else "%Ex='31/05/2004'\t" @@ -791,14 +838,14 @@ "%V='05'\t" "%w='6'\t" "%W='04'\t" -#if defined(__APPLE__) || defined(_AIX) || defined(_WIN32) +#if defined(__APPLE__) || defined(_AIX) || defined(_WIN32) || defined(__FreeBSD__) "%x='1970/01/31'\t" -#else // defined(__APPLE__) || defined(_AIX) || defined(_WIN32) +#else // defined(__APPLE__) || defined(_AIX) || defined(_WIN32) || defined(__FreeBSD__) "%x='1970年01月31日'\t" -#endif // defined(__APPLE__) || defined(_AIX) || defined(_WIN32) +#endif // defined(__APPLE__) || defined(_AIX) || defined(_WIN32) || defined(__FreeBSD__) "%y='70'\t" "%Y='1970'\t" -#if defined(__APPLE__) || defined(_AIX) || defined(_WIN32) +#if defined(__APPLE__) || defined(_AIX) || defined(_WIN32) || defined(__FreeBSD__) "%Ex='1970/01/31'\t" "%EC='19'\t" "%Ey='70'\t" @@ -809,7 +856,7 @@ "%Ow='6'\t" "%OW='04'\t" "%Oy='70'\t" -#else // defined(__APPLE__) || defined(_AIX) || defined(_WIN32) +#else // defined(__APPLE__) || defined(_AIX) || defined(_WIN32) || defined(__FreeBSD__) "%Ex='昭和45年01月31日'\t" "%EC='昭和'\t" "%Ey='45'\t" @@ -820,7 +867,7 @@ "%Ow='六'\t" "%OW='四'\t" "%Oy='七十'\t" -#endif // defined(__APPLE__) || defined(_AIX) || defined(_WIN32) +#endif // defined(__APPLE__) || defined(_AIX) || defined(_WIN32) || defined(__FreeBSD__) "\n"), lfmt, std::chrono::year_month_day_last{std::chrono::year{1970}, std::chrono::month_day_last{std::chrono::January}}); @@ -838,14 +885,14 @@ "%V='23'\t" "%w='1'\t" "%W='22'\t" -#if defined(__APPLE__) || defined(_AIX) || defined(_WIN32) +#if defined(__APPLE__) || defined(_AIX) || defined(_WIN32) || defined(__FreeBSD__) "%x='2004/05/31'\t" -#else // defined(__APPLE__) || defined(_AIX) || defined(_WIN32) +#else // defined(__APPLE__) || defined(_AIX) || defined(_WIN32) || defined(__FreeBSD__) "%x='2004年05月31日'\t" -#endif // defined(__APPLE__) || defined(_AIX) || defined(_WIN32) +#endif // defined(__APPLE__) || defined(_AIX) || defined(_WIN32) || defined(__FreeBSD__) "%y='04'\t" "%Y='2004'\t" -#if defined(__APPLE__) || defined(_AIX) || defined(_WIN32) +#if defined(__APPLE__) || defined(_AIX) || defined(_WIN32) || defined(__FreeBSD__) "%Ex='2004/05/31'\t" "%EC='20'\t" "%Ey='04'\t" @@ -856,7 +903,7 @@ "%Ow='1'\t" "%OW='22'\t" "%Oy='04'\t" -#else // defined(__APPLE__) || defined(_AIX) || defined(_WIN32) +#else // defined(__APPLE__) || defined(_AIX) || defined(_WIN32) || defined(__FreeBSD__) "%Ex='平成16年05月31日'\t" "%EC='平成'\t" "%Ey='16'\t" @@ -867,7 +914,7 @@ "%Ow='一'\t" "%OW='二十二'\t" "%Oy='四'\t" -#endif // defined(__APPLE__) || defined(_AIX) || defined(_WIN32) +#endif // defined(__APPLE__) || defined(_AIX) || defined(_WIN32) || defined(__FreeBSD__) "\n"), lfmt, std::chrono::year_month_day_last{std::chrono::year{2004}, std::chrono::month_day_last{std::chrono::May}}); diff --git a/libcxx/test/std/time/time.syn/formatter.year_month_weekday.pass.cpp b/libcxx/test/std/time/time.syn/formatter.year_month_weekday.pass.cpp --- a/libcxx/test/std/time/time.syn/formatter.year_month_weekday.pass.cpp +++ b/libcxx/test/std/time/time.syn/formatter.year_month_weekday.pass.cpp @@ -5,8 +5,6 @@ // //===----------------------------------------------------------------------===// -// XFAIL: LIBCXX-FREEBSD-FIXME - // UNSUPPORTED: c++03, c++11, c++14, c++17 // UNSUPPORTED: no-localization // UNSUPPORTED: GCC-ALWAYS_INLINE-FIXME @@ -328,7 +326,7 @@ std::chrono::year_month_weekday{ std::chrono::year{1970}, std::chrono::December, std::chrono::weekday_indexed{std::chrono::weekday{7}, 3}}); -#elif defined(_AIX) // defined(_WIN32) +#elif defined(_AIX) // defined(_WIN32) check(loc, SV("%b='1月'\t%B='1月'\t%h='1月'\t%m='01'\t%Om='01'\t%d='01'\t%e=' 1'\t%Od='01'\t%Oe=' 1'\n"), lfmt, @@ -354,6 +352,18 @@ std::chrono::year_month_weekday{ std::chrono::year{1970}, std::chrono::December, std::chrono::weekday_indexed{std::chrono::weekday{7}, 3}}); +#elif defined(__FreeBSD__) // defined(_WIN32) + check(loc, + SV("%b=' 1月'\t%B='1月'\t%h=' 1月'\t%m='01'\t%Om='01'\t%d='01'\t%e=' 1'\t%Od='01'\t%Oe=' 1'\n"), + lfmt, + std::chrono::year_month_weekday{ + std::chrono::year{1970}, std::chrono::January, std::chrono::weekday_indexed{std::chrono::weekday{4}, 1}}); + + check(loc, + SV("%b='12月'\t%B='12月'\t%h='12月'\t%m='12'\t%Om='12'\t%d='20'\t%e='20'\t%Od='20'\t%Oe='20'\n"), + lfmt, + std::chrono::year_month_weekday{ + std::chrono::year{1970}, std::chrono::December, std::chrono::weekday_indexed{std::chrono::weekday{7}, 3}}); #else // defined(_WIN32) check(loc, SV("%b=' 1月'\t%B='1月'\t%h=' 1月'\t%m='01'\t%Om='一'\t%d='01'\t%e=' 1'\t%Od='一'\t%Oe='一'\n"), @@ -507,14 +517,14 @@ "%V='01'\t" "%w='4'\t" "%W='00'\t" -#if defined(__APPLE__) +#if defined(__APPLE__) || defined(__FreeBSD__) "%x='01.01.1970'\t" #else "%x='01/01/1970'\t" #endif "%y='70'\t" "%Y='1970'\t" -#if defined(__APPLE__) +#if defined(__APPLE__) || defined(__FreeBSD__) "%Ex='01.01.1970'\t" #else "%Ex='01/01/1970'\t" @@ -545,14 +555,14 @@ "%V='22'\t" "%w='6'\t" "%W='21'\t" -#if defined(__APPLE__) +#if defined(__APPLE__) || defined(__FreeBSD__) "%x='29.05.2004'\t" #else "%x='29/05/2004'\t" #endif "%y='04'\t" "%Y='2004'\t" -#if defined(__APPLE__) +#if defined(__APPLE__) || defined(__FreeBSD__) "%Ex='29.05.2004'\t" #else "%Ex='29/05/2004'\t" @@ -585,14 +595,14 @@ "%V='01'\t" "%w='4'\t" "%W='00'\t" -#if defined(__APPLE__) || defined(_AIX) || defined(_WIN32) +#if defined(__APPLE__) || defined(_AIX) || defined(_WIN32) || defined(__FreeBSD__) "%x='1970/01/01'\t" -#else // defined(__APPLE__) || defined(_AIX) || defined(_WIN32) +#else // defined(__APPLE__) || defined(_AIX) || defined(_WIN32) || defined(__FreeBSD__) "%x='1970年01月01日'\t" -#endif // defined(__APPLE__) || defined(_AIX) || defined(_WIN32) +#endif // defined(__APPLE__) || defined(_AIX) || defined(_WIN32) || defined(__FreeBSD__) "%y='70'\t" "%Y='1970'\t" -#if defined(__APPLE__) || defined(_AIX) || defined(_WIN32) +#if defined(__APPLE__) || defined(_AIX) || defined(_WIN32) || defined(__FreeBSD__) "%Ex='1970/01/01'\t" "%EC='19'\t" "%Ey='70'\t" @@ -603,7 +613,7 @@ "%Ow='4'\t" "%OW='00'\t" "%Oy='70'\t" -#else // defined(__APPLE__) || defined(_AIX) || defined(_WIN32) +#else // defined(__APPLE__) || defined(_AIX) || defined(_WIN32) || defined(__FreeBSD__) "%Ex='昭和45年01月01日'\t" "%EC='昭和'\t" "%Ey='45'\t" @@ -614,7 +624,7 @@ "%Ow='四'\t" "%OW='〇'\t" "%Oy='七十'\t" -#endif // defined(__APPLE__) || defined(_AIX) || defined(_WIN32) +#endif // defined(__APPLE__) || defined(_AIX) || defined(_WIN32) || defined(__FreeBSD__) "\n"), lfmt, std::chrono::year_month_weekday{ @@ -633,14 +643,14 @@ "%V='22'\t" "%w='6'\t" "%W='21'\t" -#if defined(__APPLE__) || defined(_AIX) || defined(_WIN32) +#if defined(__APPLE__) || defined(_AIX) || defined(_WIN32) || defined(__FreeBSD__) "%x='2004/05/29'\t" -#else // defined(__APPLE__) || defined(_AIX) || defined(_WIN32) +#else // defined(__APPLE__) || defined(_AIX) || defined(_WIN32) || defined(__FreeBSD__) "%x='2004年05月29日'\t" -#endif // defined(__APPLE__) || defined(_AIX) || defined(_WIN32) +#endif // defined(__APPLE__) || defined(_AIX) || defined(_WIN32) || defined(__FreeBSD__) "%y='04'\t" "%Y='2004'\t" -#if defined(__APPLE__) || defined(_AIX) || defined(_WIN32) +#if defined(__APPLE__) || defined(_AIX) || defined(_WIN32) || defined(__FreeBSD__) "%Ex='2004/05/29'\t" "%EC='20'\t" "%Ey='04'\t" @@ -651,7 +661,7 @@ "%Ow='6'\t" "%OW='21'\t" "%Oy='04'\t" -#else // defined(__APPLE__) || defined(_AIX) || defined(_WIN32) +#else // defined(__APPLE__) || defined(_AIX) || defined(_WIN32) || defined(__FreeBSD__) "%Ex='平成16年05月29日'\t" "%EC='平成'\t" "%Ey='16'\t" @@ -662,7 +672,7 @@ "%Ow='六'\t" "%OW='二十一'\t" "%Oy='四'\t" -#endif // defined(__APPLE__) || defined(_AIX) || defined(_WIN32) +#endif // defined(__APPLE__) || defined(_AIX) || defined(_WIN32) || defined(__FreeBSD__) "\n"), lfmt, std::chrono::year_month_weekday{