diff --git a/libcxx/test/std/localization/locale.categories/category.ctype/facet.ctype.special/facet.ctype.char.statics/classic_table.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/facet.ctype.special/facet.ctype.char.statics/classic_table.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.ctype/facet.ctype.special/facet.ctype.char.statics/classic_table.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.ctype/facet.ctype.special/facet.ctype.char.statics/classic_table.pass.cpp @@ -12,8 +12,6 @@ // static const mask* classic_table() throw(); -// XFAIL: LIBCXX-WINDOWS-FIXME - #include #include @@ -29,19 +27,29 @@ const mask *p = F::classic_table(); const mask defined = F::space | F::print | F::cntrl | F::upper | F::lower | F::alpha | F::digit | F::punct | F::xdigit | F::blank; +#ifdef _WIN32 + // On Windows, the alpha and print masks aren't individual bits that + // are set, but are only usable as masks, as they are combinations of + // the bits for upper/lower/digit/blank/punct. + const mask bit_alpha = 0; + const mask bit_print = 0; +#else + const mask bit_alpha = F::alpha; + const mask bit_print = F::print; +#endif for ( size_t i = 0; i < 128; ++i ) // values above 128 are not consistent { mask set = 0; if ( i < 32 || i > 126 ) set |= F::cntrl; - if ( i >= 32 && i <= 126 ) set |= F::print; + if ( i >= 32 && i <= 126 ) set |= bit_print; if (( i >= 9 && i <= 13) || i == 32 ) set |= F::space; if ( i == 9 || i == 32 ) set |= F::blank; - if ( i >= 'A' && i <= 'Z' ) set |= F::alpha; - if ( i >= 'a' && i <= 'z' ) set |= F::alpha; + if ( i >= 'A' && i <= 'Z' ) set |= bit_alpha; + if ( i >= 'a' && i <= 'z' ) set |= bit_alpha; if ( i >= 'A' && i <= 'Z' ) set |= F::upper; if ( i >= 'a' && i <= 'z' ) set |= F::lower; @@ -55,6 +63,14 @@ if ( i >= 91 && i <= 96 ) set |= F::punct; // '[' .. '`' if ( i >= 123 && i <= 126 ) set |= F::punct; // '{' .. '~' } +#ifdef _WIN32 + // The underlying Windows __pctype_func() table doesn't have the blank + // bit set for horizontal tab (9). The Windows CRT implementation of + // the isblank() function instead has a special case check for the + // horizontal tab character. + if (i == 9) set &= ~F::blank; +#endif + assert(( p[i] & set) == set); // all the right bits set assert(((p[i] & ~set) & defined) == 0); // no extra ones }