11
11
// UNSUPPORTED: no-localization
12
12
// UNSUPPORTED: GCC-ALWAYS_INLINE-FIXME
13
13
14
- // TODO FMT Investigate Windows issues.
15
- // UNSUPPORTED: msvc, target={{.+}}-windows-gnu
16
-
17
14
// XFAIL: availability-fp_to_chars-missing
18
15
19
16
// REQUIRES: locale.fr_FR.UTF-8
@@ -247,7 +244,7 @@ static void test_valid_positive_integral_values() {
247
244
" %R='00:00'\t "
248
245
" %T='00:00:00'\t "
249
246
#ifdef _WIN32
250
- " %r='12 :00:00'\t "
247
+ " %r='00 :00:00'\t "
251
248
#elif defined(_AIX)
252
249
" %r='12:00:00 AM'\t "
253
250
#elif defined(__APPLE__)
@@ -313,7 +310,7 @@ static void test_valid_positive_integral_values() {
313
310
" %R='12:00'\t "
314
311
" %T='12:00:00'\t "
315
312
#ifdef _WIN32
316
- " %r='00 :00:00'\t "
313
+ " %r='12 :00:00'\t "
317
314
#elif defined(_AIX)
318
315
" %r='12:00:00 PM'\t "
319
316
#elif defined(__APPLE__)
@@ -349,6 +346,8 @@ static void test_valid_positive_integral_values() {
349
346
" %r='11:59:59 PM'\t "
350
347
#elif defined(__APPLE__)
351
348
" %r=''\t "
349
+ #elif defined(_WIN32)
350
+ " %r='23:59:59'\t "
352
351
#else
353
352
" %r='11:59:59 '\t "
354
353
#endif
@@ -377,11 +376,13 @@ static void test_valid_positive_integral_values() {
377
376
" %R='00:00'\t "
378
377
" %T='00:00:00'\t "
379
378
#ifdef _WIN32
380
- " %r='12 :00:00'\t "
379
+ " %r='00 :00:00'\t "
381
380
#elif defined(_AIX)
382
381
" %r='12:00:00 AM'\t "
383
382
#elif defined(__APPLE__)
384
383
" %r=''\t "
384
+ #elif defined(_WIN32)
385
+ " %r='12:00:00'\t "
385
386
#else
386
387
" %r='12:00:00 '\t "
387
388
#endif
@@ -395,7 +396,7 @@ static void test_valid_positive_integral_values() {
395
396
std::chrono::duration<int , std::ratio<86400 >>(7 ));
396
397
397
398
// Use supplied locale (ja_JP). This locale has a different alternate.
398
- #if defined(__APPLE__) || defined(_AIX)
399
+ #if defined(__APPLE__) || defined(_AIX) || defined(_WIN32)
399
400
check (loc,
400
401
SV (" %H='00'\t "
401
402
" %OH='00'\t "
@@ -416,6 +417,10 @@ static void test_valid_positive_integral_values() {
416
417
" %r='12:00:00 AM'\t "
417
418
" %X='00時00分00秒'\t "
418
419
" %EX='00時00分00秒'\t "
420
+ # elif defined(_WIN32)
421
+ " %r='0:00:00'\t "
422
+ " %X='0:00:00'\t "
423
+ " %EX='0:00:00'\t "
419
424
# else
420
425
" %r='午前12:00:00'\t "
421
426
" %X='00:00:00'\t "
@@ -448,6 +453,10 @@ static void test_valid_positive_integral_values() {
448
453
" %r='11:59:59 AM'\t "
449
454
" %X='11時59分59秒'\t "
450
455
" %EX='11時59分59秒'\t "
456
+ # elif defined(_WIN32)
457
+ " %r='11:59:59'\t "
458
+ " %X='11:59:59'\t "
459
+ " %EX='11:59:59'\t "
451
460
# else
452
461
" %r='午前11:59:59'\t "
453
462
" %X='11:59:59'\t "
@@ -481,7 +490,11 @@ static void test_valid_positive_integral_values() {
481
490
" %X='12時00分00秒'\t "
482
491
" %EX='12時00分00秒'\t "
483
492
# else
493
+ # ifdef _WIN32
494
+ " %r='12:00:00'\t "
495
+ # else
484
496
" %r='午後12:00:00'\t "
497
+ # endif
485
498
" %X='12:00:00'\t "
486
499
" %EX='12:00:00'\t "
487
500
# endif
@@ -513,7 +526,11 @@ static void test_valid_positive_integral_values() {
513
526
" %X='23時59分59秒'\t "
514
527
" %EX='23時59分59秒'\t "
515
528
# else
529
+ # ifdef _WIN32
530
+ " %r='23:59:59'\t "
531
+ # else
516
532
" %r='午後11:59:59'\t "
533
+ # endif
517
534
" %X='23:59:59'\t "
518
535
" %EX='23:59:59'\t "
519
536
# endif
@@ -544,6 +561,10 @@ static void test_valid_positive_integral_values() {
544
561
" %r='12:00:00 AM'\t "
545
562
" %X='00時00分00秒'\t "
546
563
" %EX='00時00分00秒'\t "
564
+ # elif defined(_WIN32)
565
+ " %r='0:00:00'\t "
566
+ " %X='0:00:00'\t "
567
+ " %EX='0:00:00'\t "
547
568
# else
548
569
" %r='午前12:00:00'\t "
549
570
" %X='00:00:00'\t "
@@ -555,7 +576,7 @@ static void test_valid_positive_integral_values() {
555
576
" \n " ),
556
577
lfmt,
557
578
std::chrono::duration<int , std::ratio<86400 >>(7 ));
558
- #else // defined(__APPLE__) || defined(_AIX)
579
+ #else // defined(__APPLE__) || defined(_AIX) || defined(_WIN32 )
559
580
check (loc,
560
581
SV (" %H='00'\t "
561
582
" %OH='〇'\t "
@@ -665,8 +686,8 @@ static void test_valid_positive_integral_values() {
665
686
" \n " ),
666
687
lfmt,
667
688
std::chrono::duration<int , std::ratio<86400 >>(7 ));
689
+ #endif // defined(__APPLE__) || defined(_AIX) || defined(_WIN32)
668
690
669
- #endif // defined(__APPLE__) || defined(_AIX)
670
691
std::locale::global (std::locale::classic ());
671
692
}
672
693
@@ -767,6 +788,8 @@ static void test_valid_negative_integral_values() {
767
788
" %r='11:59:59 PM'\t "
768
789
#elif defined(__APPLE__)
769
790
" %r=''\t "
791
+ #elif defined(_WIN32)
792
+ " %r='23:59:59'\t "
770
793
#else
771
794
" %r='11:59:59 '\t "
772
795
#endif
@@ -780,7 +803,7 @@ static void test_valid_negative_integral_values() {
780
803
-(23h + 59min + 59s));
781
804
782
805
// Use supplied locale (ja_JP). This locale has a different alternate.
783
- #if defined(__APPLE__) || defined(_AIX)
806
+ #if defined(__APPLE__) || defined(_AIX) || defined(_WIN32)
784
807
check (loc,
785
808
SV (" -%H='23'\t "
786
809
" %OH='23'\t "
@@ -801,6 +824,10 @@ static void test_valid_negative_integral_values() {
801
824
" %r='11:59:59 PM'\t "
802
825
" %X='23時59分59秒'\t "
803
826
" %EX='23時59分59秒'\t "
827
+ # elif defined(_WIN32)
828
+ " %r='23:59:59'\t "
829
+ " %X='23:59:59'\t "
830
+ " %EX='23:59:59'\t "
804
831
# else
805
832
" %r='午後11:59:59'\t "
806
833
" %X='23:59:59'\t "
@@ -812,7 +839,7 @@ static void test_valid_negative_integral_values() {
812
839
" \n " ),
813
840
lfmt,
814
841
-(23h + 59min + 59s));
815
- #else // defined(__APPLE__) || defined(_AIX)
842
+ #else // defined(__APPLE__) || defined(_AIX) || defined(_WIN32)
816
843
check (loc,
817
844
SV (" -%H='23'\t "
818
845
" %OH='二十三'\t "
@@ -834,7 +861,7 @@ static void test_valid_negative_integral_values() {
834
861
" \n " ),
835
862
lfmt,
836
863
-(23h + 59min + 59s));
837
- #endif // defined(__APPLE__) || defined(_AIX)
864
+ #endif // defined(__APPLE__) || defined(_AIX) || defined(_WIN32)
838
865
std::locale::global (std::locale::classic ());
839
866
}
840
867
@@ -987,7 +1014,7 @@ static void test_valid_fractional_values() {
987
1014
check (loc, SV (" 00.011" ), SV (" {:L%S}" ), std::chrono::duration<double , std::milli>(11.123456789 ));
988
1015
check (loc, SV (" 01" ), SV (" {:L%S}" ), std::chrono::duration<long double >(61.123456789 ));
989
1016
990
- #if defined(__APPLE__) || defined(_AIX)
1017
+ #if defined(__APPLE__) || defined(_AIX) || defined(_WIN32)
991
1018
check (SV (" 00.000000001" ), SV (" {:%OS}" ), 1ns);
992
1019
check (SV (" 00.000000501" ), SV (" {:%OS}" ), 501ns);
993
1020
check (SV (" 00.000001000" ), SV (" {:%OS}" ), 1000ns);
@@ -1003,7 +1030,7 @@ static void test_valid_fractional_values() {
1003
1030
check (SV (" 00.001" ), SV (" {:%OS}" ), std::chrono::duration<float , std::milli>(1.123456789 ));
1004
1031
check (SV (" 00.011" ), SV (" {:%OS}" ), std::chrono::duration<double , std::milli>(11.123456789 ));
1005
1032
check (SV (" 01" ), SV (" {:%OS}" ), std::chrono::duration<long double >(61.123456789 ));
1006
- #else // defined(__APPLE__) || defined(_AIX)
1033
+ #else // defined(__APPLE__) || defined(_AIX) || defined(_WIN32)
1007
1034
check (loc, SV (" 〇.000000001" ), SV (" {:L%OS}" ), 1ns);
1008
1035
check (loc, SV (" 〇.000000501" ), SV (" {:L%OS}" ), 501ns);
1009
1036
check (loc, SV (" 〇.000001000" ), SV (" {:L%OS}" ), 1000ns);
@@ -1019,7 +1046,7 @@ static void test_valid_fractional_values() {
1019
1046
check (loc, SV (" 〇.001" ), SV (" {:L%OS}" ), std::chrono::duration<float , std::milli>(1.123456789 ));
1020
1047
check (loc, SV (" 〇.011" ), SV (" {:L%OS}" ), std::chrono::duration<double , std::milli>(11.123456789 ));
1021
1048
check (loc, SV (" 一" ), SV (" {:L%OS}" ), std::chrono::duration<long double >(61.123456789 ));
1022
- #endif // defined(__APPLE__) || defined(_AIX)
1049
+ #endif // defined(__APPLE__) || defined(_AIX) || defined(_WIN32)
1023
1050
1024
1051
check (loc, SV (" 01:05:06.000000001" ), SV (" {:L%T}" ), 1h + 5min + 6s + 1ns);
1025
1052
check (loc, SV (" 01:05:06.000000501" ), SV (" {:L%T}" ), 1h + 5min + 6s + 501ns);
0 commit comments