[libcxx-commits] [libcxx] f4c1258 - [libc++] Add an option to disable wide character support in libc++

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Tue Oct 12 03:08:41 PDT 2021


Author: Louis Dionne
Date: 2021-10-12T06:08:23-04:00
New Revision: f4c1258d5633fcf06385ff3fd1f4bf57ab971964

URL: https://github.com/llvm/llvm-project/commit/f4c1258d5633fcf06385ff3fd1f4bf57ab971964
DIFF: https://github.com/llvm/llvm-project/commit/f4c1258d5633fcf06385ff3fd1f4bf57ab971964.diff

LOG: [libc++] Add an option to disable wide character support in libc++

Some embedded platforms do not wish to support the C library functionality
for handling wchar_t because they have no use for it. It makes sense for
libc++ to work properly on those platforms, so this commit adds a carve-out
of functionality for wchar_t.

Unfortunately, unlike some other carve-outs (e.g. random device), this
patch touches several parts of the library. However, despite the wide
impact of this patch, I still think it is important to support this
configuration since it makes it much simpler to port libc++ to some
embedded platforms.

Differential Revision: https://reviews.llvm.org/D111265

Added: 
    libcxx/cmake/caches/Generic-no-wide-characters.cmake
    libcxx/include/__mbstate_t.h
    libcxx/test/libcxx/diagnostics/detail.headers/mbstate_t.h.module.verify.cpp

Modified: 
    libcxx/CMakeLists.txt
    libcxx/docs/BuildingLibcxx.rst
    libcxx/docs/ReleaseNotes.rst
    libcxx/include/CMakeLists.txt
    libcxx/include/__algorithm/sort.h
    libcxx/include/__bsd_locale_fallbacks.h
    libcxx/include/__config
    libcxx/include/__config_site.in
    libcxx/include/__format/format_context.h
    libcxx/include/__format/format_parse_context.h
    libcxx/include/__format/formatter_bool.h
    libcxx/include/__format/formatter_char.h
    libcxx/include/__functional/hash.h
    libcxx/include/__locale
    libcxx/include/__string
    libcxx/include/__utility/cmp.h
    libcxx/include/atomic
    libcxx/include/codecvt
    libcxx/include/cstddef
    libcxx/include/experimental/regex
    libcxx/include/experimental/string
    libcxx/include/filesystem
    libcxx/include/format
    libcxx/include/iosfwd
    libcxx/include/iostream
    libcxx/include/istream
    libcxx/include/locale
    libcxx/include/module.modulemap
    libcxx/include/ostream
    libcxx/include/regex
    libcxx/include/string
    libcxx/include/string_view
    libcxx/include/wchar.h
    libcxx/include/wctype.h
    libcxx/src/algorithm.cpp
    libcxx/src/ios.instantiations.cpp
    libcxx/src/iostream.cpp
    libcxx/src/locale.cpp
    libcxx/src/string.cpp
    libcxx/test/libcxx/atomics/atomics.align/align.pass.cpp
    libcxx/test/libcxx/depr/depr.c.headers/extern_c.pass.cpp
    libcxx/test/libcxx/double_include.sh.cpp
    libcxx/test/libcxx/include_as_c.sh.cpp
    libcxx/test/libcxx/input.output/filesystems/class.path/path.member/path.native.obs/string_alloc.pass.cpp
    libcxx/test/libcxx/input.output/filesystems/class.path/path.req/is_pathable.pass.cpp
    libcxx/test/libcxx/input.output/iostream.format/input.streams/traits_mismatch.fail.cpp
    libcxx/test/libcxx/input.output/iostream.format/output.streams/traits_mismatch.fail.cpp
    libcxx/test/libcxx/input.output/string.streams/traits_mismatch.fail.cpp
    libcxx/test/libcxx/iterators/contiguous_iterators.pass.cpp
    libcxx/test/libcxx/iterators/failed.pass.cpp
    libcxx/test/libcxx/iterators/iterator.requirements/iterator.concepts/integer_like.compile.pass.cpp
    libcxx/test/libcxx/localization/locales/locale.convenience/conversions/conversions.string/ctor_move.pass.cpp
    libcxx/test/libcxx/min_max_macros.compile.pass.cpp
    libcxx/test/libcxx/no_assert_include.compile.pass.cpp
    libcxx/test/libcxx/strings/c.strings/version_cwchar.pass.cpp
    libcxx/test/libcxx/strings/c.strings/version_cwctype.pass.cpp
    libcxx/test/libcxx/type_traits/convert_to_integral.pass.cpp
    libcxx/test/libcxx/utilities/format/format.arguments/format.arg/visit_format_arg.pass.cpp
    libcxx/test/libcxx/utilities/format/format.arguments/format.args/get.pass.cpp
    libcxx/test/libcxx/utilities/format/format.string/format.string.std/std_format_spec_bool.pass.cpp
    libcxx/test/libcxx/utilities/format/format.string/format.string.std/std_format_spec_char.pass.cpp
    libcxx/test/libcxx/utilities/format/format.string/format.string.std/std_format_spec_integer.pass.cpp
    libcxx/test/libcxx/utilities/format/format.string/format.string.std/std_format_spec_string.pass.cpp
    libcxx/test/libcxx/utilities/format/format.string/format.string.std/std_format_spec_string_non_unicode.pass.cpp
    libcxx/test/libcxx/utilities/format/format.string/format.string.std/std_format_spec_string_unicode.pass.cpp
    libcxx/test/std/atomics/atomics.types.generic/integral.pass.cpp
    libcxx/test/std/atomics/atomics.types.generic/integral_typedefs.pass.cpp
    libcxx/test/std/atomics/types.pass.cpp
    libcxx/test/std/concepts/concepts.lang/concept.default.init/default_initializable.compile.pass.cpp
    libcxx/test/std/depr/depr.c.headers/stdint_h.pass.cpp
    libcxx/test/std/depr/depr.c.headers/wchar_h.pass.cpp
    libcxx/test/std/depr/depr.c.headers/wctype_h.pass.cpp
    libcxx/test/std/experimental/iterator/ostream.joiner/ostream.joiner.cons/ostream_joiner.cons.pass.cpp
    libcxx/test/std/experimental/iterator/ostream.joiner/ostream.joiner.ops/ostream_joiner.op.assign.pass.cpp
    libcxx/test/std/experimental/iterator/ostream.joiner/ostream.joiner.ops/ostream_joiner.op.postincrement.pass.cpp
    libcxx/test/std/experimental/iterator/ostream.joiner/ostream.joiner.ops/ostream_joiner.op.pretincrement.pass.cpp
    libcxx/test/std/experimental/iterator/ostream.joiner/ostream.joiner.ops/ostream_joiner.op.star.pass.cpp
    libcxx/test/std/experimental/memory/memory.resource.aliases/header_regex_synop.pass.cpp
    libcxx/test/std/experimental/memory/memory.resource.aliases/header_string_synop.pass.cpp
    libcxx/test/std/input.output/file.streams/c.files/cinttypes.pass.cpp
    libcxx/test/std/input.output/file.streams/fstreams/filebuf.assign/member_swap.pass.cpp
    libcxx/test/std/input.output/file.streams/fstreams/filebuf.assign/move_assign.pass.cpp
    libcxx/test/std/input.output/file.streams/fstreams/filebuf.assign/nonmember_swap.pass.cpp
    libcxx/test/std/input.output/file.streams/fstreams/filebuf.cons/default.pass.cpp
    libcxx/test/std/input.output/file.streams/fstreams/filebuf.cons/move.pass.cpp
    libcxx/test/std/input.output/file.streams/fstreams/filebuf.members/open_path.pass.cpp
    libcxx/test/std/input.output/file.streams/fstreams/filebuf.members/open_pointer.pass.cpp
    libcxx/test/std/input.output/file.streams/fstreams/filebuf.virtuals/overflow.pass.cpp
    libcxx/test/std/input.output/file.streams/fstreams/filebuf.virtuals/seekoff.pass.cpp
    libcxx/test/std/input.output/file.streams/fstreams/filebuf.virtuals/underflow.pass.cpp
    libcxx/test/std/input.output/file.streams/fstreams/fstream.assign/member_swap.pass.cpp
    libcxx/test/std/input.output/file.streams/fstreams/fstream.assign/move_assign.pass.cpp
    libcxx/test/std/input.output/file.streams/fstreams/fstream.assign/nonmember_swap.pass.cpp
    libcxx/test/std/input.output/file.streams/fstreams/fstream.cons/default.pass.cpp
    libcxx/test/std/input.output/file.streams/fstreams/fstream.cons/move.pass.cpp
    libcxx/test/std/input.output/file.streams/fstreams/fstream.cons/path.pass.cpp
    libcxx/test/std/input.output/file.streams/fstreams/fstream.cons/pointer.pass.cpp
    libcxx/test/std/input.output/file.streams/fstreams/fstream.cons/string.pass.cpp
    libcxx/test/std/input.output/file.streams/fstreams/fstream.members/close.pass.cpp
    libcxx/test/std/input.output/file.streams/fstreams/fstream.members/open_path.pass.cpp
    libcxx/test/std/input.output/file.streams/fstreams/fstream.members/open_pointer.pass.cpp
    libcxx/test/std/input.output/file.streams/fstreams/fstream.members/open_string.pass.cpp
    libcxx/test/std/input.output/file.streams/fstreams/fstream.members/rdbuf.pass.cpp
    libcxx/test/std/input.output/file.streams/fstreams/ifstream.assign/member_swap.pass.cpp
    libcxx/test/std/input.output/file.streams/fstreams/ifstream.assign/move_assign.pass.cpp
    libcxx/test/std/input.output/file.streams/fstreams/ifstream.assign/nonmember_swap.pass.cpp
    libcxx/test/std/input.output/file.streams/fstreams/ifstream.cons/default.pass.cpp
    libcxx/test/std/input.output/file.streams/fstreams/ifstream.cons/move.pass.cpp
    libcxx/test/std/input.output/file.streams/fstreams/ifstream.cons/path.pass.cpp
    libcxx/test/std/input.output/file.streams/fstreams/ifstream.cons/pointer.pass.cpp
    libcxx/test/std/input.output/file.streams/fstreams/ifstream.cons/string.pass.cpp
    libcxx/test/std/input.output/file.streams/fstreams/ifstream.members/close.pass.cpp
    libcxx/test/std/input.output/file.streams/fstreams/ifstream.members/open_path.pass.cpp
    libcxx/test/std/input.output/file.streams/fstreams/ifstream.members/open_pointer.pass.cpp
    libcxx/test/std/input.output/file.streams/fstreams/ifstream.members/open_string.pass.cpp
    libcxx/test/std/input.output/file.streams/fstreams/ifstream.members/rdbuf.pass.cpp
    libcxx/test/std/input.output/file.streams/fstreams/ofstream.assign/member_swap.pass.cpp
    libcxx/test/std/input.output/file.streams/fstreams/ofstream.assign/move_assign.pass.cpp
    libcxx/test/std/input.output/file.streams/fstreams/ofstream.assign/nonmember_swap.pass.cpp
    libcxx/test/std/input.output/file.streams/fstreams/ofstream.cons/default.pass.cpp
    libcxx/test/std/input.output/file.streams/fstreams/ofstream.cons/move.pass.cpp
    libcxx/test/std/input.output/file.streams/fstreams/ofstream.cons/path.pass.cpp
    libcxx/test/std/input.output/file.streams/fstreams/ofstream.cons/pointer.pass.cpp
    libcxx/test/std/input.output/file.streams/fstreams/ofstream.cons/string.pass.cpp
    libcxx/test/std/input.output/file.streams/fstreams/ofstream.members/close.pass.cpp
    libcxx/test/std/input.output/file.streams/fstreams/ofstream.members/open_path.pass.cpp
    libcxx/test/std/input.output/file.streams/fstreams/ofstream.members/open_pointer.pass.cpp
    libcxx/test/std/input.output/file.streams/fstreams/ofstream.members/open_string.pass.cpp
    libcxx/test/std/input.output/file.streams/fstreams/ofstream.members/rdbuf.pass.cpp
    libcxx/test/std/input.output/filesystems/class.path/path.member/path.append.pass.cpp
    libcxx/test/std/input.output/filesystems/class.path/path.member/path.assign/source.pass.cpp
    libcxx/test/std/input.output/filesystems/class.path/path.member/path.charconv.pass.cpp
    libcxx/test/std/input.output/filesystems/class.path/path.member/path.concat.pass.cpp
    libcxx/test/std/input.output/filesystems/class.path/path.member/path.construct/source.pass.cpp
    libcxx/test/std/input.output/filesystems/class.path/path.member/path.generic.obs/generic_string_alloc.pass.cpp
    libcxx/test/std/input.output/filesystems/class.path/path.member/path.generic.obs/named_overloads.pass.cpp
    libcxx/test/std/input.output/filesystems/class.path/path.member/path.native.obs/named_overloads.pass.cpp
    libcxx/test/std/input.output/filesystems/class.path/path.nonmember/path.io.pass.cpp
    libcxx/test/std/input.output/iostream.format/ext.manip/get_money.pass.cpp
    libcxx/test/std/input.output/iostream.format/ext.manip/get_time.pass.cpp
    libcxx/test/std/input.output/iostream.format/ext.manip/put_money.pass.cpp
    libcxx/test/std/input.output/iostream.format/ext.manip/put_time.pass.cpp
    libcxx/test/std/input.output/iostream.format/input.streams/iostreamclass/iostream.assign/member_swap.pass.cpp
    libcxx/test/std/input.output/iostream.format/input.streams/iostreamclass/iostream.assign/move_assign.pass.cpp
    libcxx/test/std/input.output/iostream.format/input.streams/iostreamclass/iostream.cons/move.pass.cpp
    libcxx/test/std/input.output/iostream.format/input.streams/iostreamclass/iostream.cons/streambuf.pass.cpp
    libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/bool.pass.cpp
    libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/double.pass.cpp
    libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/float.pass.cpp
    libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/int.pass.cpp
    libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/long.pass.cpp
    libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/long_double.pass.cpp
    libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/long_long.pass.cpp
    libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/pointer.pass.cpp
    libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/short.pass.cpp
    libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/unsigned_int.pass.cpp
    libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/unsigned_long.pass.cpp
    libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/unsigned_long_long.pass.cpp
    libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/unsigned_short.pass.cpp
    libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream_extractors/chart.pass.cpp
    libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream_extractors/streambuf.pass.cpp
    libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream_extractors/wchar_t_pointer.pass.cpp
    libcxx/test/std/input.output/iostream.format/input.streams/istream.manip/ws.pass.cpp
    libcxx/test/std/input.output/iostream.format/input.streams/istream.rvalue/rvalue.pass.cpp
    libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/get.pass.cpp
    libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/get_chart.pass.cpp
    libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/get_pointer_size.pass.cpp
    libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/get_pointer_size_chart.pass.cpp
    libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/get_streambuf.pass.cpp
    libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/get_streambuf_chart.pass.cpp
    libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/getline_pointer_size.pass.cpp
    libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/getline_pointer_size_chart.pass.cpp
    libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/ignore.pass.cpp
    libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/peek.pass.cpp
    libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/putback.pass.cpp
    libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/read.pass.cpp
    libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/readsome.pass.cpp
    libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/seekg.pass.cpp
    libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/seekg_off.pass.cpp
    libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/sync.pass.cpp
    libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/tellg.pass.cpp
    libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/unget.pass.cpp
    libcxx/test/std/input.output/iostream.format/input.streams/istream/istream.assign/member_swap.pass.cpp
    libcxx/test/std/input.output/iostream.format/input.streams/istream/istream.assign/move_assign.pass.cpp
    libcxx/test/std/input.output/iostream.format/input.streams/istream/istream.cons/move.pass.cpp
    libcxx/test/std/input.output/iostream.format/input.streams/istream/istream.cons/streambuf.pass.cpp
    libcxx/test/std/input.output/iostream.format/input.streams/istream/istream_sentry/ctor.pass.cpp
    libcxx/test/std/input.output/iostream.format/output.streams/ostream.assign/member_swap.pass.cpp
    libcxx/test/std/input.output/iostream.format/output.streams/ostream.assign/move_assign.pass.cpp
    libcxx/test/std/input.output/iostream.format/output.streams/ostream.cons/move.pass.cpp
    libcxx/test/std/input.output/iostream.format/output.streams/ostream.cons/streambuf.pass.cpp
    libcxx/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.character/CharT.pass.cpp
    libcxx/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.character/CharT_pointer.pass.cpp
    libcxx/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.character/char_to_wide.pass.cpp
    libcxx/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.character/char_to_wide_pointer.pass.cpp
    libcxx/test/std/input.output/iostream.format/output.streams/ostream.manip/endl.pass.cpp
    libcxx/test/std/input.output/iostream.format/output.streams/ostream.manip/ends.pass.cpp
    libcxx/test/std/input.output/iostream.format/output.streams/ostream.manip/flush.pass.cpp
    libcxx/test/std/input.output/iostream.format/output.streams/ostream.rvalue/rvalue.pass.cpp
    libcxx/test/std/input.output/iostream.format/output.streams/ostream.unformatted/put.pass.cpp
    libcxx/test/std/input.output/iostream.format/output.streams/ostream.unformatted/write.pass.cpp
    libcxx/test/std/input.output/iostream.format/quoted.manip/quoted.pass.cpp
    libcxx/test/std/input.output/iostream.format/quoted.manip/quoted_char.verify.cpp
    libcxx/test/std/input.output/iostream.format/std.manip/resetiosflags.pass.cpp
    libcxx/test/std/input.output/iostream.format/std.manip/setbase.pass.cpp
    libcxx/test/std/input.output/iostream.format/std.manip/setfill.pass.cpp
    libcxx/test/std/input.output/iostream.format/std.manip/setiosflags.pass.cpp
    libcxx/test/std/input.output/iostream.format/std.manip/setprecision.pass.cpp
    libcxx/test/std/input.output/iostream.format/std.manip/setw.pass.cpp
    libcxx/test/std/input.output/iostream.forward/iosfwd.pass.cpp
    libcxx/test/std/input.output/iostream.objects/init.pass.cpp
    libcxx/test/std/input.output/iostream.objects/wide.stream.objects/wcerr.sh.cpp
    libcxx/test/std/input.output/iostream.objects/wide.stream.objects/wcin.sh.cpp
    libcxx/test/std/input.output/iostream.objects/wide.stream.objects/wclog.sh.cpp
    libcxx/test/std/input.output/iostream.objects/wide.stream.objects/wcout.sh.cpp
    libcxx/test/std/input.output/iostreams.base/ios/basic.ios.members/narrow.pass.cpp
    libcxx/test/std/input.output/stream.buffers/streambuf/streambuf.cons/copy.pass.cpp
    libcxx/test/std/input.output/stream.buffers/streambuf/streambuf.cons/default.pass.cpp
    libcxx/test/std/input.output/stream.buffers/streambuf/streambuf.protected/streambuf.assign/assign.pass.cpp
    libcxx/test/std/input.output/stream.buffers/streambuf/streambuf.protected/streambuf.assign/swap.pass.cpp
    libcxx/test/std/input.output/stream.buffers/streambuf/streambuf.protected/streambuf.get.area/gbump.pass.cpp
    libcxx/test/std/input.output/stream.buffers/streambuf/streambuf.protected/streambuf.get.area/setg.pass.cpp
    libcxx/test/std/input.output/stream.buffers/streambuf/streambuf.protected/streambuf.put.area/pbump.pass.cpp
    libcxx/test/std/input.output/stream.buffers/streambuf/streambuf.protected/streambuf.put.area/setp.pass.cpp
    libcxx/test/std/input.output/stream.buffers/streambuf/types.pass.cpp
    libcxx/test/std/input.output/string.streams/istringstream/istringstream.assign/member_swap.pass.cpp
    libcxx/test/std/input.output/string.streams/istringstream/istringstream.assign/move.pass.cpp
    libcxx/test/std/input.output/string.streams/istringstream/istringstream.assign/nonmember_swap.pass.cpp
    libcxx/test/std/input.output/string.streams/istringstream/istringstream.cons/default.pass.cpp
    libcxx/test/std/input.output/string.streams/istringstream/istringstream.cons/move.pass.cpp
    libcxx/test/std/input.output/string.streams/istringstream/istringstream.cons/string.pass.cpp
    libcxx/test/std/input.output/string.streams/istringstream/istringstream.members/str.pass.cpp
    libcxx/test/std/input.output/string.streams/ostringstream/ostringstream.assign/member_swap.pass.cpp
    libcxx/test/std/input.output/string.streams/ostringstream/ostringstream.assign/move.pass.cpp
    libcxx/test/std/input.output/string.streams/ostringstream/ostringstream.assign/nonmember_swap.pass.cpp
    libcxx/test/std/input.output/string.streams/ostringstream/ostringstream.cons/default.pass.cpp
    libcxx/test/std/input.output/string.streams/ostringstream/ostringstream.cons/move.pass.cpp
    libcxx/test/std/input.output/string.streams/ostringstream/ostringstream.cons/string.pass.cpp
    libcxx/test/std/input.output/string.streams/ostringstream/ostringstream.members/str.pass.cpp
    libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.assign/member_swap.pass.cpp
    libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.assign/move.pass.cpp
    libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.assign/nonmember_swap.pass.cpp
    libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.cons/default.pass.cpp
    libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.cons/move.pass.cpp
    libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.cons/string.pass.cpp
    libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.members/str.pass.cpp
    libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.virtuals/overflow.pass.cpp
    libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.virtuals/pbackfail.pass.cpp
    libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.virtuals/seekoff.pass.cpp
    libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.virtuals/seekpos.pass.cpp
    libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.virtuals/setbuf.pass.cpp
    libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.virtuals/underflow.pass.cpp
    libcxx/test/std/input.output/string.streams/stringstream.cons/default.pass.cpp
    libcxx/test/std/input.output/string.streams/stringstream.cons/move.pass.cpp
    libcxx/test/std/input.output/string.streams/stringstream.cons/string.pass.cpp
    libcxx/test/std/input.output/string.streams/stringstream.cons/stringstream.assign/member_swap.pass.cpp
    libcxx/test/std/input.output/string.streams/stringstream.cons/stringstream.assign/move.pass.cpp
    libcxx/test/std/input.output/string.streams/stringstream.cons/stringstream.assign/nonmember_swap.pass.cpp
    libcxx/test/std/input.output/string.streams/stringstream.members/str.pass.cpp
    libcxx/test/std/iterators/stream.iterators/istream.iterator/types.pass.cpp
    libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator.cons/default.pass.cpp
    libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator.cons/istream.pass.cpp
    libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator.cons/proxy.pass.cpp
    libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator.cons/streambuf.pass.cpp
    libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator_equal/equal.pass.cpp
    libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator_op!=/not_equal.pass.cpp
    libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator_op++/dereference.pass.cpp
    libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator_op==/equal.pass.cpp
    libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator_op_astrk/post_increment.pass.cpp
    libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator_op_astrk/pre_increment.pass.cpp
    libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator_proxy/proxy.pass.cpp
    libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/types.pass.cpp
    libcxx/test/std/iterators/stream.iterators/ostream.iterator/ostream.iterator.cons.des/ostream_delim.pass.cpp
    libcxx/test/std/iterators/stream.iterators/ostream.iterator/ostream.iterator.ops/assign_t.pass.cpp
    libcxx/test/std/iterators/stream.iterators/ostream.iterator/types.pass.cpp
    libcxx/test/std/iterators/stream.iterators/ostreambuf.iterator/ostreambuf.iter.cons/ostream.pass.cpp
    libcxx/test/std/iterators/stream.iterators/ostreambuf.iterator/ostreambuf.iter.cons/streambuf.pass.cpp
    libcxx/test/std/iterators/stream.iterators/ostreambuf.iterator/ostreambuf.iter.ops/assign_c.pass.cpp
    libcxx/test/std/iterators/stream.iterators/ostreambuf.iterator/ostreambuf.iter.ops/deref.pass.cpp
    libcxx/test/std/iterators/stream.iterators/ostreambuf.iterator/ostreambuf.iter.ops/failed.pass.cpp
    libcxx/test/std/iterators/stream.iterators/ostreambuf.iterator/ostreambuf.iter.ops/increment.pass.cpp
    libcxx/test/std/iterators/stream.iterators/ostreambuf.iterator/types.pass.cpp
    libcxx/test/std/language.support/cstdint/cstdint.syn/cstdint.pass.cpp
    libcxx/test/std/language.support/support.limits/limits/numeric.limits.members/lowest.pass.cpp
    libcxx/test/std/language.support/support.limits/limits/numeric.limits.members/max.pass.cpp
    libcxx/test/std/language.support/support.limits/limits/numeric.limits.members/min.pass.cpp
    libcxx/test/std/localization/locale.categories/category.collate/locale.collate.byname/compare.pass.cpp
    libcxx/test/std/localization/locale.categories/category.collate/locale.collate.byname/hash.pass.cpp
    libcxx/test/std/localization/locale.categories/category.collate/locale.collate.byname/transform.pass.cpp
    libcxx/test/std/localization/locale.categories/category.collate/locale.collate.byname/types.pass.cpp
    libcxx/test/std/localization/locale.categories/category.collate/locale.collate/ctor.pass.cpp
    libcxx/test/std/localization/locale.categories/category.collate/locale.collate/locale.collate.members/compare.pass.cpp
    libcxx/test/std/localization/locale.categories/category.collate/locale.collate/locale.collate.members/hash.pass.cpp
    libcxx/test/std/localization/locale.categories/category.collate/locale.collate/locale.collate.members/transform.pass.cpp
    libcxx/test/std/localization/locale.categories/category.collate/locale.collate/types.pass.cpp
    libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt.byname/ctor_wchar_t.pass.cpp
    libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/ctor_wchar_t.pass.cpp
    libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_always_noconv.pass.cpp
    libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_encoding.pass.cpp
    libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_in.pass.cpp
    libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_length.pass.cpp
    libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_max_length.pass.cpp
    libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_out.pass.cpp
    libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_unshift.pass.cpp
    libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/types_wchar_t.pass.cpp
    libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/is_1.pass.cpp
    libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/is_many.pass.cpp
    libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/mask.pass.cpp
    libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/narrow_1.pass.cpp
    libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/narrow_many.pass.cpp
    libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/scan_is.pass.cpp
    libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/scan_not.pass.cpp
    libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_1.pass.cpp
    libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_many.pass.cpp
    libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_1.pass.cpp
    libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_many.pass.cpp
    libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/types.pass.cpp
    libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/widen_1.pass.cpp
    libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/widen_many.pass.cpp
    libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/ctor.pass.cpp
    libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/is_1.pass.cpp
    libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/is_many.pass.cpp
    libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/narrow_1.pass.cpp
    libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/narrow_many.pass.cpp
    libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/scan_is.pass.cpp
    libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/scan_not.pass.cpp
    libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/tolower_1.pass.cpp
    libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/tolower_many.pass.cpp
    libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/toupper_1.pass.cpp
    libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/toupper_many.pass.cpp
    libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/widen_1.pass.cpp
    libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/widen_many.pass.cpp
    libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/types.pass.cpp
    libcxx/test/std/localization/locale.categories/category.messages/locale.messages/types.pass.cpp
    libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_en_US.pass.cpp
    libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_fr_FR.pass.cpp
    libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_ru_RU.pass.cpp
    libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_zh_CN.pass.cpp
    libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_string_en_US.pass.cpp
    libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/types.pass.cpp
    libcxx/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_en_US.pass.cpp
    libcxx/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_fr_FR.pass.cpp
    libcxx/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_ru_RU.pass.cpp
    libcxx/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_zh_CN.pass.cpp
    libcxx/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_string_en_US.pass.cpp
    libcxx/test/std/localization/locale.categories/category.monetary/locale.money.put/types.pass.cpp
    libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/curr_symbol.pass.cpp
    libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/decimal_point.pass.cpp
    libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/frac_digits.pass.cpp
    libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/grouping.pass.cpp
    libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/neg_format.pass.cpp
    libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/negative_sign.pass.cpp
    libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/pos_format.pass.cpp
    libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/positive_sign.pass.cpp
    libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/thousands_sep.pass.cpp
    libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.members/curr_symbol.pass.cpp
    libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.members/decimal_point.pass.cpp
    libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.members/frac_digits.pass.cpp
    libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.members/grouping.pass.cpp
    libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.members/neg_format.pass.cpp
    libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.members/negative_sign.pass.cpp
    libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.members/pos_format.pass.cpp
    libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.members/positive_sign.pass.cpp
    libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.members/thousands_sep.pass.cpp
    libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct/types.pass.cpp
    libcxx/test/std/localization/locale.categories/category.numeric/locale.nm.put/types.pass.cpp
    libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/date_order_wide.pass.cpp
    libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_date_wide.pass.cpp
    libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_monthname_wide.pass.cpp
    libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_one_wide.pass.cpp
    libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_time_wide.pass.cpp
    libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_weekday_wide.pass.cpp
    libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_year_wide.pass.cpp
    libcxx/test/std/localization/locale.categories/category.time/locale.time.get/locale.time.get.members/get_date_wide.pass.cpp
    libcxx/test/std/localization/locale.categories/category.time/locale.time.get/locale.time.get.members/get_monthname_wide.pass.cpp
    libcxx/test/std/localization/locale.categories/category.time/locale.time.get/locale.time.get.members/get_time_wide.pass.cpp
    libcxx/test/std/localization/locale.categories/category.time/locale.time.get/locale.time.get.members/get_weekday_wide.pass.cpp
    libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct.byname/decimal_point.pass.cpp
    libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct.byname/grouping.pass.cpp
    libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct.byname/thousands_sep.pass.cpp
    libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct/ctor.pass.cpp
    libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct/facet.numpunct.members/decimal_point.pass.cpp
    libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct/facet.numpunct.members/falsename.pass.cpp
    libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct/facet.numpunct.members/grouping.pass.cpp
    libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct/facet.numpunct.members/thousands_sep.pass.cpp
    libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct/facet.numpunct.members/truename.pass.cpp
    libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct/types.pass.cpp
    libcxx/test/std/localization/locale.stdcvt/codecvt_utf16.pass.cpp
    libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_always_noconv.pass.cpp
    libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_encoding.pass.cpp
    libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_max_length.pass.cpp
    libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_out.pass.cpp
    libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_unshift.pass.cpp
    libcxx/test/std/localization/locale.stdcvt/codecvt_utf8.pass.cpp
    libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_always_noconv.pass.cpp
    libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_encoding.pass.cpp
    libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_length.pass.cpp
    libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_max_length.pass.cpp
    libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_out.pass.cpp
    libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_unshift.pass.cpp
    libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_utf16_always_noconv.pass.cpp
    libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_utf16_encoding.pass.cpp
    libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_utf16_in.pass.cpp
    libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_utf16_length.pass.cpp
    libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_utf16_max_length.pass.cpp
    libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_utf16_out.pass.cpp
    libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_utf16_unshift.pass.cpp
    libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/ctor.pass.cpp
    libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/overflow.pass.cpp
    libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/pbackfail.pass.cpp
    libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/rdbuf.pass.cpp
    libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/seekoff.pass.cpp
    libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/state.pass.cpp
    libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/test.pass.cpp
    libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/underflow.pass.cpp
    libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/converted.pass.cpp
    libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/ctor_codecvt.pass.cpp
    libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/ctor_codecvt_state.pass.cpp
    libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/ctor_copy.pass.cpp
    libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/ctor_err_string.pass.cpp
    libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/from_bytes.pass.cpp
    libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/state.pass.cpp
    libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/to_bytes.pass.cpp
    libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/types.pass.cpp
    libcxx/test/std/localization/locales/locale/locale.cons/assign.pass.cpp
    libcxx/test/std/localization/locales/locale/locale.cons/char_pointer.pass.cpp
    libcxx/test/std/localization/locales/locale/locale.cons/copy.pass.cpp
    libcxx/test/std/localization/locales/locale/locale.cons/default.pass.cpp
    libcxx/test/std/localization/locales/locale/locale.cons/locale_char_pointer_cat.pass.cpp
    libcxx/test/std/localization/locales/locale/locale.cons/locale_facetptr.pass.cpp
    libcxx/test/std/localization/locales/locale/locale.cons/locale_locale_cat.pass.cpp
    libcxx/test/std/localization/locales/locale/locale.cons/locale_string_cat.pass.cpp
    libcxx/test/std/localization/locales/locale/locale.cons/string.pass.cpp
    libcxx/test/std/localization/locales/locale/locale.members/combine.pass.cpp
    libcxx/test/std/localization/locales/locale/locale.operators/compare.pass.cpp
    libcxx/test/std/localization/locales/locale/locale.statics/classic.pass.cpp
    libcxx/test/std/localization/locales/locale/locale.statics/global.pass.cpp
    libcxx/test/std/namespace/addressable_functions.sh.cpp
    libcxx/test/std/ranges/range.utility/range.subrange/ctad.compile.pass.cpp
    libcxx/test/std/re/re.alg/re.alg.match/awk.locale.pass.cpp
    libcxx/test/std/re/re.alg/re.alg.match/awk.pass.cpp
    libcxx/test/std/re/re.alg/re.alg.match/basic.locale.pass.cpp
    libcxx/test/std/re/re.alg/re.alg.match/basic.pass.cpp
    libcxx/test/std/re/re.alg/re.alg.match/ecma.locale.pass.cpp
    libcxx/test/std/re/re.alg/re.alg.match/ecma.pass.cpp
    libcxx/test/std/re/re.alg/re.alg.match/extended.locale.pass.cpp
    libcxx/test/std/re/re.alg/re.alg.match/extended.pass.cpp
    libcxx/test/std/re/re.alg/re.alg.search/awk.locale.pass.cpp
    libcxx/test/std/re/re.alg/re.alg.search/awk.pass.cpp
    libcxx/test/std/re/re.alg/re.alg.search/basic.locale.pass.cpp
    libcxx/test/std/re/re.alg/re.alg.search/basic.pass.cpp
    libcxx/test/std/re/re.alg/re.alg.search/ecma.locale.pass.cpp
    libcxx/test/std/re/re.alg/re.alg.search/ecma.pass.cpp
    libcxx/test/std/re/re.alg/re.alg.search/extended.locale.pass.cpp
    libcxx/test/std/re/re.alg/re.alg.search/extended.pass.cpp
    libcxx/test/std/re/re.iter/re.regiter/re.regiter.cnstr/default.pass.cpp
    libcxx/test/std/re/re.iter/re.regiter/types.pass.cpp
    libcxx/test/std/re/re.regex/re.regex.construct/deduct.pass.cpp
    libcxx/test/std/re/re.regex/re.regex.construct/default.pass.cpp
    libcxx/test/std/re/re.results/re.results.all/get_allocator.pass.cpp
    libcxx/test/std/re/re.results/re.results.const/allocator.pass.cpp
    libcxx/test/std/re/re.results/re.results.const/copy.pass.cpp
    libcxx/test/std/re/re.results/re.results.const/copy_assign.pass.cpp
    libcxx/test/std/re/re.results/re.results.const/default.pass.cpp
    libcxx/test/std/re/re.results/re.results.const/move.pass.cpp
    libcxx/test/std/re/re.results/re.results.const/move_assign.pass.cpp
    libcxx/test/std/re/re.results/re.results.form/form1.pass.cpp
    libcxx/test/std/re/re.results/re.results.form/form2.pass.cpp
    libcxx/test/std/re/re.results/re.results.form/form3.pass.cpp
    libcxx/test/std/re/re.results/re.results.form/form4.pass.cpp
    libcxx/test/std/re/re.submatch/re.submatch.members/compare_string_type.pass.cpp
    libcxx/test/std/re/re.submatch/re.submatch.members/compare_sub_match.pass.cpp
    libcxx/test/std/re/re.submatch/re.submatch.members/compare_value_type_ptr.pass.cpp
    libcxx/test/std/re/re.submatch/re.submatch.members/default.pass.cpp
    libcxx/test/std/re/re.submatch/re.submatch.members/length.pass.cpp
    libcxx/test/std/re/re.submatch/re.submatch.members/operator_string.pass.cpp
    libcxx/test/std/re/re.submatch/re.submatch.members/str.pass.cpp
    libcxx/test/std/re/re.submatch/re.submatch.op/compare.pass.cpp
    libcxx/test/std/re/re.submatch/re.submatch.op/stream.pass.cpp
    libcxx/test/std/re/re.submatch/types.pass.cpp
    libcxx/test/std/re/re.syn/wcmatch.pass.cpp
    libcxx/test/std/re/re.syn/wcregex_iterator.pass.cpp
    libcxx/test/std/re/re.syn/wcregex_token_iterator.pass.cpp
    libcxx/test/std/re/re.syn/wcsub_match.pass.cpp
    libcxx/test/std/re/re.syn/wregex.pass.cpp
    libcxx/test/std/re/re.syn/wsmatch.pass.cpp
    libcxx/test/std/re/re.syn/wsregex_iterator.pass.cpp
    libcxx/test/std/re/re.syn/wsregex_token_iterator.pass.cpp
    libcxx/test/std/re/re.syn/wssub_match.pass.cpp
    libcxx/test/std/re/re.traits/default.pass.cpp
    libcxx/test/std/re/re.traits/getloc.pass.cpp
    libcxx/test/std/re/re.traits/isctype.pass.cpp
    libcxx/test/std/re/re.traits/length.pass.cpp
    libcxx/test/std/re/re.traits/lookup_classname.pass.cpp
    libcxx/test/std/re/re.traits/lookup_collatename.pass.cpp
    libcxx/test/std/re/re.traits/transform.pass.cpp
    libcxx/test/std/re/re.traits/transform_primary.pass.cpp
    libcxx/test/std/re/re.traits/translate.pass.cpp
    libcxx/test/std/re/re.traits/translate_nocase.pass.cpp
    libcxx/test/std/re/re.traits/types.pass.cpp
    libcxx/test/std/re/re.traits/value.pass.cpp
    libcxx/test/std/strings/basic.string.hash/enabled_hashes.pass.cpp
    libcxx/test/std/strings/basic.string.hash/strings.pass.cpp
    libcxx/test/std/strings/basic.string.literals/literal.pass.cpp
    libcxx/test/std/strings/basic.string/string.cons/dtor_noexcept.pass.cpp
    libcxx/test/std/strings/basic.string/string.cons/implicit_deduction_guides.pass.cpp
    libcxx/test/std/strings/basic.string/string.cons/initializer_list.pass.cpp
    libcxx/test/std/strings/basic.string/string.cons/string_view_deduction.pass.cpp
    libcxx/test/std/strings/basic.string/string.cons/string_view_size_size_deduction.pass.cpp
    libcxx/test/std/strings/basic.string/string.iterators/iterators.pass.cpp
    libcxx/test/std/strings/basic.string/string.nonmembers/string.io/get_line.pass.cpp
    libcxx/test/std/strings/basic.string/string.nonmembers/string.io/get_line_delim.pass.cpp
    libcxx/test/std/strings/basic.string/string.nonmembers/string.io/get_line_delim_rv.pass.cpp
    libcxx/test/std/strings/basic.string/string.nonmembers/string.io/get_line_rv.pass.cpp
    libcxx/test/std/strings/basic.string/string.nonmembers/string.io/stream_extract.pass.cpp
    libcxx/test/std/strings/basic.string/string.nonmembers/string.io/stream_insert.pass.cpp
    libcxx/test/std/strings/c.strings/cwchar.pass.cpp
    libcxx/test/std/strings/c.strings/cwctype.pass.cpp
    libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/assign2.pass.cpp
    libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/assign3.pass.cpp
    libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/compare.pass.cpp
    libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/copy.pass.cpp
    libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/eof.pass.cpp
    libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/eq.pass.cpp
    libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/eq_int_type.pass.cpp
    libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/find.pass.cpp
    libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/length.pass.cpp
    libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/lt.pass.cpp
    libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/move.pass.cpp
    libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/not_eof.pass.cpp
    libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/to_char_type.pass.cpp
    libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/to_int_type.pass.cpp
    libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/types.pass.cpp
    libcxx/test/std/strings/string.classes/typedefs.pass.cpp
    libcxx/test/std/strings/string.conversions/stod.pass.cpp
    libcxx/test/std/strings/string.conversions/stof.pass.cpp
    libcxx/test/std/strings/string.conversions/stoi.pass.cpp
    libcxx/test/std/strings/string.conversions/stol.pass.cpp
    libcxx/test/std/strings/string.conversions/stold.pass.cpp
    libcxx/test/std/strings/string.conversions/stoll.pass.cpp
    libcxx/test/std/strings/string.conversions/stoul.pass.cpp
    libcxx/test/std/strings/string.conversions/stoull.pass.cpp
    libcxx/test/std/strings/string.conversions/to_wstring.pass.cpp
    libcxx/test/std/strings/string.view/string.view.capacity/capacity.pass.cpp
    libcxx/test/std/strings/string.view/string.view.cons/assign.pass.cpp
    libcxx/test/std/strings/string.view/string.view.cons/deduct.pass.cpp
    libcxx/test/std/strings/string.view/string.view.cons/default.pass.cpp
    libcxx/test/std/strings/string.view/string.view.cons/from_iterator_sentinel.pass.cpp
    libcxx/test/std/strings/string.view/string.view.cons/from_string.pass.cpp
    libcxx/test/std/strings/string.view/string.view.cons/implicit_deduction_guides.pass.cpp
    libcxx/test/std/strings/string.view/string.view.hash/enabled_hashes.pass.cpp
    libcxx/test/std/strings/string.view/string.view.hash/string_view.pass.cpp
    libcxx/test/std/strings/string.view/string.view.io/stream_insert.pass.cpp
    libcxx/test/std/strings/string.view/string.view.iterators/begin.pass.cpp
    libcxx/test/std/strings/string.view/string.view.iterators/end.pass.cpp
    libcxx/test/std/strings/string.view/string.view.iterators/rbegin.pass.cpp
    libcxx/test/std/strings/string.view/string.view.iterators/rend.pass.cpp
    libcxx/test/std/strings/string.view/string.view.modifiers/remove_prefix.pass.cpp
    libcxx/test/std/strings/string.view/string.view.modifiers/remove_suffix.pass.cpp
    libcxx/test/std/strings/string.view/string.view.modifiers/swap.pass.cpp
    libcxx/test/std/strings/string.view/string.view.nonmem/quoted.pass.cpp
    libcxx/test/std/strings/string.view/string_view.literals/literal.pass.cpp
    libcxx/test/std/strings/string.view/trivially_copyable.compile.pass.cpp
    libcxx/test/std/utilities/format/format.arguments/format.arg.store/class.pass.cpp
    libcxx/test/std/utilities/format/format.arguments/format.arg.store/make_format_args.sh.cpp
    libcxx/test/std/utilities/format/format.arguments/format.arg.store/make_wformat_args.pass.cpp
    libcxx/test/std/utilities/format/format.arguments/format.args/ctor.pass.cpp
    libcxx/test/std/utilities/format/format.arguments/format.args/types.compile.pass.cpp
    libcxx/test/std/utilities/format/format.formatter/format.context/format.context/advance_to.pass.cpp
    libcxx/test/std/utilities/format/format.formatter/format.context/format.context/arg.pass.cpp
    libcxx/test/std/utilities/format/format.formatter/format.context/format.context/ctor.pass.cpp
    libcxx/test/std/utilities/format/format.formatter/format.context/format.context/locale.pass.cpp
    libcxx/test/std/utilities/format/format.formatter/format.context/format.context/out.pass.cpp
    libcxx/test/std/utilities/format/format.formatter/format.context/format.formatter.spec/formatter.bool.pass.cpp
    libcxx/test/std/utilities/format/format.formatter/format.context/format.formatter.spec/formatter.c_string.pass.cpp
    libcxx/test/std/utilities/format/format.formatter/format.context/format.formatter.spec/formatter.char.pass.cpp
    libcxx/test/std/utilities/format/format.formatter/format.context/format.formatter.spec/formatter.const_char_array.pass.cpp
    libcxx/test/std/utilities/format/format.formatter/format.context/format.formatter.spec/formatter.floating_point.pass.cpp
    libcxx/test/std/utilities/format/format.formatter/format.context/format.formatter.spec/formatter.signed_integral.pass.cpp
    libcxx/test/std/utilities/format/format.formatter/format.context/format.formatter.spec/formatter.string.pass.cpp
    libcxx/test/std/utilities/format/format.formatter/format.context/format.formatter.spec/formatter.unsigned_integral.pass.cpp
    libcxx/test/std/utilities/format/format.formatter/format.context/types.compile.pass.cpp
    libcxx/test/std/utilities/format/format.formatter/format.parse.ctx/types.compile.pass.cpp
    libcxx/test/std/utilities/format/format.functions/format.locale.pass.cpp
    libcxx/test/std/utilities/format/format.functions/format.pass.cpp
    libcxx/test/std/utilities/format/format.functions/format_tests.h
    libcxx/test/std/utilities/format/format.functions/format_to.locale.pass.cpp
    libcxx/test/std/utilities/format/format.functions/format_to.pass.cpp
    libcxx/test/std/utilities/format/format.functions/format_to_n.locale.pass.cpp
    libcxx/test/std/utilities/format/format.functions/format_to_n.pass.cpp
    libcxx/test/std/utilities/format/format.functions/formatted_size.locale.pass.cpp
    libcxx/test/std/utilities/format/format.functions/formatted_size.pass.cpp
    libcxx/test/std/utilities/format/format.functions/locale-specific_form.pass.cpp
    libcxx/test/std/utilities/format/format.functions/vformat.locale.pass.cpp
    libcxx/test/std/utilities/format/format.functions/vformat.pass.cpp
    libcxx/test/std/utilities/format/format.functions/vformat_to.locale.pass.cpp
    libcxx/test/std/utilities/format/format.functions/vformat_to.pass.cpp
    libcxx/test/std/utilities/function.objects/unord.hash/integral.pass.cpp
    libcxx/test/std/utilities/template.bitset/bitset.members/to_string.pass.cpp
    libcxx/test/std/utilities/template.bitset/includes.pass.cpp
    libcxx/test/std/utilities/utility/utility.intcmp/intcmp.fail.cpp
    libcxx/test/support/make_string.h
    libcxx/test/support/poisoned_hash_helper.h
    libcxx/test/support/test.support/make_string_header.pass.cpp
    libcxx/test/support/test_macros.h
    libcxx/utils/ci/buildkite-pipeline.yml
    libcxx/utils/ci/run-buildbot
    libcxx/utils/generate_header_tests.py
    libcxx/utils/libcxx/test/features.py

Removed: 
    


################################################################################
diff  --git a/libcxx/CMakeLists.txt b/libcxx/CMakeLists.txt
index e117a264ff0b7..9bc955b741f76 100644
--- a/libcxx/CMakeLists.txt
+++ b/libcxx/CMakeLists.txt
@@ -120,6 +120,12 @@ option(LIBCXX_ENABLE_UNICODE
   "Whether to include support for Unicode in the library. Disabling Unicode can
    be useful when porting to platforms that don't support UTF-8 encoding (e.g.
    embedded)." ON)
+option(LIBCXX_ENABLE_WIDE_CHARACTERS
+  "Whether to include support for wide characters in the library. Disabling
+   wide character support can be useful when porting to platforms that don't
+   support the C functionality for wide characters. When wide characters are
+   not supported, several parts of the library will be disabled, notably the
+   wide character specializations of std::basic_string." ON)
 option(LIBCXX_ENABLE_VENDOR_AVAILABILITY_ANNOTATIONS
   "Whether to turn on vendor availability annotations on declarations that depend
    on definitions in a shared library. By default, we assume that we're not building
@@ -893,6 +899,7 @@ config_define_if_not(LIBCXX_ENABLE_FILESYSTEM _LIBCPP_HAS_NO_FILESYSTEM_LIBRARY)
 config_define_if_not(LIBCXX_ENABLE_RANDOM_DEVICE _LIBCPP_HAS_NO_RANDOM_DEVICE)
 config_define_if_not(LIBCXX_ENABLE_LOCALIZATION _LIBCPP_HAS_NO_LOCALIZATION)
 config_define_if_not(LIBCXX_ENABLE_UNICODE _LIBCPP_HAS_NO_UNICODE)
+config_define_if_not(LIBCXX_ENABLE_WIDE_CHARACTERS _LIBCPP_HAS_NO_WIDE_CHARACTERS)
 config_define_if_not(LIBCXX_ENABLE_VENDOR_AVAILABILITY_ANNOTATIONS _LIBCPP_HAS_NO_VENDOR_AVAILABILITY_ANNOTATIONS)
 # Incomplete features get their own specific disabling flags. This makes it
 # easier to grep for target specific flags once the feature is complete.

diff  --git a/libcxx/cmake/caches/Generic-no-wide-characters.cmake b/libcxx/cmake/caches/Generic-no-wide-characters.cmake
new file mode 100644
index 0000000000000..728d41086a386
--- /dev/null
+++ b/libcxx/cmake/caches/Generic-no-wide-characters.cmake
@@ -0,0 +1 @@
+set(LIBCXX_ENABLE_WIDE_CHARACTERS OFF CACHE BOOL "")

diff  --git a/libcxx/docs/BuildingLibcxx.rst b/libcxx/docs/BuildingLibcxx.rst
index a29a05b8f7f7b..a0128b84eeb43 100644
--- a/libcxx/docs/BuildingLibcxx.rst
+++ b/libcxx/docs/BuildingLibcxx.rst
@@ -251,6 +251,15 @@ libc++ specific options
    This option can be used to enable or disable the filesystem components on
    platforms that may not support them. For example on Windows when using MSVC.
 
+.. option:: LIBCXX_ENABLE_WIDE_CHARACTERS:BOOL
+
+   **Default**: ``ON``
+
+   This option can be used to disable support for ``wchar_t`` in the library. It also
+   allows the library to work on top of a C Standard Library that does not provide
+   support for ``wchar_t``. This is especially useful in embedded settings where
+   C Standard Libraries don't always provide all the usual bells and whistles.
+
 .. option:: LIBCXX_ENABLE_INCOMPLETE_FEATURES:BOOL
 
   **Default**: ``ON``

diff  --git a/libcxx/docs/ReleaseNotes.rst b/libcxx/docs/ReleaseNotes.rst
index 1ec7fa3d20cd0..1ffd5b4e332fc 100644
--- a/libcxx/docs/ReleaseNotes.rst
+++ b/libcxx/docs/ReleaseNotes.rst
@@ -49,7 +49,9 @@ New Features
 API Changes
 -----------
 
-- ...
+- Support for building libc++ on top of a C Standard Library that does not support ``wchar_t`` was
+  added. This is useful for building libc++ in an embedded setting, and it adds itself to the various
+  freestanding-friendly options provided by libc++.
 
 Build System Changes
 --------------------

diff  --git a/libcxx/include/CMakeLists.txt b/libcxx/include/CMakeLists.txt
index 55834abde8b8a..ed1a585f01cf6 100644
--- a/libcxx/include/CMakeLists.txt
+++ b/libcxx/include/CMakeLists.txt
@@ -211,6 +211,7 @@ set(files
   __iterator/wrap_iter.h
   __libcpp_version
   __locale
+  __mbstate_t.h
   __memory/addressof.h
   __memory/allocation_guard.h
   __memory/allocator_arg_t.h

diff  --git a/libcxx/include/__algorithm/sort.h b/libcxx/include/__algorithm/sort.h
index f038d5f2445a4..0ab6c44a0c5ac 100644
--- a/libcxx/include/__algorithm/sort.h
+++ b/libcxx/include/__algorithm/sort.h
@@ -463,7 +463,9 @@ __sort(_Tp** __first, _Tp** __last, __less<_Tp*>&)
 }
 
 _LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS void __sort<__less<char>&, char*>(char*, char*, __less<char>&))
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 _LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS void __sort<__less<wchar_t>&, wchar_t*>(wchar_t*, wchar_t*, __less<wchar_t>&))
+#endif
 _LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS void __sort<__less<signed char>&, signed char*>(signed char*, signed char*, __less<signed char>&))
 _LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS void __sort<__less<unsigned char>&, unsigned char*>(unsigned char*, unsigned char*, __less<unsigned char>&))
 _LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS void __sort<__less<short>&, short*>(short*, short*, __less<short>&))
@@ -479,7 +481,9 @@ _LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS void __sort<__less<double>&, double*>(d
 _LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS void __sort<__less<long double>&, long double*>(long double*, long double*, __less<long double>&))
 
 _LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less<char>&, char*>(char*, char*, __less<char>&))
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 _LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less<wchar_t>&, wchar_t*>(wchar_t*, wchar_t*, __less<wchar_t>&))
+#endif
 _LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less<signed char>&, signed char*>(signed char*, signed char*, __less<signed char>&))
 _LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less<unsigned char>&, unsigned char*>(unsigned char*, unsigned char*, __less<unsigned char>&))
 _LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less<short>&, short*>(short*, short*, __less<short>&))

diff  --git a/libcxx/include/__bsd_locale_fallbacks.h b/libcxx/include/__bsd_locale_fallbacks.h
index ed0eabf60ece2..aa64b54c4d056 100644
--- a/libcxx/include/__bsd_locale_fallbacks.h
+++ b/libcxx/include/__bsd_locale_fallbacks.h
@@ -30,6 +30,7 @@ decltype(MB_CUR_MAX) __libcpp_mb_cur_max_l(locale_t __l)
     return MB_CUR_MAX;
 }
 
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 inline _LIBCPP_INLINE_VISIBILITY
 wint_t __libcpp_btowc_l(int __c, locale_t __l)
 {
@@ -88,6 +89,7 @@ size_t __libcpp_mbrlen_l(const char *__s, size_t __n, mbstate_t *__ps, locale_t
     __libcpp_locale_guard __current(__l);
     return mbrlen(__s, __n, __ps);
 }
+#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
 
 inline _LIBCPP_INLINE_VISIBILITY
 lconv *__libcpp_localeconv_l(locale_t __l)
@@ -96,6 +98,7 @@ lconv *__libcpp_localeconv_l(locale_t __l)
     return localeconv();
 }
 
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 inline _LIBCPP_INLINE_VISIBILITY
 size_t __libcpp_mbsrtowcs_l(wchar_t *__dest, const char **__src, size_t __len,
                      mbstate_t *__ps, locale_t __l)
@@ -103,6 +106,7 @@ size_t __libcpp_mbsrtowcs_l(wchar_t *__dest, const char **__src, size_t __len,
     __libcpp_locale_guard __current(__l);
     return mbsrtowcs(__dest, __src, __len, __ps);
 }
+#endif
 
 inline
 int __libcpp_snprintf_l(char *__s, size_t __n, locale_t __l, const char *__format, ...) {

diff  --git a/libcxx/include/__config b/libcxx/include/__config
index 31f98faaa7219..0c6839025bca4 100644
--- a/libcxx/include/__config
+++ b/libcxx/include/__config
@@ -1241,6 +1241,16 @@ extern "C" _LIBCPP_FUNC_VIS void __sanitizer_annotate_contiguous_container(
 #define _LIBCPP_PREFERRED_NAME(x)
 #endif
 
+// We often repeat things just for handling wide characters in the library.
+// When wide characters are disabled, it can be useful to have a quick way of
+// disabling it without having to resort to #if-#endif, which has a larger
+// impact on readability.
+#if defined(_LIBCPP_HAS_NO_WIDE_CHARACTERS)
+# define _LIBCPP_IF_WIDE_CHARACTERS(...)
+#else
+# define _LIBCPP_IF_WIDE_CHARACTERS(...) __VA_ARGS__
+#endif
+
 #if defined(_LIBCPP_ABI_MICROSOFT) && \
     (defined(_LIBCPP_COMPILER_MSVC) || __has_declspec_attribute(empty_bases))
 #  define _LIBCPP_DECLSPEC_EMPTY_BASES __declspec(empty_bases)

diff  --git a/libcxx/include/__config_site.in b/libcxx/include/__config_site.in
index c938daae1ed2e..a8b17ad72b73c 100644
--- a/libcxx/include/__config_site.in
+++ b/libcxx/include/__config_site.in
@@ -30,6 +30,7 @@
 #cmakedefine _LIBCPP_HAS_PARALLEL_ALGORITHMS
 #cmakedefine _LIBCPP_HAS_NO_RANDOM_DEVICE
 #cmakedefine _LIBCPP_HAS_NO_LOCALIZATION
+#cmakedefine _LIBCPP_HAS_NO_WIDE_CHARACTERS
 #cmakedefine _LIBCPP_HAS_NO_INCOMPLETE_FORMAT
 #cmakedefine _LIBCPP_HAS_NO_INCOMPLETE_RANGES
 

diff  --git a/libcxx/include/__format/format_context.h b/libcxx/include/__format/format_context.h
index e277aa0f9dea7..1cb7ee6a49ec3 100644
--- a/libcxx/include/__format/format_context.h
+++ b/libcxx/include/__format/format_context.h
@@ -146,8 +146,9 @@ class _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT basic_format_context {
 // (such as a span<charT>) and polymorphic reallocation. - end note]
 
 using format_context = basic_format_context<back_insert_iterator<string>, char>;
-using wformat_context =
-    basic_format_context<back_insert_iterator<wstring>, wchar_t>;
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+using wformat_context = basic_format_context<back_insert_iterator<wstring>, wchar_t>;
+#endif
 
 #endif // !defined(_LIBCPP_HAS_NO_CONCEPTS)
 

diff  --git a/libcxx/include/__format/format_parse_context.h b/libcxx/include/__format/format_parse_context.h
index 35ecc1fe9212b..289cab9f0ee45 100644
--- a/libcxx/include/__format/format_parse_context.h
+++ b/libcxx/include/__format/format_parse_context.h
@@ -96,7 +96,9 @@ class _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT basic_format_parse_contex
 };
 
 using format_parse_context = basic_format_parse_context<char>;
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 using wformat_parse_context = basic_format_parse_context<wchar_t>;
+#endif
 
 #endif // !defined(_LIBCPP_HAS_NO_CONCEPTS)
 

diff  --git a/libcxx/include/__format/formatter_bool.h b/libcxx/include/__format/formatter_bool.h
index 8d9a1d26a4e22..fdd1d75355d24 100644
--- a/libcxx/include/__format/formatter_bool.h
+++ b/libcxx/include/__format/formatter_bool.h
@@ -85,11 +85,13 @@ struct _LIBCPP_TEMPLATE_VIS __bool_strings<char> {
   static constexpr string_view __false{"false"};
 };
 
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 template <>
 struct _LIBCPP_TEMPLATE_VIS __bool_strings<wchar_t> {
   static constexpr wstring_view __true{L"true"};
   static constexpr wstring_view __false{L"false"};
 };
+#endif
 
 template <class _CharT>
 using __formatter_bool = __formatter_integral<__parser_bool<_CharT>>;

diff  --git a/libcxx/include/__format/formatter_char.h b/libcxx/include/__format/formatter_char.h
index bbc54c4168099..2131de0778f2e 100644
--- a/libcxx/include/__format/formatter_char.h
+++ b/libcxx/include/__format/formatter_char.h
@@ -78,6 +78,7 @@ template <>
 struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<char, char>
     : public __format_spec::__formatter_char<char> {};
 
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 template <>
 struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<char, wchar_t>
     : public __format_spec::__formatter_char<wchar_t> {
@@ -93,7 +94,7 @@ template <>
 struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT
     formatter<wchar_t, wchar_t>
     : public __format_spec::__formatter_char<wchar_t> {};
-
+#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
 #endif // !defined(_LIBCPP_HAS_NO_CONCEPTS)
 
 #endif //_LIBCPP_STD_VER > 17

diff  --git a/libcxx/include/__functional/hash.h b/libcxx/include/__functional/hash.h
index f8bcda014a5da..b1a3ad94ae2db 100644
--- a/libcxx/include/__functional/hash.h
+++ b/libcxx/include/__functional/hash.h
@@ -561,6 +561,7 @@ _LIBCPP_SUPPRESS_DEPRECATED_POP
 
 #endif // _LIBCPP_HAS_NO_UNICODE_CHARS
 
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 _LIBCPP_SUPPRESS_DEPRECATED_PUSH
 template <>
 struct _LIBCPP_TEMPLATE_VIS hash<wchar_t>
@@ -576,6 +577,7 @@ _LIBCPP_SUPPRESS_DEPRECATED_POP
     _LIBCPP_INLINE_VISIBILITY
     size_t operator()(wchar_t __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
 };
+#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
 
 _LIBCPP_SUPPRESS_DEPRECATED_PUSH
 template <>

diff  --git a/libcxx/include/__locale b/libcxx/include/__locale
index 5f4d66fc56769..4296adbbd8e92 100644
--- a/libcxx/include/__locale
+++ b/libcxx/include/__locale
@@ -338,7 +338,9 @@ collate<_CharT>::do_hash(const char_type* __lo, const char_type* __hi) const
 }
 
 _LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS collate<char>)
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 _LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS collate<wchar_t>)
+#endif
 
 // template <class CharT> class collate_byname;
 
@@ -363,6 +365,7 @@ protected:
     virtual string_type do_transform(const char_type* __lo, const char_type* __hi) const;
 };
 
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 template <>
 class _LIBCPP_TYPE_VIS collate_byname<wchar_t>
     : public collate<wchar_t>
@@ -382,6 +385,7 @@ protected:
                            const char_type* __lo2, const char_type* __hi2) const;
     virtual string_type do_transform(const char_type* __lo, const char_type* __hi) const;
 };
+#endif
 
 template <class _CharT, class _Traits, class _Allocator>
 bool
@@ -516,6 +520,7 @@ public:
 
 template <class _CharT> class _LIBCPP_TEMPLATE_VIS ctype;
 
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 template <>
 class _LIBCPP_TYPE_VIS ctype<wchar_t>
     : public locale::facet,
@@ -617,6 +622,7 @@ protected:
     virtual char do_narrow(char_type, char __dfault) const;
     virtual const char_type* do_narrow(const char_type* __low, const char_type* __high, char __dfault, char* __dest) const;
 };
+#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
 
 template <>
 class _LIBCPP_TYPE_VIS ctype<char>
@@ -761,6 +767,7 @@ protected:
     virtual const char_type* do_tolower(char_type* __low, const char_type* __high) const;
 };
 
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 template <>
 class _LIBCPP_TYPE_VIS ctype_byname<wchar_t>
     : public ctype<wchar_t>
@@ -786,6 +793,7 @@ protected:
     virtual char do_narrow(char_type, char __dfault) const;
     virtual const char_type* do_narrow(const char_type* __low, const char_type* __high, char __dfault, char* __dest) const;
 };
+#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
 
 template <class _CharT>
 inline _LIBCPP_INLINE_VISIBILITY
@@ -992,6 +1000,7 @@ protected:
 
 // template <> class codecvt<wchar_t, char, mbstate_t>
 
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 template <>
 class _LIBCPP_TYPE_VIS codecvt<wchar_t, char, mbstate_t>
     : public locale::facet,
@@ -1072,6 +1081,7 @@ protected:
     virtual int do_length(state_type&, const extern_type* __frm, const extern_type* __end, size_t __mx) const;
     virtual int do_max_length() const  _NOEXCEPT;
 };
+#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
 
 // template <> class codecvt<char16_t, char, mbstate_t> // deprecated in C++20
 
@@ -1450,7 +1460,9 @@ codecvt_byname<_InternT, _ExternT, _StateT>::~codecvt_byname()
 _LIBCPP_SUPPRESS_DEPRECATED_POP
 
 _LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS codecvt_byname<char, char, mbstate_t>)
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 _LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS codecvt_byname<wchar_t, char, mbstate_t>)
+#endif
 _LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_DEPRECATED_IN_CXX20 _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS codecvt_byname<char16_t, char, mbstate_t>) // deprecated in C++20
 _LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_DEPRECATED_IN_CXX20 _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS codecvt_byname<char32_t, char, mbstate_t>) // deprecated in C++20
 #ifndef _LIBCPP_HAS_NO_CHAR8_T
@@ -1681,6 +1693,7 @@ protected:
     string __grouping_;
 };
 
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 template <>
 class _LIBCPP_TYPE_VIS numpunct<wchar_t>
     : public locale::facet
@@ -1711,6 +1724,7 @@ protected:
     char_type __thousands_sep_;
     string __grouping_;
 };
+#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
 
 // template <class charT> class numpunct_byname
 
@@ -1734,6 +1748,7 @@ private:
     void __init(const char*);
 };
 
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 template <>
 class _LIBCPP_TYPE_VIS numpunct_byname<wchar_t>
 : public numpunct<wchar_t>
@@ -1751,6 +1766,7 @@ protected:
 private:
     void __init(const char*);
 };
+#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
 
 _LIBCPP_END_NAMESPACE_STD
 

diff  --git a/libcxx/include/__mbstate_t.h b/libcxx/include/__mbstate_t.h
new file mode 100644
index 0000000000000..3489f9cc0e3a2
--- /dev/null
+++ b/libcxx/include/__mbstate_t.h
@@ -0,0 +1,44 @@
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___MBSTATE_T_H
+#define _LIBCPP___MBSTATE_T_H
+
+#include <__config>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+// TODO(ldionne):
+// The goal of this header is to provide mbstate_t without having to pull in
+// <wchar.h> or <uchar.h>. This is necessary because we need that type even
+// when we don't have (or try to provide) support for wchar_t, because several
+// types like std::fpos are defined in terms of mbstate_t.
+//
+// This is a gruesome hack, but I don't know how to make it cleaner for
+// the time being.
+
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+#   include <wchar.h> // for mbstate_t
+#elif __has_include(<bits/types/mbstate_t.h>)
+#   include <bits/types/mbstate_t.h> // works on most Unixes
+#elif __has_include(<sys/_types/_mbstate_t.h>)
+#   include <sys/_types/_mbstate_t.h> // works on Darwin
+#else
+#   error "The library was configured without support for wide-characters, but we don't know how to get the definition of mbstate_t without <wchar.h> on your platform."
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+using ::mbstate_t _LIBCPP_USING_IF_EXISTS;
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___MBSTATE_T_H

diff  --git a/libcxx/include/__string b/libcxx/include/__string
index a968fc0ac5b83..1691b44ed5374 100644
--- a/libcxx/include/__string
+++ b/libcxx/include/__string
@@ -23,8 +23,12 @@
 #include <cstdio>      // for EOF
 #include <cstdint>     // for uint_least16_t
 #include <cstring>     // for memcpy
-#include <cwchar>      // for wmemcpy
 #include <type_traits> // for __libcpp_is_constant_evaluated
+#include <iosfwd>      // for streampos & friends
+
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+#   include <cwchar> // for wmemcpy
+#endif
 
 #include <__debug>
 
@@ -423,6 +427,7 @@ char_traits<char>::find(const char_type* __s, size_t __n, const char_type& __a)
 
 // char_traits<wchar_t>
 
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 template <>
 struct _LIBCPP_TEMPLATE_VIS char_traits<wchar_t>
 {
@@ -539,6 +544,7 @@ char_traits<wchar_t>::find(const char_type* __s, size_t __n, const char_type& __
     return nullptr;
 #endif
 }
+#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
 
 template <class _Traits>
 _LIBCPP_INLINE_VISIBILITY

diff  --git a/libcxx/include/__utility/cmp.h b/libcxx/include/__utility/cmp.h
index a14e373c3f4b3..4fc96b054f4d5 100644
--- a/libcxx/include/__utility/cmp.h
+++ b/libcxx/include/__utility/cmp.h
@@ -30,14 +30,17 @@ struct _IsSameAsAny : _Or<_IsSame<_Tp, _Up>...> {};
 
 template<class _Tp>
 concept __is_safe_integral_cmp = is_integral_v<_Tp> &&
-                      !_IsSameAsAny<_Tp, bool, char,
+                      !_IsSameAsAny<_Tp, bool, char
 #ifndef _LIBCPP_HAS_NO_CHAR8_T
-                                    char8_t,
+                                    , char8_t
 #endif
 #ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
-                                    char16_t, char32_t,
+                                    , char16_t, char32_t
 #endif
-                                    wchar_t>::value;
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+                                    , wchar_t
+#endif
+                                    >::value;
 
 template<__is_safe_integral_cmp _Tp, __is_safe_integral_cmp _Up>
 _LIBCPP_INLINE_VISIBILITY constexpr

diff  --git a/libcxx/include/atomic b/libcxx/include/atomic
index 958935bbd9c06..a10e596d49816 100644
--- a/libcxx/include/atomic
+++ b/libcxx/include/atomic
@@ -1473,7 +1473,9 @@ template<> struct __cxx_is_always_lock_free<char8_t> { enum { __value = 2 == ATO
 #endif
 template<> struct __cxx_is_always_lock_free<char16_t> { enum { __value = 2 == ATOMIC_CHAR16_T_LOCK_FREE }; };
 template<> struct __cxx_is_always_lock_free<char32_t> { enum { __value = 2 == ATOMIC_CHAR32_T_LOCK_FREE }; };
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 template<> struct __cxx_is_always_lock_free<wchar_t> { enum { __value = 2 == ATOMIC_WCHAR_T_LOCK_FREE }; };
+#endif
 template<> struct __cxx_is_always_lock_free<short> { enum { __value = 2 == ATOMIC_SHORT_LOCK_FREE }; };
 template<> struct __cxx_is_always_lock_free<unsigned short> { enum { __value = 2 == ATOMIC_SHORT_LOCK_FREE }; };
 template<> struct __cxx_is_always_lock_free<int> { enum { __value = 2 == ATOMIC_INT_LOCK_FREE }; };
@@ -2672,7 +2674,9 @@ typedef atomic<char8_t>            atomic_char8_t;
 #endif
 typedef atomic<char16_t>           atomic_char16_t;
 typedef atomic<char32_t>           atomic_char32_t;
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 typedef atomic<wchar_t>            atomic_wchar_t;
+#endif
 
 typedef atomic<int_least8_t>   atomic_int_least8_t;
 typedef atomic<uint_least8_t>  atomic_uint_least8_t;

diff  --git a/libcxx/include/codecvt b/libcxx/include/codecvt
index ec7d4a7809582..4ae07be3f825b 100644
--- a/libcxx/include/codecvt
+++ b/libcxx/include/codecvt
@@ -74,6 +74,7 @@ enum codecvt_mode
 
 template <class _Elem> class __codecvt_utf8;
 
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 template <>
 class _LIBCPP_TYPE_VIS __codecvt_utf8<wchar_t>
     : public codecvt<wchar_t, char, mbstate_t>
@@ -108,6 +109,7 @@ protected:
                           size_t __mx) const;
     virtual int do_max_length() const _NOEXCEPT;
 };
+#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
 
 _LIBCPP_SUPPRESS_DEPRECATED_PUSH
 template <>
@@ -203,6 +205,7 @@ public:
 
 template <class _Elem, bool _LittleEndian> class __codecvt_utf16;
 
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 template <>
 class _LIBCPP_TYPE_VIS __codecvt_utf16<wchar_t, false>
     : public codecvt<wchar_t, char, mbstate_t>
@@ -272,6 +275,7 @@ protected:
                           size_t __mx) const;
     virtual int do_max_length() const _NOEXCEPT;
 };
+#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
 
 _LIBCPP_SUPPRESS_DEPRECATED_PUSH
 template <>
@@ -443,6 +447,7 @@ public:
 
 template <class _Elem> class __codecvt_utf8_utf16;
 
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 template <>
 class _LIBCPP_TYPE_VIS __codecvt_utf8_utf16<wchar_t>
     : public codecvt<wchar_t, char, mbstate_t>
@@ -477,6 +482,7 @@ protected:
                           size_t __mx) const;
     virtual int do_max_length() const _NOEXCEPT;
 };
+#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
 
 _LIBCPP_SUPPRESS_DEPRECATED_PUSH
 template <>

diff  --git a/libcxx/include/cstddef b/libcxx/include/cstddef
index 551bd8364f17f..3e56d4452cc13 100644
--- a/libcxx/include/cstddef
+++ b/libcxx/include/cstddef
@@ -58,7 +58,9 @@ template <>          struct __libcpp_is_integral<bool>               { enum { va
 template <>          struct __libcpp_is_integral<char>               { enum { value = 1 }; };
 template <>          struct __libcpp_is_integral<signed char>        { enum { value = 1 }; };
 template <>          struct __libcpp_is_integral<unsigned char>      { enum { value = 1 }; };
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 template <>          struct __libcpp_is_integral<wchar_t>            { enum { value = 1 }; };
+#endif
 #ifndef _LIBCPP_HAS_NO_CHAR8_T
 template <>          struct __libcpp_is_integral<char8_t>            { enum { value = 1 }; };
 #endif

diff  --git a/libcxx/include/experimental/regex b/libcxx/include/experimental/regex
index 17193cf2f6f67..dcd45ac56a837 100644
--- a/libcxx/include/experimental/regex
+++ b/libcxx/include/experimental/regex
@@ -52,9 +52,11 @@ using match_results =
         polymorphic_allocator<_VSTD::sub_match<_BiDirIter>>>;
 
 typedef match_results<const char*> cmatch;
-typedef match_results<const wchar_t*> wcmatch;
 typedef match_results<_VSTD_LFTS_PMR::string::const_iterator> smatch;
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+typedef match_results<const wchar_t*> wcmatch;
 typedef match_results<_VSTD_LFTS_PMR::wstring::const_iterator> wsmatch;
+#endif
 
 _LIBCPP_END_NAMESPACE_LFTS_PMR
 

diff  --git a/libcxx/include/experimental/string b/libcxx/include/experimental/string
index 264ff92368225..63890ac51b0f3 100644
--- a/libcxx/include/experimental/string
+++ b/libcxx/include/experimental/string
@@ -54,7 +54,9 @@ using basic_string =
 typedef basic_string<char> string;
 typedef basic_string<char16_t> u16string;
 typedef basic_string<char32_t> u32string;
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 typedef basic_string<wchar_t> wstring;
+#endif
 
 _LIBCPP_END_NAMESPACE_LFTS_PMR
 

diff  --git a/libcxx/include/filesystem b/libcxx/include/filesystem
index ccb7bc4755fcd..a11d2a4888f40 100644
--- a/libcxx/include/filesystem
+++ b/libcxx/include/filesystem
@@ -1283,9 +1283,11 @@ public:
     return __s;
   }
 
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
   _LIBCPP_INLINE_VISIBILITY _VSTD::wstring wstring() const {
     return string<wchar_t>();
   }
+#endif
   _LIBCPP_INLINE_VISIBILITY _VSTD::u16string u16string() const {
     return string<char16_t>();
   }
@@ -1310,7 +1312,9 @@ public:
     return string<_ECharT, _Traits, _Allocator>(__a);
   }
 
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
   _VSTD::wstring generic_wstring() const { return string<wchar_t>(); }
+#endif
   _VSTD::u16string generic_u16string() const { return string<char16_t>(); }
   _VSTD::u32string generic_u32string() const { return string<char32_t>(); }
 #endif /* !_LIBCPP_HAS_NO_LOCALIZATION */

diff  --git a/libcxx/include/format b/libcxx/include/format
index 91160151489aa..19f642716b1b7 100644
--- a/libcxx/include/format
+++ b/libcxx/include/format
@@ -318,7 +318,9 @@ _LIBCPP_BEGIN_NAMESPACE_STD
 // to do this optimization now.
 
 using format_args = basic_format_args<format_context>;
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 using wformat_args = basic_format_args<wformat_context>;
+#endif
 
 template <class _OutIt, class _CharT>
 using format_args_t = basic_format_args<basic_format_context<_OutIt, _CharT>>;
@@ -335,11 +337,14 @@ make_format_args(const _Args&... __args) {
   return {basic_format_arg<_Context>(__args)...};
 }
 
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 template <class... _Args>
 _LIBCPP_HIDE_FROM_ABI __format_arg_store<wformat_context, _Args...>
 make_wformat_args(const _Args&... __args) {
   return _VSTD::make_format_args<wformat_context>(__args...);
 }
+#endif
+
 namespace __format {
 
 template <class _Tp, class _CharT>
@@ -363,11 +368,13 @@ private:
   __convert(_Uv __value) requires(same_as<_CharT, char>) {
     return _VSTD::to_string(__value);
   }
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
   template <class _Uv>
   _LIBCPP_HIDDEN static wstring
   __convert(_Uv __value) requires(same_as<_CharT, wchar_t>) {
     return _VSTD::to_wstring(__value);
   }
+#endif
 
   template <class _Uv>
   _LIBCPP_HIDDEN auto __handle_format(_Uv __value, auto& __ctx)
@@ -514,12 +521,14 @@ vformat_to(_OutIt __out_it, string_view __fmt,
   return _VSTD::__vformat_to(_VSTD::move(__out_it), __fmt, __args);
 }
 
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 template <output_iterator<const wchar_t&> _OutIt>
 _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT _OutIt
 vformat_to(_OutIt __out_it, wstring_view __fmt,
            format_args_t<type_identity_t<_OutIt>, wchar_t> __args) {
   return _VSTD::__vformat_to(_VSTD::move(__out_it), __fmt, __args);
 }
+#endif
 
 template <output_iterator<const char&> _OutIt, class... _Args>
 _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT _OutIt
@@ -529,6 +538,7 @@ format_to(_OutIt __out_it, string_view __fmt, const _Args&... __args) {
       _VSTD::make_format_args<basic_format_context<_OutIt, char>>(__args...));
 }
 
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 template <output_iterator<const wchar_t&> _OutIt, class... _Args>
 _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT _OutIt
 format_to(_OutIt __out_it, wstring_view __fmt, const _Args&... __args) {
@@ -537,6 +547,7 @@ format_to(_OutIt __out_it, wstring_view __fmt, const _Args&... __args) {
       _VSTD::make_format_args<basic_format_context<_OutIt, wchar_t>>(
           __args...));
 }
+#endif
 
 inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT string
 vformat(string_view __fmt, format_args __args) {
@@ -545,12 +556,14 @@ vformat(string_view __fmt, format_args __args) {
   return __res;
 }
 
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT wstring
 vformat(wstring_view __fmt, wformat_args __args) {
   wstring __res;
   _VSTD::vformat_to(_VSTD::back_inserter(__res), __fmt, __args);
   return __res;
 }
+#endif
 
 template <class... _Args>
 _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT string
@@ -558,11 +571,13 @@ format(string_view __fmt, const _Args&... __args) {
   return _VSTD::vformat(__fmt, _VSTD::make_format_args(__args...));
 }
 
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 template <class... _Args>
 _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT wstring
 format(wstring_view __fmt, const _Args&... __args) {
   return _VSTD::vformat(__fmt, _VSTD::make_wformat_args(__args...));
 }
+#endif
 
 template <class _OutIt>
 struct _LIBCPP_TEMPLATE_VIS format_to_n_result {
@@ -583,6 +598,7 @@ format_to_n(_OutIt __out_it, iter_
diff erence_t<_OutIt> __n, string_view __fmt,
   return {_VSTD::move(__out_it), __s};
 }
 
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 template <output_iterator<const wchar_t&> _OutIt, class... _Args>
 _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT format_to_n_result<_OutIt>
 format_to_n(_OutIt __out_it, iter_
diff erence_t<_OutIt> __n, wstring_view __fmt,
@@ -595,6 +611,7 @@ format_to_n(_OutIt __out_it, iter_
diff erence_t<_OutIt> __n, wstring_view __fmt,
   __out_it = _VSTD::copy_n(__str.begin(), __m, _VSTD::move(__out_it));
   return {_VSTD::move(__out_it), __s};
 }
+#endif
 
 template <class... _Args>
 _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT size_t
@@ -603,12 +620,14 @@ formatted_size(string_view __fmt, const _Args&... __args) {
   return _VSTD::vformat(__fmt, _VSTD::make_format_args(__args...)).size();
 }
 
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 template <class... _Args>
 _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT size_t
 formatted_size(wstring_view __fmt, const _Args&... __args) {
   // TODO FMT Improve PoC: using std::string is inefficient.
   return _VSTD::vformat(__fmt, _VSTD::make_wformat_args(__args...)).size();
 }
+#endif
 
 #ifndef _LIBCPP_HAS_NO_LOCALIZATION
 
@@ -630,6 +649,7 @@ vformat_to(_OutIt __out_it, locale __loc, string_view __fmt,
                              __args);
 }
 
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 template <output_iterator<const wchar_t&> _OutIt>
 _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT _OutIt
 vformat_to(_OutIt __out_it, locale __loc, wstring_view __fmt,
@@ -637,6 +657,7 @@ vformat_to(_OutIt __out_it, locale __loc, wstring_view __fmt,
   return _VSTD::__vformat_to(_VSTD::move(__out_it), _VSTD::move(__loc), __fmt,
                              __args);
 }
+#endif
 
 template <output_iterator<const char&> _OutIt, class... _Args>
 _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT _OutIt format_to(
@@ -646,6 +667,7 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT _OutIt format_to(
       _VSTD::make_format_args<basic_format_context<_OutIt, char>>(__args...));
 }
 
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 template <output_iterator<const wchar_t&> _OutIt, class... _Args>
 _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT _OutIt format_to(
     _OutIt __out_it, locale __loc, wstring_view __fmt, const _Args&... __args) {
@@ -654,6 +676,7 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT _OutIt format_to(
       _VSTD::make_format_args<basic_format_context<_OutIt, wchar_t>>(
           __args...));
 }
+#endif
 
 inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT string
 vformat(locale __loc, string_view __fmt, format_args __args) {
@@ -663,6 +686,7 @@ vformat(locale __loc, string_view __fmt, format_args __args) {
   return __res;
 }
 
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT wstring
 vformat(locale __loc, wstring_view __fmt, wformat_args __args) {
   wstring __res;
@@ -670,6 +694,7 @@ vformat(locale __loc, wstring_view __fmt, wformat_args __args) {
                     __args);
   return __res;
 }
+#endif
 
 template <class... _Args>
 _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT string
@@ -678,12 +703,14 @@ format(locale __loc, string_view __fmt, const _Args&... __args) {
                         _VSTD::make_format_args(__args...));
 }
 
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 template <class... _Args>
 _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT wstring
 format(locale __loc, wstring_view __fmt, const _Args&... __args) {
   return _VSTD::vformat(_VSTD::move(__loc), __fmt,
                         _VSTD::make_wformat_args(__args...));
 }
+#endif
 
 template <output_iterator<const char&> _OutIt, class... _Args>
 _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT format_to_n_result<_OutIt>
@@ -699,6 +726,7 @@ format_to_n(_OutIt __out_it, iter_
diff erence_t<_OutIt> __n, locale __loc,
   return {_VSTD::move(__out_it), __s};
 }
 
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 template <output_iterator<const wchar_t&> _OutIt, class... _Args>
 _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT format_to_n_result<_OutIt>
 format_to_n(_OutIt __out_it, iter_
diff erence_t<_OutIt> __n, locale __loc,
@@ -712,6 +740,7 @@ format_to_n(_OutIt __out_it, iter_
diff erence_t<_OutIt> __n, locale __loc,
   __out_it = _VSTD::copy_n(__str.begin(), __m, _VSTD::move(__out_it));
   return {_VSTD::move(__out_it), __s};
 }
+#endif
 
 template <class... _Args>
 _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT size_t
@@ -722,6 +751,7 @@ formatted_size(locale __loc, string_view __fmt, const _Args&... __args) {
       .size();
 }
 
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 template <class... _Args>
 _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT size_t
 formatted_size(locale __loc, wstring_view __fmt, const _Args&... __args) {
@@ -730,6 +760,7 @@ formatted_size(locale __loc, wstring_view __fmt, const _Args&... __args) {
                         _VSTD::make_wformat_args(__args...))
       .size();
 }
+#endif
 
 #endif // _LIBCPP_HAS_NO_LOCALIZATION
 

diff  --git a/libcxx/include/iosfwd b/libcxx/include/iosfwd
index 974cb427deadc..099b60e85d607 100644
--- a/libcxx/include/iosfwd
+++ b/libcxx/include/iosfwd
@@ -95,7 +95,7 @@ using u32streampos = fpos<char_traits<char32_t>::state_type>;
 */
 
 #include <__config>
-#include <wchar.h>  // for mbstate_t
+#include <__mbstate_t.h>
 
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
@@ -112,7 +112,9 @@ template<> struct char_traits<char8_t>;
 #endif
 template<> struct char_traits<char16_t>;
 template<> struct char_traits<char32_t>;
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 template<> struct char_traits<wchar_t>;
+#endif
 
 template<class _Tp>     class _LIBCPP_TEMPLATE_VIS allocator;
 
@@ -156,7 +158,9 @@ template <class _CharT, class _Traits = char_traits<_CharT> >
     class _LIBCPP_TEMPLATE_VIS ostreambuf_iterator;
 
 typedef basic_ios<char>              ios;
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 typedef basic_ios<wchar_t>           wios;
+#endif
 
 typedef basic_streambuf<char>        streambuf;
 typedef basic_istream<char>          istream;
@@ -173,6 +177,7 @@ typedef basic_ifstream<char>         ifstream;
 typedef basic_ofstream<char>         ofstream;
 typedef basic_fstream<char>          fstream;
 
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 typedef basic_streambuf<wchar_t>     wstreambuf;
 typedef basic_istream<wchar_t>       wistream;
 typedef basic_ostream<wchar_t>       wostream;
@@ -187,36 +192,37 @@ typedef basic_filebuf<wchar_t>       wfilebuf;
 typedef basic_ifstream<wchar_t>      wifstream;
 typedef basic_ofstream<wchar_t>      wofstream;
 typedef basic_fstream<wchar_t>       wfstream;
+#endif
 
 template <class _CharT, class _Traits>
-    class _LIBCPP_PREFERRED_NAME(ios) _LIBCPP_PREFERRED_NAME(wios) basic_ios;
+    class _LIBCPP_PREFERRED_NAME(ios) _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wios)) basic_ios;
 
 template <class _CharT, class _Traits>
-    class _LIBCPP_PREFERRED_NAME(streambuf) _LIBCPP_PREFERRED_NAME(wstreambuf) basic_streambuf;
+    class _LIBCPP_PREFERRED_NAME(streambuf) _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wstreambuf)) basic_streambuf;
 template <class _CharT, class _Traits>
-    class _LIBCPP_PREFERRED_NAME(istream) _LIBCPP_PREFERRED_NAME(wistream) basic_istream;
+    class _LIBCPP_PREFERRED_NAME(istream) _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wistream)) basic_istream;
 template <class _CharT, class _Traits>
-    class _LIBCPP_PREFERRED_NAME(ostream) _LIBCPP_PREFERRED_NAME(wostream) basic_ostream;
+    class _LIBCPP_PREFERRED_NAME(ostream) _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wostream)) basic_ostream;
 template <class _CharT, class _Traits>
-    class _LIBCPP_PREFERRED_NAME(iostream) _LIBCPP_PREFERRED_NAME(wiostream) basic_iostream;
+    class _LIBCPP_PREFERRED_NAME(iostream) _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wiostream)) basic_iostream;
 
 template <class _CharT, class _Traits, class _Allocator>
-    class _LIBCPP_PREFERRED_NAME(stringbuf) _LIBCPP_PREFERRED_NAME(wstringbuf) basic_stringbuf;
+    class _LIBCPP_PREFERRED_NAME(stringbuf) _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wstringbuf)) basic_stringbuf;
 template <class _CharT, class _Traits, class _Allocator>
-    class _LIBCPP_PREFERRED_NAME(istringstream) _LIBCPP_PREFERRED_NAME(wistringstream) basic_istringstream;
+    class _LIBCPP_PREFERRED_NAME(istringstream) _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wistringstream)) basic_istringstream;
 template <class _CharT, class _Traits, class _Allocator>
-    class _LIBCPP_PREFERRED_NAME(ostringstream) _LIBCPP_PREFERRED_NAME(wostringstream) basic_ostringstream;
+    class _LIBCPP_PREFERRED_NAME(ostringstream) _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wostringstream)) basic_ostringstream;
 template <class _CharT, class _Traits, class _Allocator>
-    class _LIBCPP_PREFERRED_NAME(stringstream) _LIBCPP_PREFERRED_NAME(wstringstream) basic_stringstream;
+    class _LIBCPP_PREFERRED_NAME(stringstream) _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wstringstream)) basic_stringstream;
 
 template <class _CharT, class _Traits>
-    class _LIBCPP_PREFERRED_NAME(filebuf) _LIBCPP_PREFERRED_NAME(wfilebuf) basic_filebuf;
+    class _LIBCPP_PREFERRED_NAME(filebuf) _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wfilebuf)) basic_filebuf;
 template <class _CharT, class _Traits>
-    class _LIBCPP_PREFERRED_NAME(ifstream) _LIBCPP_PREFERRED_NAME(wifstream) basic_ifstream;
+    class _LIBCPP_PREFERRED_NAME(ifstream) _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wifstream)) basic_ifstream;
 template <class _CharT, class _Traits>
-    class _LIBCPP_PREFERRED_NAME(ofstream) _LIBCPP_PREFERRED_NAME(wofstream) basic_ofstream;
+    class _LIBCPP_PREFERRED_NAME(ofstream) _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wofstream)) basic_ofstream;
 template <class _CharT, class _Traits>
-    class _LIBCPP_PREFERRED_NAME(fstream) _LIBCPP_PREFERRED_NAME(wfstream) basic_fstream;
+    class _LIBCPP_PREFERRED_NAME(fstream) _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wfstream)) basic_fstream;
 
 template <class _State>             class _LIBCPP_TEMPLATE_VIS fpos;
 typedef fpos<mbstate_t>    streampos;
@@ -241,10 +247,12 @@ template <class _CharT,             // for <stdexcept>
           class _Allocator = allocator<_CharT> >
     class _LIBCPP_TEMPLATE_VIS basic_string;
 typedef basic_string<char, char_traits<char>, allocator<char> > string;
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 typedef basic_string<wchar_t, char_traits<wchar_t>, allocator<wchar_t> > wstring;
+#endif
 
 template <class _CharT, class _Traits, class _Allocator>
-    class _LIBCPP_PREFERRED_NAME(string) _LIBCPP_PREFERRED_NAME(wstring) basic_string;
+    class _LIBCPP_PREFERRED_NAME(string) _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wstring)) basic_string;
 
 // Include other forward declarations here
 template <class _Tp, class _Alloc = allocator<_Tp> >

diff  --git a/libcxx/include/iostream b/libcxx/include/iostream
index 788cfe1c61067..f88f01315375a 100644
--- a/libcxx/include/iostream
+++ b/libcxx/include/iostream
@@ -46,13 +46,16 @@ extern wostream wclog;
 _LIBCPP_BEGIN_NAMESPACE_STD
 
 extern _LIBCPP_FUNC_VIS istream cin;
-extern _LIBCPP_FUNC_VIS wistream wcin;
 extern _LIBCPP_FUNC_VIS ostream cout;
-extern _LIBCPP_FUNC_VIS wostream wcout;
 extern _LIBCPP_FUNC_VIS ostream cerr;
-extern _LIBCPP_FUNC_VIS wostream wcerr;
 extern _LIBCPP_FUNC_VIS ostream clog;
+
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+extern _LIBCPP_FUNC_VIS wistream wcin;
+extern _LIBCPP_FUNC_VIS wostream wcout;
+extern _LIBCPP_FUNC_VIS wostream wcerr;
 extern _LIBCPP_FUNC_VIS wostream wclog;
+#endif
 
 _LIBCPP_END_NAMESPACE_STD
 

diff  --git a/libcxx/include/istream b/libcxx/include/istream
index 17ca68388f523..6fb296f820f3e 100644
--- a/libcxx/include/istream
+++ b/libcxx/include/istream
@@ -1628,7 +1628,9 @@ operator>>(basic_istream<_CharT, _Traits>& __is, bitset<_Size>& __x)
 }
 
 _LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_istream<char>)
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 _LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_istream<wchar_t>)
+#endif
 _LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_iostream<char>)
 
 _LIBCPP_END_NAMESPACE_STD

diff  --git a/libcxx/include/locale b/libcxx/include/locale
index 25cafdd35db3a..c20e15f3e750b 100644
--- a/libcxx/include/locale
+++ b/libcxx/include/locale
@@ -573,7 +573,9 @@ __num_get<_CharT>::__stage2_float_loop(_CharT __ct, bool& __in_units, char& __ex
 }
 
 _LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(struct _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __num_get<char>)
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 _LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(struct _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __num_get<wchar_t>)
+#endif
 
 template <class _CharT, class _InputIterator = istreambuf_iterator<_CharT> >
 class _LIBCPP_TEMPLATE_VIS num_get
@@ -1111,7 +1113,9 @@ num_get<_CharT, _InputIterator>::do_get(iter_type __b, iter_type __e,
 }
 
 _LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS num_get<char>)
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 _LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS num_get<wchar_t>)
+#endif
 
 struct _LIBCPP_TYPE_VIS __num_put_base
 {
@@ -1261,7 +1265,9 @@ __num_put<_CharT>::__widen_and_group_float(char* __nb, char* __np, char* __ne,
 }
 
 _LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(struct _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __num_put<char>)
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 _LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(struct _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __num_put<wchar_t>)
+#endif
 
 template <class _CharT, class _OutputIterator = ostreambuf_iterator<_CharT> >
 class _LIBCPP_TEMPLATE_VIS num_put
@@ -1694,7 +1700,9 @@ num_put<_CharT, _OutputIterator>::do_put(iter_type __s, ios_base& __iob,
 }
 
 _LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS num_put<char>)
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 _LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS num_put<wchar_t>)
+#endif
 
 template <class _CharT, class _InputIterator>
 _LIBCPP_HIDDEN
@@ -1761,6 +1769,7 @@ template <> _LIBCPP_FUNC_VIS const string& __time_get_c_storage<char>::__r() con
 template <> _LIBCPP_FUNC_VIS const string& __time_get_c_storage<char>::__x() const;
 template <> _LIBCPP_FUNC_VIS const string& __time_get_c_storage<char>::__X() const;
 
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 template <> _LIBCPP_FUNC_VIS const wstring* __time_get_c_storage<wchar_t>::__weeks() const;
 template <> _LIBCPP_FUNC_VIS const wstring* __time_get_c_storage<wchar_t>::__months() const;
 template <> _LIBCPP_FUNC_VIS const wstring* __time_get_c_storage<wchar_t>::__am_pm() const;
@@ -1768,6 +1777,7 @@ template <> _LIBCPP_FUNC_VIS const wstring& __time_get_c_storage<wchar_t>::__c()
 template <> _LIBCPP_FUNC_VIS const wstring& __time_get_c_storage<wchar_t>::__r() const;
 template <> _LIBCPP_FUNC_VIS const wstring& __time_get_c_storage<wchar_t>::__x() const;
 template <> _LIBCPP_FUNC_VIS const wstring& __time_get_c_storage<wchar_t>::__X() const;
+#endif
 
 template <class _CharT, class _InputIterator = istreambuf_iterator<_CharT> >
 class _LIBCPP_TEMPLATE_VIS time_get
@@ -2380,7 +2390,9 @@ time_get<_CharT, _InputIterator>::do_get(iter_type __b, iter_type __e,
 }
 
 _LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS time_get<char>)
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 _LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS time_get<wchar_t>)
+#endif
 
 class _LIBCPP_TYPE_VIS __time_get
 {
@@ -2480,7 +2492,9 @@ private:
 };
 
 _LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS time_get_byname<char>)
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 _LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS time_get_byname<wchar_t>)
+#endif
 
 class _LIBCPP_TYPE_VIS __time_put
 {
@@ -2593,7 +2607,9 @@ time_put<_CharT, _OutputIterator>::do_put(iter_type __s, ios_base&,
 }
 
 _LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS time_put<char>)
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 _LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS time_put<wchar_t>)
+#endif
 
 template <class _CharT, class _OutputIterator = ostreambuf_iterator<_CharT> >
 class _LIBCPP_TEMPLATE_VIS time_put_byname
@@ -2614,7 +2630,9 @@ protected:
 };
 
 _LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS time_put_byname<char>)
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 _LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS time_put_byname<wchar_t>)
+#endif
 
 // money_base
 
@@ -2682,8 +2700,10 @@ moneypunct<_CharT, _International>::intl;
 
 _LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS moneypunct<char, false>)
 _LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS moneypunct<char, true>)
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 _LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS moneypunct<wchar_t, false>)
 _LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS moneypunct<wchar_t, true>)
+#endif
 
 // moneypunct_byname
 
@@ -2734,13 +2754,15 @@ private:
 
 template<> _LIBCPP_FUNC_VIS void moneypunct_byname<char, false>::init(const char*);
 template<> _LIBCPP_FUNC_VIS void moneypunct_byname<char, true>::init(const char*);
-template<> _LIBCPP_FUNC_VIS void moneypunct_byname<wchar_t, false>::init(const char*);
-template<> _LIBCPP_FUNC_VIS void moneypunct_byname<wchar_t, true>::init(const char*);
-
 _LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS moneypunct_byname<char, false>)
 _LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS moneypunct_byname<char, true>)
+
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+template<> _LIBCPP_FUNC_VIS void moneypunct_byname<wchar_t, false>::init(const char*);
+template<> _LIBCPP_FUNC_VIS void moneypunct_byname<wchar_t, true>::init(const char*);
 _LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS moneypunct_byname<wchar_t, false>)
 _LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS moneypunct_byname<wchar_t, true>)
+#endif
 
 // money_get
 
@@ -2797,7 +2819,9 @@ __money_get<_CharT>::__gather_info(bool __intl, const locale& __loc,
 }
 
 _LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __money_get<char>)
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 _LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __money_get<wchar_t>)
+#endif
 
 template <class _CharT, class _InputIterator = istreambuf_iterator<_CharT> >
 class _LIBCPP_TEMPLATE_VIS money_get
@@ -3184,7 +3208,9 @@ money_get<_CharT, _InputIterator>::do_get(iter_type __b, iter_type __e,
 }
 
 _LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS money_get<char>)
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 _LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS money_get<wchar_t>)
+#endif
 
 // money_put
 
@@ -3359,7 +3385,9 @@ __money_put<_CharT>::__format(char_type* __mb, char_type*& __mi, char_type*& __m
 }
 
 _LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __money_put<char>)
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 _LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __money_put<wchar_t>)
+#endif
 
 template <class _CharT, class _OutputIterator = ostreambuf_iterator<_CharT> >
 class _LIBCPP_TEMPLATE_VIS money_put
@@ -3512,7 +3540,9 @@ money_put<_CharT, _OutputIterator>::do_put(iter_type __s, bool __intl,
 }
 
 _LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS money_put<char>)
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 _LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS money_put<wchar_t>)
+#endif
 
 // messages
 
@@ -3628,7 +3658,9 @@ messages<_CharT>::do_close(catalog __c) const
 }
 
 _LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS messages<char>)
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 _LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS messages<wchar_t>)
+#endif
 
 template <class _CharT>
 class _LIBCPP_TEMPLATE_VIS messages_byname
@@ -3652,7 +3684,9 @@ protected:
 };
 
 _LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS messages_byname<char>)
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 _LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS messages_byname<wchar_t>)
+#endif
 
 template<class _Codecvt, class _Elem = wchar_t,
          class _Wide_alloc = allocator<_Elem>,

diff  --git a/libcxx/include/module.modulemap b/libcxx/include/module.modulemap
index d8049cb3854fc..80cdfe323f7e2 100644
--- a/libcxx/include/module.modulemap
+++ b/libcxx/include/module.modulemap
@@ -869,6 +869,7 @@ module std [system] {
   module __function_like     { private header "__function_like.h"   export * }
   module __hash_table        { header "__hash_table"        export * }
   module __locale            { private header "__locale"            export * }
+  module __mbstate           { private header "__mbstate_t.h"       export * }
   module __mutex_base        { private header "__mutex_base"        export * }
   module __node_handle       { private header "__node_handle"       export * }
   module __nullptr           { header "__nullptr"           export * }

diff  --git a/libcxx/include/ostream b/libcxx/include/ostream
index efeaee253eb97..e0aa18fa4818e 100644
--- a/libcxx/include/ostream
+++ b/libcxx/include/ostream
@@ -1087,7 +1087,9 @@ operator<<(basic_ostream<_CharT, _Traits>& __os, const bitset<_Size>& __x)
 }
 
 _LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_ostream<char>)
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 _LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_ostream<wchar_t>)
+#endif
 
 _LIBCPP_END_NAMESPACE_STD
 

diff  --git a/libcxx/include/regex b/libcxx/include/regex
index a0bf3e2f732b8..c0d1edac5ef1c 100644
--- a/libcxx/include/regex
+++ b/libcxx/include/regex
@@ -1072,32 +1072,38 @@ private:
     template <class _ForwardIterator>
         string_type
         __transform_primary(_ForwardIterator __f, _ForwardIterator __l, char) const;
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
     template <class _ForwardIterator>
         string_type
         __transform_primary(_ForwardIterator __f, _ForwardIterator __l, wchar_t) const;
-
+#endif
     template <class _ForwardIterator>
         string_type
         __lookup_collatename(_ForwardIterator __f, _ForwardIterator __l, char) const;
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
     template <class _ForwardIterator>
         string_type
         __lookup_collatename(_ForwardIterator __f, _ForwardIterator __l, wchar_t) const;
-
+#endif
     template <class _ForwardIterator>
         char_class_type
         __lookup_classname(_ForwardIterator __f, _ForwardIterator __l,
                            bool __icase, char) const;
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
     template <class _ForwardIterator>
         char_class_type
         __lookup_classname(_ForwardIterator __f, _ForwardIterator __l,
                            bool __icase, wchar_t) const;
+#endif
 
     static int __regex_traits_value(unsigned char __ch, int __radix);
     _LIBCPP_INLINE_VISIBILITY
     int __regex_traits_value(char __ch, int __radix) const
         {return __regex_traits_value(static_cast<unsigned char>(__ch), __radix);}
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
     _LIBCPP_INLINE_VISIBILITY
     int __regex_traits_value(wchar_t __ch, int __radix) const;
+#endif
 };
 
 template <class _CharT>
@@ -1168,6 +1174,7 @@ regex_traits<_CharT>::__transform_primary(_ForwardIterator __f,
     return __d;
 }
 
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 template <class _CharT>
 template <class _ForwardIterator>
 typename regex_traits<_CharT>::string_type
@@ -1189,6 +1196,7 @@ regex_traits<_CharT>::__transform_primary(_ForwardIterator __f,
     }
     return __d;
 }
+#endif
 
 // lookup_collatename is very FreeBSD-specific
 
@@ -1217,6 +1225,7 @@ regex_traits<_CharT>::__lookup_collatename(_ForwardIterator __f,
     return __r;
 }
 
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 template <class _CharT>
 template <class _ForwardIterator>
 typename regex_traits<_CharT>::string_type
@@ -1250,6 +1259,7 @@ regex_traits<_CharT>::__lookup_collatename(_ForwardIterator __f,
     }
     return __r;
 }
+#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
 
 // lookup_classname
 
@@ -1268,6 +1278,7 @@ regex_traits<_CharT>::__lookup_classname(_ForwardIterator __f,
     return __get_classname(__s.c_str(), __icase);
 }
 
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 template <class _CharT>
 template <class _ForwardIterator>
 typename regex_traits<_CharT>::char_class_type
@@ -1288,6 +1299,7 @@ regex_traits<_CharT>::__lookup_classname(_ForwardIterator __f,
     }
     return __get_classname(__n.c_str(), __icase);
 }
+#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
 
 template <class _CharT>
 bool
@@ -1318,6 +1330,7 @@ regex_traits<_CharT>::__regex_traits_value(unsigned char __ch, int __radix)
     return -1;
 }
 
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 template <class _CharT>
 inline
 int
@@ -1325,6 +1338,7 @@ regex_traits<_CharT>::__regex_traits_value(wchar_t __ch, int __radix) const
 {
     return __regex_traits_value(static_cast<unsigned char>(__ct_->narrow(__ch, char_type())), __radix);
 }
+#endif
 
 template <class _CharT> class __node;
 
@@ -2135,7 +2149,9 @@ public:
 };
 
 template <> _LIBCPP_FUNC_VIS void __match_any_but_newline<char>::__exec(__state&) const;
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 template <> _LIBCPP_FUNC_VIS void __match_any_but_newline<wchar_t>::__exec(__state&) const;
+#endif
 
 // __match_char
 
@@ -2542,13 +2558,15 @@ template <class _CharT, class _Traits = regex_traits<_CharT> >
     class _LIBCPP_TEMPLATE_VIS basic_regex;
 
 typedef basic_regex<char>    regex;
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 typedef basic_regex<wchar_t> wregex;
+#endif
 
 template <class _CharT, class _Traits>
 class
     _LIBCPP_TEMPLATE_VIS
     _LIBCPP_PREFERRED_NAME(regex)
-    _LIBCPP_PREFERRED_NAME(wregex)
+    _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wregex))
     basic_regex
 {
 public:
@@ -4897,17 +4915,19 @@ basic_regex<_CharT, _Traits>::__push_lookahead(const basic_regex& __exp,
 // sub_match
 
 typedef sub_match<const char*>             csub_match;
-typedef sub_match<const wchar_t*>          wcsub_match;
 typedef sub_match<string::const_iterator>  ssub_match;
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+typedef sub_match<const wchar_t*>          wcsub_match;
 typedef sub_match<wstring::const_iterator> wssub_match;
+#endif
 
 template <class _BidirectionalIterator>
 class
     _LIBCPP_TEMPLATE_VIS
     _LIBCPP_PREFERRED_NAME(csub_match)
-    _LIBCPP_PREFERRED_NAME(wcsub_match)
+    _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wcsub_match))
     _LIBCPP_PREFERRED_NAME(ssub_match)
-    _LIBCPP_PREFERRED_NAME(wssub_match)
+    _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wssub_match))
     sub_match
     : public pair<_BidirectionalIterator, _BidirectionalIterator>
 {
@@ -5326,17 +5346,19 @@ operator<<(basic_ostream<_CharT, _ST>& __os, const sub_match<_BiIter>& __m)
 }
 
 typedef match_results<const char*>             cmatch;
-typedef match_results<const wchar_t*>          wcmatch;
 typedef match_results<string::const_iterator>  smatch;
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+typedef match_results<const wchar_t*>          wcmatch;
 typedef match_results<wstring::const_iterator> wsmatch;
+#endif
 
 template <class _BidirectionalIterator, class _Allocator>
 class
     _LIBCPP_TEMPLATE_VIS
     _LIBCPP_PREFERRED_NAME(cmatch)
-    _LIBCPP_PREFERRED_NAME(wcmatch)
+    _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wcmatch))
     _LIBCPP_PREFERRED_NAME(smatch)
-    _LIBCPP_PREFERRED_NAME(wsmatch)
+    _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wsmatch))
     match_results
 {
 public:
@@ -6244,17 +6266,19 @@ template <class _BidirectionalIterator,
     class _LIBCPP_TEMPLATE_VIS regex_iterator;
 
 typedef regex_iterator<const char*>             cregex_iterator;
-typedef regex_iterator<const wchar_t*>          wcregex_iterator;
 typedef regex_iterator<string::const_iterator>  sregex_iterator;
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+typedef regex_iterator<const wchar_t*>          wcregex_iterator;
 typedef regex_iterator<wstring::const_iterator> wsregex_iterator;
+#endif
 
 template <class _BidirectionalIterator, class _CharT, class _Traits>
 class
     _LIBCPP_TEMPLATE_VIS
     _LIBCPP_PREFERRED_NAME(cregex_iterator)
-    _LIBCPP_PREFERRED_NAME(wcregex_iterator)
+    _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wcregex_iterator))
     _LIBCPP_PREFERRED_NAME(sregex_iterator)
-    _LIBCPP_PREFERRED_NAME(wsregex_iterator)
+    _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wsregex_iterator))
     regex_iterator
 {
 public:
@@ -6372,17 +6396,19 @@ template <class _BidirectionalIterator,
     class _LIBCPP_TEMPLATE_VIS regex_token_iterator;
 
 typedef regex_token_iterator<const char*>             cregex_token_iterator;
-typedef regex_token_iterator<const wchar_t*>          wcregex_token_iterator;
 typedef regex_token_iterator<string::const_iterator>  sregex_token_iterator;
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+typedef regex_token_iterator<const wchar_t*>          wcregex_token_iterator;
 typedef regex_token_iterator<wstring::const_iterator> wsregex_token_iterator;
+#endif
 
 template <class _BidirectionalIterator, class _CharT, class _Traits>
 class
     _LIBCPP_TEMPLATE_VIS
     _LIBCPP_PREFERRED_NAME(cregex_token_iterator)
-    _LIBCPP_PREFERRED_NAME(wcregex_token_iterator)
+    _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wcregex_token_iterator))
     _LIBCPP_PREFERRED_NAME(sregex_token_iterator)
-    _LIBCPP_PREFERRED_NAME(wsregex_token_iterator)
+    _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wsregex_token_iterator))
     regex_token_iterator
 {
 public:

diff  --git a/libcxx/include/string b/libcxx/include/string
index c6a799dbc7e89..53b4e09b68f34 100644
--- a/libcxx/include/string
+++ b/libcxx/include/string
@@ -524,7 +524,6 @@ basic_string<char32_t> operator "" s( const char32_t *str, size_t len ); // C++1
 #include <cstdio>  // EOF
 #include <cstdlib>
 #include <cstring>
-#include <cwchar>
 #include <initializer_list>
 #include <iosfwd>
 #include <iterator>
@@ -535,6 +534,10 @@ basic_string<char32_t> operator "" s( const char32_t *str, size_t len ); // C++1
 #include <utility>
 #include <version>
 
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+#   include <cwchar>
+#endif
+
 #ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
 # include <cstdint>
 #endif
@@ -1729,11 +1732,15 @@ private:
 // These declarations must appear before any functions are implicitly used
 // so that they have the correct visibility specifier.
 #ifdef _LIBCPP_ABI_STRING_OPTIMIZED_EXTERNAL_INSTANTIATION
-_LIBCPP_STRING_UNSTABLE_EXTERN_TEMPLATE_LIST(_LIBCPP_EXTERN_TEMPLATE, char)
-_LIBCPP_STRING_UNSTABLE_EXTERN_TEMPLATE_LIST(_LIBCPP_EXTERN_TEMPLATE, wchar_t)
+    _LIBCPP_STRING_UNSTABLE_EXTERN_TEMPLATE_LIST(_LIBCPP_EXTERN_TEMPLATE, char)
+#   ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+        _LIBCPP_STRING_UNSTABLE_EXTERN_TEMPLATE_LIST(_LIBCPP_EXTERN_TEMPLATE, wchar_t)
+#   endif
 #else
-_LIBCPP_STRING_V1_EXTERN_TEMPLATE_LIST(_LIBCPP_EXTERN_TEMPLATE, char)
-_LIBCPP_STRING_V1_EXTERN_TEMPLATE_LIST(_LIBCPP_EXTERN_TEMPLATE, wchar_t)
+    _LIBCPP_STRING_V1_EXTERN_TEMPLATE_LIST(_LIBCPP_EXTERN_TEMPLATE, char)
+#   ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+        _LIBCPP_STRING_V1_EXTERN_TEMPLATE_LIST(_LIBCPP_EXTERN_TEMPLATE, wchar_t)
+#   endif
 #endif
 
 
@@ -4395,6 +4402,7 @@ _LIBCPP_FUNC_VIS string to_string(float __val);
 _LIBCPP_FUNC_VIS string to_string(double __val);
 _LIBCPP_FUNC_VIS string to_string(long double __val);
 
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 _LIBCPP_FUNC_VIS int                stoi  (const wstring& __str, size_t* __idx = nullptr, int __base = 10);
 _LIBCPP_FUNC_VIS long               stol  (const wstring& __str, size_t* __idx = nullptr, int __base = 10);
 _LIBCPP_FUNC_VIS unsigned long      stoul (const wstring& __str, size_t* __idx = nullptr, int __base = 10);
@@ -4414,6 +4422,7 @@ _LIBCPP_FUNC_VIS wstring to_wstring(unsigned long long __val);
 _LIBCPP_FUNC_VIS wstring to_wstring(float __val);
 _LIBCPP_FUNC_VIS wstring to_wstring(double __val);
 _LIBCPP_FUNC_VIS wstring to_wstring(long double __val);
+#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
 
 template<class _CharT, class _Traits, class _Allocator>
 _LIBCPP_TEMPLATE_DATA_VIS
@@ -4535,11 +4544,13 @@ inline namespace literals
         return basic_string<char> (__str, __len);
     }
 
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
     inline _LIBCPP_INLINE_VISIBILITY
     basic_string<wchar_t> operator "" s( const wchar_t *__str, size_t __len )
     {
         return basic_string<wchar_t> (__str, __len);
     }
+#endif
 
 #ifndef _LIBCPP_HAS_NO_CHAR8_T
     inline _LIBCPP_INLINE_VISIBILITY

diff  --git a/libcxx/include/string_view b/libcxx/include/string_view
index 45bb7654930db..b9d00b33baefe 100644
--- a/libcxx/include/string_view
+++ b/libcxx/include/string_view
@@ -225,7 +225,9 @@ typedef basic_string_view<char8_t>  u8string_view;
 #endif
 typedef basic_string_view<char16_t> u16string_view;
 typedef basic_string_view<char32_t> u32string_view;
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 typedef basic_string_view<wchar_t>  wstring_view;
+#endif
 
 template<class _CharT, class _Traits>
 class
@@ -235,7 +237,7 @@ class
 #endif
     _LIBCPP_PREFERRED_NAME(u16string_view)
     _LIBCPP_PREFERRED_NAME(u32string_view)
-    _LIBCPP_PREFERRED_NAME(wstring_view)
+    _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wstring_view))
     basic_string_view {
 public:
     // types
@@ -885,11 +887,13 @@ inline namespace literals
         return basic_string_view<char> (__str, __len);
     }
 
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
     inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
     basic_string_view<wchar_t> operator "" sv(const wchar_t *__str, size_t __len) _NOEXCEPT
     {
         return basic_string_view<wchar_t> (__str, __len);
     }
+#endif
 
 #ifndef _LIBCPP_HAS_NO_CHAR8_T
     inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR

diff  --git a/libcxx/include/wchar.h b/libcxx/include/wchar.h
index 4d391f9ebd0a3..0802640015831 100644
--- a/libcxx/include/wchar.h
+++ b/libcxx/include/wchar.h
@@ -108,6 +108,10 @@ size_t wcsrtombs(char* restrict dst, const wchar_t** restrict src, size_t len,
 #include <__config>
 #include <stddef.h>
 
+#if defined(_LIBCPP_HAS_NO_WIDE_CHARACTERS)
+#   error "The <wchar.h> header is not supported since libc++ has been configured with LIBCXX_ENABLE_WIDE_CHARACTERS disabled"
+#endif
+
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
 #endif

diff  --git a/libcxx/include/wctype.h b/libcxx/include/wctype.h
index 3b614759ac6d1..8dd82327c915c 100644
--- a/libcxx/include/wctype.h
+++ b/libcxx/include/wctype.h
@@ -46,6 +46,10 @@ wctrans_t wctrans(const char* property);
 
 #include <__config>
 
+#if defined(_LIBCPP_HAS_NO_WIDE_CHARACTERS)
+#   error "The <wctype.h> header is not supported since libc++ has been configured with LIBCXX_ENABLE_WIDE_CHARACTERS disabled"
+#endif
+
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
 #endif

diff  --git a/libcxx/src/algorithm.cpp b/libcxx/src/algorithm.cpp
index 9f11dc38b15b4..16221f4b75156 100644
--- a/libcxx/src/algorithm.cpp
+++ b/libcxx/src/algorithm.cpp
@@ -11,7 +11,9 @@
 _LIBCPP_BEGIN_NAMESPACE_STD
 
 template void __sort<__less<char>&, char*>(char*, char*, __less<char>&);
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 template void __sort<__less<wchar_t>&, wchar_t*>(wchar_t*, wchar_t*, __less<wchar_t>&);
+#endif
 template void __sort<__less<signed char>&, signed char*>(signed char*, signed char*, __less<signed char>&);
 template void __sort<__less<unsigned char>&, unsigned char*>(unsigned char*, unsigned char*, __less<unsigned char>&);
 template void __sort<__less<short>&, short*>(short*, short*, __less<short>&);
@@ -27,7 +29,9 @@ template void __sort<__less<double>&, double*>(double*, double*, __less<double>&
 template void __sort<__less<long double>&, long double*>(long double*, long double*, __less<long double>&);
 
 template bool __insertion_sort_incomplete<__less<char>&, char*>(char*, char*, __less<char>&);
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 template bool __insertion_sort_incomplete<__less<wchar_t>&, wchar_t*>(wchar_t*, wchar_t*, __less<wchar_t>&);
+#endif
 template bool __insertion_sort_incomplete<__less<signed char>&, signed char*>(signed char*, signed char*, __less<signed char>&);
 template bool __insertion_sort_incomplete<__less<unsigned char>&, unsigned char*>(unsigned char*, unsigned char*, __less<unsigned char>&);
 template bool __insertion_sort_incomplete<__less<short>&, short*>(short*, short*, __less<short>&);

diff  --git a/libcxx/src/ios.instantiations.cpp b/libcxx/src/ios.instantiations.cpp
index 1a23687d128de..e1189d0b5bd97 100644
--- a/libcxx/src/ios.instantiations.cpp
+++ b/libcxx/src/ios.instantiations.cpp
@@ -19,15 +19,18 @@ _LIBCPP_BEGIN_NAMESPACE_STD
 
 // Original explicit instantiations provided in the library
 template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_ios<char>;
-template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_ios<wchar_t>;
 template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_streambuf<char>;
-template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_streambuf<wchar_t>;
 template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_istream<char>;
-template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_istream<wchar_t>;
 template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_ostream<char>;
-template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_ostream<wchar_t>;
 template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_iostream<char>;
 
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_ios<wchar_t>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_streambuf<wchar_t>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_istream<wchar_t>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_ostream<wchar_t>;
+#endif
+
 // Additional instantiations added later. Whether programs rely on these being
 // available is protected by _LIBCPP_ABI_ENABLE_ADDITIONAL_IOSTREAM_EXPLICIT_INSTANTIATIONS_1.
 template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_stringbuf<char>;

diff  --git a/libcxx/src/iostream.cpp b/libcxx/src/iostream.cpp
index 99bd5288842a9..61d5e54c411b0 100644
--- a/libcxx/src/iostream.cpp
+++ b/libcxx/src/iostream.cpp
@@ -24,6 +24,8 @@ __asm__("?cin@" _LIBCPP_ABI_NAMESPACE_STR "@std@@3V?$basic_istream at DU?$char_trai
 ;
 _ALIGNAS_TYPE (__stdinbuf<char> ) static char __cin[sizeof(__stdinbuf <char>)];
 static mbstate_t mb_cin;
+
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 _ALIGNAS_TYPE (wistream) _LIBCPP_FUNC_VIS char wcin[sizeof(wistream)]
 #if defined(_LIBCPP_ABI_MICROSOFT) && defined(__clang__)
 __asm__("?wcin@" _LIBCPP_ABI_NAMESPACE_STR "@std@@3V?$basic_istream at _WU?$char_traits at _W@" _LIBCPP_ABI_NAMESPACE_STR "@std@@@12 at A")
@@ -31,6 +33,7 @@ __asm__("?wcin@" _LIBCPP_ABI_NAMESPACE_STR "@std@@3V?$basic_istream at _WU?$char_tr
 ;
 _ALIGNAS_TYPE (__stdinbuf<wchar_t> ) static char __wcin[sizeof(__stdinbuf <wchar_t>)];
 static mbstate_t mb_wcin;
+#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
 
 _ALIGNAS_TYPE (ostream) _LIBCPP_FUNC_VIS char cout[sizeof(ostream)]
 #if defined(_LIBCPP_ABI_MICROSOFT) && defined(__clang__)
@@ -39,6 +42,8 @@ __asm__("?cout@" _LIBCPP_ABI_NAMESPACE_STR "@std@@3V?$basic_ostream at DU?$char_tra
 ;
 _ALIGNAS_TYPE (__stdoutbuf<char>) static char __cout[sizeof(__stdoutbuf<char>)];
 static mbstate_t mb_cout;
+
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 _ALIGNAS_TYPE (wostream) _LIBCPP_FUNC_VIS char wcout[sizeof(wostream)]
 #if defined(_LIBCPP_ABI_MICROSOFT) && defined(__clang__)
 __asm__("?wcout@" _LIBCPP_ABI_NAMESPACE_STR "@std@@3V?$basic_ostream at _WU?$char_traits at _W@" _LIBCPP_ABI_NAMESPACE_STR "@std@@@12 at A")
@@ -46,6 +51,7 @@ __asm__("?wcout@" _LIBCPP_ABI_NAMESPACE_STR "@std@@3V?$basic_ostream at _WU?$char_t
 ;
 _ALIGNAS_TYPE (__stdoutbuf<wchar_t>) static char __wcout[sizeof(__stdoutbuf<wchar_t>)];
 static mbstate_t mb_wcout;
+#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
 
 _ALIGNAS_TYPE (ostream) _LIBCPP_FUNC_VIS char cerr[sizeof(ostream)]
 #if defined(_LIBCPP_ABI_MICROSOFT) && defined(__clang__)
@@ -54,6 +60,8 @@ __asm__("?cerr@" _LIBCPP_ABI_NAMESPACE_STR "@std@@3V?$basic_ostream at DU?$char_tra
 ;
 _ALIGNAS_TYPE (__stdoutbuf<char>) static char __cerr[sizeof(__stdoutbuf<char>)];
 static mbstate_t mb_cerr;
+
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 _ALIGNAS_TYPE (wostream) _LIBCPP_FUNC_VIS char wcerr[sizeof(wostream)]
 #if defined(_LIBCPP_ABI_MICROSOFT) && defined(__clang__)
 __asm__("?wcerr@" _LIBCPP_ABI_NAMESPACE_STR "@std@@3V?$basic_ostream at _WU?$char_traits at _W@" _LIBCPP_ABI_NAMESPACE_STR "@std@@@12 at A")
@@ -61,17 +69,21 @@ __asm__("?wcerr@" _LIBCPP_ABI_NAMESPACE_STR "@std@@3V?$basic_ostream at _WU?$char_t
 ;
 _ALIGNAS_TYPE (__stdoutbuf<wchar_t>) static char __wcerr[sizeof(__stdoutbuf<wchar_t>)];
 static mbstate_t mb_wcerr;
+#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
 
 _ALIGNAS_TYPE (ostream) _LIBCPP_FUNC_VIS char clog[sizeof(ostream)]
 #if defined(_LIBCPP_ABI_MICROSOFT) && defined(__clang__)
 __asm__("?clog@" _LIBCPP_ABI_NAMESPACE_STR "@std@@3V?$basic_ostream at DU?$char_traits at D@" _LIBCPP_ABI_NAMESPACE_STR "@std@@@12 at A")
 #endif
 ;
+
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 _ALIGNAS_TYPE (wostream) _LIBCPP_FUNC_VIS char wclog[sizeof(wostream)]
 #if defined(_LIBCPP_ABI_MICROSOFT) && defined(__clang__)
 __asm__("?wclog@" _LIBCPP_ABI_NAMESPACE_STR "@std@@3V?$basic_ostream at _WU?$char_traits at _W@" _LIBCPP_ABI_NAMESPACE_STR "@std@@@12 at A")
 #endif
 ;
+#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
 
 // Hacky way to make the compiler believe that we're inside a system header so
 // it doesn't flag the use of the init_priority attribute with a value that's
@@ -109,33 +121,38 @@ DoIOSInit::DoIOSInit()
     force_locale_initialization();
 
     istream* cin_ptr  = ::new(cin)  istream(::new(__cin)  __stdinbuf <char>(stdin, &mb_cin));
-    wistream* wcin_ptr  = ::new(wcin)  wistream(::new(__wcin)  __stdinbuf <wchar_t>(stdin, &mb_wcin));
     ostream* cout_ptr = ::new(cout) ostream(::new(__cout) __stdoutbuf<char>(stdout, &mb_cout));
-    wostream* wcout_ptr = ::new(wcout) wostream(::new(__wcout) __stdoutbuf<wchar_t>(stdout, &mb_wcout));
     ostream* cerr_ptr = ::new(cerr) ostream(::new(__cerr) __stdoutbuf<char>(stderr, &mb_cerr));
                         ::new(clog) ostream(cerr_ptr->rdbuf());
+    cin_ptr->tie(cout_ptr);
+    _VSTD::unitbuf(*cerr_ptr);
+    cerr_ptr->tie(cout_ptr);
+
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+    wistream* wcin_ptr  = ::new(wcin)  wistream(::new(__wcin)  __stdinbuf <wchar_t>(stdin, &mb_wcin));
+    wostream* wcout_ptr = ::new(wcout) wostream(::new(__wcout) __stdoutbuf<wchar_t>(stdout, &mb_wcout));
     wostream* wcerr_ptr = ::new(wcerr) wostream(::new(__wcerr) __stdoutbuf<wchar_t>(stderr, &mb_wcerr));
                           ::new(wclog) wostream(wcerr_ptr->rdbuf());
 
-    cin_ptr->tie(cout_ptr);
     wcin_ptr->tie(wcout_ptr);
-    _VSTD::unitbuf(*cerr_ptr);
     _VSTD::unitbuf(*wcerr_ptr);
-    cerr_ptr->tie(cout_ptr);
     wcerr_ptr->tie(wcout_ptr);
+#endif
 }
 
 DoIOSInit::~DoIOSInit()
 {
     ostream* cout_ptr = reinterpret_cast<ostream*>(cout);
-    wostream* wcout_ptr = reinterpret_cast<wostream*>(wcout);
     cout_ptr->flush();
-    wcout_ptr->flush();
-
     ostream* clog_ptr = reinterpret_cast<ostream*>(clog);
-    wostream* wclog_ptr = reinterpret_cast<wostream*>(wclog);
     clog_ptr->flush();
+
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+    wostream* wcout_ptr = reinterpret_cast<wostream*>(wcout);
+    wcout_ptr->flush();
+    wostream* wclog_ptr = reinterpret_cast<wostream*>(wclog);
     wclog_ptr->flush();
+#endif
 }
 
 ios_base::Init::Init()

diff  --git a/libcxx/src/locale.cpp b/libcxx/src/locale.cpp
index 8aa67f7b38a8b..d069b42aed9e7 100644
--- a/libcxx/src/locale.cpp
+++ b/libcxx/src/locale.cpp
@@ -18,13 +18,16 @@
 #include "cstdio"
 #include "cstdlib"
 #include "cstring"
-#include "cwctype"
 #include "locale"
 #include "string"
 #include "type_traits"
 #include "typeinfo"
 #include "vector"
 
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+#   include "cwctype"
+#endif
+
 #if defined(_LIBCPP_MSVCRT)
 #   define _CTYPE_DISABLE_MACROS
 #endif
@@ -176,11 +179,17 @@ locale::__imp::__imp(size_t refs)
 {
     facets_.clear();
     install(&make<_VSTD::collate<char> >(1u));
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
     install(&make<_VSTD::collate<wchar_t> >(1u));
+#endif
     install(&make<_VSTD::ctype<char> >(nullptr, false, 1u));
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
     install(&make<_VSTD::ctype<wchar_t> >(1u));
+#endif
     install(&make<codecvt<char, char, mbstate_t> >(1u));
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
     install(&make<codecvt<wchar_t, char, mbstate_t> >(1u));
+#endif
 _LIBCPP_SUPPRESS_DEPRECATED_PUSH
     install(&make<codecvt<char16_t, char, mbstate_t> >(1u));
     install(&make<codecvt<char32_t, char, mbstate_t> >(1u));
@@ -190,25 +199,43 @@ _LIBCPP_SUPPRESS_DEPRECATED_POP
     install(&make<codecvt<char32_t, char8_t, mbstate_t> >(1u));
 #endif
     install(&make<numpunct<char> >(1u));
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
     install(&make<numpunct<wchar_t> >(1u));
+#endif
     install(&make<num_get<char> >(1u));
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
     install(&make<num_get<wchar_t> >(1u));
+#endif
     install(&make<num_put<char> >(1u));
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
     install(&make<num_put<wchar_t> >(1u));
+#endif
     install(&make<moneypunct<char, false> >(1u));
     install(&make<moneypunct<char, true> >(1u));
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
     install(&make<moneypunct<wchar_t, false> >(1u));
     install(&make<moneypunct<wchar_t, true> >(1u));
+#endif
     install(&make<money_get<char> >(1u));
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
     install(&make<money_get<wchar_t> >(1u));
+#endif
     install(&make<money_put<char> >(1u));
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
     install(&make<money_put<wchar_t> >(1u));
+#endif
     install(&make<time_get<char> >(1u));
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
     install(&make<time_get<wchar_t> >(1u));
+#endif
     install(&make<time_put<char> >(1u));
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
     install(&make<time_put<wchar_t> >(1u));
+#endif
     install(&make<_VSTD::messages<char> >(1u));
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
     install(&make<_VSTD::messages<wchar_t> >(1u));
+#endif
 }
 
 locale::__imp::__imp(const string& name, size_t refs)
@@ -225,11 +252,17 @@ locale::__imp::__imp(const string& name, size_t refs)
             if (facets_[i])
                 facets_[i]->__add_shared();
         install(new collate_byname<char>(name_));
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
         install(new collate_byname<wchar_t>(name_));
+#endif
         install(new ctype_byname<char>(name_));
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
         install(new ctype_byname<wchar_t>(name_));
+#endif
         install(new codecvt_byname<char, char, mbstate_t>(name_));
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
         install(new codecvt_byname<wchar_t, char, mbstate_t>(name_));
+#endif
 _LIBCPP_SUPPRESS_DEPRECATED_PUSH
         install(new codecvt_byname<char16_t, char, mbstate_t>(name_));
         install(new codecvt_byname<char32_t, char, mbstate_t>(name_));
@@ -239,17 +272,27 @@ _LIBCPP_SUPPRESS_DEPRECATED_POP
         install(new codecvt_byname<char32_t, char8_t, mbstate_t>(name_));
 #endif
         install(new numpunct_byname<char>(name_));
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
         install(new numpunct_byname<wchar_t>(name_));
+#endif
         install(new moneypunct_byname<char, false>(name_));
         install(new moneypunct_byname<char, true>(name_));
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
         install(new moneypunct_byname<wchar_t, false>(name_));
         install(new moneypunct_byname<wchar_t, true>(name_));
+#endif
         install(new time_get_byname<char>(name_));
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
         install(new time_get_byname<wchar_t>(name_));
+#endif
         install(new time_put_byname<char>(name_));
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
         install(new time_put_byname<wchar_t>(name_));
+#endif
         install(new messages_byname<char>(name_));
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
         install(new messages_byname<wchar_t>(name_));
+#endif
 #ifndef _LIBCPP_NO_EXCEPTIONS
     }
     catch (...)
@@ -287,14 +330,20 @@ locale::__imp::__imp(const __imp& other, const string& name, locale::category c)
         if (c & locale::collate)
         {
             install(new collate_byname<char>(name));
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
             install(new collate_byname<wchar_t>(name));
+#endif
         }
         if (c & locale::ctype)
         {
             install(new ctype_byname<char>(name));
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
             install(new ctype_byname<wchar_t>(name));
+#endif
             install(new codecvt_byname<char, char, mbstate_t>(name));
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
             install(new codecvt_byname<wchar_t, char, mbstate_t>(name));
+#endif
 _LIBCPP_SUPPRESS_DEPRECATED_PUSH
             install(new codecvt_byname<char16_t, char, mbstate_t>(name));
             install(new codecvt_byname<char32_t, char, mbstate_t>(name));
@@ -308,25 +357,35 @@ _LIBCPP_SUPPRESS_DEPRECATED_POP
         {
             install(new moneypunct_byname<char, false>(name));
             install(new moneypunct_byname<char, true>(name));
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
             install(new moneypunct_byname<wchar_t, false>(name));
             install(new moneypunct_byname<wchar_t, true>(name));
+#endif
         }
         if (c & locale::numeric)
         {
             install(new numpunct_byname<char>(name));
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
             install(new numpunct_byname<wchar_t>(name));
+#endif
         }
         if (c & locale::time)
         {
             install(new time_get_byname<char>(name));
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
             install(new time_get_byname<wchar_t>(name));
+#endif
             install(new time_put_byname<char>(name));
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
             install(new time_put_byname<wchar_t>(name));
+#endif
         }
         if (c & locale::messages)
         {
             install(new messages_byname<char>(name));
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
             install(new messages_byname<wchar_t>(name));
+#endif
         }
 #ifndef _LIBCPP_NO_EXCEPTIONS
     }
@@ -364,12 +423,16 @@ locale::__imp::__imp(const __imp& other, const __imp& one, locale::category c)
         if (c & locale::collate)
         {
             install_from<_VSTD::collate<char> >(one);
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
             install_from<_VSTD::collate<wchar_t> >(one);
+#endif
         }
         if (c & locale::ctype)
         {
             install_from<_VSTD::ctype<char> >(one);
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
             install_from<_VSTD::ctype<wchar_t> >(one);
+#endif
             install_from<_VSTD::codecvt<char, char, mbstate_t> >(one);
 _LIBCPP_SUPPRESS_DEPRECATED_PUSH
             install_from<_VSTD::codecvt<char16_t, char, mbstate_t> >(one);
@@ -379,39 +442,59 @@ _LIBCPP_SUPPRESS_DEPRECATED_POP
             install_from<_VSTD::codecvt<char16_t, char8_t, mbstate_t> >(one);
             install_from<_VSTD::codecvt<char32_t, char8_t, mbstate_t> >(one);
 #endif
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
             install_from<_VSTD::codecvt<wchar_t, char, mbstate_t> >(one);
+#endif
         }
         if (c & locale::monetary)
         {
             install_from<moneypunct<char, false> >(one);
             install_from<moneypunct<char, true> >(one);
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
             install_from<moneypunct<wchar_t, false> >(one);
             install_from<moneypunct<wchar_t, true> >(one);
+#endif
             install_from<money_get<char> >(one);
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
             install_from<money_get<wchar_t> >(one);
+#endif
             install_from<money_put<char> >(one);
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
             install_from<money_put<wchar_t> >(one);
+#endif
         }
         if (c & locale::numeric)
         {
             install_from<numpunct<char> >(one);
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
             install_from<numpunct<wchar_t> >(one);
+#endif
             install_from<num_get<char> >(one);
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
             install_from<num_get<wchar_t> >(one);
+#endif
             install_from<num_put<char> >(one);
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
             install_from<num_put<wchar_t> >(one);
+#endif
         }
         if (c & locale::time)
         {
             install_from<time_get<char> >(one);
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
             install_from<time_get<wchar_t> >(one);
+#endif
             install_from<time_put<char> >(one);
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
             install_from<time_put<wchar_t> >(one);
+#endif
         }
         if (c & locale::messages)
         {
             install_from<_VSTD::messages<char> >(one);
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
             install_from<_VSTD::messages<wchar_t> >(one);
+#endif
         }
 #ifndef _LIBCPP_NO_EXCEPTIONS
     }
@@ -702,6 +785,7 @@ collate_byname<char>::do_transform(const char_type* lo, const char_type* hi) con
 
 // template <> class collate_byname<wchar_t>
 
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 collate_byname<wchar_t>::collate_byname(const char* n, size_t refs)
     : collate<wchar_t>(refs),
       __l(newlocale(LC_ALL_MASK, n, 0))
@@ -747,6 +831,7 @@ collate_byname<wchar_t>::do_transform(const char_type* lo, const char_type* hi)
     wcsxfrm_l(const_cast<wchar_t*>(out.c_str()), in.c_str(), out.size()+1, __l);
     return out;
 }
+#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
 
 const ctype_base::mask ctype_base::space;
 const ctype_base::mask ctype_base::print;
@@ -763,6 +848,7 @@ const ctype_base::mask ctype_base::graph;
 
 // template <> class ctype<wchar_t>;
 
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 locale::id ctype<wchar_t>::id;
 
 ctype<wchar_t>::~ctype()
@@ -892,6 +978,7 @@ ctype<wchar_t>::do_narrow(const char_type* low, const char_type* high, char dfau
             *dest = dfault;
     return low;
 }
+#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
 
 // template <> class ctype<char>;
 
@@ -1223,6 +1310,7 @@ ctype_byname<char>::do_tolower(char_type* low, const char_type* high) const
 
 // template <> class ctype_byname<wchar_t>
 
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 ctype_byname<wchar_t>::ctype_byname(const char* name, size_t refs)
     : ctype<wchar_t>(refs),
       __l(newlocale(LC_ALL_MASK, name, 0))
@@ -1422,6 +1510,7 @@ ctype_byname<wchar_t>::do_narrow(const char_type* low, const char_type* high, ch
     }
     return low;
 }
+#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
 
 // template <> class codecvt<char, char, mbstate_t>
 
@@ -1486,6 +1575,7 @@ codecvt<char, char, mbstate_t>::do_max_length() const noexcept
 
 // template <> class codecvt<wchar_t, char, mbstate_t>
 
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 locale::id codecvt<wchar_t, char, mbstate_t>::id;
 
 codecvt<wchar_t, char, mbstate_t>::codecvt(size_t refs)
@@ -1698,6 +1788,7 @@ codecvt<wchar_t, char, mbstate_t>::do_max_length() const noexcept
 {
     return __l == 0 ? 1 : static_cast<int>(__libcpp_mb_cur_max_l(__l));
 }
+#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
 
 //                                     Valid UTF ranges
 //     UTF-32               UTF-16                          UTF-8               # of code points
@@ -3404,6 +3495,7 @@ codecvt<char32_t, char8_t, mbstate_t>::do_max_length() const noexcept
 
 // __codecvt_utf8<wchar_t>
 
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 __codecvt_utf8<wchar_t>::result
 __codecvt_utf8<wchar_t>::do_out(state_type&,
     const intern_type* frm, const intern_type* frm_end, const intern_type*& frm_nxt,
@@ -3505,6 +3597,7 @@ __codecvt_utf8<wchar_t>::do_max_length() const noexcept
     return 4;
 #endif
 }
+#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
 
 // __codecvt_utf8<char16_t>
 
@@ -3658,6 +3751,7 @@ __codecvt_utf8<char32_t>::do_max_length() const noexcept
 
 // __codecvt_utf16<wchar_t, false>
 
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 __codecvt_utf16<wchar_t, false>::result
 __codecvt_utf16<wchar_t, false>::do_out(state_type&,
     const intern_type* frm, const intern_type* frm_end, const intern_type*& frm_nxt,
@@ -3863,6 +3957,7 @@ __codecvt_utf16<wchar_t, true>::do_max_length() const noexcept
     return 4;
 #endif
 }
+#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
 
 // __codecvt_utf16<char16_t, false>
 
@@ -4166,6 +4261,7 @@ __codecvt_utf16<char32_t, true>::do_max_length() const noexcept
 
 // __codecvt_utf8_utf16<wchar_t>
 
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 __codecvt_utf8_utf16<wchar_t>::result
 __codecvt_utf8_utf16<wchar_t>::do_out(state_type&,
     const intern_type* frm, const intern_type* frm_end, const intern_type*& frm_nxt,
@@ -4250,6 +4346,7 @@ __codecvt_utf8_utf16<wchar_t>::do_max_length() const noexcept
         return 7;
     return 4;
 }
+#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
 
 // __codecvt_utf8_utf16<char16_t>
 
@@ -4425,7 +4522,7 @@ __widen_from_utf8<32>::~__widen_from_utf8()
 {
 }
 
-
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 static bool checked_string_to_wchar_convert(wchar_t& dest,
                                             const char* ptr,
                                             locale_t loc) {
@@ -4440,6 +4537,7 @@ static bool checked_string_to_wchar_convert(wchar_t& dest,
   dest = out;
   return true;
 }
+#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
 
 static bool checked_string_to_char_convert(char& dest,
                                            const char* ptr,
@@ -4450,6 +4548,8 @@ static bool checked_string_to_char_convert(char& dest,
     dest = *ptr;
     return true;
   }
+
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
   // First convert the MBS into a wide char then attempt to narrow it using
   // wctob_l.
   wchar_t wout;
@@ -4470,6 +4570,9 @@ static bool checked_string_to_char_convert(char& dest,
   default:
     return false;
   }
+#else // _LIBCPP_HAS_NO_WIDE_CHARACTERS
+  return false;
+#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
   _LIBCPP_UNREACHABLE();
 }
 
@@ -4477,7 +4580,9 @@ static bool checked_string_to_char_convert(char& dest,
 // numpunct<char> && numpunct<wchar_t>
 
 locale::id numpunct< char  >::id;
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 locale::id numpunct<wchar_t>::id;
+#endif
 
 numpunct<char>::numpunct(size_t refs)
     : locale::facet(refs),
@@ -4486,35 +4591,49 @@ numpunct<char>::numpunct(size_t refs)
 {
 }
 
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 numpunct<wchar_t>::numpunct(size_t refs)
     : locale::facet(refs),
       __decimal_point_(L'.'),
       __thousands_sep_(L',')
 {
 }
+#endif
 
 numpunct<char>::~numpunct()
 {
 }
 
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 numpunct<wchar_t>::~numpunct()
 {
 }
+#endif
 
  char   numpunct< char  >::do_decimal_point() const {return __decimal_point_;}
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 wchar_t numpunct<wchar_t>::do_decimal_point() const {return __decimal_point_;}
+#endif
 
  char   numpunct< char  >::do_thousands_sep() const {return __thousands_sep_;}
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 wchar_t numpunct<wchar_t>::do_thousands_sep() const {return __thousands_sep_;}
+#endif
 
 string numpunct< char  >::do_grouping() const {return __grouping_;}
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 string numpunct<wchar_t>::do_grouping() const {return __grouping_;}
+#endif
 
  string numpunct< char  >::do_truename() const {return "true";}
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 wstring numpunct<wchar_t>::do_truename() const {return L"true";}
+#endif
 
  string numpunct< char  >::do_falsename() const {return "false";}
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 wstring numpunct<wchar_t>::do_falsename() const {return L"false";}
+#endif
 
 // numpunct_byname<char>
 
@@ -4537,6 +4656,7 @@ numpunct_byname<char>::~numpunct_byname()
 void
 numpunct_byname<char>::__init(const char* nm)
 {
+    typedef numpunct<char> base;
     if (strcmp(nm, "C") != 0)
     {
         __libcpp_unique_locale loc(nm);
@@ -4545,10 +4665,12 @@ numpunct_byname<char>::__init(const char* nm)
                                 " failed to construct for " + string(nm));
 
         lconv* lc = __libcpp_localeconv_l(loc.get());
-        checked_string_to_char_convert(__decimal_point_, lc->decimal_point,
-                                       loc.get());
-        checked_string_to_char_convert(__thousands_sep_, lc->thousands_sep,
-                                       loc.get());
+        if (!checked_string_to_char_convert(__decimal_point_, lc->decimal_point,
+                                            loc.get()))
+            __decimal_point_ = base::do_decimal_point();
+        if (!checked_string_to_char_convert(__thousands_sep_, lc->thousands_sep,
+                                            loc.get()))
+            __thousands_sep_ = base::do_thousands_sep();
         __grouping_ = lc->grouping;
         // localization for truename and falsename is not available
     }
@@ -4556,6 +4678,7 @@ numpunct_byname<char>::__init(const char* nm)
 
 // numpunct_byname<wchar_t>
 
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 numpunct_byname<wchar_t>::numpunct_byname(const char* nm, size_t refs)
     : numpunct<wchar_t>(refs)
 {
@@ -4591,6 +4714,7 @@ numpunct_byname<wchar_t>::__init(const char* nm)
         // localization for truename and falsename is not available
     }
 }
+#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
 
 // num_get helpers
 
@@ -4766,6 +4890,7 @@ init_weeks()
     return weeks;
 }
 
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 static
 wstring*
 init_wweeks()
@@ -4787,6 +4912,7 @@ init_wweeks()
     weeks[13] = L"Sat";
     return weeks;
 }
+#endif
 
 template <>
 const string*
@@ -4796,6 +4922,7 @@ __time_get_c_storage<char>::__weeks() const
     return weeks;
 }
 
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 template <>
 const wstring*
 __time_get_c_storage<wchar_t>::__weeks() const
@@ -4803,6 +4930,7 @@ __time_get_c_storage<wchar_t>::__weeks() const
     static const wstring* weeks = init_wweeks();
     return weeks;
 }
+#endif
 
 static
 string*
@@ -4836,6 +4964,7 @@ init_months()
     return months;
 }
 
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 static
 wstring*
 init_wmonths()
@@ -4867,6 +4996,7 @@ init_wmonths()
     months[23] = L"Dec";
     return months;
 }
+#endif
 
 template <>
 const string*
@@ -4876,6 +5006,7 @@ __time_get_c_storage<char>::__months() const
     return months;
 }
 
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 template <>
 const wstring*
 __time_get_c_storage<wchar_t>::__months() const
@@ -4883,6 +5014,7 @@ __time_get_c_storage<wchar_t>::__months() const
     static const wstring* months = init_wmonths();
     return months;
 }
+#endif
 
 static
 string*
@@ -4894,6 +5026,7 @@ init_am_pm()
     return am_pm;
 }
 
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 static
 wstring*
 init_wam_pm()
@@ -4903,6 +5036,7 @@ init_wam_pm()
     am_pm[1]  = L"PM";
     return am_pm;
 }
+#endif
 
 template <>
 const string*
@@ -4912,6 +5046,7 @@ __time_get_c_storage<char>::__am_pm() const
     return am_pm;
 }
 
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 template <>
 const wstring*
 __time_get_c_storage<wchar_t>::__am_pm() const
@@ -4919,6 +5054,7 @@ __time_get_c_storage<wchar_t>::__am_pm() const
     static const wstring* am_pm = init_wam_pm();
     return am_pm;
 }
+#endif
 
 template <>
 const string&
@@ -4928,6 +5064,7 @@ __time_get_c_storage<char>::__x() const
     return s;
 }
 
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 template <>
 const wstring&
 __time_get_c_storage<wchar_t>::__x() const
@@ -4935,6 +5072,7 @@ __time_get_c_storage<wchar_t>::__x() const
     static wstring s(L"%m/%d/%y");
     return s;
 }
+#endif
 
 template <>
 const string&
@@ -4944,6 +5082,7 @@ __time_get_c_storage<char>::__X() const
     return s;
 }
 
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 template <>
 const wstring&
 __time_get_c_storage<wchar_t>::__X() const
@@ -4951,6 +5090,7 @@ __time_get_c_storage<wchar_t>::__X() const
     static wstring s(L"%H:%M:%S");
     return s;
 }
+#endif
 
 template <>
 const string&
@@ -4960,6 +5100,7 @@ __time_get_c_storage<char>::__c() const
     return s;
 }
 
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 template <>
 const wstring&
 __time_get_c_storage<wchar_t>::__c() const
@@ -4967,6 +5108,7 @@ __time_get_c_storage<wchar_t>::__c() const
     static wstring s(L"%a %b %d %H:%M:%S %Y");
     return s;
 }
+#endif
 
 template <>
 const string&
@@ -4976,6 +5118,7 @@ __time_get_c_storage<char>::__r() const
     return s;
 }
 
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 template <>
 const wstring&
 __time_get_c_storage<wchar_t>::__r() const
@@ -4983,6 +5126,7 @@ __time_get_c_storage<wchar_t>::__r() const
     static wstring s(L"%I:%M:%S %p");
     return s;
 }
+#endif
 
 // time_get_byname
 
@@ -5161,6 +5305,7 @@ __time_get_storage<char>::__analyze(char fmt, const ctype<char>& ct)
 #pragma clang diagnostic ignored "-Wmissing-braces"
 #endif
 
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 template <>
 wstring
 __time_get_storage<wchar_t>::__analyze(char fmt, const ctype<wchar_t>& ct)
@@ -5310,6 +5455,7 @@ __time_get_storage<wchar_t>::__analyze(char fmt, const ctype<wchar_t>& ct)
     }
     return result;
 }
+#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
 
 template <>
 void
@@ -5348,6 +5494,7 @@ __time_get_storage<char>::init(const ctype<char>& ct)
     __X_ = __analyze('X', ct);
 }
 
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 template <>
 void
 __time_get_storage<wchar_t>::init(const ctype<wchar_t>& ct)
@@ -5423,6 +5570,7 @@ __time_get_storage<wchar_t>::init(const ctype<wchar_t>& ct)
     __x_ = __analyze('x', ct);
     __X_ = __analyze('X', ct);
 }
+#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
 
 template <class CharT>
 struct _LIBCPP_HIDDEN __time_get_temp
@@ -5450,6 +5598,7 @@ __time_get_storage<char>::__time_get_storage(const string& __nm)
     init(ct);
 }
 
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 template <>
 __time_get_storage<wchar_t>::__time_get_storage(const char* __nm)
     : __time_get(__nm)
@@ -5465,6 +5614,7 @@ __time_get_storage<wchar_t>::__time_get_storage(const string& __nm)
     const __time_get_temp<wchar_t> ct(__nm);
     init(ct);
 }
+#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
 
 template <>
 time_base::dateorder
@@ -5553,6 +5703,7 @@ __time_get_storage<char>::__do_date_order() const
     return time_base::no_order;
 }
 
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 template <>
 time_base::dateorder
 __time_get_storage<wchar_t>::__do_date_order() const
@@ -5639,6 +5790,7 @@ __time_get_storage<wchar_t>::__do_date_order() const
     }
     return time_base::no_order;
 }
+#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
 
 // time_put
 
@@ -5675,6 +5827,7 @@ __time_put::__do_put(char* __nb, char*& __ne, const tm* __tm,
     __ne = __nb + n;
 }
 
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 void
 __time_put::__do_put(wchar_t* __wb, wchar_t*& __we, const tm* __tm,
                      char __fmt, char __mod) const
@@ -5689,6 +5842,7 @@ __time_put::__do_put(wchar_t* __wb, wchar_t*& __we, const tm* __tm,
         __throw_runtime_error("locale not supported");
     __we = __wb + j;
 }
+#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
 
 // moneypunct_byname
 
@@ -6168,6 +6322,7 @@ moneypunct_byname<char, true>::init(const char* nm)
 #endif // !_LIBCPP_MSVCRT
 }
 
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 template<>
 void
 moneypunct_byname<wchar_t, false>::init(const char* nm)
@@ -6315,6 +6470,7 @@ moneypunct_byname<wchar_t, true>::init(const char* nm)
                lc->int_n_sign_posn, L' ');
 #endif // !_LIBCPP_MSVCRT
 }
+#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
 
 void __do_nothing(void*) {}
 
@@ -6328,63 +6484,63 @@ void __throw_runtime_error(const char* msg)
 #endif
 }
 
-template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS collate<char>;
-template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS collate<wchar_t>;
+                           template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS collate<char>;
+_LIBCPP_IF_WIDE_CHARACTERS(template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS collate<wchar_t>;)
 
-template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS num_get<char>;
-template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS num_get<wchar_t>;
+                           template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS num_get<char>;
+_LIBCPP_IF_WIDE_CHARACTERS(template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS num_get<wchar_t>;)
 
-template struct _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS __num_get<char>;
-template struct _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS __num_get<wchar_t>;
+                           template struct _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS __num_get<char>;
+_LIBCPP_IF_WIDE_CHARACTERS(template struct _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS __num_get<wchar_t>;)
 
-template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS num_put<char>;
-template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS num_put<wchar_t>;
+                           template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS num_put<char>;
+_LIBCPP_IF_WIDE_CHARACTERS(template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS num_put<wchar_t>;)
 
-template struct _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS __num_put<char>;
-template struct _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS __num_put<wchar_t>;
+                           template struct _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS __num_put<char>;
+_LIBCPP_IF_WIDE_CHARACTERS(template struct _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS __num_put<wchar_t>;)
 
-template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS time_get<char>;
-template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS time_get<wchar_t>;
+                           template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS time_get<char>;
+_LIBCPP_IF_WIDE_CHARACTERS(template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS time_get<wchar_t>;)
 
-template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS time_get_byname<char>;
-template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS time_get_byname<wchar_t>;
+                           template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS time_get_byname<char>;
+_LIBCPP_IF_WIDE_CHARACTERS(template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS time_get_byname<wchar_t>;)
 
-template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS time_put<char>;
-template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS time_put<wchar_t>;
+                           template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS time_put<char>;
+_LIBCPP_IF_WIDE_CHARACTERS(template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS time_put<wchar_t>;)
 
-template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS time_put_byname<char>;
-template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS time_put_byname<wchar_t>;
+                           template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS time_put_byname<char>;
+_LIBCPP_IF_WIDE_CHARACTERS(template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS time_put_byname<wchar_t>;)
 
-template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS moneypunct<char, false>;
-template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS moneypunct<char, true>;
-template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS moneypunct<wchar_t, false>;
-template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS moneypunct<wchar_t, true>;
+                           template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS moneypunct<char, false>;
+                           template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS moneypunct<char, true>;
+_LIBCPP_IF_WIDE_CHARACTERS(template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS moneypunct<wchar_t, false>;)
+_LIBCPP_IF_WIDE_CHARACTERS(template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS moneypunct<wchar_t, true>;)
 
-template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS moneypunct_byname<char, false>;
-template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS moneypunct_byname<char, true>;
-template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS moneypunct_byname<wchar_t, false>;
-template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS moneypunct_byname<wchar_t, true>;
+                           template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS moneypunct_byname<char, false>;
+                           template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS moneypunct_byname<char, true>;
+_LIBCPP_IF_WIDE_CHARACTERS(template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS moneypunct_byname<wchar_t, false>;)
+_LIBCPP_IF_WIDE_CHARACTERS(template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS moneypunct_byname<wchar_t, true>;)
 
-template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS money_get<char>;
-template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS money_get<wchar_t>;
+                           template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS money_get<char>;
+_LIBCPP_IF_WIDE_CHARACTERS(template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS money_get<wchar_t>;)
 
-template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS __money_get<char>;
-template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS __money_get<wchar_t>;
+                           template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS __money_get<char>;
+_LIBCPP_IF_WIDE_CHARACTERS(template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS __money_get<wchar_t>;)
 
-template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS money_put<char>;
-template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS money_put<wchar_t>;
+                           template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS money_put<char>;
+_LIBCPP_IF_WIDE_CHARACTERS(template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS money_put<wchar_t>;)
 
-template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS __money_put<char>;
-template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS __money_put<wchar_t>;
+                           template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS __money_put<char>;
+_LIBCPP_IF_WIDE_CHARACTERS(template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS __money_put<wchar_t>;)
 
-template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS messages<char>;
-template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS messages<wchar_t>;
+                           template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS messages<char>;
+_LIBCPP_IF_WIDE_CHARACTERS(template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS messages<wchar_t>;)
 
-template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS messages_byname<char>;
-template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS messages_byname<wchar_t>;
+                           template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS messages_byname<char>;
+_LIBCPP_IF_WIDE_CHARACTERS(template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS messages_byname<wchar_t>;)
 
-template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS codecvt_byname<char, char, mbstate_t>;
-template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS codecvt_byname<wchar_t, char, mbstate_t>;
+                           template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS codecvt_byname<char, char, mbstate_t>;
+_LIBCPP_IF_WIDE_CHARACTERS(template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS codecvt_byname<wchar_t, char, mbstate_t>;)
 template class _LIBCPP_DEPRECATED_IN_CXX20 _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS codecvt_byname<char16_t, char, mbstate_t>;
 template class _LIBCPP_DEPRECATED_IN_CXX20 _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS codecvt_byname<char32_t, char, mbstate_t>;
 #ifndef _LIBCPP_HAS_NO_CHAR8_T

diff  --git a/libcxx/src/string.cpp b/libcxx/src/string.cpp
index 012b2ea089585..c8dae342726a8 100644
--- a/libcxx/src/string.cpp
+++ b/libcxx/src/string.cpp
@@ -9,13 +9,16 @@
 #include "string"
 #include "charconv"
 #include "cstdlib"
-#include "cwchar"
 #include "cerrno"
 #include "limits"
 #include "stdexcept"
 #include <stdio.h>
 #include "__debug"
 
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+#   include "cwchar"
+#endif
+
 _LIBCPP_BEGIN_NAMESPACE_STD
 
 void __basic_string_common<true>::__throw_length_error() const {
@@ -28,11 +31,15 @@ void __basic_string_common<true>::__throw_out_of_range() const {
 
 #define _LIBCPP_EXTERN_TEMPLATE_DEFINE(...) template __VA_ARGS__;
 #ifdef _LIBCPP_ABI_STRING_OPTIMIZED_EXTERNAL_INSTANTIATION
-_LIBCPP_STRING_UNSTABLE_EXTERN_TEMPLATE_LIST(_LIBCPP_EXTERN_TEMPLATE_DEFINE, char)
-_LIBCPP_STRING_UNSTABLE_EXTERN_TEMPLATE_LIST(_LIBCPP_EXTERN_TEMPLATE_DEFINE, wchar_t)
+    _LIBCPP_STRING_UNSTABLE_EXTERN_TEMPLATE_LIST(_LIBCPP_EXTERN_TEMPLATE_DEFINE, char)
+#   ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+        _LIBCPP_STRING_UNSTABLE_EXTERN_TEMPLATE_LIST(_LIBCPP_EXTERN_TEMPLATE_DEFINE, wchar_t)
+#   endif
 #else
-_LIBCPP_STRING_V1_EXTERN_TEMPLATE_LIST(_LIBCPP_EXTERN_TEMPLATE_DEFINE, char)
-_LIBCPP_STRING_V1_EXTERN_TEMPLATE_LIST(_LIBCPP_EXTERN_TEMPLATE_DEFINE, wchar_t)
+    _LIBCPP_STRING_V1_EXTERN_TEMPLATE_LIST(_LIBCPP_EXTERN_TEMPLATE_DEFINE, char)
+#   ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+        _LIBCPP_STRING_V1_EXTERN_TEMPLATE_LIST(_LIBCPP_EXTERN_TEMPLATE_DEFINE, wchar_t)
+#   endif
 #endif
 #undef _LIBCPP_EXTERN_TEMPLATE_DEFINE
 
@@ -137,6 +144,7 @@ as_integer( const string& func, const string& s, size_t* idx, int base )
     return as_integer_helper<unsigned long long>( func, s, idx, base, strtoull );
 }
 
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 // wstring
 template<>
 inline
@@ -181,6 +189,7 @@ as_integer( const string& func, const wstring& s, size_t* idx, int base )
 {
     return as_integer_helper<unsigned long long>( func, s, idx, base, wcstoull );
 }
+#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
 
 // as_float
 
@@ -232,6 +241,7 @@ as_float( const string& func, const string& s, size_t* idx )
     return as_float_helper<long double>( func, s, idx, strtold );
 }
 
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 template<>
 inline
 float
@@ -255,6 +265,7 @@ as_float( const string& func, const wstring& s, size_t* idx )
 {
     return as_float_helper<long double>( func, s, idx, wcstold );
 }
+#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
 
 }  // unnamed namespace
 
@@ -264,11 +275,13 @@ stoi(const string& str, size_t* idx, int base)
     return as_integer<int>( "stoi", str, idx, base );
 }
 
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 int
 stoi(const wstring& str, size_t* idx, int base)
 {
     return as_integer<int>( "stoi", str, idx, base );
 }
+#endif
 
 long
 stol(const string& str, size_t* idx, int base)
@@ -276,11 +289,13 @@ stol(const string& str, size_t* idx, int base)
     return as_integer<long>( "stol", str, idx, base );
 }
 
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 long
 stol(const wstring& str, size_t* idx, int base)
 {
     return as_integer<long>( "stol", str, idx, base );
 }
+#endif
 
 unsigned long
 stoul(const string& str, size_t* idx, int base)
@@ -288,11 +303,13 @@ stoul(const string& str, size_t* idx, int base)
     return as_integer<unsigned long>( "stoul", str, idx, base );
 }
 
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 unsigned long
 stoul(const wstring& str, size_t* idx, int base)
 {
     return as_integer<unsigned long>( "stoul", str, idx, base );
 }
+#endif
 
 long long
 stoll(const string& str, size_t* idx, int base)
@@ -300,11 +317,13 @@ stoll(const string& str, size_t* idx, int base)
     return as_integer<long long>( "stoll", str, idx, base );
 }
 
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 long long
 stoll(const wstring& str, size_t* idx, int base)
 {
     return as_integer<long long>( "stoll", str, idx, base );
 }
+#endif
 
 unsigned long long
 stoull(const string& str, size_t* idx, int base)
@@ -312,11 +331,13 @@ stoull(const string& str, size_t* idx, int base)
     return as_integer<unsigned long long>( "stoull", str, idx, base );
 }
 
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 unsigned long long
 stoull(const wstring& str, size_t* idx, int base)
 {
     return as_integer<unsigned long long>( "stoull", str, idx, base );
 }
+#endif
 
 float
 stof(const string& str, size_t* idx)
@@ -324,11 +345,13 @@ stof(const string& str, size_t* idx)
     return as_float<float>( "stof", str, idx );
 }
 
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 float
 stof(const wstring& str, size_t* idx)
 {
     return as_float<float>( "stof", str, idx );
 }
+#endif
 
 double
 stod(const string& str, size_t* idx)
@@ -336,11 +359,13 @@ stod(const string& str, size_t* idx)
     return as_float<double>( "stod", str, idx );
 }
 
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 double
 stod(const wstring& str, size_t* idx)
 {
     return as_float<double>( "stod", str, idx );
 }
+#endif
 
 long double
 stold(const string& str, size_t* idx)
@@ -348,11 +373,13 @@ stold(const string& str, size_t* idx)
     return as_float<long double>( "stold", str, idx );
 }
 
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 long double
 stold(const wstring& str, size_t* idx)
 {
     return as_float<long double>( "stold", str, idx );
 }
+#endif
 
 // to_string
 
@@ -403,6 +430,7 @@ struct initial_string<string>
     }
 };
 
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 template <>
 struct initial_string<wstring>
 {
@@ -427,6 +455,7 @@ get_swprintf()
     return static_cast<int (__cdecl*)(wchar_t* __restrict, size_t, const wchar_t*__restrict, ...)>(_snwprintf);
 #endif
 }
+#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
 
 template <typename S, typename V>
 S i_to_string(V v)
@@ -450,20 +479,23 @@ string  to_string (unsigned val)           { return i_to_string< string>(val); }
 string  to_string (unsigned long val)      { return i_to_string< string>(val); }
 string  to_string (unsigned long long val) { return i_to_string< string>(val); }
 
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 wstring to_wstring(int val)                { return i_to_string<wstring>(val); }
 wstring to_wstring(long val)               { return i_to_string<wstring>(val); }
 wstring to_wstring(long long val)          { return i_to_string<wstring>(val); }
 wstring to_wstring(unsigned val)           { return i_to_string<wstring>(val); }
 wstring to_wstring(unsigned long val)      { return i_to_string<wstring>(val); }
 wstring to_wstring(unsigned long long val) { return i_to_string<wstring>(val); }
-
+#endif
 
 string  to_string (float val)       { return as_string(snprintf,       initial_string< string>()(),   "%f", val); }
 string  to_string (double val)      { return as_string(snprintf,       initial_string< string>()(),   "%f", val); }
 string  to_string (long double val) { return as_string(snprintf,       initial_string< string>()(),  "%Lf", val); }
 
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 wstring to_wstring(float val)       { return as_string(get_swprintf(), initial_string<wstring>()(),  L"%f", val); }
 wstring to_wstring(double val)      { return as_string(get_swprintf(), initial_string<wstring>()(),  L"%f", val); }
 wstring to_wstring(long double val) { return as_string(get_swprintf(), initial_string<wstring>()(), L"%Lf", val); }
+#endif
 
 _LIBCPP_END_NAMESPACE_STD

diff  --git a/libcxx/test/libcxx/atomics/atomics.align/align.pass.cpp b/libcxx/test/libcxx/atomics/atomics.align/align.pass.cpp
index 3735bb50367b8..2e5a9c149ca44 100644
--- a/libcxx/test/libcxx/atomics/atomics.align/align.pass.cpp
+++ b/libcxx/test/libcxx/atomics/atomics.align/align.pass.cpp
@@ -65,7 +65,9 @@ int main(int, char**) {
   CHECK_ALIGNMENT(unsigned char);
   CHECK_ALIGNMENT(char16_t);
   CHECK_ALIGNMENT(char32_t);
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
   CHECK_ALIGNMENT(wchar_t);
+#endif
   CHECK_ALIGNMENT(short);
   CHECK_ALIGNMENT(unsigned short);
   CHECK_ALIGNMENT(int);

diff  --git a/libcxx/test/libcxx/depr/depr.c.headers/extern_c.pass.cpp b/libcxx/test/libcxx/depr/depr.c.headers/extern_c.pass.cpp
index acfcc90f873fb..a4a05e6a08ef0 100644
--- a/libcxx/test/libcxx/depr/depr.c.headers/extern_c.pass.cpp
+++ b/libcxx/test/libcxx/depr/depr.c.headers/extern_c.pass.cpp
@@ -39,8 +39,10 @@ extern "C" {
 // tgmath.h is not supported in extern "C".
 #include <time.h>
 // FIXME: #include <uchar.h>
-#include <wchar.h>
-#include <wctype.h>
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+#   include <wchar.h>
+#   include <wctype.h>
+#endif
 }
 
 int main(int, char**) {

diff  --git a/libcxx/test/libcxx/diagnostics/detail.headers/mbstate_t.h.module.verify.cpp b/libcxx/test/libcxx/diagnostics/detail.headers/mbstate_t.h.module.verify.cpp
new file mode 100644
index 0000000000000..a656832feb079
--- /dev/null
+++ b/libcxx/test/libcxx/diagnostics/detail.headers/mbstate_t.h.module.verify.cpp
@@ -0,0 +1,15 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// REQUIRES: modules-build
+
+// WARNING: This test was generated by 'generate_private_header_tests.py'
+// and should not be edited manually.
+
+// expected-error@*:* {{use of private header from outside its module: '__mbstate_t.h'}}
+#include <__mbstate_t.h>

diff  --git a/libcxx/test/libcxx/double_include.sh.cpp b/libcxx/test/libcxx/double_include.sh.cpp
index f18fc89f9dd4b..05286fb72cf02 100644
--- a/libcxx/test/libcxx/double_include.sh.cpp
+++ b/libcxx/test/libcxx/double_include.sh.cpp
@@ -74,8 +74,12 @@
 #include <ctgmath>
 #include <ctime>
 #include <ctype.h>
-#include <cwchar>
-#include <cwctype>
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+#    include <cwchar>
+#endif
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+#    include <cwctype>
+#endif
 #include <deque>
 #include <errno.h>
 #include <exception>
@@ -191,8 +195,12 @@
 #include <variant>
 #include <vector>
 #include <version>
-#include <wchar.h>
-#include <wctype.h>
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+#    include <wchar.h>
+#endif
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+#    include <wctype.h>
+#endif
 
 // experimental headers
 #if __cplusplus >= 201103L

diff  --git a/libcxx/test/libcxx/include_as_c.sh.cpp b/libcxx/test/libcxx/include_as_c.sh.cpp
index 7dc3753094e49..a3e5d533040d4 100644
--- a/libcxx/test/libcxx/include_as_c.sh.cpp
+++ b/libcxx/test/libcxx/include_as_c.sh.cpp
@@ -45,8 +45,10 @@
 #ifndef _MSC_VER
 #    include <tgmath.h>
 #endif
-#include <wchar.h>
-#include <wctype.h>
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+#   include <wchar.h>
+#   include <wctype.h>
+#endif
 
 int main(int argc, char **argv) {
   (void)argc;

diff  --git a/libcxx/test/libcxx/input.output/filesystems/class.path/path.member/path.native.obs/string_alloc.pass.cpp b/libcxx/test/libcxx/input.output/filesystems/class.path/path.member/path.native.obs/string_alloc.pass.cpp
index e38000ef0a5fb..87f9766435d4c 100644
--- a/libcxx/test/libcxx/input.output/filesystems/class.path/path.member/path.native.obs/string_alloc.pass.cpp
+++ b/libcxx/test/libcxx/input.output/filesystems/class.path/path.member/path.native.obs/string_alloc.pass.cpp
@@ -146,7 +146,9 @@ int main(int, char**)
   {
     auto const& S = shortString;
     doShortStringTest<char>(S);
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     doShortStringTest<wchar_t>(S);
+#endif
     doShortStringTest<char16_t>(S);
     doShortStringTest<char32_t>(S);
 #if TEST_STD_VER > 17 && defined(__cpp_lib_char8_t)
@@ -156,7 +158,9 @@ int main(int, char**)
   {
     auto const& S = longString;
     doLongStringTest<char>(S);
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     doLongStringTest<wchar_t>(S);
+#endif
     doLongStringTest<char16_t>(S);
     doLongStringTest<char32_t>(S);
 #if TEST_STD_VER > 17 && defined(__cpp_lib_char8_t)

diff  --git a/libcxx/test/libcxx/input.output/filesystems/class.path/path.req/is_pathable.pass.cpp b/libcxx/test/libcxx/input.output/filesystems/class.path/path.req/is_pathable.pass.cpp
index 7e158648cd85c..2dbc016399557 100644
--- a/libcxx/test/libcxx/input.output/filesystems/class.path/path.req/is_pathable.pass.cpp
+++ b/libcxx/test/libcxx/input.output/filesystems/class.path/path.req/is_pathable.pass.cpp
@@ -97,7 +97,9 @@ struct MakeTestType {
 
 int main(int, char**) {
   MakeTestType<char>::Test();
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
   MakeTestType<wchar_t>::Test();
+#endif
   MakeTestType<char16_t>::Test();
   MakeTestType<char32_t>::Test();
 

diff  --git a/libcxx/test/libcxx/input.output/iostream.format/input.streams/traits_mismatch.fail.cpp b/libcxx/test/libcxx/input.output/iostream.format/input.streams/traits_mismatch.fail.cpp
index 10131986afde2..faa693ad1b48b 100644
--- a/libcxx/test/libcxx/input.output/iostream.format/input.streams/traits_mismatch.fail.cpp
+++ b/libcxx/test/libcxx/input.output/iostream.format/input.streams/traits_mismatch.fail.cpp
@@ -13,6 +13,8 @@
 
 // The char type of the stream and the char_type of the traits have to match
 
+// UNSUPPORTED: libcpp-has-no-wide-characters
+
 #include <istream>
 #include <type_traits>
 #include <cassert>

diff  --git a/libcxx/test/libcxx/input.output/iostream.format/output.streams/traits_mismatch.fail.cpp b/libcxx/test/libcxx/input.output/iostream.format/output.streams/traits_mismatch.fail.cpp
index dba4c920a4dd8..bf974d3cf8bcc 100644
--- a/libcxx/test/libcxx/input.output/iostream.format/output.streams/traits_mismatch.fail.cpp
+++ b/libcxx/test/libcxx/input.output/iostream.format/output.streams/traits_mismatch.fail.cpp
@@ -13,6 +13,8 @@
 
 // The char type of the stream and the char_type of the traits have to match
 
+// UNSUPPORTED: libcpp-has-no-wide-characters
+
 #include <ostream>
 #include <type_traits>
 #include <cassert>

diff  --git a/libcxx/test/libcxx/input.output/string.streams/traits_mismatch.fail.cpp b/libcxx/test/libcxx/input.output/string.streams/traits_mismatch.fail.cpp
index 60b95a7077e53..91d992d2c33bb 100644
--- a/libcxx/test/libcxx/input.output/string.streams/traits_mismatch.fail.cpp
+++ b/libcxx/test/libcxx/input.output/string.streams/traits_mismatch.fail.cpp
@@ -14,6 +14,8 @@
 //
 // The char type of the stream and the char_type of the traits have to match
 
+// UNSUPPORTED: libcpp-has-no-wide-characters
+
 #include <sstream>
 
 int main(int, char**)

diff  --git a/libcxx/test/libcxx/iterators/contiguous_iterators.pass.cpp b/libcxx/test/libcxx/iterators/contiguous_iterators.pass.cpp
index 71407bac49f03..dcb573c7a86ff 100644
--- a/libcxx/test/libcxx/iterators/contiguous_iterators.pass.cpp
+++ b/libcxx/test/libcxx/iterators/contiguous_iterators.pass.cpp
@@ -225,10 +225,12 @@ int main(int, char**)
     static_assert(( std::__is_cpp17_contiguous_iterator<std::string::const_iterator>        ::value), "");
     static_assert((!std::__is_cpp17_contiguous_iterator<std::string::reverse_iterator>      ::value), "");
     static_assert((!std::__is_cpp17_contiguous_iterator<std::string::const_reverse_iterator>::value), "");
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     static_assert(( std::__is_cpp17_contiguous_iterator<std::wstring::iterator>              ::value), "");
     static_assert(( std::__is_cpp17_contiguous_iterator<std::wstring::const_iterator>        ::value), "");
     static_assert((!std::__is_cpp17_contiguous_iterator<std::wstring::reverse_iterator>      ::value), "");
     static_assert((!std::__is_cpp17_contiguous_iterator<std::wstring::const_reverse_iterator>::value), "");
+#endif
 
 //  deque is random-access but not contiguous
     static_assert((!std::__is_cpp17_contiguous_iterator<std::deque<int>::iterator>                   ::value), "");

diff  --git a/libcxx/test/libcxx/iterators/failed.pass.cpp b/libcxx/test/libcxx/iterators/failed.pass.cpp
index c47101e20cd12..afb445378fd55 100644
--- a/libcxx/test/libcxx/iterators/failed.pass.cpp
+++ b/libcxx/test/libcxx/iterators/failed.pass.cpp
@@ -25,10 +25,12 @@ int main(int, char**)
         std::ostreambuf_iterator<char> i(nullptr);
         assert(i.failed());
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::ostreambuf_iterator<wchar_t> i(nullptr);
         assert(i.failed());
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/libcxx/iterators/iterator.requirements/iterator.concepts/integer_like.compile.pass.cpp b/libcxx/test/libcxx/iterators/iterator.requirements/iterator.concepts/integer_like.compile.pass.cpp
index c514f6a63b60e..fa400d0a80cf8 100644
--- a/libcxx/test/libcxx/iterators/iterator.requirements/iterator.concepts/integer_like.compile.pass.cpp
+++ b/libcxx/test/libcxx/iterators/iterator.requirements/iterator.concepts/integer_like.compile.pass.cpp
@@ -25,7 +25,9 @@ static_assert(std::__integer_like<unsigned long>);
 static_assert(std::__integer_like<long long>);
 static_assert(std::__integer_like<unsigned long long>);
 static_assert(std::__integer_like<char>);
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
 static_assert(std::__integer_like<wchar_t>);
+#endif
 static_assert(std::__integer_like<char8_t>);
 static_assert(std::__integer_like<char16_t>);
 static_assert(std::__integer_like<char32_t>);
@@ -42,7 +44,9 @@ static_assert(!std::__signed_integer_like<unsigned int>);
 static_assert(!std::__signed_integer_like<unsigned long>);
 static_assert(!std::__signed_integer_like<unsigned long long>);
 static_assert(std::__signed_integer_like<char> == std::signed_integral<char>);
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
 static_assert(std::__signed_integer_like<wchar_t> == std::signed_integral<wchar_t>);
+#endif
 static_assert(std::__signed_integer_like<char8_t> == std::signed_integral<char8_t>);
 static_assert(std::__signed_integer_like<char16_t> == std::signed_integral<char16_t>);
 static_assert(std::__signed_integer_like<char32_t> == std::signed_integral<char32_t>);

diff  --git a/libcxx/test/libcxx/localization/locales/locale.convenience/conversions/conversions.string/ctor_move.pass.cpp b/libcxx/test/libcxx/localization/locales/locale.convenience/conversions/conversions.string/ctor_move.pass.cpp
index dc7979db72279..8816227c327f4 100644
--- a/libcxx/test/libcxx/localization/locales/locale.convenience/conversions/conversions.string/ctor_move.pass.cpp
+++ b/libcxx/test/libcxx/localization/locales/locale.convenience/conversions/conversions.string/ctor_move.pass.cpp
@@ -9,6 +9,8 @@
 // 'do_bytes' throws a std::range_error unexpectedly
 // XFAIL: LIBCXX-WINDOWS-FIXME, powerpc-ibm-aix
 
+// XFAIL: libcpp-has-no-wide-characters
+
 // UNSUPPORTED: c++03
 
 // <locale>

diff  --git a/libcxx/test/libcxx/min_max_macros.compile.pass.cpp b/libcxx/test/libcxx/min_max_macros.compile.pass.cpp
index 18702d6c244ad..d1e2b90ab7f2e 100644
--- a/libcxx/test/libcxx/min_max_macros.compile.pass.cpp
+++ b/libcxx/test/libcxx/min_max_macros.compile.pass.cpp
@@ -112,10 +112,14 @@ TEST_MACROS();
 TEST_MACROS();
 #include <ctype.h>
 TEST_MACROS();
-#include <cwchar>
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+#    include <cwchar>
 TEST_MACROS();
-#include <cwctype>
+#endif
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+#    include <cwctype>
 TEST_MACROS();
+#endif
 #include <deque>
 TEST_MACROS();
 #include <errno.h>
@@ -304,10 +308,14 @@ TEST_MACROS();
 TEST_MACROS();
 #include <version>
 TEST_MACROS();
-#include <wchar.h>
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+#    include <wchar.h>
 TEST_MACROS();
-#include <wctype.h>
+#endif
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+#    include <wctype.h>
 TEST_MACROS();
+#endif
 
 // experimental headers
 #if __cplusplus >= 201103L

diff  --git a/libcxx/test/libcxx/no_assert_include.compile.pass.cpp b/libcxx/test/libcxx/no_assert_include.compile.pass.cpp
index 8b5581f465153..9c80b401dca2b 100644
--- a/libcxx/test/libcxx/no_assert_include.compile.pass.cpp
+++ b/libcxx/test/libcxx/no_assert_include.compile.pass.cpp
@@ -69,8 +69,12 @@
 #include <ctgmath>
 #include <ctime>
 #include <ctype.h>
-#include <cwchar>
-#include <cwctype>
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+#    include <cwchar>
+#endif
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+#    include <cwctype>
+#endif
 #include <deque>
 #include <errno.h>
 #include <exception>
@@ -186,8 +190,12 @@
 #include <variant>
 #include <vector>
 #include <version>
-#include <wchar.h>
-#include <wctype.h>
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+#    include <wchar.h>
+#endif
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
+#    include <wctype.h>
+#endif
 
 // experimental headers
 #if __cplusplus >= 201103L

diff  --git a/libcxx/test/libcxx/strings/c.strings/version_cwchar.pass.cpp b/libcxx/test/libcxx/strings/c.strings/version_cwchar.pass.cpp
index 1e2eff5bbf633..571bdc62cbd30 100644
--- a/libcxx/test/libcxx/strings/c.strings/version_cwchar.pass.cpp
+++ b/libcxx/test/libcxx/strings/c.strings/version_cwchar.pass.cpp
@@ -6,6 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+// XFAIL: libcpp-has-no-wide-characters
+
 // <cwchar>
 
 #include <cwchar>

diff  --git a/libcxx/test/libcxx/strings/c.strings/version_cwctype.pass.cpp b/libcxx/test/libcxx/strings/c.strings/version_cwctype.pass.cpp
index d82198039c585..453ceb198f789 100644
--- a/libcxx/test/libcxx/strings/c.strings/version_cwctype.pass.cpp
+++ b/libcxx/test/libcxx/strings/c.strings/version_cwctype.pass.cpp
@@ -6,6 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+// XFAIL: libcpp-has-no-wide-characters
+
 // <cwctype>
 
 #include <cwctype>

diff  --git a/libcxx/test/libcxx/type_traits/convert_to_integral.pass.cpp b/libcxx/test/libcxx/type_traits/convert_to_integral.pass.cpp
index f7152d2fd8dd5..d8fce1e1414ce 100644
--- a/libcxx/test/libcxx/type_traits/convert_to_integral.pass.cpp
+++ b/libcxx/test/libcxx/type_traits/convert_to_integral.pass.cpp
@@ -87,7 +87,9 @@ int main(int, char**)
   check_integral_types<char, int>();
   check_integral_types<signed char, int>();
   check_integral_types<unsigned char, int>();
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
   check_integral_types<wchar_t, decltype(((wchar_t)1) + 1)>();
+#endif
   check_integral_types<char16_t, int>();
   // On some platforms, unsigned int and long are the same size.  These
   // platforms have a choice of making uint32_t an int or a long.  However

diff  --git a/libcxx/test/libcxx/utilities/format/format.arguments/format.arg/visit_format_arg.pass.cpp b/libcxx/test/libcxx/utilities/format/format.arguments/format.arg/visit_format_arg.pass.cpp
index 03c177b7d1338..b6e34d78c8ac8 100644
--- a/libcxx/test/libcxx/utilities/format/format.arguments/format.arg/visit_format_arg.pass.cpp
+++ b/libcxx/test/libcxx/utilities/format/format.arguments/format.arg/visit_format_arg.pass.cpp
@@ -350,7 +350,9 @@ void test() {
 
 void test() {
   test<char>();
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
   test<wchar_t>();
+#endif
 }
 
 int main(int, char**) {

diff  --git a/libcxx/test/libcxx/utilities/format/format.arguments/format.args/get.pass.cpp b/libcxx/test/libcxx/utilities/format/format.arguments/format.args/get.pass.cpp
index 37116c5b6436b..6f8035bff7707 100644
--- a/libcxx/test/libcxx/utilities/format/format.arguments/format.args/get.pass.cpp
+++ b/libcxx/test/libcxx/utilities/format/format.arguments/format.args/get.pass.cpp
@@ -304,7 +304,9 @@ void test() {
 
 void test() {
   test<char>();
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
   test<wchar_t>();
+#endif
 }
 
 int main(int, char**) {

diff  --git a/libcxx/test/libcxx/utilities/format/format.string/format.string.std/std_format_spec_bool.pass.cpp b/libcxx/test/libcxx/utilities/format/format.string/format.string.std/std_format_spec_bool.pass.cpp
index c6fdbee325320..c32d36340869f 100644
--- a/libcxx/test/libcxx/utilities/format/format.string/format.string.std/std_format_spec_bool.pass.cpp
+++ b/libcxx/test/libcxx/utilities/format/format.string/format.string.std/std_format_spec_bool.pass.cpp
@@ -430,7 +430,9 @@ constexpr void test() {
 
 constexpr bool test() {
   test<char>();
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
   test<wchar_t>();
+#endif
 
   return true;
 }
@@ -440,10 +442,12 @@ int main(int, char**) {
   // Make sure the parsers match the expectations. The layout of the
   // subobjects is chosen to minimize the size required.
   static_assert(sizeof(Parser<char>) == 2 * sizeof(uint32_t));
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
   static_assert(
       sizeof(Parser<wchar_t>) ==
       (sizeof(wchar_t) <= 2 ? 2 * sizeof(uint32_t) : 3 * sizeof(uint32_t)));
 #endif
+#endif // _WIN32
 
   test();
   static_assert(test());

diff  --git a/libcxx/test/libcxx/utilities/format/format.string/format.string.std/std_format_spec_char.pass.cpp b/libcxx/test/libcxx/utilities/format/format.string/format.string.std/std_format_spec_char.pass.cpp
index 07c5bbb815c4f..876c7d247d67e 100644
--- a/libcxx/test/libcxx/utilities/format/format.string/format.string.std/std_format_spec_char.pass.cpp
+++ b/libcxx/test/libcxx/utilities/format/format.string/format.string.std/std_format_spec_char.pass.cpp
@@ -428,7 +428,9 @@ constexpr void test() {
 
 constexpr bool test() {
   test<char>();
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
   test<wchar_t>();
+#endif
 
   return true;
 }
@@ -440,10 +442,12 @@ int main(int, char**) {
   // Make sure the parsers match the expectations. The layout of the
   // subobjects is chosen to minimize the size required.
   static_assert(sizeof(Parser<char>) == 2 * sizeof(uint32_t));
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
   static_assert(
       sizeof(Parser<wchar_t>) ==
       (sizeof(wchar_t) <= 2 ? 2 * sizeof(uint32_t) : 3 * sizeof(uint32_t)));
 #endif
+#endif // _WIN32
 
   test();
   static_assert(test());

diff  --git a/libcxx/test/libcxx/utilities/format/format.string/format.string.std/std_format_spec_integer.pass.cpp b/libcxx/test/libcxx/utilities/format/format.string/format.string.std/std_format_spec_integer.pass.cpp
index d7c3d6a294025..652c2caba022d 100644
--- a/libcxx/test/libcxx/utilities/format/format.string/format.string.std/std_format_spec_integer.pass.cpp
+++ b/libcxx/test/libcxx/utilities/format/format.string/format.string.std/std_format_spec_integer.pass.cpp
@@ -323,7 +323,9 @@ constexpr void test() {
 
 constexpr bool test() {
   test<char>();
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
   test<wchar_t>();
+#endif
 
   return true;
 }
@@ -333,10 +335,12 @@ int main(int, char**) {
   // Make sure the parsers match the expectations. The layout of the
   // subobjects is chosen to minimize the size required.
   static_assert(sizeof(Parser<char>) == 2 * sizeof(uint32_t));
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
   static_assert(
       sizeof(Parser<wchar_t>) ==
       (sizeof(wchar_t) <= 2 ? 2 * sizeof(uint32_t) : 3 * sizeof(uint32_t)));
 #endif
+#endif // _WIN32
 
   test();
   static_assert(test());

diff  --git a/libcxx/test/libcxx/utilities/format/format.string/format.string.std/std_format_spec_string.pass.cpp b/libcxx/test/libcxx/utilities/format/format.string/format.string.std/std_format_spec_string.pass.cpp
index 53753d03d791a..930a6b43ef722 100644
--- a/libcxx/test/libcxx/utilities/format/format.string/format.string.std/std_format_spec_string.pass.cpp
+++ b/libcxx/test/libcxx/utilities/format/format.string/format.string.std/std_format_spec_string.pass.cpp
@@ -351,7 +351,9 @@ constexpr void test() {
 
 constexpr bool test() {
   test<char>();
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
   test<wchar_t>();
+#endif
 #ifndef _LIBCPP_HAS_NO_CHAR8_T
   test<char8_t>();
 #endif
@@ -368,10 +370,12 @@ int main(int, char**) {
   // Make sure the parsers match the expectations. The layout of the
   // subobjects is chosen to minimize the size required.
   LIBCPP_STATIC_ASSERT(sizeof(Parser<char>) == 3 * sizeof(uint32_t));
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
   LIBCPP_STATIC_ASSERT(
       sizeof(Parser<wchar_t>) ==
       (sizeof(wchar_t) <= 2 ? 3 * sizeof(uint32_t) : 4 * sizeof(uint32_t)));
 #endif
+#endif // _WIN32
 
   test();
   static_assert(test());

diff  --git a/libcxx/test/libcxx/utilities/format/format.string/format.string.std/std_format_spec_string_non_unicode.pass.cpp b/libcxx/test/libcxx/utilities/format/format.string/format.string.std/std_format_spec_string_non_unicode.pass.cpp
index 51c0826328d21..f2d338104ff8b 100644
--- a/libcxx/test/libcxx/utilities/format/format.string/format.string.std/std_format_spec_string_non_unicode.pass.cpp
+++ b/libcxx/test/libcxx/utilities/format/format.string/format.string.std/std_format_spec_string_non_unicode.pass.cpp
@@ -91,7 +91,9 @@ constexpr void test() {
 
 constexpr bool test() {
   test<char>();
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
   test<wchar_t>();
+#endif
 #ifndef _LIBCPP_HAS_NO_CHAR8_T
   test<char8_t>();
 #endif

diff  --git a/libcxx/test/libcxx/utilities/format/format.string/format.string.std/std_format_spec_string_unicode.pass.cpp b/libcxx/test/libcxx/utilities/format/format.string/format.string.std/std_format_spec_string_unicode.pass.cpp
index 8109331838a9e..f6337a00c833b 100644
--- a/libcxx/test/libcxx/utilities/format/format.string/format.string.std/std_format_spec_string_unicode.pass.cpp
+++ b/libcxx/test/libcxx/utilities/format/format.string/format.string.std/std_format_spec_string_unicode.pass.cpp
@@ -251,7 +251,9 @@ constexpr void test() {
 
 constexpr bool test() {
   test<char>();
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
   test<wchar_t>();
+#endif
 #ifndef _LIBCPP_HAS_NO_CHAR8_T
   test<char8_t>();
 #endif

diff  --git a/libcxx/test/std/atomics/atomics.types.generic/integral.pass.cpp b/libcxx/test/std/atomics/atomics.types.generic/integral.pass.cpp
index 5f23be8772a9a..b585f455b561f 100644
--- a/libcxx/test/std/atomics/atomics.types.generic/integral.pass.cpp
+++ b/libcxx/test/std/atomics/atomics.types.generic/integral.pass.cpp
@@ -183,7 +183,9 @@ int main(int, char**)
     test<std::atomic_char16_t, char16_t>();
     test<std::atomic_char32_t, char32_t>();
 #endif
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     test<std::atomic_wchar_t, wchar_t>();
+#endif
 
     test<std::atomic_int8_t,    int8_t>();
     test<std::atomic_uint8_t,  uint8_t>();
@@ -209,7 +211,9 @@ int main(int, char**)
     test<volatile std::atomic_char16_t, char16_t>();
     test<volatile std::atomic_char32_t, char32_t>();
 #endif
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     test<volatile std::atomic_wchar_t, wchar_t>();
+#endif
 
     test<volatile std::atomic_int8_t,    int8_t>();
     test<volatile std::atomic_uint8_t,  uint8_t>();

diff  --git a/libcxx/test/std/atomics/atomics.types.generic/integral_typedefs.pass.cpp b/libcxx/test/std/atomics/atomics.types.generic/integral_typedefs.pass.cpp
index 56e0decad48a2..6ae1fa66cb5dd 100644
--- a/libcxx/test/std/atomics/atomics.types.generic/integral_typedefs.pass.cpp
+++ b/libcxx/test/std/atomics/atomics.types.generic/integral_typedefs.pass.cpp
@@ -56,7 +56,9 @@ int main(int, char**)
     static_assert((std::is_same<std::atomic<unsigned long>, std::atomic_ulong>::value), "");
     static_assert((std::is_same<std::atomic<long long>, std::atomic_llong>::value), "");
     static_assert((std::is_same<std::atomic<unsigned long long>, std::atomic_ullong>::value), "");
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     static_assert((std::is_same<std::atomic<wchar_t>, std::atomic_wchar_t>::value), "");
+#endif
 #if TEST_STD_VER > 17 && defined(__cpp_char8_t)
     static_assert((std::is_same<std::atomic<char8_t>, std::atomic_char8_t>::value), "");
 #endif

diff  --git a/libcxx/test/std/atomics/types.pass.cpp b/libcxx/test/std/atomics/types.pass.cpp
index e3f1a43632fbe..21ff0d373a049 100644
--- a/libcxx/test/std/atomics/types.pass.cpp
+++ b/libcxx/test/std/atomics/types.pass.cpp
@@ -118,7 +118,9 @@ int main(int, char**)
 #endif
     test<char16_t>           ();
     test<char32_t>           ();
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     test<wchar_t>            ();
+#endif
 
     test<int_least8_t>   ();
     test<uint_least8_t>  ();

diff  --git a/libcxx/test/std/concepts/concepts.lang/concept.default.init/default_initializable.compile.pass.cpp b/libcxx/test/std/concepts/concepts.lang/concept.default.init/default_initializable.compile.pass.cpp
index 930282f55a5d3..57d3132234f5c 100644
--- a/libcxx/test/std/concepts/concepts.lang/concept.default.init/default_initializable.compile.pass.cpp
+++ b/libcxx/test/std/concepts/concepts.lang/concept.default.init/default_initializable.compile.pass.cpp
@@ -236,14 +236,18 @@ void test()
 
     // Strings
     test_true     <std::string>();
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     test_true     <std::wstring>();
+#endif
     test_true     <std::u8string>();
     test_true     <std::u16string>();
     test_true     <std::u32string>();
 
     // String views
     test_true     <std::string_view>();
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     test_true     <std::wstring_view>();
+#endif
     test_true     <std::u8string_view>();
     test_true     <std::u16string_view>();
     test_true     <std::u32string_view>();

diff  --git a/libcxx/test/std/depr/depr.c.headers/stdint_h.pass.cpp b/libcxx/test/std/depr/depr.c.headers/stdint_h.pass.cpp
index 36f0ae8fd68f7..37945eea6c40a 100644
--- a/libcxx/test/std/depr/depr.c.headers/stdint_h.pass.cpp
+++ b/libcxx/test/std/depr/depr.c.headers/stdint_h.pass.cpp
@@ -11,7 +11,6 @@
 #include <stdint.h>
 #include <cstddef>
 #include <csignal>
-#include <cwctype>
 #include <climits>
 #include <type_traits>
 #include <limits>
@@ -19,6 +18,10 @@
 
 #include "test_macros.h"
 
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
+#   include <cwctype>
+#endif
+
 int main(int, char**)
 {
     // typedef int8_t
@@ -238,6 +241,7 @@ int main(int, char**)
     // SIZE_MAX
     assert(SIZE_MAX == std::numeric_limits<size_t>::max());
 
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     // WCHAR_MIN
     assert(WCHAR_MIN == std::numeric_limits<wchar_t>::min());
 
@@ -249,6 +253,7 @@ int main(int, char**)
 
     // WINT_MAX
     assert(WINT_MAX == std::numeric_limits<wint_t>::max());
+#endif
 
 #ifndef INT8_C
 #error INT8_C not defined

diff  --git a/libcxx/test/std/depr/depr.c.headers/wchar_h.pass.cpp b/libcxx/test/std/depr/depr.c.headers/wchar_h.pass.cpp
index de05a2db63539..e5b8c2c69b808 100644
--- a/libcxx/test/std/depr/depr.c.headers/wchar_h.pass.cpp
+++ b/libcxx/test/std/depr/depr.c.headers/wchar_h.pass.cpp
@@ -6,6 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+// XFAIL: libcpp-has-no-wide-characters
+
 // <wchar.h>
 
 #include <wchar.h>

diff  --git a/libcxx/test/std/depr/depr.c.headers/wctype_h.pass.cpp b/libcxx/test/std/depr/depr.c.headers/wctype_h.pass.cpp
index 8ec5bbd4674a5..1738c6c4c727c 100644
--- a/libcxx/test/std/depr/depr.c.headers/wctype_h.pass.cpp
+++ b/libcxx/test/std/depr/depr.c.headers/wctype_h.pass.cpp
@@ -6,6 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+// XFAIL: libcpp-has-no-wide-characters
+
 // <wctype.h>
 
 #include <wctype.h>

diff  --git a/libcxx/test/std/experimental/iterator/ostream.joiner/ostream.joiner.cons/ostream_joiner.cons.pass.cpp b/libcxx/test/std/experimental/iterator/ostream.joiner/ostream.joiner.cons/ostream_joiner.cons.pass.cpp
index 429388c277a5f..a4210d0ad81ab 100644
--- a/libcxx/test/std/experimental/iterator/ostream.joiner/ostream.joiner.cons/ostream_joiner.cons.pass.cpp
+++ b/libcxx/test/std/experimental/iterator/ostream.joiner/ostream.joiner.cons/ostream_joiner.cons.pass.cpp
@@ -28,33 +28,40 @@ namespace exper = std::experimental;
 int main(int, char**) {
     const char eight = '8';
     const std::string nine = "9";
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     const std::wstring ten = L"10";
+#endif
     const int eleven = 11;
 
-//  Narrow streams w/rvalues
+    // Narrow streams w/rvalues
     { exper::ostream_joiner<char>         oj(std::cout, '8'); }
     { exper::ostream_joiner<std::string>  oj(std::cout, std::string("9")); }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     { exper::ostream_joiner<std::wstring> oj(std::cout, std::wstring(L"10")); }
+#endif
     { exper::ostream_joiner<int>          oj(std::cout, 11); }
 
-//  Narrow streams w/lvalues
+    // Narrow streams w/lvalues
     { exper::ostream_joiner<char>         oj(std::cout, eight); }
     { exper::ostream_joiner<std::string>  oj(std::cout, nine); }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     { exper::ostream_joiner<std::wstring> oj(std::cout, ten); }
+#endif
     { exper::ostream_joiner<int>          oj(std::cout, eleven); }
 
-//  Wide streams w/rvalues
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
+    // Wide streams w/rvalues
     { exper::ostream_joiner<char, wchar_t>         oj(std::wcout, '8'); }
     { exper::ostream_joiner<std::string, wchar_t>  oj(std::wcout, std::string("9")); }
     { exper::ostream_joiner<std::wstring, wchar_t> oj(std::wcout, std::wstring(L"10")); }
     { exper::ostream_joiner<int, wchar_t>          oj(std::wcout, 11); }
 
-//  Wide streams w/lvalues
+    // Wide streams w/lvalues
     { exper::ostream_joiner<char, wchar_t>         oj(std::wcout, eight); }
     { exper::ostream_joiner<std::string, wchar_t>  oj(std::wcout, nine); }
     { exper::ostream_joiner<std::wstring, wchar_t> oj(std::wcout, ten); }
     { exper::ostream_joiner<int, wchar_t>          oj(std::wcout, eleven); }
-
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/experimental/iterator/ostream.joiner/ostream.joiner.ops/ostream_joiner.op.assign.pass.cpp b/libcxx/test/std/experimental/iterator/ostream.joiner/ostream.joiner.ops/ostream_joiner.op.assign.pass.cpp
index 44604d47f17e0..20074735699b0 100644
--- a/libcxx/test/std/experimental/iterator/ostream.joiner/ostream.joiner.ops/ostream_joiner.op.assign.pass.cpp
+++ b/libcxx/test/std/experimental/iterator/ostream.joiner/ostream.joiner.ops/ostream_joiner.op.assign.pass.cpp
@@ -85,8 +85,10 @@ int main(int, char**) {
     test("Z", chars, chars+10, "0Z1Z2Z3Z4Z5Z6Z7Z8Z9");
     test("z", ints,  ints+10,  "10z11z12z13z14z15z16z17z18z19");
 
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     test<char, const char *, wchar_t> ('X', chars, chars+10, L"0X1X2X3X4X5X6X7X8X9");
     test<char, const int *,  wchar_t> ('x',  ints,  ints+10, L"10x11x12x13x14x15x16x17x18x19");
+#endif
 //  test<char, const char *, char16_t>('X', chars, chars+10, u"0X1X2X3X4X5X6X7X8X9");
 //  test<char, const int *,  char16_t>('x',  ints,  ints+10, u"10x11x12x13x14x15x16x17x18x19");
 //  test<char, const char *, char32_t>('X', chars, chars+10, U"0X1X2X3X4X5X6X7X8X9");
@@ -96,6 +98,7 @@ int main(int, char**) {
     test(mutating_delimiter2(), chars, chars+10, "0 1!2\"3#4$5%6&7'8(9");
     }
 
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
     const wchar_t chars[] = L"0123456789";
     const int  ints [] = { 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 };
@@ -116,7 +119,7 @@ int main(int, char**) {
 
     test(mutating_delimiter(), chars, chars+10, L"0 1!2\"3#4$5%6&7'8(9");
     }
-
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
 
   return 0;
 }

diff  --git a/libcxx/test/std/experimental/iterator/ostream.joiner/ostream.joiner.ops/ostream_joiner.op.postincrement.pass.cpp b/libcxx/test/std/experimental/iterator/ostream.joiner/ostream.joiner.ops/ostream_joiner.op.postincrement.pass.cpp
index 9d9457bafdf22..774ee36e389bb 100644
--- a/libcxx/test/std/experimental/iterator/ostream.joiner/ostream.joiner.ops/ostream_joiner.op.postincrement.pass.cpp
+++ b/libcxx/test/std/experimental/iterator/ostream.joiner/ostream.joiner.ops/ostream_joiner.op.postincrement.pass.cpp
@@ -36,13 +36,17 @@ int main(int, char**) {
 
     { exper::ostream_joiner<char>         oj(std::cout, '8');                 test(oj); }
     { exper::ostream_joiner<std::string>  oj(std::cout, std::string("9"));    test(oj); }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     { exper::ostream_joiner<std::wstring> oj(std::cout, std::wstring(L"10")); test(oj); }
+#endif
     { exper::ostream_joiner<int>          oj(std::cout, 11);                  test(oj); }
 
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     { exper::ostream_joiner<char, wchar_t>         oj(std::wcout, '8');                 test(oj); }
     { exper::ostream_joiner<std::string, wchar_t>  oj(std::wcout, std::string("9"));    test(oj); }
     { exper::ostream_joiner<std::wstring, wchar_t> oj(std::wcout, std::wstring(L"10")); test(oj); }
     { exper::ostream_joiner<int, wchar_t>          oj(std::wcout, 11);                  test(oj); }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/experimental/iterator/ostream.joiner/ostream.joiner.ops/ostream_joiner.op.pretincrement.pass.cpp b/libcxx/test/std/experimental/iterator/ostream.joiner/ostream.joiner.ops/ostream_joiner.op.pretincrement.pass.cpp
index f03fbb0e98d50..d8929c44da7bc 100644
--- a/libcxx/test/std/experimental/iterator/ostream.joiner/ostream.joiner.ops/ostream_joiner.op.pretincrement.pass.cpp
+++ b/libcxx/test/std/experimental/iterator/ostream.joiner/ostream.joiner.ops/ostream_joiner.op.pretincrement.pass.cpp
@@ -36,13 +36,17 @@ int main(int, char**) {
 
     { exper::ostream_joiner<char>         oj(std::cout, '8');                 test(oj); }
     { exper::ostream_joiner<std::string>  oj(std::cout, std::string("9"));    test(oj); }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     { exper::ostream_joiner<std::wstring> oj(std::cout, std::wstring(L"10")); test(oj); }
+#endif
     { exper::ostream_joiner<int>          oj(std::cout, 11);                  test(oj); }
 
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     { exper::ostream_joiner<char, wchar_t>         oj(std::wcout, '8');                 test(oj); }
     { exper::ostream_joiner<std::string, wchar_t>  oj(std::wcout, std::string("9"));    test(oj); }
     { exper::ostream_joiner<std::wstring, wchar_t> oj(std::wcout, std::wstring(L"10")); test(oj); }
     { exper::ostream_joiner<int, wchar_t>          oj(std::wcout, 11);                  test(oj); }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/experimental/iterator/ostream.joiner/ostream.joiner.ops/ostream_joiner.op.star.pass.cpp b/libcxx/test/std/experimental/iterator/ostream.joiner/ostream.joiner.ops/ostream_joiner.op.star.pass.cpp
index 6e54879fe64e8..a0804ccb68e1e 100644
--- a/libcxx/test/std/experimental/iterator/ostream.joiner/ostream.joiner.ops/ostream_joiner.op.star.pass.cpp
+++ b/libcxx/test/std/experimental/iterator/ostream.joiner/ostream.joiner.ops/ostream_joiner.op.star.pass.cpp
@@ -36,13 +36,17 @@ int main(int, char**) {
 
     { exper::ostream_joiner<char>         oj(std::cout, '8');                 test(oj); }
     { exper::ostream_joiner<std::string>  oj(std::cout, std::string("9"));    test(oj); }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     { exper::ostream_joiner<std::wstring> oj(std::cout, std::wstring(L"10")); test(oj); }
+#endif
     { exper::ostream_joiner<int>          oj(std::cout, 11);                  test(oj); }
 
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     { exper::ostream_joiner<char, wchar_t>         oj(std::wcout, '8');                 test(oj); }
     { exper::ostream_joiner<std::string, wchar_t>  oj(std::wcout, std::string("9"));    test(oj); }
     { exper::ostream_joiner<std::wstring, wchar_t> oj(std::wcout, std::wstring(L"10")); test(oj); }
     { exper::ostream_joiner<int, wchar_t>          oj(std::wcout, 11);                  test(oj); }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/experimental/memory/memory.resource.aliases/header_regex_synop.pass.cpp b/libcxx/test/std/experimental/memory/memory.resource.aliases/header_regex_synop.pass.cpp
index d407378630b53..7d5c2636b4fd2 100644
--- a/libcxx/test/std/experimental/memory/memory.resource.aliases/header_regex_synop.pass.cpp
+++ b/libcxx/test/std/experimental/memory/memory.resource.aliases/header_regex_synop.pass.cpp
@@ -45,9 +45,11 @@ int main(int, char**)
 {
     {
         test_match_result_typedef<const char*, pmr::cmatch>();
-        test_match_result_typedef<const wchar_t*, pmr::wcmatch>();
         test_match_result_typedef<pmr::string::const_iterator, pmr::smatch>();
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
+        test_match_result_typedef<const wchar_t*, pmr::wcmatch>();
         test_match_result_typedef<pmr::wstring::const_iterator, pmr::wsmatch>();
+#endif
     }
     {
         // Check that std::match_results has been included and is complete.

diff  --git a/libcxx/test/std/experimental/memory/memory.resource.aliases/header_string_synop.pass.cpp b/libcxx/test/std/experimental/memory/memory.resource.aliases/header_string_synop.pass.cpp
index 326ca78389a6d..95cb8e5a8d3dc 100644
--- a/libcxx/test/std/experimental/memory/memory.resource.aliases/header_string_synop.pass.cpp
+++ b/libcxx/test/std/experimental/memory/memory.resource.aliases/header_string_synop.pass.cpp
@@ -54,13 +54,17 @@ int main(int, char**)
 {
     {
         test_string_typedef<char,     pmr::string>();
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
         test_string_typedef<wchar_t,  pmr::wstring>();
+#endif
         test_string_typedef<char16_t, pmr::u16string>();
         test_string_typedef<char32_t, pmr::u32string>();
     }
     {
         test_basic_string_alias<char,    constexpr_char_traits<char>>();
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
         test_basic_string_alias<wchar_t, constexpr_char_traits<wchar_t>>();
+#endif
         test_basic_string_alias<char16_t, constexpr_char_traits<char16_t>>();
         test_basic_string_alias<char32_t, constexpr_char_traits<char32_t>>();
     }

diff  --git a/libcxx/test/std/input.output/file.streams/c.files/cinttypes.pass.cpp b/libcxx/test/std/input.output/file.streams/c.files/cinttypes.pass.cpp
index 5a49bb8ba64af..6b76efd0b0ff2 100644
--- a/libcxx/test/std/input.output/file.streams/c.files/cinttypes.pass.cpp
+++ b/libcxx/test/std/input.output/file.streams/c.files/cinttypes.pass.cpp
@@ -927,8 +927,10 @@ int main(int, char**)
     static_assert((std::is_same<decltype(std::imaxdiv(i, i)), std::imaxdiv_t>::value), "");
     static_assert((std::is_same<decltype(std::strtoimax("", (char**)0, 0)), std::intmax_t>::value), "");
     static_assert((std::is_same<decltype(std::strtoumax("", (char**)0, 0)), std::uintmax_t>::value), "");
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     static_assert((std::is_same<decltype(std::wcstoimax(L"", (wchar_t**)0, 0)), std::intmax_t>::value), "");
     static_assert((std::is_same<decltype(std::wcstoumax(L"", (wchar_t**)0, 0)), std::uintmax_t>::value), "");
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/file.streams/fstreams/filebuf.assign/member_swap.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/filebuf.assign/member_swap.pass.cpp
index c4e67c1f7d262..6febc692165df 100644
--- a/libcxx/test/std/input.output/file.streams/fstreams/filebuf.assign/member_swap.pass.cpp
+++ b/libcxx/test/std/input.output/file.streams/fstreams/filebuf.assign/member_swap.pass.cpp
@@ -36,6 +36,8 @@ int main(int, char**)
         assert(f2.sgetc() == '2');
     }
     std::remove(temp.c_str());
+
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::wfilebuf f;
         assert(f.open(temp.c_str(), std::ios_base::out | std::ios_base::in
@@ -51,6 +53,7 @@ int main(int, char**)
         assert(f2.sgetc() == L'2');
     }
     std::remove(temp.c_str());
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/file.streams/fstreams/filebuf.assign/move_assign.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/filebuf.assign/move_assign.pass.cpp
index 173c9d110ffc4..863fd3ef87a7e 100644
--- a/libcxx/test/std/input.output/file.streams/fstreams/filebuf.assign/move_assign.pass.cpp
+++ b/libcxx/test/std/input.output/file.streams/fstreams/filebuf.assign/move_assign.pass.cpp
@@ -36,6 +36,8 @@ int main(int, char**)
         assert(f2.sgetc() == '2');
     }
     std::remove(temp.c_str());
+
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::wfilebuf f;
         assert(f.open(temp.c_str(), std::ios_base::out | std::ios_base::in
@@ -51,6 +53,7 @@ int main(int, char**)
         assert(f2.sgetc() == L'2');
     }
     std::remove(temp.c_str());
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/file.streams/fstreams/filebuf.assign/nonmember_swap.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/filebuf.assign/nonmember_swap.pass.cpp
index 4b7ec4756197e..4ae3fc22f0664 100644
--- a/libcxx/test/std/input.output/file.streams/fstreams/filebuf.assign/nonmember_swap.pass.cpp
+++ b/libcxx/test/std/input.output/file.streams/fstreams/filebuf.assign/nonmember_swap.pass.cpp
@@ -38,6 +38,8 @@ int main(int, char**)
         assert(f2.sgetc() == '2');
     }
     std::remove(temp.c_str());
+
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::wfilebuf f;
         assert(f.open(temp.c_str(), std::ios_base::out | std::ios_base::in
@@ -53,6 +55,7 @@ int main(int, char**)
         assert(f2.sgetc() == L'2');
     }
     std::remove(temp.c_str());
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/file.streams/fstreams/filebuf.cons/default.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/filebuf.cons/default.pass.cpp
index 58086904f2379..f012fe734b06d 100644
--- a/libcxx/test/std/input.output/file.streams/fstreams/filebuf.cons/default.pass.cpp
+++ b/libcxx/test/std/input.output/file.streams/fstreams/filebuf.cons/default.pass.cpp
@@ -24,10 +24,12 @@ int main(int, char**)
         std::filebuf f;
         assert(!f.is_open());
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::wfilebuf f;
         assert(!f.is_open());
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/file.streams/fstreams/filebuf.cons/move.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/filebuf.cons/move.pass.cpp
index 38aba56540f0d..f618e4324f44d 100644
--- a/libcxx/test/std/input.output/file.streams/fstreams/filebuf.cons/move.pass.cpp
+++ b/libcxx/test/std/input.output/file.streams/fstreams/filebuf.cons/move.pass.cpp
@@ -35,6 +35,8 @@ int main(int, char**)
         assert(f2.sgetc() == '2');
     }
     std::remove(temp.c_str());
+
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::wfilebuf f;
         assert(f.open(temp.c_str(), std::ios_base::out | std::ios_base::in
@@ -49,6 +51,7 @@ int main(int, char**)
         assert(f2.sgetc() == L'2');
     }
     std::remove(temp.c_str());
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/file.streams/fstreams/filebuf.members/open_path.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/filebuf.members/open_path.pass.cpp
index cf852964b9114..81749cfe19c43 100644
--- a/libcxx/test/std/input.output/file.streams/fstreams/filebuf.members/open_path.pass.cpp
+++ b/libcxx/test/std/input.output/file.streams/fstreams/filebuf.members/open_path.pass.cpp
@@ -42,6 +42,8 @@ int main(int, char**) {
     assert(f.sbumpc() == '3');
   }
   std::remove(p.string().c_str());
+
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
   {
     std::wfilebuf f;
     assert(f.open(p, std::ios_base::out) != 0);
@@ -56,7 +58,8 @@ int main(int, char**) {
     assert(f.sbumpc() == L'2');
     assert(f.sbumpc() == L'3');
   }
-  remove(p.string().c_str());
+  std::remove(p.string().c_str());
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/file.streams/fstreams/filebuf.members/open_pointer.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/filebuf.members/open_pointer.pass.cpp
index 8b959880209a5..388d452a7da8a 100644
--- a/libcxx/test/std/input.output/file.streams/fstreams/filebuf.members/open_pointer.pass.cpp
+++ b/libcxx/test/std/input.output/file.streams/fstreams/filebuf.members/open_pointer.pass.cpp
@@ -33,6 +33,8 @@ int main(int, char**)
         assert(f.sbumpc() == '3');
     }
     std::remove(temp.c_str());
+
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::wfilebuf f;
         assert(f.open(temp.c_str(), std::ios_base::out) != 0);
@@ -47,7 +49,8 @@ int main(int, char**)
         assert(f.sbumpc() == L'2');
         assert(f.sbumpc() == L'3');
     }
-    remove(temp.c_str());
+    std::remove(temp.c_str());
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/file.streams/fstreams/filebuf.virtuals/overflow.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/filebuf.virtuals/overflow.pass.cpp
index 69ab2788d77c2..d4f8f0f2c322c 100644
--- a/libcxx/test/std/input.output/file.streams/fstreams/filebuf.virtuals/overflow.pass.cpp
+++ b/libcxx/test/std/input.output/file.streams/fstreams/filebuf.virtuals/overflow.pass.cpp
@@ -80,6 +80,8 @@ int main(int, char**)
         assert(f.sgetc() == 'a');
     }
     std::remove("overflow.dat");
+
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         test_buf<wchar_t> f;
         assert(f.open("overflow.dat", std::ios_base::out) != 0);
@@ -143,6 +145,7 @@ int main(int, char**)
         assert(f.sbumpc() == -1);
     }
     std::remove("overflow.dat");
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/file.streams/fstreams/filebuf.virtuals/seekoff.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/filebuf.virtuals/seekoff.pass.cpp
index f9e8938da9ee6..475974e3acd39 100644
--- a/libcxx/test/std/input.output/file.streams/fstreams/filebuf.virtuals/seekoff.pass.cpp
+++ b/libcxx/test/std/input.output/file.streams/fstreams/filebuf.virtuals/seekoff.pass.cpp
@@ -43,6 +43,8 @@ int main(int, char**)
         assert(f.sgetc() == 'l');
     }
     std::remove("seekoff.dat");
+
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         wchar_t buf[10];
         typedef std::filebuf::pos_type pos_type;
@@ -64,6 +66,7 @@ int main(int, char**)
         assert(f.sgetc() == L'l');
     }
     std::remove("seekoff.dat");
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/file.streams/fstreams/filebuf.virtuals/underflow.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/filebuf.virtuals/underflow.pass.cpp
index 1954ffa5aa290..7adc07da9d380 100644
--- a/libcxx/test/std/input.output/file.streams/fstreams/filebuf.virtuals/underflow.pass.cpp
+++ b/libcxx/test/std/input.output/file.streams/fstreams/filebuf.virtuals/underflow.pass.cpp
@@ -78,6 +78,7 @@ int main(int, char**)
         assert(*f.gptr() == '9');
         assert(f.egptr() - f.gptr() == 1);
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         test_buf<wchar_t> f;
         assert(f.open("underflow.dat", std::ios_base::in) != 0);
@@ -125,6 +126,7 @@ int main(int, char**)
         assert(f.sbumpc() == 0x4E53);
         assert(f.sbumpc() == static_cast<Traits::int_type>(-1));
     }
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/file.streams/fstreams/fstream.assign/member_swap.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/fstream.assign/member_swap.pass.cpp
index d08ca9e04326d..392fc40c6196f 100644
--- a/libcxx/test/std/input.output/file.streams/fstreams/fstream.assign/member_swap.pass.cpp
+++ b/libcxx/test/std/input.output/file.streams/fstreams/fstream.assign/member_swap.pass.cpp
@@ -65,6 +65,8 @@ int main(int, char**)
     }
     std::remove(temp1.c_str());
     std::remove(temp2.c_str());
+
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::wfstream fs1(temp1.c_str(), std::ios_base::in | std::ios_base::out
                                                    | std::ios_base::trunc);
@@ -88,6 +90,7 @@ int main(int, char**)
     }
     std::remove(temp1.c_str());
     std::remove(temp2.c_str());
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/file.streams/fstreams/fstream.assign/move_assign.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/fstream.assign/move_assign.pass.cpp
index 9bc7887f839fd..90a7cf6ed69c6 100644
--- a/libcxx/test/std/input.output/file.streams/fstreams/fstream.assign/move_assign.pass.cpp
+++ b/libcxx/test/std/input.output/file.streams/fstreams/fstream.assign/move_assign.pass.cpp
@@ -33,6 +33,8 @@ int main(int, char**)
         assert(x == 3.25);
     }
     std::remove(temp.c_str());
+
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::wfstream fso(temp.c_str(), std::ios_base::in | std::ios_base::out
                                                   | std::ios_base::trunc);
@@ -45,6 +47,7 @@ int main(int, char**)
         assert(x == 3.25);
     }
     std::remove(temp.c_str());
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/file.streams/fstreams/fstream.assign/nonmember_swap.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/fstream.assign/nonmember_swap.pass.cpp
index e222392ffff97..287716f365353 100644
--- a/libcxx/test/std/input.output/file.streams/fstreams/fstream.assign/nonmember_swap.pass.cpp
+++ b/libcxx/test/std/input.output/file.streams/fstreams/fstream.assign/nonmember_swap.pass.cpp
@@ -67,6 +67,8 @@ int main(int, char**)
     }
     std::remove(temp1.c_str());
     std::remove(temp2.c_str());
+
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::wfstream fs1(temp1.c_str(), std::ios_base::in | std::ios_base::out
                                                    | std::ios_base::trunc);
@@ -90,6 +92,7 @@ int main(int, char**)
     }
     std::remove(temp1.c_str());
     std::remove(temp2.c_str());
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/file.streams/fstreams/fstream.cons/default.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/fstream.cons/default.pass.cpp
index ac746783cc9e7..5749de2d1e6a4 100644
--- a/libcxx/test/std/input.output/file.streams/fstreams/fstream.cons/default.pass.cpp
+++ b/libcxx/test/std/input.output/file.streams/fstreams/fstream.cons/default.pass.cpp
@@ -23,9 +23,11 @@ int main(int, char**)
     {
         std::fstream fs;
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::wfstream fs;
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/file.streams/fstreams/fstream.cons/move.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/fstream.cons/move.pass.cpp
index e210b562ac949..b282e7fc5f6ec 100644
--- a/libcxx/test/std/input.output/file.streams/fstreams/fstream.cons/move.pass.cpp
+++ b/libcxx/test/std/input.output/file.streams/fstreams/fstream.cons/move.pass.cpp
@@ -32,6 +32,8 @@ int main(int, char**)
         assert(x == 3.25);
     }
     std::remove(temp.c_str());
+
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::wfstream fso(temp, std::ios_base::in | std::ios_base::out
                                                   | std::ios_base::trunc);
@@ -43,6 +45,7 @@ int main(int, char**)
         assert(x == 3.25);
     }
     std::remove(temp.c_str());
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/file.streams/fstreams/fstream.cons/path.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/fstream.cons/path.pass.cpp
index 364fe72817aeb..6714e62ce0b5c 100644
--- a/libcxx/test/std/input.output/file.streams/fstreams/fstream.cons/path.pass.cpp
+++ b/libcxx/test/std/input.output/file.streams/fstreams/fstream.cons/path.pass.cpp
@@ -40,6 +40,8 @@ int main(int, char**) {
     assert(x == 3.25);
   }
   std::remove(p.string().c_str());
+
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
   {
     std::wfstream fs(p, std::ios_base::in | std::ios_base::out |
                             std::ios_base::trunc);
@@ -50,6 +52,7 @@ int main(int, char**) {
     assert(x == 3.25);
   }
   std::remove(p.string().c_str());
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/file.streams/fstreams/fstream.cons/pointer.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/fstream.cons/pointer.pass.cpp
index 5ecdcc51e286e..63f8b049e69f2 100644
--- a/libcxx/test/std/input.output/file.streams/fstreams/fstream.cons/pointer.pass.cpp
+++ b/libcxx/test/std/input.output/file.streams/fstreams/fstream.cons/pointer.pass.cpp
@@ -31,6 +31,8 @@ int main(int, char**)
         assert(x == 3.25);
     }
     std::remove(temp.c_str());
+
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::wfstream fs(temp.c_str(), std::ios_base::in | std::ios_base::out
                                                  | std::ios_base::trunc);
@@ -41,6 +43,7 @@ int main(int, char**)
         assert(x == 3.25);
     }
     std::remove(temp.c_str());
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/file.streams/fstreams/fstream.cons/string.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/fstream.cons/string.pass.cpp
index d07926ac6ae8a..80b3fe4f464e9 100644
--- a/libcxx/test/std/input.output/file.streams/fstreams/fstream.cons/string.pass.cpp
+++ b/libcxx/test/std/input.output/file.streams/fstreams/fstream.cons/string.pass.cpp
@@ -32,6 +32,8 @@ int main(int, char**)
         assert(x == 3.25);
     }
     std::remove(temp.c_str());
+
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::wfstream fs(temp,
                          std::ios_base::in | std::ios_base::out
@@ -43,6 +45,7 @@ int main(int, char**)
         assert(x == 3.25);
     }
     std::remove(temp.c_str());
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/file.streams/fstreams/fstream.members/close.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/fstream.members/close.pass.cpp
index ac708d12e5362..d1ab079698213 100644
--- a/libcxx/test/std/input.output/file.streams/fstreams/fstream.members/close.pass.cpp
+++ b/libcxx/test/std/input.output/file.streams/fstreams/fstream.members/close.pass.cpp
@@ -30,6 +30,8 @@ int main(int, char**)
         assert(!fs.is_open());
     }
     std::remove(temp.c_str());
+
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::wfstream fs;
         assert(!fs.is_open());
@@ -39,6 +41,7 @@ int main(int, char**)
         assert(!fs.is_open());
     }
     std::remove(temp.c_str());
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/file.streams/fstreams/fstream.members/open_path.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/fstream.members/open_path.pass.cpp
index 824201a7cf074..e44dde9eecc29 100644
--- a/libcxx/test/std/input.output/file.streams/fstreams/fstream.members/open_path.pass.cpp
+++ b/libcxx/test/std/input.output/file.streams/fstreams/fstream.members/open_path.pass.cpp
@@ -40,6 +40,8 @@ int main(int, char**) {
     assert(x == 3.25);
   }
   std::remove(p.string().c_str());
+
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
   {
     std::wfstream stream;
     assert(!stream.is_open());
@@ -53,6 +55,7 @@ int main(int, char**) {
     assert(x == 3.25);
   }
   std::remove(p.string().c_str());
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/file.streams/fstreams/fstream.members/open_pointer.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/fstream.members/open_pointer.pass.cpp
index a406c6afb8493..acfc282d33ef5 100644
--- a/libcxx/test/std/input.output/file.streams/fstreams/fstream.members/open_pointer.pass.cpp
+++ b/libcxx/test/std/input.output/file.streams/fstreams/fstream.members/open_pointer.pass.cpp
@@ -34,6 +34,8 @@ int main(int, char**)
         assert(x == 3.25);
     }
     std::remove(temp.c_str());
+
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::wfstream fs;
         assert(!fs.is_open());
@@ -47,6 +49,7 @@ int main(int, char**)
         assert(x == 3.25);
     }
     std::remove(temp.c_str());
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/file.streams/fstreams/fstream.members/open_string.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/fstream.members/open_string.pass.cpp
index 854b668e843e2..8ee0fe49c5da5 100644
--- a/libcxx/test/std/input.output/file.streams/fstreams/fstream.members/open_string.pass.cpp
+++ b/libcxx/test/std/input.output/file.streams/fstreams/fstream.members/open_string.pass.cpp
@@ -34,6 +34,8 @@ int main(int, char**)
         assert(x == 3.25);
     }
     std::remove(temp.c_str());
+
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::wfstream fs;
         assert(!fs.is_open());
@@ -47,6 +49,7 @@ int main(int, char**)
         assert(x == 3.25);
     }
     std::remove(temp.c_str());
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/file.streams/fstreams/fstream.members/rdbuf.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/fstream.members/rdbuf.pass.cpp
index 2d86c25eb034d..7216b084c19b7 100644
--- a/libcxx/test/std/input.output/file.streams/fstreams/fstream.members/rdbuf.pass.cpp
+++ b/libcxx/test/std/input.output/file.streams/fstreams/fstream.members/rdbuf.pass.cpp
@@ -24,10 +24,13 @@ int main(int, char**)
         std::fstream fs;
         assert(fs.rdbuf());
     }
+
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::wfstream fs;
         assert(fs.rdbuf());
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/file.streams/fstreams/ifstream.assign/member_swap.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/ifstream.assign/member_swap.pass.cpp
index 7a5d9c18d1749..0115959e36584 100644
--- a/libcxx/test/std/input.output/file.streams/fstreams/ifstream.assign/member_swap.pass.cpp
+++ b/libcxx/test/std/input.output/file.streams/fstreams/ifstream.assign/member_swap.pass.cpp
@@ -32,6 +32,7 @@ int main(int, char**)
         fs2 >> x;
         assert(x == 3.25);
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::wifstream fs1("test.dat");
         std::wifstream fs2("test2.dat");
@@ -42,6 +43,7 @@ int main(int, char**)
         fs2 >> x;
         assert(x == 3.25);
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/file.streams/fstreams/ifstream.assign/move_assign.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/ifstream.assign/move_assign.pass.cpp
index 439db87a0eba3..abb3863c12984 100644
--- a/libcxx/test/std/input.output/file.streams/fstreams/ifstream.assign/move_assign.pass.cpp
+++ b/libcxx/test/std/input.output/file.streams/fstreams/ifstream.assign/move_assign.pass.cpp
@@ -30,6 +30,7 @@ int main(int, char**)
         fs >> x;
         assert(x == 3.25);
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::wifstream fso("test.dat");
         std::wifstream fs;
@@ -38,6 +39,7 @@ int main(int, char**)
         fs >> x;
         assert(x == 3.25);
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/file.streams/fstreams/ifstream.assign/nonmember_swap.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/ifstream.assign/nonmember_swap.pass.cpp
index f04c5e4b52da5..f22193d62a0f1 100644
--- a/libcxx/test/std/input.output/file.streams/fstreams/ifstream.assign/nonmember_swap.pass.cpp
+++ b/libcxx/test/std/input.output/file.streams/fstreams/ifstream.assign/nonmember_swap.pass.cpp
@@ -33,6 +33,7 @@ int main(int, char**)
         fs2 >> x;
         assert(x == 3.25);
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::wifstream fs1("test.dat");
         std::wifstream fs2("test2.dat");
@@ -43,6 +44,7 @@ int main(int, char**)
         fs2 >> x;
         assert(x == 3.25);
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/file.streams/fstreams/ifstream.cons/default.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/ifstream.cons/default.pass.cpp
index e4fffa7f81b93..043db1581d8ee 100644
--- a/libcxx/test/std/input.output/file.streams/fstreams/ifstream.cons/default.pass.cpp
+++ b/libcxx/test/std/input.output/file.streams/fstreams/ifstream.cons/default.pass.cpp
@@ -23,9 +23,11 @@ int main(int, char**)
     {
         std::ifstream fs;
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::wifstream fs;
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/file.streams/fstreams/ifstream.cons/move.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/ifstream.cons/move.pass.cpp
index 28f55f6a857db..f21943a56a0dd 100644
--- a/libcxx/test/std/input.output/file.streams/fstreams/ifstream.cons/move.pass.cpp
+++ b/libcxx/test/std/input.output/file.streams/fstreams/ifstream.cons/move.pass.cpp
@@ -29,6 +29,7 @@ int main(int, char**)
         fs >> x;
         assert(x == 3.25);
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::wifstream fso("test.dat");
         std::wifstream fs = std::move(fso);
@@ -36,6 +37,7 @@ int main(int, char**)
         fs >> x;
         assert(x == 3.25);
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/file.streams/fstreams/ifstream.cons/path.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/ifstream.cons/path.pass.cpp
index aef3014f670a4..98643765fddf9 100644
--- a/libcxx/test/std/input.output/file.streams/fstreams/ifstream.cons/path.pass.cpp
+++ b/libcxx/test/std/input.output/file.streams/fstreams/ifstream.cons/path.pass.cpp
@@ -48,6 +48,8 @@ int main(int, char**) {
   // std::ifstream(const fs::path&, std::ios_base::openmode) is tested in
   // test/std/input.output/file.streams/fstreams/ofstream.cons/string.pass.cpp
   // which creates writable files.
+
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
   {
     std::wifstream fs(fs::path("test.dat"));
     double x = 0;
@@ -57,6 +59,7 @@ int main(int, char**) {
   // std::wifstream(const fs::path&, std::ios_base::openmode) is tested in
   // test/std/input.output/file.streams/fstreams/ofstream.cons/string.pass.cpp
   // which creates writable files.
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/file.streams/fstreams/ifstream.cons/pointer.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/ifstream.cons/pointer.pass.cpp
index e6674255e50b0..bd0880477ff80 100644
--- a/libcxx/test/std/input.output/file.streams/fstreams/ifstream.cons/pointer.pass.cpp
+++ b/libcxx/test/std/input.output/file.streams/fstreams/ifstream.cons/pointer.pass.cpp
@@ -31,6 +31,8 @@ int main(int, char**)
     // std::ifstream(const char*, std::ios_base::openmode) is tested in
     // test/std/input.output/file.streams/fstreams/ofstream.cons/pointer.pass.cpp
     // which creates writable files.
+
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::wifstream fs("test.dat");
         double x = 0;
@@ -40,6 +42,7 @@ int main(int, char**)
     // std::wifstream(const char*, std::ios_base::openmode) is tested in
     // test/std/input.output/file.streams/fstreams/ofstream.cons/pointer.pass.cpp
     // which creates writable files.
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/file.streams/fstreams/ifstream.cons/string.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/ifstream.cons/string.pass.cpp
index f0e96256e2674..ae7976b1a0581 100644
--- a/libcxx/test/std/input.output/file.streams/fstreams/ifstream.cons/string.pass.cpp
+++ b/libcxx/test/std/input.output/file.streams/fstreams/ifstream.cons/string.pass.cpp
@@ -31,6 +31,8 @@ int main(int, char**)
     // std::ifstream(const std::string&, std::ios_base::openmode) is tested in
     // test/std/input.output/file.streams/fstreams/ofstream.cons/string.pass.cpp
     // which creates writable files.
+
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::wifstream fs(std::string("test.dat"));
         double x = 0;
@@ -40,6 +42,7 @@ int main(int, char**)
     // std::wifstream(const std::string&, std::ios_base::openmode) is tested in
     // test/std/input.output/file.streams/fstreams/ofstream.cons/string.pass.cpp
     // which creates writable files.
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/file.streams/fstreams/ifstream.members/close.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/ifstream.members/close.pass.cpp
index 3641dfdc15acf..534e66edfc13c 100644
--- a/libcxx/test/std/input.output/file.streams/fstreams/ifstream.members/close.pass.cpp
+++ b/libcxx/test/std/input.output/file.streams/fstreams/ifstream.members/close.pass.cpp
@@ -30,6 +30,7 @@ int main(int, char**)
         fs.close();
         assert(!fs.is_open());
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::wifstream fs;
         assert(!fs.is_open());
@@ -38,6 +39,7 @@ int main(int, char**)
         fs.close();
         assert(!fs.is_open());
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/file.streams/fstreams/ifstream.members/open_path.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/ifstream.members/open_path.pass.cpp
index 2bb46b876b14e..67f741efb479a 100644
--- a/libcxx/test/std/input.output/file.streams/fstreams/ifstream.members/open_path.pass.cpp
+++ b/libcxx/test/std/input.output/file.streams/fstreams/ifstream.members/open_path.pass.cpp
@@ -40,6 +40,7 @@ int main(int, char**) {
     fs >> c;
     assert(c == 'r');
   }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
   {
     std::wifstream fs;
     assert(!fs.is_open());
@@ -52,6 +53,7 @@ int main(int, char**) {
     fs >> c;
     assert(c == L'r');
   }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/file.streams/fstreams/ifstream.members/open_pointer.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/ifstream.members/open_pointer.pass.cpp
index 4626f968e53d5..ebd9909080a9b 100644
--- a/libcxx/test/std/input.output/file.streams/fstreams/ifstream.members/open_pointer.pass.cpp
+++ b/libcxx/test/std/input.output/file.streams/fstreams/ifstream.members/open_pointer.pass.cpp
@@ -34,6 +34,7 @@ int main(int, char**)
         fs >> c;
         assert(c == 'r');
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::wifstream fs;
         assert(!fs.is_open());
@@ -46,6 +47,7 @@ int main(int, char**)
         fs >> c;
         assert(c == L'r');
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/file.streams/fstreams/ifstream.members/open_string.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/ifstream.members/open_string.pass.cpp
index 35722d52849fb..f50cc96538613 100644
--- a/libcxx/test/std/input.output/file.streams/fstreams/ifstream.members/open_string.pass.cpp
+++ b/libcxx/test/std/input.output/file.streams/fstreams/ifstream.members/open_string.pass.cpp
@@ -34,6 +34,7 @@ int main(int, char**)
         fs >> c;
         assert(c == 'r');
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::wifstream fs;
         assert(!fs.is_open());
@@ -46,6 +47,7 @@ int main(int, char**)
         fs >> c;
         assert(c == L'r');
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/file.streams/fstreams/ifstream.members/rdbuf.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/ifstream.members/rdbuf.pass.cpp
index aa6cbb20f1aff..c51a8079f1823 100644
--- a/libcxx/test/std/input.output/file.streams/fstreams/ifstream.members/rdbuf.pass.cpp
+++ b/libcxx/test/std/input.output/file.streams/fstreams/ifstream.members/rdbuf.pass.cpp
@@ -27,11 +27,13 @@ int main(int, char**)
         std::filebuf* fb = fs.rdbuf();
         assert(fb->sgetc() == 'r');
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::wifstream fs("test.dat");
         std::wfilebuf* fb = fs.rdbuf();
         assert(fb->sgetc() == L'r');
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/file.streams/fstreams/ofstream.assign/member_swap.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/ofstream.assign/member_swap.pass.cpp
index 4917bbf89a0f1..37cb0a6373d7f 100644
--- a/libcxx/test/std/input.output/file.streams/fstreams/ofstream.assign/member_swap.pass.cpp
+++ b/libcxx/test/std/input.output/file.streams/fstreams/ofstream.assign/member_swap.pass.cpp
@@ -69,6 +69,8 @@ int main(int, char**)
         assert(x == 3.25);
     }
     std::remove(temp2.c_str());
+
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::wofstream fs1(temp1.c_str());
         std::wofstream fs2(temp2.c_str());
@@ -96,6 +98,7 @@ int main(int, char**)
         assert(x == 3.25);
     }
     std::remove(temp2.c_str());
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/file.streams/fstreams/ofstream.assign/move_assign.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/ofstream.assign/move_assign.pass.cpp
index 4db1e6c3b35fb..71e57a1f9bcb2 100644
--- a/libcxx/test/std/input.output/file.streams/fstreams/ofstream.assign/move_assign.pass.cpp
+++ b/libcxx/test/std/input.output/file.streams/fstreams/ofstream.assign/move_assign.pass.cpp
@@ -34,6 +34,8 @@ int main(int, char**)
         assert(x == 3.25);
     }
     std::remove(temp.c_str());
+
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::wofstream fso(temp.c_str());
         std::wofstream fs;
@@ -47,6 +49,7 @@ int main(int, char**)
         assert(x == 3.25);
     }
     std::remove(temp.c_str());
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/file.streams/fstreams/ofstream.assign/nonmember_swap.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/ofstream.assign/nonmember_swap.pass.cpp
index 1ee265a4ba46e..831d53c5f83b2 100644
--- a/libcxx/test/std/input.output/file.streams/fstreams/ofstream.assign/nonmember_swap.pass.cpp
+++ b/libcxx/test/std/input.output/file.streams/fstreams/ofstream.assign/nonmember_swap.pass.cpp
@@ -70,6 +70,8 @@ int main(int, char**)
         assert(x == 3.25);
     }
     std::remove(temp2.c_str());
+
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::wofstream fs1(temp1.c_str());
         std::wofstream fs2(temp2.c_str());
@@ -97,6 +99,7 @@ int main(int, char**)
         assert(x == 3.25);
     }
     std::remove(temp2.c_str());
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/file.streams/fstreams/ofstream.cons/default.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/ofstream.cons/default.pass.cpp
index 1b0ad8240e0cf..347013312a343 100644
--- a/libcxx/test/std/input.output/file.streams/fstreams/ofstream.cons/default.pass.cpp
+++ b/libcxx/test/std/input.output/file.streams/fstreams/ofstream.cons/default.pass.cpp
@@ -23,9 +23,11 @@ int main(int, char**)
     {
         std::ofstream fs;
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::wofstream fs;
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/file.streams/fstreams/ofstream.cons/move.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/ofstream.cons/move.pass.cpp
index 01676f0e75a0d..a06ad43de87f6 100644
--- a/libcxx/test/std/input.output/file.streams/fstreams/ofstream.cons/move.pass.cpp
+++ b/libcxx/test/std/input.output/file.streams/fstreams/ofstream.cons/move.pass.cpp
@@ -33,6 +33,8 @@ int main(int, char**)
         assert(x == 3.25);
     }
     std::remove(temp.c_str());
+
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::wofstream fso(temp.c_str());
         std::wofstream fs = std::move(fso);
@@ -45,6 +47,7 @@ int main(int, char**)
         assert(x == 3.25);
     }
     std::remove(temp.c_str());
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/file.streams/fstreams/ofstream.cons/path.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/ofstream.cons/path.pass.cpp
index 5dc1f74bdaf9d..3a8be7fe0f449 100644
--- a/libcxx/test/std/input.output/file.streams/fstreams/ofstream.cons/path.pass.cpp
+++ b/libcxx/test/std/input.output/file.streams/fstreams/ofstream.cons/path.pass.cpp
@@ -53,6 +53,8 @@ int main(int, char**) {
     assert(x == 3.25);
   }
   std::remove(p.string().c_str());
+
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
   {
     std::wofstream stream(p);
     stream << 3.25;
@@ -70,6 +72,7 @@ int main(int, char**) {
     assert(x == 3.25);
   }
   std::remove(p.string().c_str());
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/file.streams/fstreams/ofstream.cons/pointer.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/ofstream.cons/pointer.pass.cpp
index a00f763dfa74d..b43f0ff8ebd9f 100644
--- a/libcxx/test/std/input.output/file.streams/fstreams/ofstream.cons/pointer.pass.cpp
+++ b/libcxx/test/std/input.output/file.streams/fstreams/ofstream.cons/pointer.pass.cpp
@@ -38,6 +38,8 @@ int main(int, char**)
         assert(x == 3.25);
     }
     std::remove(temp.c_str());
+
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::wofstream fs(temp.c_str());
         fs << 3.25;
@@ -55,6 +57,7 @@ int main(int, char**)
         assert(x == 3.25);
     }
     std::remove(temp.c_str());
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/file.streams/fstreams/ofstream.cons/string.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/ofstream.cons/string.pass.cpp
index bd81f19260871..4c0823e2574aa 100644
--- a/libcxx/test/std/input.output/file.streams/fstreams/ofstream.cons/string.pass.cpp
+++ b/libcxx/test/std/input.output/file.streams/fstreams/ofstream.cons/string.pass.cpp
@@ -38,6 +38,8 @@ int main(int, char**)
         assert(x == 3.25);
     }
     std::remove(temp.c_str());
+
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::wofstream fs(temp);
         fs << 3.25;
@@ -55,6 +57,7 @@ int main(int, char**)
         assert(x == 3.25);
     }
     std::remove(temp.c_str());
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/file.streams/fstreams/ofstream.members/close.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/ofstream.members/close.pass.cpp
index 21c362a57933a..bcab4b3a55ee4 100644
--- a/libcxx/test/std/input.output/file.streams/fstreams/ofstream.members/close.pass.cpp
+++ b/libcxx/test/std/input.output/file.streams/fstreams/ofstream.members/close.pass.cpp
@@ -30,6 +30,8 @@ int main(int, char**)
         assert(!fs.is_open());
     }
     std::remove(temp.c_str());
+
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::wofstream fs;
         assert(!fs.is_open());
@@ -39,6 +41,7 @@ int main(int, char**)
         assert(!fs.is_open());
     }
     std::remove(temp.c_str());
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/file.streams/fstreams/ofstream.members/open_path.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/ofstream.members/open_path.pass.cpp
index 2c8fa8ad846cf..36f81dfb110f9 100644
--- a/libcxx/test/std/input.output/file.streams/fstreams/ofstream.members/open_path.pass.cpp
+++ b/libcxx/test/std/input.output/file.streams/fstreams/ofstream.members/open_path.pass.cpp
@@ -46,6 +46,8 @@ int main(int, char**) {
     assert(c == 'a');
   }
   std::remove(p.string().c_str());
+
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
   {
     std::wofstream fs;
     assert(!fs.is_open());
@@ -63,6 +65,7 @@ int main(int, char**) {
     assert(c == L'a');
   }
   std::remove(p.string().c_str());
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/file.streams/fstreams/ofstream.members/open_pointer.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/ofstream.members/open_pointer.pass.cpp
index eb39065c22d73..6b9d157ef4308 100644
--- a/libcxx/test/std/input.output/file.streams/fstreams/ofstream.members/open_pointer.pass.cpp
+++ b/libcxx/test/std/input.output/file.streams/fstreams/ofstream.members/open_pointer.pass.cpp
@@ -38,6 +38,8 @@ int main(int, char**)
         assert(c == 'a');
     }
     std::remove(temp.c_str());
+
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::wofstream fs;
         assert(!fs.is_open());
@@ -55,6 +57,7 @@ int main(int, char**)
         assert(c == L'a');
     }
     std::remove(temp.c_str());
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/file.streams/fstreams/ofstream.members/open_string.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/ofstream.members/open_string.pass.cpp
index e817bbe677709..61bd22b9981e0 100644
--- a/libcxx/test/std/input.output/file.streams/fstreams/ofstream.members/open_string.pass.cpp
+++ b/libcxx/test/std/input.output/file.streams/fstreams/ofstream.members/open_string.pass.cpp
@@ -38,6 +38,8 @@ int main(int, char**)
         assert(c == 'a');
     }
     std::remove(temp.c_str());
+
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::wofstream fs;
         assert(!fs.is_open());
@@ -55,6 +57,7 @@ int main(int, char**)
         assert(c == L'a');
     }
     std::remove(temp.c_str());
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/file.streams/fstreams/ofstream.members/rdbuf.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/ofstream.members/rdbuf.pass.cpp
index dab7e3286f35c..6af86658bce08 100644
--- a/libcxx/test/std/input.output/file.streams/fstreams/ofstream.members/rdbuf.pass.cpp
+++ b/libcxx/test/std/input.output/file.streams/fstreams/ofstream.members/rdbuf.pass.cpp
@@ -27,12 +27,15 @@ int main(int, char**)
         assert(fb->sputc('r') == 'r');
     }
     std::remove(temp.c_str());
+
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::wofstream fs(temp.c_str());
         std::wfilebuf* fb = fs.rdbuf();
         assert(fb->sputc(L'r') == L'r');
     }
     std::remove(temp.c_str());
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/filesystems/class.path/path.member/path.append.pass.cpp b/libcxx/test/std/input.output/filesystems/class.path/path.member/path.append.pass.cpp
index 5157161bae872..799c89c681c3f 100644
--- a/libcxx/test/std/input.output/filesystems/class.path/path.member/path.append.pass.cpp
+++ b/libcxx/test/std/input.output/filesystems/class.path/path.member/path.append.pass.cpp
@@ -386,14 +386,18 @@ int main(int, char**)
       assert(&Res == &LHS);
     }
     doAppendSourceTest<char>    (TC);
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     doAppendSourceTest<wchar_t> (TC);
+#endif
     doAppendSourceTest<char16_t>(TC);
     doAppendSourceTest<char32_t>(TC);
   }
   for (auto const & TC : LongLHSCases) {
     (void)TC;
     LIBCPP_ONLY(doAppendSourceAllocTest<char>(TC));
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     LIBCPP_ONLY(doAppendSourceAllocTest<wchar_t>(TC));
+#endif
   }
   test_sfinae();
 

diff  --git a/libcxx/test/std/input.output/filesystems/class.path/path.member/path.assign/source.pass.cpp b/libcxx/test/std/input.output/filesystems/class.path/path.member/path.assign/source.pass.cpp
index def6c43eb6597..235c3c6baa946 100644
--- a/libcxx/test/std/input.output/filesystems/class.path/path.member/path.assign/source.pass.cpp
+++ b/libcxx/test/std/input.output/filesystems/class.path/path.member/path.assign/source.pass.cpp
@@ -236,7 +236,9 @@ void RunStringMoveTest(const fs::path::value_type* Expect) {
 int main(int, char**) {
   for (auto const& MS : PathList) {
     RunTestCase<char>(MS);
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     RunTestCase<wchar_t>(MS);
+#endif
     RunTestCase<char16_t>(MS);
     RunTestCase<char32_t>(MS);
     RunStringMoveTest(MS);

diff  --git a/libcxx/test/std/input.output/filesystems/class.path/path.member/path.charconv.pass.cpp b/libcxx/test/std/input.output/filesystems/class.path/path.member/path.charconv.pass.cpp
index 4f9dc265d0d3c..f8e8da49dbadc 100644
--- a/libcxx/test/std/input.output/filesystems/class.path/path.member/path.charconv.pass.cpp
+++ b/libcxx/test/std/input.output/filesystems/class.path/path.member/path.charconv.pass.cpp
@@ -39,11 +39,6 @@
 #include "test_macros.h"
 #include "filesystem_test_helper.h"
 
-// libstdc++ doesn't define conversions from/to wchar_t outside of windows.
-#if defined(__GLIBCXX__) && !defined(_WIN32)
-#  define HAS_NO_WCHAR
-#endif
-
 // Test conversion with strings that fit within the latin1 charset, that fit
 // within one code point in UTF-16, and that can be expressible in certain
 // one-byte code pages.
@@ -57,7 +52,7 @@ static void test_latin_unicode()
 #else
   const char u8str[] = { char(0xc3), char(0xa5), char(0xc3), char(0xa4), char(0xc3), char(0xb6), 0x00 };
 #endif
-#ifndef HAS_NO_WCHAR
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
   const wchar_t wstr[] = { 0xe5, 0xe4, 0xf6, 0x00 };
 #endif
 
@@ -112,7 +107,7 @@ static void test_latin_unicode()
     assert(p.string<char8_t>() == u8str);
   }
 #endif
-#ifndef HAS_NO_WCHAR
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
   // Test conversion to/from wchar_t.
   {
     const fs::path p(u16str);
@@ -132,7 +127,7 @@ static void test_latin_unicode()
     assert(p.u32string() == u32str);
     assert(p.string<wchar_t>() == wstr);
   }
-#endif
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
 #ifndef _WIN32
   // Test conversion to/from regular char-based string. On POSIX, this
   // is implied to convert to/from UTF-8.
@@ -226,14 +221,13 @@ static void test_wide_unicode()
     assert(p.u16string() == u16str);
     assert(p.u32string() == u32str);
   }
-#if !defined(HAS_NO_WCHAR) && defined(__SIZEOF_WCHAR_T__)
-#if __SIZEOF_WCHAR_T__ == 2
+#if !defined(TEST_HAS_NO_WIDE_CHARACTERS) && defined(__SIZEOF_WCHAR_T__)
+# if __SIZEOF_WCHAR_T__ == 2
   const wchar_t wstr[] = { 0xd801, 0xdc37, 0x00 };
-#else
+# else
   const wchar_t wstr[] = { 0x10437, 0x00 };
-#endif
+# endif
   // Test conversion to/from wchar_t.
-  // libstdc++ doesn't define conversions from/to wchar_t outside of windows.
   {
     const fs::path p = fs::u8path(str);
     assert(p.wstring() == wstr);
@@ -253,7 +247,7 @@ static void test_wide_unicode()
     assert(p.u32string() == u32str);
     assert(p.wstring() == wstr);
   }
-#endif
+#endif // !defined(TEST_HAS_NO_WIDE_CHARACTERS) && defined(__SIZEOF_WCHAR_T__)
 }
 
 // Test appending paths in 
diff erent encodings.
@@ -273,14 +267,13 @@ static void test_append()
     p /= u32str;
     assert(p.u32string() == u32ref);
   }
-#if !defined(HAS_NO_WCHAR) && defined(__SIZEOF_WCHAR_T__)
-#if __SIZEOF_WCHAR_T__ == 2
+#if !defined(TEST_HAS_NO_WIDE_CHARACTERS) && defined(__SIZEOF_WCHAR_T__)
+# if __SIZEOF_WCHAR_T__ == 2
   const wchar_t wstr[] = { 0xd801, 0xdc37, 0x00 };
-#else
+# else
   const wchar_t wstr[] = { 0x10437, 0x00 };
-#endif
+# endif
   // Test conversion from wchar_t.
-  // libstdc++ doesn't define conversions from/to wchar_t outside of windows.
   {
     fs::path p = fs::path(u16str) / wstr / u32str;
     assert(p.u32string() == u32ref);
@@ -291,7 +284,7 @@ static void test_append()
     p /= u32str;
     assert(p.u32string() == u32ref);
   }
-#endif
+#endif // !defined(TEST_HAS_NO_WIDE_CHARACTERS) && defined(__SIZEOF_WCHAR_T__)
 }
 
 static void test_concat()
@@ -308,14 +301,13 @@ static void test_concat()
     p = fs::u8path(str).concat(u16str).concat(u32str);
     assert(p.u32string() == u32ref);
   }
-#if !defined(HAS_NO_WCHAR) && defined(__SIZEOF_WCHAR_T__)
-#if __SIZEOF_WCHAR_T__ == 2
+#if !defined(TEST_HAS_NO_WIDE_CHARACTERS) && defined(__SIZEOF_WCHAR_T__)
+# if __SIZEOF_WCHAR_T__ == 2
   const wchar_t wstr[] = { 0xd801, 0xdc37, 0x00 };
-#else
+# else
   const wchar_t wstr[] = { 0x10437, 0x00 };
-#endif
+# endif
   // Test conversion from wchar_t.
-  // libstdc++ doesn't define conversions from/to wchar_t outside of windows.
   {
     fs::path p = fs::path(u16str);
     p += wstr;
@@ -324,7 +316,7 @@ static void test_concat()
     p = fs::path(u16str).concat(wstr).concat(u32str);
     assert(p.u32string() == u32ref);
   }
-#endif
+#endif // !defined(TEST_HAS_NO_WIDE_CHARACTERS) && defined(__SIZEOF_WCHAR_T__)
 }
 
 static void test_append_concat_narrow()

diff  --git a/libcxx/test/std/input.output/filesystems/class.path/path.member/path.concat.pass.cpp b/libcxx/test/std/input.output/filesystems/class.path/path.member/path.concat.pass.cpp
index 6212e1d706338..3442e30484d16 100644
--- a/libcxx/test/std/input.output/filesystems/class.path/path.member/path.concat.pass.cpp
+++ b/libcxx/test/std/input.output/filesystems/class.path/path.member/path.concat.pass.cpp
@@ -361,7 +361,9 @@ int main(int, char**)
       assert(&Ref == &LHS);
     }
     doConcatSourceTest<char>    (TC);
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     doConcatSourceTest<wchar_t> (TC);
+#endif
     doConcatSourceTest<char16_t>(TC);
     doConcatSourceTest<char32_t>(TC);
   }
@@ -392,11 +394,15 @@ int main(int, char**)
       assert(LHS == E);
     }
     LIBCPP_ONLY(doConcatSourceAllocTest<char>(TC));
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     LIBCPP_ONLY(doConcatSourceAllocTest<wchar_t>(TC));
+#endif
   }
   for (auto const& TC : CharTestCases) {
     doConcatECharTest<char>(TC);
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     doConcatECharTest<wchar_t>(TC);
+#endif
     doConcatECharTest<char16_t>(TC);
     doConcatECharTest<char32_t>(TC);
   }

diff  --git a/libcxx/test/std/input.output/filesystems/class.path/path.member/path.construct/source.pass.cpp b/libcxx/test/std/input.output/filesystems/class.path/path.member/path.construct/source.pass.cpp
index f689769e302f3..64cebeb7eea2a 100644
--- a/libcxx/test/std/input.output/filesystems/class.path/path.member/path.construct/source.pass.cpp
+++ b/libcxx/test/std/input.output/filesystems/class.path/path.member/path.construct/source.pass.cpp
@@ -129,7 +129,9 @@ int main(int, char**) {
 #if TEST_STD_VER > 17 && defined(__cpp_char8_t)
     RunTestCase<char8_t>(MS);
 #endif
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     RunTestCase<wchar_t>(MS);
+#endif
     RunTestCase<char16_t>(MS);
     RunTestCase<char32_t>(MS);
   }

diff  --git a/libcxx/test/std/input.output/filesystems/class.path/path.member/path.generic.obs/generic_string_alloc.pass.cpp b/libcxx/test/std/input.output/filesystems/class.path/path.member/path.generic.obs/generic_string_alloc.pass.cpp
index 8034e22080890..7d8893adadf7f 100644
--- a/libcxx/test/std/input.output/filesystems/class.path/path.member/path.generic.obs/generic_string_alloc.pass.cpp
+++ b/libcxx/test/std/input.output/filesystems/class.path/path.member/path.generic.obs/generic_string_alloc.pass.cpp
@@ -62,7 +62,9 @@ void doAllocTest()
 int main(int, char**)
 {
   doAllocTest<char>();
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
   doAllocTest<wchar_t>();
+#endif
   doAllocTest<char16_t>();
   doAllocTest<char32_t>();
 #if TEST_STD_VER > 17 && defined(__cpp_lib_char8_t)

diff  --git a/libcxx/test/std/input.output/filesystems/class.path/path.member/path.generic.obs/named_overloads.pass.cpp b/libcxx/test/std/input.output/filesystems/class.path/path.member/path.generic.obs/named_overloads.pass.cpp
index d8991592efcf4..bc547e5485f36 100644
--- a/libcxx/test/std/input.output/filesystems/class.path/path.member/path.generic.obs/named_overloads.pass.cpp
+++ b/libcxx/test/std/input.output/filesystems/class.path/path.member/path.generic.obs/named_overloads.pass.cpp
@@ -62,10 +62,12 @@ int main(int, char**)
     assert(s == (const char*)MS);
 #endif
   }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
   {
     std::wstring s = p.generic_wstring();
     assert(s == (const wchar_t*)MS);
   }
+#endif
   {
     std::u16string s = p.generic_u16string();
     assert(s == (const char16_t*)MS);

diff  --git a/libcxx/test/std/input.output/filesystems/class.path/path.member/path.native.obs/named_overloads.pass.cpp b/libcxx/test/std/input.output/filesystems/class.path/path.member/path.native.obs/named_overloads.pass.cpp
index 05075a31c0135..6611da48d74ab 100644
--- a/libcxx/test/std/input.output/filesystems/class.path/path.member/path.native.obs/named_overloads.pass.cpp
+++ b/libcxx/test/std/input.output/filesystems/class.path/path.member/path.native.obs/named_overloads.pass.cpp
@@ -56,10 +56,12 @@ int main(int, char**)
     assert(s == (const char*)MS);
 #endif
   }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
   {
     std::wstring s = p.wstring();
     assert(s == (const wchar_t*)MS);
   }
+#endif
   {
     std::u16string s = p.u16string();
     assert(s == (const char16_t*)MS);

diff  --git a/libcxx/test/std/input.output/filesystems/class.path/path.nonmember/path.io.pass.cpp b/libcxx/test/std/input.output/filesystems/class.path/path.nonmember/path.io.pass.cpp
index 7c60ae208a58f..572967175ea76 100644
--- a/libcxx/test/std/input.output/filesystems/class.path/path.nonmember/path.io.pass.cpp
+++ b/libcxx/test/std/input.output/filesystems/class.path/path.nonmember/path.io.pass.cpp
@@ -36,8 +36,6 @@
 MultiStringType InStr =  MKSTR("abcdefg/\"hijklmnop\"/qrstuvwxyz/123456789");
 MultiStringType OutStr = MKSTR("\"abcdefg/\\\"hijklmnop\\\"/qrstuvwxyz/123456789\"");
 
-
-
 template <class CharT>
 void doIOTest() {
   using namespace fs;
@@ -83,15 +81,19 @@ template <class Stream, class Tp>
 struct is_istreamable : decltype(impl::is_istreamable_imp<Stream, Tp>(0)) {};
 
 void test_LWG2989() {
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
   static_assert(!is_ostreamable<decltype(std::cout), std::wstring>::value, "");
   static_assert(!is_ostreamable<decltype(std::wcout), std::string>::value, "");
   static_assert(!is_istreamable<decltype(std::cin), std::wstring>::value, "");
   static_assert(!is_istreamable<decltype(std::wcin), std::string>::value, "");
+#endif
 }
 
 int main(int, char**) {
   doIOTest<char>();
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
   doIOTest<wchar_t>();
+#endif
   //doIOTest<char16_t>();
   //doIOTest<char32_t>();
   test_LWG2989();

diff  --git a/libcxx/test/std/input.output/iostream.format/ext.manip/get_money.pass.cpp b/libcxx/test/std/input.output/iostream.format/ext.manip/get_money.pass.cpp
index a2934b21826d8..e6cce946a7391 100644
--- a/libcxx/test/std/input.output/iostream.format/ext.manip/get_money.pass.cpp
+++ b/libcxx/test/std/input.output/iostream.format/ext.manip/get_money.pass.cpp
@@ -59,6 +59,7 @@ int main(int, char**)
         is >> std::get_money(x, true);
         assert(x == -123456789);
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         testbuf<wchar_t> sb(L"  -$1,234,567.89");
         std::wistream is(&sb);
@@ -75,6 +76,7 @@ int main(int, char**)
         is >> std::get_money(x, true);
         assert(x == -123456789);
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/iostream.format/ext.manip/get_time.pass.cpp b/libcxx/test/std/input.output/iostream.format/ext.manip/get_time.pass.cpp
index 7fd353c4c0a02..addf53fcdeb30 100644
--- a/libcxx/test/std/input.output/iostream.format/ext.manip/get_time.pass.cpp
+++ b/libcxx/test/std/input.output/iostream.format/ext.manip/get_time.pass.cpp
@@ -57,6 +57,7 @@ int main(int, char**)
         assert(is.eof());
         assert(!is.fail());
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         testbuf<wchar_t> sb(L"  Sat Dec 31 23:55:59 2061");
         std::wistream is(&sb);
@@ -73,6 +74,7 @@ int main(int, char**)
         assert(is.eof());
         assert(!is.fail());
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/iostream.format/ext.manip/put_money.pass.cpp b/libcxx/test/std/input.output/iostream.format/ext.manip/put_money.pass.cpp
index acb4552e20e25..1678412014ba9 100644
--- a/libcxx/test/std/input.output/iostream.format/ext.manip/put_money.pass.cpp
+++ b/libcxx/test/std/input.output/iostream.format/ext.manip/put_money.pass.cpp
@@ -73,6 +73,7 @@ int main(int, char**)
         os << std::put_money(x, true);
         assert(sb.str() == "-USD 1,234,567.89");
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         testbuf<wchar_t> sb;
         std::wostream os(&sb);
@@ -91,6 +92,7 @@ int main(int, char**)
         os << std::put_money(x, true);
         assert(sb.str() == L"-USD 1,234,567.89");
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/iostream.format/ext.manip/put_time.pass.cpp b/libcxx/test/std/input.output/iostream.format/ext.manip/put_time.pass.cpp
index 620896788afb9..7de93bef0f7b8 100644
--- a/libcxx/test/std/input.output/iostream.format/ext.manip/put_time.pass.cpp
+++ b/libcxx/test/std/input.output/iostream.format/ext.manip/put_time.pass.cpp
@@ -69,6 +69,7 @@ int main(int, char**)
         os << std::put_time(&t, "%a %b %d %H:%M:%S %Y");
         assert(sb.str() == "Sat Dec 31 23:55:59 2061");
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         testbuf<wchar_t> sb;
         std::wostream os(&sb);
@@ -84,6 +85,7 @@ int main(int, char**)
         os << std::put_time(&t, L"%a %b %d %H:%M:%S %Y");
         assert(sb.str() == L"Sat Dec 31 23:55:59 2061");
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/iostream.format/input.streams/iostreamclass/iostream.assign/member_swap.pass.cpp b/libcxx/test/std/input.output/iostream.format/input.streams/iostreamclass/iostream.assign/member_swap.pass.cpp
index 00e44f9fdea30..a1fbc7dd06517 100644
--- a/libcxx/test/std/input.output/iostream.format/input.streams/iostreamclass/iostream.assign/member_swap.pass.cpp
+++ b/libcxx/test/std/input.output/iostream.format/input.streams/iostreamclass/iostream.assign/member_swap.pass.cpp
@@ -60,6 +60,7 @@ int main(int, char**)
         assert(is2.precision() == 6);
         assert(is2.getloc().name() == "C");
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         testbuf<wchar_t> sb1;
         testbuf<wchar_t> sb2;
@@ -83,6 +84,7 @@ int main(int, char**)
         assert(is2.precision() == 6);
         assert(is2.getloc().name() == "C");
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/iostream.format/input.streams/iostreamclass/iostream.assign/move_assign.pass.cpp b/libcxx/test/std/input.output/iostream.format/input.streams/iostreamclass/iostream.assign/move_assign.pass.cpp
index fb1f524c7123e..b8b2f013cf6e9 100644
--- a/libcxx/test/std/input.output/iostream.format/input.streams/iostreamclass/iostream.assign/move_assign.pass.cpp
+++ b/libcxx/test/std/input.output/iostream.format/input.streams/iostreamclass/iostream.assign/move_assign.pass.cpp
@@ -63,6 +63,7 @@ int main(int, char**)
         assert(is2.precision() == 6);
         assert(is2.getloc().name() == "C");
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         testbuf<wchar_t> sb1;
         testbuf<wchar_t> sb2;
@@ -86,6 +87,7 @@ int main(int, char**)
         assert(is2.precision() == 6);
         assert(is2.getloc().name() == "C");
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/iostream.format/input.streams/iostreamclass/iostream.cons/move.pass.cpp b/libcxx/test/std/input.output/iostream.format/input.streams/iostreamclass/iostream.cons/move.pass.cpp
index 2a4e1a6b1123b..c1761fce3146c 100644
--- a/libcxx/test/std/input.output/iostream.format/input.streams/iostreamclass/iostream.cons/move.pass.cpp
+++ b/libcxx/test/std/input.output/iostream.format/input.streams/iostreamclass/iostream.cons/move.pass.cpp
@@ -56,6 +56,7 @@ int main(int, char**)
         assert(is.precision() == 6);
         assert(is.getloc().name() == "C");
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         testbuf<wchar_t> sb;
         test_iostream<wchar_t> is1(&sb);
@@ -72,6 +73,7 @@ int main(int, char**)
         assert(is.precision() == 6);
         assert(is.getloc().name() == "C");
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/iostream.format/input.streams/iostreamclass/iostream.cons/streambuf.pass.cpp b/libcxx/test/std/input.output/iostream.format/input.streams/iostreamclass/iostream.cons/streambuf.pass.cpp
index 012737fa480de..e30560e440fda 100644
--- a/libcxx/test/std/input.output/iostream.format/input.streams/iostreamclass/iostream.cons/streambuf.pass.cpp
+++ b/libcxx/test/std/input.output/iostream.format/input.streams/iostreamclass/iostream.cons/streambuf.pass.cpp
@@ -40,6 +40,7 @@ int main(int, char**)
         assert(is.getloc().name() == "C");
         assert(is.gcount() == 0);
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         testbuf<wchar_t> sb;
         std::basic_iostream<wchar_t> is(&sb);
@@ -53,6 +54,7 @@ int main(int, char**)
         assert(is.getloc().name() == "C");
         assert(is.gcount() == 0);
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/bool.pass.cpp b/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/bool.pass.cpp
index ea354a487e7b8..fa14790720649 100644
--- a/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/bool.pass.cpp
+++ b/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/bool.pass.cpp
@@ -69,6 +69,7 @@ int main(int, char**)
         assert(!is.eof());
         assert(!is.fail());
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         testbuf<wchar_t> sb(L" 1 ");
         std::wistream is(&sb);
@@ -78,6 +79,7 @@ int main(int, char**)
         assert(!is.eof());
         assert(!is.fail());
     }
+#endif
 #ifndef TEST_HAS_NO_EXCEPTIONS
     {
         testbuf<char> sb;

diff  --git a/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/double.pass.cpp b/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/double.pass.cpp
index a3f977bcd1e8b..85d13b3886056 100644
--- a/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/double.pass.cpp
+++ b/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/double.pass.cpp
@@ -69,6 +69,7 @@ int main(int, char**)
         assert(!is.eof());
         assert(!is.fail());
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         testbuf<wchar_t> sb(L" -123.5 ");
         std::wistream is(&sb);
@@ -78,6 +79,7 @@ int main(int, char**)
         assert(!is.eof());
         assert(!is.fail());
     }
+#endif
 #ifndef TEST_HAS_NO_EXCEPTIONS
     {
         testbuf<char> sb;

diff  --git a/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/float.pass.cpp b/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/float.pass.cpp
index 2d68dfddd076e..44ba89a504223 100644
--- a/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/float.pass.cpp
+++ b/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/float.pass.cpp
@@ -69,6 +69,7 @@ int main(int, char**)
         assert(!is.eof());
         assert(!is.fail());
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         testbuf<wchar_t> sb(L" -123.5 ");
         std::wistream is(&sb);
@@ -78,6 +79,7 @@ int main(int, char**)
         assert(!is.eof());
         assert(!is.fail());
     }
+#endif
 #ifndef TEST_HAS_NO_EXCEPTIONS
     {
         testbuf<char> sb;

diff  --git a/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/int.pass.cpp b/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/int.pass.cpp
index 563b8d2dff7e6..5ab45157f0d59 100644
--- a/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/int.pass.cpp
+++ b/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/int.pass.cpp
@@ -70,6 +70,7 @@ int main(int, char**)
         assert(!is.eof());
         assert(!is.fail());
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         testbuf<wchar_t> sb(L" -1234567890123456 ");
         std::wistream is(&sb);
@@ -79,6 +80,7 @@ int main(int, char**)
         assert(!is.eof());
         assert( is.fail());
     }
+#endif
 #ifndef TEST_HAS_NO_EXCEPTIONS
     {
         testbuf<char> sb;

diff  --git a/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/long.pass.cpp b/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/long.pass.cpp
index 5d00260a64703..4af857865e14f 100644
--- a/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/long.pass.cpp
+++ b/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/long.pass.cpp
@@ -69,6 +69,7 @@ int main(int, char**)
         assert(!is.eof());
         assert(!is.fail());
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         testbuf<wchar_t> sb(L" -123 ");
         std::wistream is(&sb);
@@ -78,6 +79,7 @@ int main(int, char**)
         assert(!is.eof());
         assert(!is.fail());
     }
+#endif
 #ifndef TEST_HAS_NO_EXCEPTIONS
     {
         testbuf<char> sb;

diff  --git a/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/long_double.pass.cpp b/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/long_double.pass.cpp
index ed198d54a5463..e7d707413b38d 100644
--- a/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/long_double.pass.cpp
+++ b/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/long_double.pass.cpp
@@ -69,6 +69,7 @@ int main(int, char**)
         assert(!is.eof());
         assert(!is.fail());
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         testbuf<wchar_t> sb(L" -123.5 ");
         std::wistream is(&sb);
@@ -78,6 +79,7 @@ int main(int, char**)
         assert(!is.eof());
         assert(!is.fail());
     }
+#endif
 #ifndef TEST_HAS_NO_EXCEPTIONS
     {
         testbuf<char> sb;

diff  --git a/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/long_long.pass.cpp b/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/long_long.pass.cpp
index d6ccc11ee9927..e13237cabb172 100644
--- a/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/long_long.pass.cpp
+++ b/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/long_long.pass.cpp
@@ -69,6 +69,7 @@ int main(int, char**)
         assert(!is.eof());
         assert(!is.fail());
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         testbuf<wchar_t> sb(L" -123 ");
         std::wistream is(&sb);
@@ -78,6 +79,7 @@ int main(int, char**)
         assert(!is.eof());
         assert(!is.fail());
     }
+#endif
 #ifndef TEST_HAS_NO_EXCEPTIONS
     {
         testbuf<char> sb;

diff  --git a/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/pointer.pass.cpp b/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/pointer.pass.cpp
index 9b9fab8b9e790..f3b5bbac7017c 100644
--- a/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/pointer.pass.cpp
+++ b/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/pointer.pass.cpp
@@ -69,6 +69,7 @@ int main(int, char**)
         assert(!is.eof());
         assert(!is.fail());
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         testbuf<wchar_t> sb(L" 1 ");
         std::wistream is(&sb);
@@ -78,6 +79,7 @@ int main(int, char**)
         assert(!is.eof());
         assert(!is.fail());
     }
+#endif
     {
         testbuf<char> sb("12345678");
         std::istream is(&sb);
@@ -87,6 +89,7 @@ int main(int, char**)
         assert( is.eof());
         assert(!is.fail());
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         testbuf<wchar_t> sb(L"12345678");
         std::wistream is(&sb);
@@ -96,6 +99,7 @@ int main(int, char**)
         assert( is.eof());
         assert(!is.fail());
     }
+#endif
 #ifndef TEST_HAS_NO_EXCEPTIONS
     {
         testbuf<char> sb;

diff  --git a/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/short.pass.cpp b/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/short.pass.cpp
index dbecc33c5308c..4f9c1a1579286 100644
--- a/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/short.pass.cpp
+++ b/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/short.pass.cpp
@@ -70,6 +70,7 @@ int main(int, char**)
         assert(!is.eof());
         assert(!is.fail());
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         testbuf<wchar_t> sb(L" -1234567890 ");
         std::wistream is(&sb);
@@ -79,6 +80,7 @@ int main(int, char**)
         assert(!is.eof());
         assert( is.fail());
     }
+#endif
 #ifndef TEST_HAS_NO_EXCEPTIONS
     {
         testbuf<char> sb;

diff  --git a/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/unsigned_int.pass.cpp b/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/unsigned_int.pass.cpp
index d0ad52174524a..64bafa1b304a6 100644
--- a/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/unsigned_int.pass.cpp
+++ b/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/unsigned_int.pass.cpp
@@ -69,6 +69,7 @@ int main(int, char**)
         assert(!is.eof());
         assert(!is.fail());
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         testbuf<wchar_t> sb(L" 123 ");
         std::wistream is(&sb);
@@ -78,6 +79,7 @@ int main(int, char**)
         assert(!is.eof());
         assert(!is.fail());
     }
+#endif
 #ifndef TEST_HAS_NO_EXCEPTIONS
     {
         testbuf<char> sb;

diff  --git a/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/unsigned_long.pass.cpp b/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/unsigned_long.pass.cpp
index 984c18890e9ce..764ca34207ad7 100644
--- a/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/unsigned_long.pass.cpp
+++ b/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/unsigned_long.pass.cpp
@@ -69,6 +69,7 @@ int main(int, char**)
         assert(!is.eof());
         assert(!is.fail());
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         testbuf<wchar_t> sb(L" 123 ");
         std::wistream is(&sb);
@@ -78,6 +79,7 @@ int main(int, char**)
         assert(!is.eof());
         assert(!is.fail());
     }
+#endif
 #ifndef TEST_HAS_NO_EXCEPTIONS
     {
         testbuf<char> sb;

diff  --git a/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/unsigned_long_long.pass.cpp b/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/unsigned_long_long.pass.cpp
index a67ae60a8322b..25dface597b1b 100644
--- a/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/unsigned_long_long.pass.cpp
+++ b/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/unsigned_long_long.pass.cpp
@@ -69,6 +69,7 @@ int main(int, char**)
         assert(!is.eof());
         assert(!is.fail());
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         testbuf<wchar_t> sb(L" 123 ");
         std::wistream is(&sb);
@@ -78,6 +79,7 @@ int main(int, char**)
         assert(!is.eof());
         assert(!is.fail());
     }
+#endif
 #ifndef TEST_HAS_NO_EXCEPTIONS
     {
         testbuf<char> sb;

diff  --git a/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/unsigned_short.pass.cpp b/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/unsigned_short.pass.cpp
index 7157c885cc368..e01cd3d86eaf6 100644
--- a/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/unsigned_short.pass.cpp
+++ b/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/unsigned_short.pass.cpp
@@ -69,6 +69,7 @@ int main(int, char**)
         assert(!is.eof());
         assert(!is.fail());
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         testbuf<wchar_t> sb(L" 123 ");
         std::wistream is(&sb);
@@ -78,6 +79,7 @@ int main(int, char**)
         assert(!is.eof());
         assert(!is.fail());
     }
+#endif
 #ifndef TEST_HAS_NO_EXCEPTIONS
     {
         testbuf<char> sb;

diff  --git a/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream_extractors/chart.pass.cpp b/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream_extractors/chart.pass.cpp
index 15f26fcaaa37f..ca7df067086ee 100644
--- a/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream_extractors/chart.pass.cpp
+++ b/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream_extractors/chart.pass.cpp
@@ -67,6 +67,7 @@ int main(int, char**)
         assert(!is.fail());
         assert(c == 'c');
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         testbuf<wchar_t> sb(L"   abc");
         std::wistream is(&sb);
@@ -84,6 +85,7 @@ int main(int, char**)
         assert(!is.fail());
         assert(c == L'c');
     }
+#endif
 #ifndef TEST_HAS_NO_EXCEPTIONS
     {
         testbuf<char> sb;
@@ -103,6 +105,7 @@ int main(int, char**)
         assert(is.eof());
         assert(threw);
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         testbuf<wchar_t> sb;
         std::basic_istream<wchar_t> is(&sb);
@@ -121,6 +124,7 @@ int main(int, char**)
         assert(is.eof());
         assert(threw);
     }
+#endif
     {
         testbuf<char> sb;
         std::basic_istream<char> is(&sb);
@@ -139,6 +143,7 @@ int main(int, char**)
         assert(is.eof());
         assert(threw);
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         testbuf<wchar_t> sb;
         std::basic_istream<wchar_t> is(&sb);
@@ -157,6 +162,7 @@ int main(int, char**)
         assert(is.eof());
         assert(threw);
     }
+#endif
 #endif // TEST_HAS_NO_EXCEPTIONS
 
     return 0;

diff  --git a/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream_extractors/streambuf.pass.cpp b/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream_extractors/streambuf.pass.cpp
index d71f29595e251..ff96d125f0981 100644
--- a/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream_extractors/streambuf.pass.cpp
+++ b/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream_extractors/streambuf.pass.cpp
@@ -86,6 +86,7 @@ int main(int, char**)
         assert( is.eof());
         assert(!is.fail());
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         testbuf<wchar_t> sb(L" ");
         std::basic_istream<wchar_t> is(&sb);
@@ -102,6 +103,7 @@ int main(int, char**)
         assert( is.eof());
         assert(!is.fail());
     }
+#endif
 
     {
         testbuf<char> sb;
@@ -119,6 +121,7 @@ int main(int, char**)
         assert( is.eof());
         assert( is.fail());
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         testbuf<wchar_t> sb;
         std::basic_istream<wchar_t> is(&sb);
@@ -135,6 +138,7 @@ int main(int, char**)
         assert( is.eof());
         assert( is.fail());
     }
+#endif
 
     {
         testbuf<char> sb;
@@ -151,6 +155,7 @@ int main(int, char**)
         assert(!is.eof());
         assert( is.fail());
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         testbuf<wchar_t> sb;
         std::basic_istream<wchar_t> is(&sb);
@@ -167,6 +172,7 @@ int main(int, char**)
         assert( is.fail());
     }
 #endif
+#endif // TEST_HAS_NO_EXCEPTIONS
 
     return 0;
 }

diff  --git a/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream_extractors/wchar_t_pointer.pass.cpp b/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream_extractors/wchar_t_pointer.pass.cpp
index 117a0ba83e373..736849b7f0d9c 100644
--- a/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream_extractors/wchar_t_pointer.pass.cpp
+++ b/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream_extractors/wchar_t_pointer.pass.cpp
@@ -61,6 +61,7 @@ int main(int, char**)
         assert(std::string(s) == "abc");
     }
 #endif
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         testbuf<wchar_t> sb(L"   abcdefghijk    ");
         std::wistream is(&sb);
@@ -93,6 +94,7 @@ int main(int, char**)
         assert(std::wstring(s) == L"abc");
     }
 #endif
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
     {
         testbuf<char> sb("   abcdefghijk");
         std::istream is(&sb);
@@ -135,6 +137,7 @@ int main(int, char**)
         assert(is.eof());
         assert(threw);
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         testbuf<wchar_t> sb;
         std::wistream is(&sb);
@@ -154,6 +157,7 @@ int main(int, char**)
         assert(is.eof());
         assert(threw);
     }
+#endif
     {
         testbuf<char> sb;
         std::basic_istream<char> is(&sb);
@@ -173,6 +177,7 @@ int main(int, char**)
         assert(is.eof());
         assert(threw);
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         testbuf<wchar_t> sb;
         std::wistream is(&sb);
@@ -192,6 +197,7 @@ int main(int, char**)
         assert(is.eof());
         assert(threw);
     }
+#endif
 #endif // TEST_HAS_NO_EXCEPTIONS
 
     return 0;

diff  --git a/libcxx/test/std/input.output/iostream.format/input.streams/istream.manip/ws.pass.cpp b/libcxx/test/std/input.output/iostream.format/input.streams/istream.manip/ws.pass.cpp
index 0eaf58b69b3df..96c3b74ce2ea7 100644
--- a/libcxx/test/std/input.output/iostream.format/input.streams/istream.manip/ws.pass.cpp
+++ b/libcxx/test/std/input.output/iostream.format/input.streams/istream.manip/ws.pass.cpp
@@ -49,6 +49,7 @@ int main(int, char**)
         assert(is.good());
         assert(is.peek() == '1');
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         testbuf<wchar_t> sb(L"   123");
         std::wistream is(&sb);
@@ -56,6 +57,7 @@ int main(int, char**)
         assert(is.good());
         assert(is.peek() == L'1');
     }
+#endif
     {
         testbuf<char> sb("  ");
         std::istream is(&sb);
@@ -66,6 +68,7 @@ int main(int, char**)
         assert(is.eof());
         assert(is.fail());
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         testbuf<wchar_t> sb(L"  ");
         std::wistream is(&sb);
@@ -76,6 +79,7 @@ int main(int, char**)
         assert(is.eof());
         assert(is.fail());
     }
+#endif
 #ifndef TEST_HAS_NO_EXCEPTIONS
     {
         testbuf<char> sb("  ");
@@ -94,6 +98,7 @@ int main(int, char**)
         assert( is.eof());
         assert(threw);
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         testbuf<wchar_t> sb(L"  ");
         std::basic_istream<wchar_t> is(&sb);
@@ -111,7 +116,8 @@ int main(int, char**)
         assert( is.eof());
         assert(threw);
     }
-#endif
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
+#endif // TEST_HAS_NO_EXCEPTIONS
 
     return 0;
 }

diff  --git a/libcxx/test/std/input.output/iostream.format/input.streams/istream.rvalue/rvalue.pass.cpp b/libcxx/test/std/input.output/iostream.format/input.streams/istream.rvalue/rvalue.pass.cpp
index a2fe4e82a0505..23ad80eddb8f8 100644
--- a/libcxx/test/std/input.output/iostream.format/input.streams/istream.rvalue/rvalue.pass.cpp
+++ b/libcxx/test/std/input.output/iostream.format/input.streams/istream.rvalue/rvalue.pass.cpp
@@ -63,6 +63,7 @@ int main(int, char**)
         assert(&result == &is);
         assert(i.value == 123);
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         testbuf<wchar_t> sb(L"   123");
         Int i = {0};
@@ -71,6 +72,7 @@ int main(int, char**)
         assert(&result == &is);
         assert(i.value == 123);
     }
+#endif
     {
         // test perfect forwarding
         assert(called == false);

diff  --git a/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/get.pass.cpp b/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/get.pass.cpp
index 91ae1045b3b7c..18a29dacb0711 100644
--- a/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/get.pass.cpp
+++ b/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/get.pass.cpp
@@ -75,6 +75,7 @@ int main(int, char**)
         assert(c == 'c');
         assert(is.gcount() == 1);
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         testbuf<wchar_t> sb(L" abc");
         std::wistream is(&sb);
@@ -99,6 +100,7 @@ int main(int, char**)
         assert(c == L'c');
         assert(is.gcount() == 1);
     }
+#endif
 #ifndef TEST_HAS_NO_EXCEPTIONS
     {
         testbuf<char> sb("rrrrrrrrr");
@@ -121,6 +123,7 @@ int main(int, char**)
         assert( is.eof());
         assert(threw);
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         testbuf<wchar_t> sb(L"rrrrrrrrr");
         std::basic_istream<wchar_t> is(&sb);
@@ -143,6 +146,7 @@ int main(int, char**)
         assert(threw);
     }
 #endif
+#endif // TEST_HAS_NO_EXCEPTIONS
 
     return 0;
 }

diff  --git a/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/get_chart.pass.cpp b/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/get_chart.pass.cpp
index fb3c2d07d36e8..7dd808e1d8cfc 100644
--- a/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/get_chart.pass.cpp
+++ b/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/get_chart.pass.cpp
@@ -77,6 +77,7 @@ int main(int, char**)
         assert(c == 'c');
         assert(is.gcount() == 1);
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         testbuf<wchar_t> sb(L" abc");
         std::wistream is(&sb);
@@ -102,6 +103,7 @@ int main(int, char**)
         assert(c == L'c');
         assert(is.gcount() == 1);
     }
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
 #ifndef TEST_HAS_NO_EXCEPTIONS
     {
         testbuf<char> sb("rrrrrrrrr");
@@ -125,6 +127,7 @@ int main(int, char**)
         assert( is.eof());
         assert(threw);
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         testbuf<wchar_t> sb(L"rrrrrrrrr");
         std::basic_istream<wchar_t> is(&sb);
@@ -147,7 +150,8 @@ int main(int, char**)
         assert( is.eof());
         assert(threw);
     }
-#endif
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
+#endif // TEST_HAS_NO_EXCEPTIONS
 
     return 0;
 }

diff  --git a/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/get_pointer_size.pass.cpp b/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/get_pointer_size.pass.cpp
index b3af36e32b398..76e860f9c29f0 100644
--- a/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/get_pointer_size.pass.cpp
+++ b/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/get_pointer_size.pass.cpp
@@ -79,6 +79,7 @@ int main(int, char**)
         assert(std::string(s) == "");
         assert(is.gcount() == 0);
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         testbuf<wchar_t> sb(L"  \n    \n ");
         std::wistream is(&sb);
@@ -113,6 +114,7 @@ int main(int, char**)
         assert(std::wstring(s) == L"");
         assert(is.gcount() == 0);
     }
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
 #ifndef TEST_HAS_NO_EXCEPTIONS
     {
         testbuf<char> sb(" ");
@@ -132,6 +134,7 @@ int main(int, char**)
         assert(std::string(s) == " ");
         assert(is.gcount() == 1);
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         testbuf<wchar_t> sb(L" ");
         std::basic_istream<wchar_t> is(&sb);
@@ -150,6 +153,7 @@ int main(int, char**)
         assert(std::wstring(s) == L" ");
         assert(is.gcount() == 1);
     }
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
 
     {
         testbuf<char> sb;
@@ -169,6 +173,7 @@ int main(int, char**)
         assert(std::basic_string<char>(s) == "");
         assert(is.gcount() == 0);
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         testbuf<wchar_t> sb;
         std::basic_istream<wchar_t> is(&sb);
@@ -187,7 +192,8 @@ int main(int, char**)
         assert(std::basic_string<wchar_t>(s) == L"");
         assert(is.gcount() == 0);
     }
-#endif
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
+#endif // TEST_HAS_NO_EXCEPTIONS
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/get_pointer_size_chart.pass.cpp b/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/get_pointer_size_chart.pass.cpp
index 11b820ef4d617..38b51630b6b97 100644
--- a/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/get_pointer_size_chart.pass.cpp
+++ b/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/get_pointer_size_chart.pass.cpp
@@ -79,6 +79,7 @@ int main(int, char**)
         assert(std::string(s) == "");
         assert(is.gcount() == 0);
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         testbuf<wchar_t> sb(L"  *    * ");
         std::wistream is(&sb);
@@ -113,6 +114,7 @@ int main(int, char**)
         assert(std::wstring(s) == L"");
         assert(is.gcount() == 0);
     }
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
 #ifndef TEST_HAS_NO_EXCEPTIONS
     {
         testbuf<char> sb(" ");
@@ -132,6 +134,7 @@ int main(int, char**)
         assert(std::basic_string<char>(s) == " ");
         assert(is.gcount() == 1);
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         testbuf<wchar_t> sb(L" ");
         std::basic_istream<wchar_t> is(&sb);
@@ -150,6 +153,7 @@ int main(int, char**)
         assert(std::basic_string<wchar_t>(s) == L" ");
         assert(is.gcount() == 1);
     }
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
 
     {
         testbuf<char> sb;
@@ -169,6 +173,7 @@ int main(int, char**)
         assert(std::basic_string<char>(s) == "");
         assert(is.gcount() == 0);
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         testbuf<wchar_t> sb;
         std::basic_istream<wchar_t> is(&sb);
@@ -187,7 +192,8 @@ int main(int, char**)
         assert(std::basic_string<wchar_t>(s) == L"");
         assert(is.gcount() == 0);
     }
-#endif
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
+#endif // TEST_HAS_NO_EXCEPTIONS
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/get_streambuf.pass.cpp b/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/get_streambuf.pass.cpp
index 8067792e09de2..a6c6687ccb5f7 100644
--- a/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/get_streambuf.pass.cpp
+++ b/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/get_streambuf.pass.cpp
@@ -73,6 +73,7 @@ int main(int, char**)
         assert(!is.fail());
         assert(is.gcount() == 3);
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         testbuf<wchar_t> sb(L"testing\n...");
         std::wistream is(&sb);
@@ -88,6 +89,7 @@ int main(int, char**)
         assert(!is.fail());
         assert(is.gcount() == 3);
     }
+#endif
 #ifndef TEST_HAS_NO_EXCEPTIONS
     {
         testbuf<char> sb(" ");
@@ -105,6 +107,7 @@ int main(int, char**)
         assert( is.eof());
         assert(!is.fail());
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         testbuf<wchar_t> sb(L" ");
         std::basic_istream<wchar_t> is(&sb);
@@ -121,6 +124,7 @@ int main(int, char**)
         assert( is.eof());
         assert(!is.fail());
     }
+#endif
 
     {
         testbuf<char> sb;
@@ -138,6 +142,7 @@ int main(int, char**)
         assert( is.eof());
         assert( is.fail());
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         testbuf<wchar_t> sb;
         std::basic_istream<wchar_t> is(&sb);
@@ -155,6 +160,7 @@ int main(int, char**)
         assert( is.fail());
     }
 #endif
+#endif // TEST_HAS_NO_EXCEPTIONS
 
     return 0;
 }

diff  --git a/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/get_streambuf_chart.pass.cpp b/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/get_streambuf_chart.pass.cpp
index dceb06ada7945..27d9ed89c1cf1 100644
--- a/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/get_streambuf_chart.pass.cpp
+++ b/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/get_streambuf_chart.pass.cpp
@@ -73,6 +73,7 @@ int main(int, char**)
         assert(!is.fail());
         assert(is.gcount() == 3);
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         testbuf<wchar_t> sb(L"testing*...");
         std::wistream is(&sb);
@@ -88,6 +89,7 @@ int main(int, char**)
         assert(!is.fail());
         assert(is.gcount() == 3);
     }
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
 #ifndef TEST_HAS_NO_EXCEPTIONS
     {
         testbuf<char> sb(" ");
@@ -105,6 +107,7 @@ int main(int, char**)
         assert( is.eof());
         assert(!is.fail());
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         testbuf<wchar_t> sb(L" ");
         std::basic_istream<wchar_t> is(&sb);
@@ -121,6 +124,7 @@ int main(int, char**)
         assert( is.eof());
         assert(!is.fail());
     }
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
 
     {
         testbuf<char> sb;
@@ -138,6 +142,7 @@ int main(int, char**)
         assert( is.eof());
         assert( is.fail());
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         testbuf<wchar_t> sb;
         std::basic_istream<wchar_t> is(&sb);
@@ -154,7 +159,8 @@ int main(int, char**)
         assert( is.eof());
         assert( is.fail());
     }
-#endif
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
+#endif // TEST_HAS_NO_EXCEPTIONS
 
     return 0;
 }

diff  --git a/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/getline_pointer_size.pass.cpp b/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/getline_pointer_size.pass.cpp
index 44fa59501a511..6e0d8b09ae357 100644
--- a/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/getline_pointer_size.pass.cpp
+++ b/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/getline_pointer_size.pass.cpp
@@ -71,6 +71,7 @@ int main(int, char**)
         assert(std::string(s) == "");
         assert(is.gcount() == 0);
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         testbuf<wchar_t> sb(L"  \n    \n ");
         std::wistream is(&sb);
@@ -97,6 +98,7 @@ int main(int, char**)
         assert(std::wstring(s) == L"");
         assert(is.gcount() == 0);
     }
+#endif
 #ifndef TEST_HAS_NO_EXCEPTIONS
     {
         testbuf<char> sb(" ");
@@ -116,6 +118,7 @@ int main(int, char**)
         assert(std::basic_string<char>(s) == " ");
         assert(is.gcount() == 1);
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         testbuf<wchar_t> sb(L" ");
         std::basic_istream<wchar_t> is(&sb);
@@ -134,6 +137,7 @@ int main(int, char**)
         assert(std::basic_string<wchar_t>(s) == L" ");
         assert(is.gcount() == 1);
     }
+#endif
 
     {
         testbuf<char> sb;
@@ -153,6 +157,7 @@ int main(int, char**)
         assert(std::basic_string<char>(s) == "");
         assert(is.gcount() == 0);
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         testbuf<wchar_t> sb;
         std::basic_istream<wchar_t> is(&sb);
@@ -172,6 +177,7 @@ int main(int, char**)
         assert(is.gcount() == 0);
     }
 #endif
+#endif // TEST_HAS_NO_EXCEPTIONS
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/getline_pointer_size_chart.pass.cpp b/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/getline_pointer_size_chart.pass.cpp
index 72bc2a4c00ccd..d07e74c2df16d 100644
--- a/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/getline_pointer_size_chart.pass.cpp
+++ b/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/getline_pointer_size_chart.pass.cpp
@@ -71,6 +71,7 @@ int main(int, char**)
         assert(std::string(s) == "");
         assert(is.gcount() == 0);
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         testbuf<wchar_t> sb(L"  *    * ");
         std::wistream is(&sb);
@@ -97,6 +98,7 @@ int main(int, char**)
         assert(std::wstring(s) == L"");
         assert(is.gcount() == 0);
     }
+#endif
 #ifndef TEST_HAS_NO_EXCEPTIONS
     {
         testbuf<char> sb(" ");
@@ -116,6 +118,7 @@ int main(int, char**)
         assert(std::basic_string<char>(s) == " ");
         assert(is.gcount() == 1);
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         testbuf<wchar_t> sb(L" ");
         std::basic_istream<wchar_t> is(&sb);
@@ -134,6 +137,7 @@ int main(int, char**)
         assert(std::basic_string<wchar_t>(s) == L" ");
         assert(is.gcount() == 1);
     }
+#endif
 
     {
         testbuf<char> sb;
@@ -153,6 +157,7 @@ int main(int, char**)
         assert(std::basic_string<char>(s) == "");
         assert(is.gcount() == 0);
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         testbuf<wchar_t> sb;
         std::basic_istream<wchar_t> is(&sb);
@@ -172,6 +177,7 @@ int main(int, char**)
         assert(is.gcount() == 0);
     }
 #endif
+#endif // TEST_HAS_NO_EXCEPTIONS
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/ignore.pass.cpp b/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/ignore.pass.cpp
index 0d0b4a8f40c45..0f1edcdd50913 100644
--- a/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/ignore.pass.cpp
+++ b/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/ignore.pass.cpp
@@ -60,6 +60,7 @@ int main(int, char**)
         assert(!is.fail());
         assert(is.gcount() == 6);
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         testbuf<wchar_t> sb(L" 1\n2345\n6");
         std::wistream is(&sb);
@@ -76,6 +77,7 @@ int main(int, char**)
         assert(!is.fail());
         assert(is.gcount() == 6);
     }
+#endif
 #ifndef TEST_HAS_NO_EXCEPTIONS
     {
         testbuf<char> sb(" ");
@@ -92,6 +94,7 @@ int main(int, char**)
         assert( is.eof());
         assert(!is.fail());
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         testbuf<wchar_t> sb(L" ");
         std::basic_istream<wchar_t> is(&sb);
@@ -108,6 +111,7 @@ int main(int, char**)
         assert(!is.fail());
     }
 #endif
+#endif // TEST_HAS_NO_EXCEPTIONS
 
     return 0;
 }

diff  --git a/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/peek.pass.cpp b/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/peek.pass.cpp
index be9600cf15614..2ca701664c290 100644
--- a/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/peek.pass.cpp
+++ b/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/peek.pass.cpp
@@ -55,6 +55,7 @@ int main(int, char**)
         assert(!is.fail());
         assert(is.gcount() == 0);
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         testbuf<wchar_t> sb(L" 1\n2345\n6");
         std::wistream is(&sb);
@@ -68,6 +69,7 @@ int main(int, char**)
         assert(!is.fail());
         assert(is.gcount() == 0);
     }
+#endif
 #ifndef TEST_HAS_NO_EXCEPTIONS
     {
         testbuf<char> sb;
@@ -84,6 +86,7 @@ int main(int, char**)
         assert( is.eof());
         assert(!is.fail());
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         testbuf<wchar_t> sb;
         std::basic_istream<wchar_t> is(&sb);
@@ -100,6 +103,7 @@ int main(int, char**)
         assert(!is.fail());
     }
 #endif
+#endif // TEST_HAS_NO_EXCEPTIONS
 
     return 0;
 }

diff  --git a/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/putback.pass.cpp b/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/putback.pass.cpp
index 588c0a6def57b..cb57b89a45cbe 100644
--- a/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/putback.pass.cpp
+++ b/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/putback.pass.cpp
@@ -64,6 +64,7 @@ int main(int, char**)
         assert(is.bad());
         assert(is.gcount() == 0);
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         testbuf<wchar_t> sb(L" 123456789");
         std::wistream is(&sb);
@@ -87,6 +88,7 @@ int main(int, char**)
         assert(is.bad());
         assert(is.gcount() == 0);
     }
+#endif
 #ifndef TEST_HAS_NO_EXCEPTIONS
     {
         testbuf<char> sb;
@@ -103,6 +105,7 @@ int main(int, char**)
         assert(!is.eof());
         assert( is.fail());
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         testbuf<wchar_t> sb;
         std::basic_istream<wchar_t> is(&sb);
@@ -119,6 +122,7 @@ int main(int, char**)
         assert( is.fail());
     }
 #endif
+#endif // TEST_HAS_NO_EXCEPTIONS
 
     return 0;
 }

diff  --git a/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/read.pass.cpp b/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/read.pass.cpp
index 2e6c2a2082164..5f8c4556edc4d 100644
--- a/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/read.pass.cpp
+++ b/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/read.pass.cpp
@@ -61,6 +61,7 @@ int main(int, char**)
         assert( is.fail());
         assert(is.gcount() == 0);
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         testbuf<wchar_t> sb(L" 123456789");
         std::wistream is(&sb);
@@ -80,6 +81,7 @@ int main(int, char**)
         assert( is.fail());
         assert(is.gcount() == 0);
     }
+#endif
 #ifndef TEST_HAS_NO_EXCEPTIONS
     {
         testbuf<char> sb;
@@ -97,6 +99,7 @@ int main(int, char**)
         assert( is.eof());
         assert( is.fail());
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         testbuf<wchar_t> sb;
         std::basic_istream<wchar_t> is(&sb);
@@ -114,6 +117,7 @@ int main(int, char**)
         assert( is.fail());
     }
 #endif
+#endif // TEST_HAS_NO_EXCEPTIONS
 
     return 0;
 }

diff  --git a/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/readsome.pass.cpp b/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/readsome.pass.cpp
index e2fe3788e865f..3c523bb2bfb55 100644
--- a/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/readsome.pass.cpp
+++ b/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/readsome.pass.cpp
@@ -62,6 +62,7 @@ int main(int, char**)
         assert(std::string(s, 1) == "0");
         assert(is.readsome(s, 5) == 0);
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         testbuf<wchar_t> sb(L" 1234567890");
         std::wistream is(&sb);
@@ -83,6 +84,7 @@ int main(int, char**)
         assert(std::wstring(s, 1) == L"0");
         assert(is.readsome(s, 5) == 0);
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/seekg.pass.cpp b/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/seekg.pass.cpp
index fc442d4bd2fdc..7bbbf94089cec 100644
--- a/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/seekg.pass.cpp
+++ b/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/seekg.pass.cpp
@@ -56,6 +56,7 @@ int main(int, char**)
         is.seekg(-1);
         assert(is.fail());
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         testbuf<wchar_t> sb(L" 123456789");
         std::wistream is(&sb);
@@ -64,6 +65,7 @@ int main(int, char**)
         is.seekg(-1);
         assert(is.fail());
     }
+#endif
     {
         testbuf<char> sb(" 123456789");
         std::istream is(&sb);

diff  --git a/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/seekg_off.pass.cpp b/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/seekg_off.pass.cpp
index d9412bf920ba0..a5aaf211da1c5 100644
--- a/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/seekg_off.pass.cpp
+++ b/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/seekg_off.pass.cpp
@@ -64,6 +64,7 @@ int main(int, char**)
         assert(is.fail());
         assert(seekoff_called == 2);
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         testbuf<wchar_t> sb(L" 123456789");
         std::wistream is(&sb);
@@ -74,6 +75,7 @@ int main(int, char**)
         assert(is.fail());
         assert(seekoff_called == 4);
     }
+#endif
     {
         testbuf<char> sb(" 123456789");
         std::istream is(&sb);

diff  --git a/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/sync.pass.cpp b/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/sync.pass.cpp
index bc808fb69caed..ec1195d6b32bd 100644
--- a/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/sync.pass.cpp
+++ b/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/sync.pass.cpp
@@ -91,12 +91,14 @@ int main(int, char**)
         assert(is.sync() == 0);
         assert(sync_called == 1);
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         testbuf<wchar_t> sb(L" 123456789");
         std::wistream is(&sb);
         assert(is.sync() == 0);
         assert(sync_called == 2);
     }
+#endif
 #ifndef TEST_HAS_NO_EXCEPTIONS
     {
         throwing_testbuf<char> sb(" 123456789");
@@ -113,6 +115,7 @@ int main(int, char**)
         assert( is.fail());
         assert(threw);
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         throwing_testbuf<wchar_t> sb(L" 123456789");
         std::basic_istream<wchar_t> is(&sb);
@@ -129,6 +132,7 @@ int main(int, char**)
         assert(threw);
     }
 #endif
+#endif // TEST_HAS_NO_EXCEPTIONS
 
     return 0;
 }

diff  --git a/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/tellg.pass.cpp b/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/tellg.pass.cpp
index 32a7787317fcc..816e400287cf5 100644
--- a/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/tellg.pass.cpp
+++ b/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/tellg.pass.cpp
@@ -56,11 +56,13 @@ int main(int, char**)
         std::istream is(&sb);
         assert(is.tellg() == 5);
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         testbuf<wchar_t> sb(L" 123456789");
         std::wistream is(&sb);
         assert(is.tellg() == 5);
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/unget.pass.cpp b/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/unget.pass.cpp
index b48ff86fbaa7e..eddfaa8848f0e 100644
--- a/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/unget.pass.cpp
+++ b/libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/unget.pass.cpp
@@ -60,6 +60,7 @@ int main(int, char**)
         assert(is.bad());
         assert(is.gcount() == 0);
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         testbuf<wchar_t> sb(L" 123456789");
         std::wistream is(&sb);
@@ -79,6 +80,7 @@ int main(int, char**)
         assert(is.bad());
         assert(is.gcount() == 0);
     }
+#endif
 #ifndef TEST_HAS_NO_EXCEPTIONS
     {
         testbuf<char> sb;
@@ -95,6 +97,7 @@ int main(int, char**)
         assert(!is.eof());
         assert( is.fail());
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         testbuf<wchar_t> sb;
         std::basic_istream<wchar_t> is(&sb);
@@ -111,6 +114,7 @@ int main(int, char**)
         assert( is.fail());
     }
 #endif
+#endif // TEST_HAS_NO_EXCEPTIONS
 
     return 0;
 }

diff  --git a/libcxx/test/std/input.output/iostream.format/input.streams/istream/istream.assign/member_swap.pass.cpp b/libcxx/test/std/input.output/iostream.format/input.streams/istream/istream.assign/member_swap.pass.cpp
index 0e6cdbb74504b..64ddcf2fe8d1a 100644
--- a/libcxx/test/std/input.output/iostream.format/input.streams/istream/istream.assign/member_swap.pass.cpp
+++ b/libcxx/test/std/input.output/iostream.format/input.streams/istream/istream.assign/member_swap.pass.cpp
@@ -60,6 +60,7 @@ int main(int, char**)
         assert(is2.precision() == 6);
         assert(is2.getloc().name() == "C");
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         testbuf<wchar_t> sb1;
         testbuf<wchar_t> sb2;
@@ -83,6 +84,7 @@ int main(int, char**)
         assert(is2.precision() == 6);
         assert(is2.getloc().name() == "C");
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/iostream.format/input.streams/istream/istream.assign/move_assign.pass.cpp b/libcxx/test/std/input.output/iostream.format/input.streams/istream/istream.assign/move_assign.pass.cpp
index 7899c63e8293e..fd79726d6b394 100644
--- a/libcxx/test/std/input.output/iostream.format/input.streams/istream/istream.assign/move_assign.pass.cpp
+++ b/libcxx/test/std/input.output/iostream.format/input.streams/istream/istream.assign/move_assign.pass.cpp
@@ -63,6 +63,7 @@ int main(int, char**)
         assert(is2.precision() == 6);
         assert(is2.getloc().name() == "C");
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         testbuf<wchar_t> sb1;
         testbuf<wchar_t> sb2;
@@ -86,6 +87,7 @@ int main(int, char**)
         assert(is2.precision() == 6);
         assert(is2.getloc().name() == "C");
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/iostream.format/input.streams/istream/istream.cons/move.pass.cpp b/libcxx/test/std/input.output/iostream.format/input.streams/istream/istream.cons/move.pass.cpp
index fb071ba970163..4f46ff509ef0e 100644
--- a/libcxx/test/std/input.output/iostream.format/input.streams/istream/istream.cons/move.pass.cpp
+++ b/libcxx/test/std/input.output/iostream.format/input.streams/istream/istream.cons/move.pass.cpp
@@ -54,6 +54,7 @@ int main(int, char**)
         assert(is.precision() == 6);
         assert(is.getloc().name() == "C");
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         testbuf<wchar_t> sb;
         test_istream<wchar_t> is1(&sb);
@@ -70,6 +71,7 @@ int main(int, char**)
         assert(is.precision() == 6);
         assert(is.getloc().name() == "C");
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/iostream.format/input.streams/istream/istream.cons/streambuf.pass.cpp b/libcxx/test/std/input.output/iostream.format/input.streams/istream/istream.cons/streambuf.pass.cpp
index 669c1c9e2da4a..b2b428ede516d 100644
--- a/libcxx/test/std/input.output/iostream.format/input.streams/istream/istream.cons/streambuf.pass.cpp
+++ b/libcxx/test/std/input.output/iostream.format/input.streams/istream/istream.cons/streambuf.pass.cpp
@@ -40,6 +40,7 @@ int main(int, char**)
         assert(is.getloc().name() == "C");
         assert(is.gcount() == 0);
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         testbuf<wchar_t> sb;
         std::basic_istream<wchar_t> is(&sb);
@@ -53,6 +54,7 @@ int main(int, char**)
         assert(is.getloc().name() == "C");
         assert(is.gcount() == 0);
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/iostream.format/input.streams/istream/istream_sentry/ctor.pass.cpp b/libcxx/test/std/input.output/iostream.format/input.streams/istream/istream_sentry/ctor.pass.cpp
index f4e84378e31f0..fa094d79074aa 100644
--- a/libcxx/test/std/input.output/iostream.format/input.streams/istream/istream_sentry/ctor.pass.cpp
+++ b/libcxx/test/std/input.output/iostream.format/input.streams/istream/istream_sentry/ctor.pass.cpp
@@ -61,14 +61,6 @@ int main(int, char**)
         assert(is.gcount() == 0);
         assert(sync_called == 0);
     }
-    {
-        std::wistream is((testbuf<wchar_t>*)0);
-        std::wistream::sentry sen(is, true);
-        assert(!(bool)sen);
-        assert(!is.good());
-        assert(is.gcount() == 0);
-        assert(sync_called == 0);
-    }
     {
         testbuf<char> sb("   123");
         std::istream is(&sb);
@@ -79,16 +71,6 @@ int main(int, char**)
         assert(sync_called == 0);
         assert(sb.gptr() == sb.eback());
     }
-    {
-        testbuf<wchar_t> sb(L"   123");
-        std::wistream is(&sb);
-        std::wistream::sentry sen(is, true);
-        assert((bool)sen);
-        assert(is.good());
-        assert(is.gcount() == 0);
-        assert(sync_called == 0);
-        assert(sb.gptr() == sb.eback());
-    }
     {
         testbuf<char> sb("   123");
         std::istream is(&sb);
@@ -98,15 +80,6 @@ int main(int, char**)
         assert(sync_called == 0);
         assert(sb.gptr() == sb.eback() + 3);
     }
-    {
-        testbuf<wchar_t> sb(L"   123");
-        std::wistream is(&sb);
-        std::wistream::sentry sen(is);
-        assert((bool)sen);
-        assert(is.good());
-        assert(sync_called == 0);
-        assert(sb.gptr() == sb.eback() + 3);
-    }
     {
         testbuf<char> sb("      ");
         std::istream is(&sb);
@@ -127,5 +100,35 @@ int main(int, char**)
         assert(sb.gptr() == sb.eback());
     }
 
-  return 0;
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
+    {
+        std::wistream is((testbuf<wchar_t>*)0);
+        std::wistream::sentry sen(is, true);
+        assert(!(bool)sen);
+        assert(!is.good());
+        assert(is.gcount() == 0);
+        assert(sync_called == 0);
+    }
+    {
+        testbuf<wchar_t> sb(L"   123");
+        std::wistream is(&sb);
+        std::wistream::sentry sen(is, true);
+        assert((bool)sen);
+        assert(is.good());
+        assert(is.gcount() == 0);
+        assert(sync_called == 0);
+        assert(sb.gptr() == sb.eback());
+    }
+    {
+        testbuf<wchar_t> sb(L"   123");
+        std::wistream is(&sb);
+        std::wistream::sentry sen(is);
+        assert((bool)sen);
+        assert(is.good());
+        assert(sync_called == 0);
+        assert(sb.gptr() == sb.eback() + 3);
+    }
+#endif
+
+    return 0;
 }

diff  --git a/libcxx/test/std/input.output/iostream.format/output.streams/ostream.assign/member_swap.pass.cpp b/libcxx/test/std/input.output/iostream.format/output.streams/ostream.assign/member_swap.pass.cpp
index 0a8279692c9dc..032d2cfb190f9 100644
--- a/libcxx/test/std/input.output/iostream.format/output.streams/ostream.assign/member_swap.pass.cpp
+++ b/libcxx/test/std/input.output/iostream.format/output.streams/ostream.assign/member_swap.pass.cpp
@@ -60,6 +60,7 @@ int main(int, char**)
         assert(os2.precision() == 6);
         assert(os2.getloc().name() == "C");
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         testbuf<wchar_t> sb1;
         testbuf<wchar_t> sb2;
@@ -83,6 +84,7 @@ int main(int, char**)
         assert(os2.precision() == 6);
         assert(os2.getloc().name() == "C");
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/iostream.format/output.streams/ostream.assign/move_assign.pass.cpp b/libcxx/test/std/input.output/iostream.format/output.streams/ostream.assign/move_assign.pass.cpp
index 8fcb0c2b1ee97..dbac8387b88af 100644
--- a/libcxx/test/std/input.output/iostream.format/output.streams/ostream.assign/move_assign.pass.cpp
+++ b/libcxx/test/std/input.output/iostream.format/output.streams/ostream.assign/move_assign.pass.cpp
@@ -63,6 +63,7 @@ int main(int, char**)
         assert(os2.precision() == 6);
         assert(os2.getloc().name() == "C");
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         testbuf<wchar_t> sb1;
         testbuf<wchar_t> sb2;
@@ -86,6 +87,7 @@ int main(int, char**)
         assert(os2.precision() == 6);
         assert(os2.getloc().name() == "C");
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/iostream.format/output.streams/ostream.cons/move.pass.cpp b/libcxx/test/std/input.output/iostream.format/output.streams/ostream.cons/move.pass.cpp
index 73991b36f6c9b..d2de7b09d0e27 100644
--- a/libcxx/test/std/input.output/iostream.format/output.streams/ostream.cons/move.pass.cpp
+++ b/libcxx/test/std/input.output/iostream.format/output.streams/ostream.cons/move.pass.cpp
@@ -54,6 +54,7 @@ int main(int, char**)
         assert(os.precision() == 6);
         assert(os.getloc().name() == "C");
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         testbuf<wchar_t> sb;
         test_ostream<wchar_t> os1(&sb);
@@ -68,6 +69,7 @@ int main(int, char**)
         assert(os.precision() == 6);
         assert(os.getloc().name() == "C");
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/iostream.format/output.streams/ostream.cons/streambuf.pass.cpp b/libcxx/test/std/input.output/iostream.format/output.streams/ostream.cons/streambuf.pass.cpp
index d3c837581cc19..1c38a68f1f895 100644
--- a/libcxx/test/std/input.output/iostream.format/output.streams/ostream.cons/streambuf.pass.cpp
+++ b/libcxx/test/std/input.output/iostream.format/output.streams/ostream.cons/streambuf.pass.cpp
@@ -39,6 +39,7 @@ int main(int, char**)
         assert(os.precision() == 6);
         assert(os.getloc().name() == "C");
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         testbuf<wchar_t> sb;
         std::basic_ostream<wchar_t> os(&sb);
@@ -51,6 +52,7 @@ int main(int, char**)
         assert(os.precision() == 6);
         assert(os.getloc().name() == "C");
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.character/CharT.pass.cpp b/libcxx/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.character/CharT.pass.cpp
index a04a80c1bad29..6adf30f3bdaec 100644
--- a/libcxx/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.character/CharT.pass.cpp
+++ b/libcxx/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.character/CharT.pass.cpp
@@ -14,6 +14,8 @@
 // template<class charT, class traits>
 //   basic_ostream<charT,traits>& operator<<(basic_ostream<charT,traits>& out, charT c);
 
+// XFAIL: libcpp-has-no-wide-characters
+
 #include <ostream>
 #include <cassert>
 

diff  --git a/libcxx/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.character/CharT_pointer.pass.cpp b/libcxx/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.character/CharT_pointer.pass.cpp
index 95615a9e2082e..1ce962c9bc111 100644
--- a/libcxx/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.character/CharT_pointer.pass.cpp
+++ b/libcxx/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.character/CharT_pointer.pass.cpp
@@ -14,6 +14,8 @@
 // template<class charT, class traits>
 //   basic_ostream<charT,traits>& operator<<(basic_ostream<charT,traits>& out, const charT* s);
 
+// XFAIL: libcpp-has-no-wide-characters
+
 #include <ostream>
 #include <cassert>
 

diff  --git a/libcxx/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.character/char_to_wide.pass.cpp b/libcxx/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.character/char_to_wide.pass.cpp
index 7d9772609a719..c1e18eab13585 100644
--- a/libcxx/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.character/char_to_wide.pass.cpp
+++ b/libcxx/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.character/char_to_wide.pass.cpp
@@ -14,6 +14,8 @@
 // template<class charT, class traits>
 //   basic_ostream<charT,traits>& operator<<(basic_ostream<charT,traits>& out, char c);
 
+// XFAIL: libcpp-has-no-wide-characters
+
 #include <ostream>
 #include <cassert>
 

diff  --git a/libcxx/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.character/char_to_wide_pointer.pass.cpp b/libcxx/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.character/char_to_wide_pointer.pass.cpp
index 0587f6f3c387f..98c01532af827 100644
--- a/libcxx/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.character/char_to_wide_pointer.pass.cpp
+++ b/libcxx/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.character/char_to_wide_pointer.pass.cpp
@@ -14,6 +14,8 @@
 // template<class charT, class traits>
 //   basic_ostream<charT,traits>& operator<<(basic_ostream<charT,traits>& out, const char* s);
 
+// XFAIL: libcpp-has-no-wide-characters
+
 #include <ostream>
 #include <cassert>
 

diff  --git a/libcxx/test/std/input.output/iostream.format/output.streams/ostream.manip/endl.pass.cpp b/libcxx/test/std/input.output/iostream.format/output.streams/ostream.manip/endl.pass.cpp
index 71f9e8df02968..bedbe6c4ec94c 100644
--- a/libcxx/test/std/input.output/iostream.format/output.streams/ostream.manip/endl.pass.cpp
+++ b/libcxx/test/std/input.output/iostream.format/output.streams/ostream.manip/endl.pass.cpp
@@ -70,6 +70,7 @@ int main(int, char**)
         assert(sync_called == 1);
         assert(os.good());
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         testbuf<wchar_t> sb;
         std::wostream os(&sb);
@@ -78,6 +79,7 @@ int main(int, char**)
         assert(sync_called == 2);
         assert(os.good());
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/iostream.format/output.streams/ostream.manip/ends.pass.cpp b/libcxx/test/std/input.output/iostream.format/output.streams/ostream.manip/ends.pass.cpp
index 94135f784652d..e4c0cd694cc44 100644
--- a/libcxx/test/std/input.output/iostream.format/output.streams/ostream.manip/ends.pass.cpp
+++ b/libcxx/test/std/input.output/iostream.format/output.streams/ostream.manip/ends.pass.cpp
@@ -61,6 +61,7 @@ int main(int, char**)
         assert(sb.str().back() == 0);
         assert(os.good());
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         testbuf<wchar_t> sb;
         std::wostream os(&sb);
@@ -69,6 +70,7 @@ int main(int, char**)
         assert(sb.str().back() == 0);
         assert(os.good());
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/iostream.format/output.streams/ostream.manip/flush.pass.cpp b/libcxx/test/std/input.output/iostream.format/output.streams/ostream.manip/flush.pass.cpp
index 6fcba87a3c4dc..20d541ef36083 100644
--- a/libcxx/test/std/input.output/iostream.format/output.streams/ostream.manip/flush.pass.cpp
+++ b/libcxx/test/std/input.output/iostream.format/output.streams/ostream.manip/flush.pass.cpp
@@ -49,6 +49,7 @@ int main(int, char**)
         assert(sync_called == 1);
         assert(os.good());
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         testbuf<wchar_t> sb;
         std::wostream os(&sb);
@@ -56,6 +57,7 @@ int main(int, char**)
         assert(sync_called == 2);
         assert(os.good());
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/iostream.format/output.streams/ostream.rvalue/rvalue.pass.cpp b/libcxx/test/std/input.output/iostream.format/output.streams/ostream.rvalue/rvalue.pass.cpp
index d71855a9b51a7..8ef9b6c77a021 100644
--- a/libcxx/test/std/input.output/iostream.format/output.streams/ostream.rvalue/rvalue.pass.cpp
+++ b/libcxx/test/std/input.output/iostream.format/output.streams/ostream.rvalue/rvalue.pass.cpp
@@ -67,6 +67,7 @@ int main(int, char**)
         assert(&result == &os);
         assert(sb.str() == "123");
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         testbuf<wchar_t> sb;
         std::wostream os(&sb);
@@ -75,6 +76,7 @@ int main(int, char**)
         assert(&result == &os);
         assert(sb.str() == L"123");
     }
+#endif
 
     return 0;
 }

diff  --git a/libcxx/test/std/input.output/iostream.format/output.streams/ostream.unformatted/put.pass.cpp b/libcxx/test/std/input.output/iostream.format/output.streams/ostream.unformatted/put.pass.cpp
index 08a701829c1f3..e52a1a485eff1 100644
--- a/libcxx/test/std/input.output/iostream.format/output.streams/ostream.unformatted/put.pass.cpp
+++ b/libcxx/test/std/input.output/iostream.format/output.streams/ostream.unformatted/put.pass.cpp
@@ -52,6 +52,21 @@ class testbuf
 
 int main(int, char**)
 {
+    {
+        std::ostream os((std::streambuf*)0);
+        char c = 'a';
+        os.put(c);
+        assert(os.bad());
+    }
+    {
+        testbuf<char> sb;
+        std::ostream os(&sb);
+        char c = 'a';
+        os.put(c);
+        assert(sb.str() == "a");
+        assert(os.good());
+    }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::wostream os((std::wstreambuf*)0);
         wchar_t c = L'a';
@@ -66,14 +81,7 @@ int main(int, char**)
         assert(sb.str() == L"a");
         assert(os.good());
     }
-    {
-        testbuf<char> sb;
-        std::ostream os(&sb);
-        char c = 'a';
-        os.put(c);
-        assert(sb.str() == "a");
-        assert(os.good());
-    }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/iostream.format/output.streams/ostream.unformatted/write.pass.cpp b/libcxx/test/std/input.output/iostream.format/output.streams/ostream.unformatted/write.pass.cpp
index c81c770c1d3d3..b0f3889e25726 100644
--- a/libcxx/test/std/input.output/iostream.format/output.streams/ostream.unformatted/write.pass.cpp
+++ b/libcxx/test/std/input.output/iostream.format/output.streams/ostream.unformatted/write.pass.cpp
@@ -52,6 +52,21 @@ class testbuf
 
 int main(int, char**)
 {
+    {
+        std::ostream os((std::streambuf*)0);
+        const char s[] = "123456790";
+        os.write(s, sizeof(s)/sizeof(s[0])-1);
+        assert(os.bad());
+    }
+    {
+        testbuf<char> sb;
+        std::ostream os(&sb);
+        const char s[] = "123456790";
+        os.write(s, sizeof(s)/sizeof(s[0])-1);
+        assert(sb.str() == s);
+        assert(os.good());
+    }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::wostream os((std::wstreambuf*)0);
         const wchar_t s[] = L"123456790";
@@ -66,14 +81,7 @@ int main(int, char**)
         assert(os.good());
         assert(sb.str() == s);
     }
-    {
-        testbuf<char> sb;
-        std::ostream os(&sb);
-        const char s[] = "123456790";
-        os.write(s, sizeof(s)/sizeof(s[0])-1);
-        assert(sb.str() == s);
-        assert(os.good());
-    }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/iostream.format/quoted.manip/quoted.pass.cpp b/libcxx/test/std/input.output/iostream.format/quoted.manip/quoted.pass.cpp
index 854e271fcabb5..ef43339ee44c0 100644
--- a/libcxx/test/std/input.output/iostream.format/quoted.manip/quoted.pass.cpp
+++ b/libcxx/test/std/input.output/iostream.format/quoted.manip/quoted.pass.cpp
@@ -132,10 +132,12 @@ int main(int, char**)
     round_trip_d  (  "", 'q' );
     round_trip_e  (  "", 'q' );
 
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     round_trip    ( L"" );
     round_trip_ws ( L"" );
     round_trip_d  ( L"", 'q' );
     round_trip_e  ( L"", 'q' );
+#endif
 
     round_trip    (  "Hi" );
     round_trip_ws (  "Hi" );
@@ -144,34 +146,47 @@ int main(int, char**)
     assert ( quote ( "Hi", '!' ) == "!Hi!" );
     assert ( quote ( "Hi!", '!' ) == R"(!Hi\!!)" );
 
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     round_trip    ( L"Hi" );
     round_trip_ws ( L"Hi" );
     round_trip_d  ( L"Hi", '!' );
     round_trip_e  ( L"Hi", '!' );
     assert ( quote ( L"Hi", '!' )  == L"!Hi!" );
     assert ( quote ( L"Hi!", '!' ) == LR"(!Hi\!!)" );
+#endif
 
     round_trip    (  "Hi Mom" );
     round_trip_ws (  "Hi Mom" );
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     round_trip    ( L"Hi Mom" );
     round_trip_ws ( L"Hi Mom" );
+#endif
 
     assert ( quote (  "" )  ==  "\"\"" );
-    assert ( quote ( L"" )  == L"\"\"" );
     assert ( quote (  "a" ) ==  "\"a\"" );
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
+    assert ( quote ( L"" )  == L"\"\"" );
     assert ( quote ( L"a" ) == L"\"a\"" );
+#endif
 
-//  missing end quote - must not hang
+    // missing end quote - must not hang
     assert ( unquote (  "\"abc" ) ==  "abc" );
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     assert ( unquote ( L"\"abc" ) == L"abc" );
+#endif
 
     assert ( unquote (  "abc" ) == "abc" ); // no delimiter
-    assert ( unquote ( L"abc" ) == L"abc" ); // no delimiter
     assert ( unquote (  "abc def" ) ==  "abc" ); // no delimiter
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
+    assert ( unquote ( L"abc" ) == L"abc" ); // no delimiter
     assert ( unquote ( L"abc def" ) == L"abc" ); // no delimiter
+#endif
 
     assert ( unquote (  "" ) ==  "" ); // nothing there
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     assert ( unquote ( L"" ) == L"" ); // nothing there
+#endif
+
     test_padding ();
 
     return 0;

diff  --git a/libcxx/test/std/input.output/iostream.format/quoted.manip/quoted_char.verify.cpp b/libcxx/test/std/input.output/iostream.format/quoted.manip/quoted_char.verify.cpp
index 9340edbf80a31..29a084e62f668 100644
--- a/libcxx/test/std/input.output/iostream.format/quoted.manip/quoted_char.verify.cpp
+++ b/libcxx/test/std/input.output/iostream.format/quoted.manip/quoted_char.verify.cpp
@@ -11,6 +11,7 @@
 // quoted
 
 // UNSUPPORTED: c++03, c++11
+// XFAIL: libcpp-has-no-wide-characters
 
 #include <iomanip>
 #include <sstream>

diff  --git a/libcxx/test/std/input.output/iostream.format/std.manip/resetiosflags.pass.cpp b/libcxx/test/std/input.output/iostream.format/std.manip/resetiosflags.pass.cpp
index 1603d9fb62533..a61357eba4017 100644
--- a/libcxx/test/std/input.output/iostream.format/std.manip/resetiosflags.pass.cpp
+++ b/libcxx/test/std/input.output/iostream.format/std.manip/resetiosflags.pass.cpp
@@ -40,6 +40,7 @@ int main(int, char**)
         os << std::resetiosflags(std::ios_base::skipws);
         assert(!(os.flags() & std::ios_base::skipws));
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         testbuf<wchar_t> sb;
         std::wistream is(&sb);
@@ -54,6 +55,7 @@ int main(int, char**)
         os << std::resetiosflags(std::ios_base::skipws);
         assert(!(os.flags() & std::ios_base::skipws));
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/iostream.format/std.manip/setbase.pass.cpp b/libcxx/test/std/input.output/iostream.format/std.manip/setbase.pass.cpp
index be5edf8bf22fd..0e8b13c21bce0 100644
--- a/libcxx/test/std/input.output/iostream.format/std.manip/setbase.pass.cpp
+++ b/libcxx/test/std/input.output/iostream.format/std.manip/setbase.pass.cpp
@@ -50,6 +50,7 @@ int main(int, char**)
         os << std::setbase(15);
         assert((os.flags() & std::ios_base::basefield) == 0);
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         testbuf<wchar_t> sb;
         std::wistream is(&sb);
@@ -74,6 +75,7 @@ int main(int, char**)
         os << std::setbase(15);
         assert((os.flags() & std::ios_base::basefield) == 0);
     }
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/iostream.format/std.manip/setfill.pass.cpp b/libcxx/test/std/input.output/iostream.format/std.manip/setfill.pass.cpp
index 68002b9107d5b..3413743eaf66a 100644
--- a/libcxx/test/std/input.output/iostream.format/std.manip/setfill.pass.cpp
+++ b/libcxx/test/std/input.output/iostream.format/std.manip/setfill.pass.cpp
@@ -31,12 +31,14 @@ int main(int, char**)
         os << std::setfill('*');
         assert(os.fill() == '*');
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         testbuf<wchar_t> sb;
         std::wostream os(&sb);
         os << std::setfill(L'*');
         assert(os.fill() == L'*');
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/iostream.format/std.manip/setiosflags.pass.cpp b/libcxx/test/std/input.output/iostream.format/std.manip/setiosflags.pass.cpp
index 8b249f46ca101..9ed8b9f6c5833 100644
--- a/libcxx/test/std/input.output/iostream.format/std.manip/setiosflags.pass.cpp
+++ b/libcxx/test/std/input.output/iostream.format/std.manip/setiosflags.pass.cpp
@@ -40,6 +40,7 @@ int main(int, char**)
         os << std::setiosflags(std::ios_base::oct);
         assert(os.flags() & std::ios_base::oct);
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         testbuf<wchar_t> sb;
         std::wistream is(&sb);
@@ -54,6 +55,7 @@ int main(int, char**)
         os << std::setiosflags(std::ios_base::oct);
         assert(os.flags() & std::ios_base::oct);
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/iostream.format/std.manip/setprecision.pass.cpp b/libcxx/test/std/input.output/iostream.format/std.manip/setprecision.pass.cpp
index 7063cf3add69c..0fa289b5d5e4c 100644
--- a/libcxx/test/std/input.output/iostream.format/std.manip/setprecision.pass.cpp
+++ b/libcxx/test/std/input.output/iostream.format/std.manip/setprecision.pass.cpp
@@ -38,6 +38,7 @@ int main(int, char**)
         os << std::setprecision(10);
         assert(os.precision() == 10);
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         testbuf<wchar_t> sb;
         std::wistream is(&sb);
@@ -50,6 +51,7 @@ int main(int, char**)
         os << std::setprecision(10);
         assert(os.precision() == 10);
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/iostream.format/std.manip/setw.pass.cpp b/libcxx/test/std/input.output/iostream.format/std.manip/setw.pass.cpp
index 346d5f4fabc72..565dadd11dab0 100644
--- a/libcxx/test/std/input.output/iostream.format/std.manip/setw.pass.cpp
+++ b/libcxx/test/std/input.output/iostream.format/std.manip/setw.pass.cpp
@@ -8,7 +8,7 @@
 
 // <iomanip>
 
-// T6 setw(int n);
+// <unspecified> setw(int n);
 
 #include <iomanip>
 #include <istream>
@@ -38,6 +38,7 @@ int main(int, char**)
         os << std::setw(10);
         assert(os.width() == 10);
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         testbuf<wchar_t> sb;
         std::wistream is(&sb);
@@ -50,6 +51,7 @@ int main(int, char**)
         os << std::setw(10);
         assert(os.width() == 10);
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/iostream.forward/iosfwd.pass.cpp b/libcxx/test/std/input.output/iostream.forward/iosfwd.pass.cpp
index 3bf880a15edc6..b6ef60d967b4e 100644
--- a/libcxx/test/std/input.output/iostream.forward/iosfwd.pass.cpp
+++ b/libcxx/test/std/input.output/iostream.forward/iosfwd.pass.cpp
@@ -9,10 +9,13 @@
 // <iosfwd>
 
 #include <iosfwd>
-#include <cwchar>  // for mbstate_t
 
 #include "test_macros.h"
 
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
+#   include <cwchar>
+#endif
+
 template <class Ptr> void test()
 {
     Ptr p = 0;
@@ -22,71 +25,105 @@ template <class Ptr> void test()
 int main(int, char**)
 {
     test<std::char_traits<char>*          >();
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     test<std::char_traits<wchar_t>*       >();
+#endif
     test<std::char_traits<unsigned short>*>();
 
     test<std::basic_ios<char>*          >();
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     test<std::basic_ios<wchar_t>*       >();
+#endif
     test<std::basic_ios<unsigned short>*>();
 
     test<std::basic_streambuf<char>*          >();
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     test<std::basic_streambuf<wchar_t>*       >();
+#endif
     test<std::basic_streambuf<unsigned short>*>();
 
     test<std::basic_istream<char>*          >();
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     test<std::basic_istream<wchar_t>*       >();
+#endif
     test<std::basic_istream<unsigned short>*>();
 
     test<std::basic_ostream<char>*          >();
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     test<std::basic_ostream<wchar_t>*       >();
+#endif
     test<std::basic_ostream<unsigned short>*>();
 
     test<std::basic_iostream<char>*          >();
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     test<std::basic_iostream<wchar_t>*       >();
+#endif
     test<std::basic_iostream<unsigned short>*>();
 
     test<std::basic_stringbuf<char>*          >();
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     test<std::basic_stringbuf<wchar_t>*       >();
+#endif
     test<std::basic_stringbuf<unsigned short>*>();
 
     test<std::basic_istringstream<char>*          >();
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     test<std::basic_istringstream<wchar_t>*       >();
+#endif
     test<std::basic_istringstream<unsigned short>*>();
 
     test<std::basic_ostringstream<char>*          >();
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     test<std::basic_ostringstream<wchar_t>*       >();
+#endif
     test<std::basic_ostringstream<unsigned short>*>();
 
     test<std::basic_stringstream<char>*          >();
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     test<std::basic_stringstream<wchar_t>*       >();
+#endif
     test<std::basic_stringstream<unsigned short>*>();
 
     test<std::basic_filebuf<char>*          >();
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     test<std::basic_filebuf<wchar_t>*       >();
+#endif
     test<std::basic_filebuf<unsigned short>*>();
 
     test<std::basic_ifstream<char>*          >();
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     test<std::basic_ifstream<wchar_t>*       >();
+#endif
     test<std::basic_ifstream<unsigned short>*>();
 
     test<std::basic_ofstream<char>*          >();
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     test<std::basic_ofstream<wchar_t>*       >();
+#endif
     test<std::basic_ofstream<unsigned short>*>();
 
     test<std::basic_fstream<char>*          >();
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     test<std::basic_fstream<wchar_t>*       >();
+#endif
     test<std::basic_fstream<unsigned short>*>();
 
     test<std::istreambuf_iterator<char>*          >();
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     test<std::istreambuf_iterator<wchar_t>*       >();
+#endif
     test<std::istreambuf_iterator<unsigned short>*>();
 
     test<std::ostreambuf_iterator<char>*          >();
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     test<std::ostreambuf_iterator<wchar_t>*       >();
+#endif
     test<std::ostreambuf_iterator<unsigned short>*>();
 
     test<std::ios* >();
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     test<std::wios*>();
+#endif
 
     test<std::streambuf*>();
     test<std::istream*  >();
@@ -103,6 +140,7 @@ int main(int, char**)
     test<std::ofstream*>();
     test<std::fstream* >();
 
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     test<std::wstreambuf*>();
     test<std::wistream*  >();
     test<std::wostream*  >();
@@ -117,10 +155,13 @@ int main(int, char**)
     test<std::wifstream*>();
     test<std::wofstream*>();
     test<std::wfstream* >();
+#endif
 
     test<std::fpos<std::mbstate_t>*>();
     test<std::streampos*           >();
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     test<std::wstreampos*          >();
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/iostream.objects/init.pass.cpp b/libcxx/test/std/input.output/iostream.objects/init.pass.cpp
index e53228adc3245..293d105fe258d 100644
--- a/libcxx/test/std/input.output/iostream.objects/init.pass.cpp
+++ b/libcxx/test/std/input.output/iostream.objects/init.pass.cpp
@@ -25,37 +25,24 @@
 #include <cstring>
 #include <iostream>
 
+#include "test_macros.h"
+
 struct Checker {
     char *cerr_mem_dump;
     char *cin_mem_dump;
     char *cout_mem_dump;
     char *clog_mem_dump;
 
-    char *wcerr_mem_dump;
-    char *wcin_mem_dump;
-    char *wcout_mem_dump;
-    char *wclog_mem_dump;
-
     Checker()
         : cerr_mem_dump(new char[sizeof(std::cerr)])
         , cin_mem_dump(new char[sizeof(std::cin)])
         , cout_mem_dump(new char[sizeof(std::cout)])
         , clog_mem_dump(new char[sizeof(std::clog)])
-
-        , wcerr_mem_dump(new char[sizeof(std::wcerr)])
-        , wcin_mem_dump(new char[sizeof(std::wcin)])
-        , wcout_mem_dump(new char[sizeof(std::wcout)])
-        , wclog_mem_dump(new char[sizeof(std::wclog)])
      {
         std::memcpy(cerr_mem_dump, (char*)&std::cerr, sizeof(std::cerr));
         std::memcpy(cin_mem_dump, (char*)&std::cin, sizeof(std::cin));
         std::memcpy(cout_mem_dump, (char*)&std::cout, sizeof(std::cout));
         std::memcpy(clog_mem_dump, (char*)&std::clog, sizeof(std::clog));
-
-        std::memcpy(wcerr_mem_dump, (char*)&std::wcerr, sizeof(std::wcerr));
-        std::memcpy(wcin_mem_dump, (char*)&std::wcin, sizeof(std::wcin));
-        std::memcpy(wcout_mem_dump, (char*)&std::wcout, sizeof(std::wcout));
-        std::memcpy(wclog_mem_dump, (char*)&std::wclog, sizeof(std::wclog));
     }
 
     ~Checker() {
@@ -63,7 +50,30 @@ struct Checker {
         delete[] cin_mem_dump;
         delete[] cout_mem_dump;
         delete[] clog_mem_dump;
+    }
+};
+static Checker check;
 
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
+struct WideChecker {
+    char *wcerr_mem_dump;
+    char *wcin_mem_dump;
+    char *wcout_mem_dump;
+    char *wclog_mem_dump;
+
+    WideChecker()
+        : wcerr_mem_dump(new char[sizeof(std::wcerr)])
+        , wcin_mem_dump(new char[sizeof(std::wcin)])
+        , wcout_mem_dump(new char[sizeof(std::wcout)])
+        , wclog_mem_dump(new char[sizeof(std::wclog)])
+     {
+        std::memcpy(wcerr_mem_dump, (char*)&std::wcerr, sizeof(std::wcerr));
+        std::memcpy(wcin_mem_dump, (char*)&std::wcin, sizeof(std::wcin));
+        std::memcpy(wcout_mem_dump, (char*)&std::wcout, sizeof(std::wcout));
+        std::memcpy(wclog_mem_dump, (char*)&std::wclog, sizeof(std::wclog));
+    }
+
+    ~WideChecker() {
         delete[] wcerr_mem_dump;
         delete[] wcin_mem_dump;
         delete[] wcout_mem_dump;
@@ -71,7 +81,8 @@ struct Checker {
     }
 };
 
-static Checker check;
+static WideChecker wide_check;
+#endif
 
 int main(int, char**) {
     assert(std::memcmp(check.cerr_mem_dump, (char const*)&std::cerr, sizeof(std::cerr)) == 0);
@@ -79,9 +90,11 @@ int main(int, char**) {
     assert(std::memcmp(check.cout_mem_dump, (char const*)&std::cout, sizeof(std::cout)) == 0);
     assert(std::memcmp(check.clog_mem_dump, (char const*)&std::clog, sizeof(std::clog)) == 0);
 
-    assert(std::memcmp(check.wcerr_mem_dump, (char const*)&std::wcerr, sizeof(std::wcerr)) == 0);
-    assert(std::memcmp(check.wcin_mem_dump, (char const*)&std::wcin, sizeof(std::wcin)) == 0);
-    assert(std::memcmp(check.wcout_mem_dump, (char const*)&std::wcout, sizeof(std::wcout)) == 0);
-    assert(std::memcmp(check.wclog_mem_dump, (char const*)&std::wclog, sizeof(std::wclog)) == 0);
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
+    assert(std::memcmp(wide_check.wcerr_mem_dump, (char const*)&std::wcerr, sizeof(std::wcerr)) == 0);
+    assert(std::memcmp(wide_check.wcin_mem_dump, (char const*)&std::wcin, sizeof(std::wcin)) == 0);
+    assert(std::memcmp(wide_check.wcout_mem_dump, (char const*)&std::wcout, sizeof(std::wcout)) == 0);
+    assert(std::memcmp(wide_check.wclog_mem_dump, (char const*)&std::wclog, sizeof(std::wclog)) == 0);
+#endif
     return 0;
 }

diff  --git a/libcxx/test/std/input.output/iostream.objects/wide.stream.objects/wcerr.sh.cpp b/libcxx/test/std/input.output/iostream.objects/wide.stream.objects/wcerr.sh.cpp
index 7e8e570c4f3e0..8ff1666496c7b 100644
--- a/libcxx/test/std/input.output/iostream.objects/wide.stream.objects/wcerr.sh.cpp
+++ b/libcxx/test/std/input.output/iostream.objects/wide.stream.objects/wcerr.sh.cpp
@@ -10,6 +10,7 @@
 
 // istream wcerr;
 
+// XFAIL: libcpp-has-no-wide-characters
 // XFAIL: LIBCXX-WINDOWS-FIXME
 
 // FILE_DEPENDENCIES: ../check-stderr.sh

diff  --git a/libcxx/test/std/input.output/iostream.objects/wide.stream.objects/wcin.sh.cpp b/libcxx/test/std/input.output/iostream.objects/wide.stream.objects/wcin.sh.cpp
index aee8d793eb4f3..af7107cd4769d 100644
--- a/libcxx/test/std/input.output/iostream.objects/wide.stream.objects/wcin.sh.cpp
+++ b/libcxx/test/std/input.output/iostream.objects/wide.stream.objects/wcin.sh.cpp
@@ -10,6 +10,8 @@
 
 // istream wcin;
 
+// XFAIL: libcpp-has-no-wide-characters
+
 // FILE_DEPENDENCIES: ../send-stdin.sh
 // RUN: %{build}
 // RUN: %{exec} bash send-stdin.sh "%t.exe" "1234"

diff  --git a/libcxx/test/std/input.output/iostream.objects/wide.stream.objects/wclog.sh.cpp b/libcxx/test/std/input.output/iostream.objects/wide.stream.objects/wclog.sh.cpp
index 07c6a2540a17d..1a5b200f27c2b 100644
--- a/libcxx/test/std/input.output/iostream.objects/wide.stream.objects/wclog.sh.cpp
+++ b/libcxx/test/std/input.output/iostream.objects/wide.stream.objects/wclog.sh.cpp
@@ -10,6 +10,7 @@
 
 // istream wclog;
 
+// XFAIL: libcpp-has-no-wide-characters
 // XFAIL: LIBCXX-WINDOWS-FIXME
 
 // FILE_DEPENDENCIES: ../check-stderr.sh

diff  --git a/libcxx/test/std/input.output/iostream.objects/wide.stream.objects/wcout.sh.cpp b/libcxx/test/std/input.output/iostream.objects/wide.stream.objects/wcout.sh.cpp
index 5dd8345c0b047..3d4af9799973e 100644
--- a/libcxx/test/std/input.output/iostream.objects/wide.stream.objects/wcout.sh.cpp
+++ b/libcxx/test/std/input.output/iostream.objects/wide.stream.objects/wcout.sh.cpp
@@ -10,6 +10,7 @@
 
 // istream wcout;
 
+// XFAIL: libcpp-has-no-wide-characters
 // XFAIL: LIBCXX-WINDOWS-FIXME
 
 // FILE_DEPENDENCIES: ../check-stdout.sh

diff  --git a/libcxx/test/std/input.output/iostreams.base/ios/basic.ios.members/narrow.pass.cpp b/libcxx/test/std/input.output/iostreams.base/ios/basic.ios.members/narrow.pass.cpp
index 5b0c903deec62..fbc3ae88784c7 100644
--- a/libcxx/test/std/input.output/iostreams.base/ios/basic.ios.members/narrow.pass.cpp
+++ b/libcxx/test/std/input.output/iostreams.base/ios/basic.ios.members/narrow.pass.cpp
@@ -12,6 +12,8 @@
 
 // char narrow(char_type c, char dfault) const;
 
+// XFAIL: libcpp-has-no-wide-characters
+
 #include <ios>
 #include <cassert>
 

diff  --git a/libcxx/test/std/input.output/stream.buffers/streambuf/streambuf.cons/copy.pass.cpp b/libcxx/test/std/input.output/stream.buffers/streambuf/streambuf.cons/copy.pass.cpp
index 9c47c074d03bd..5806751195070 100644
--- a/libcxx/test/std/input.output/stream.buffers/streambuf/streambuf.cons/copy.pass.cpp
+++ b/libcxx/test/std/input.output/stream.buffers/streambuf/streambuf.cons/copy.pass.cpp
@@ -56,10 +56,6 @@ int main(int, char**)
         test<char> t;
         test<char> t2 = t;
     }
-    {
-        test<wchar_t> t;
-        test<wchar_t> t2 = t;
-    }
     {
         char g1, g2, g3, p1, p3;
         test<char> t;
@@ -67,6 +63,7 @@ int main(int, char**)
         t.setp(&p1, &p3);
         test<char> t2 = t;
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         wchar_t g1, g2, g3, p1, p3;
         test<wchar_t> t;
@@ -74,15 +71,22 @@ int main(int, char**)
         t.setp(&p1, &p3);
         test<wchar_t> t2 = t;
     }
+    {
+        test<wchar_t> t;
+        test<wchar_t> t2 = t;
+    }
+#endif
     std::locale::global(std::locale(LOCALE_en_US_UTF_8));
     {
         test<char> t;
         test<char> t2 = t;
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         test<wchar_t> t;
         test<wchar_t> t2 = t;
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/stream.buffers/streambuf/streambuf.cons/default.pass.cpp b/libcxx/test/std/input.output/stream.buffers/streambuf/streambuf.cons/default.pass.cpp
index eaa1a9b03c94e..df9df9005fe89 100644
--- a/libcxx/test/std/input.output/stream.buffers/streambuf/streambuf.cons/default.pass.cpp
+++ b/libcxx/test/std/input.output/stream.buffers/streambuf/streambuf.cons/default.pass.cpp
@@ -42,19 +42,24 @@ int main(int, char**)
         test<char> t;
         assert(t.getloc().name() == "C");
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         test<wchar_t> t;
         assert(t.getloc().name() == "C");
     }
+#endif
+
     std::locale::global(std::locale(LOCALE_en_US_UTF_8));
     {
         test<char> t;
         assert(t.getloc().name() == LOCALE_en_US_UTF_8);
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         test<wchar_t> t;
         assert(t.getloc().name() == LOCALE_en_US_UTF_8);
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/stream.buffers/streambuf/streambuf.protected/streambuf.assign/assign.pass.cpp b/libcxx/test/std/input.output/stream.buffers/streambuf/streambuf.protected/streambuf.assign/assign.pass.cpp
index e16094bacf9ef..8a976e77f0f13 100644
--- a/libcxx/test/std/input.output/stream.buffers/streambuf/streambuf.protected/streambuf.assign/assign.pass.cpp
+++ b/libcxx/test/std/input.output/stream.buffers/streambuf/streambuf.protected/streambuf.assign/assign.pass.cpp
@@ -58,11 +58,6 @@ int main(int, char**)
         test<char> t2;
         t2 = t;
     }
-    {
-        test<wchar_t> t;
-        test<wchar_t> t2;
-        t2 = t;
-    }
     {
         char g1, g2, g3, p1, p3;
         test<char> t;
@@ -71,6 +66,12 @@ int main(int, char**)
         test<char> t2;
         t2 = t;
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
+    {
+        test<wchar_t> t;
+        test<wchar_t> t2;
+        t2 = t;
+    }
     {
         wchar_t g1, g2, g3, p1, p3;
         test<wchar_t> t;
@@ -79,17 +80,20 @@ int main(int, char**)
         test<wchar_t> t2;
         t2 = t;
     }
+#endif
     std::locale::global(std::locale(LOCALE_en_US_UTF_8));
     {
         test<char> t;
         test<char> t2;
         t2 = t;
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         test<wchar_t> t;
         test<wchar_t> t2;
         t2 = t;
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/stream.buffers/streambuf/streambuf.protected/streambuf.assign/swap.pass.cpp b/libcxx/test/std/input.output/stream.buffers/streambuf/streambuf.protected/streambuf.assign/swap.pass.cpp
index d96a60ab41903..c575c2cb12711 100644
--- a/libcxx/test/std/input.output/stream.buffers/streambuf/streambuf.protected/streambuf.assign/swap.pass.cpp
+++ b/libcxx/test/std/input.output/stream.buffers/streambuf/streambuf.protected/streambuf.assign/swap.pass.cpp
@@ -67,11 +67,6 @@ int main(int, char**)
         test<char> t2;
         t2.swap(t);
     }
-    {
-        test<wchar_t> t;
-        test<wchar_t> t2;
-        t2.swap(t);
-    }
     {
         char g1, g2, g3, p1, p3;
         test<char> t;
@@ -80,6 +75,12 @@ int main(int, char**)
         test<char> t2;
         t2.swap(t);
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
+    {
+        test<wchar_t> t;
+        test<wchar_t> t2;
+        t2.swap(t);
+    }
     {
         wchar_t g1, g2, g3, p1, p3;
         test<wchar_t> t;
@@ -88,17 +89,20 @@ int main(int, char**)
         test<wchar_t> t2;
         t2.swap(t);
     }
+#endif
     std::locale::global(std::locale(LOCALE_en_US_UTF_8));
     {
         test<char> t;
         test<char> t2;
         t2.swap(t);
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         test<wchar_t> t;
         test<wchar_t> t2;
         t2.swap(t);
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/stream.buffers/streambuf/streambuf.protected/streambuf.get.area/gbump.pass.cpp b/libcxx/test/std/input.output/stream.buffers/streambuf/streambuf.protected/streambuf.get.area/gbump.pass.cpp
index 2091a9d092c8d..f02fe4222aa2b 100644
--- a/libcxx/test/std/input.output/stream.buffers/streambuf/streambuf.protected/streambuf.get.area/gbump.pass.cpp
+++ b/libcxx/test/std/input.output/stream.buffers/streambuf/streambuf.protected/streambuf.get.area/gbump.pass.cpp
@@ -51,12 +51,14 @@ int main(int, char**)
         t.setg(in, in+1, in+sizeof(in)/sizeof(in[0]));
         t.gbump(2);
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         test<wchar_t> t;
         wchar_t in[] = L"ABCDE";
         t.setg(in, in+1, in+sizeof(in)/sizeof(in[0]));
         t.gbump(3);
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/stream.buffers/streambuf/streambuf.protected/streambuf.get.area/setg.pass.cpp b/libcxx/test/std/input.output/stream.buffers/streambuf/streambuf.protected/streambuf.get.area/setg.pass.cpp
index 8f01ac9edc109..ee6dc78853aba 100644
--- a/libcxx/test/std/input.output/stream.buffers/streambuf/streambuf.protected/streambuf.get.area/setg.pass.cpp
+++ b/libcxx/test/std/input.output/stream.buffers/streambuf/streambuf.protected/streambuf.get.area/setg.pass.cpp
@@ -42,11 +42,13 @@ int main(int, char**)
         char in[] = "ABC";
         t.setg(in, in+1, in+sizeof(in)/sizeof(in[0]));
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         test<wchar_t> t;
         wchar_t in[] = L"ABC";
         t.setg(in, in+1, in+sizeof(in)/sizeof(in[0]));
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/stream.buffers/streambuf/streambuf.protected/streambuf.put.area/pbump.pass.cpp b/libcxx/test/std/input.output/stream.buffers/streambuf/streambuf.protected/streambuf.put.area/pbump.pass.cpp
index 346951ff527b8..6acd179f46036 100644
--- a/libcxx/test/std/input.output/stream.buffers/streambuf/streambuf.protected/streambuf.put.area/pbump.pass.cpp
+++ b/libcxx/test/std/input.output/stream.buffers/streambuf/streambuf.protected/streambuf.put.area/pbump.pass.cpp
@@ -52,6 +52,7 @@ int main(int, char**)
         t.pbump(2);
         t.pbump(1);
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         test<wchar_t> t;
         wchar_t in[] = L"ABCDE";
@@ -59,6 +60,7 @@ int main(int, char**)
         t.pbump(3);
         t.pbump(1);
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/stream.buffers/streambuf/streambuf.protected/streambuf.put.area/setp.pass.cpp b/libcxx/test/std/input.output/stream.buffers/streambuf/streambuf.protected/streambuf.put.area/setp.pass.cpp
index 201a65dff0c7c..acbc00063cdfe 100644
--- a/libcxx/test/std/input.output/stream.buffers/streambuf/streambuf.protected/streambuf.put.area/setp.pass.cpp
+++ b/libcxx/test/std/input.output/stream.buffers/streambuf/streambuf.protected/streambuf.put.area/setp.pass.cpp
@@ -42,11 +42,13 @@ int main(int, char**)
         char in[] = "ABC";
         t.setp(in, in+sizeof(in)/sizeof(in[0]));
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         test<wchar_t> t;
         wchar_t in[] = L"ABC";
         t.setp(in, in+sizeof(in)/sizeof(in[0]));
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/stream.buffers/streambuf/types.pass.cpp b/libcxx/test/std/input.output/stream.buffers/streambuf/types.pass.cpp
index a80c23e4a4b00..3dd8a3efe4c05 100644
--- a/libcxx/test/std/input.output/stream.buffers/streambuf/types.pass.cpp
+++ b/libcxx/test/std/input.output/stream.buffers/streambuf/types.pass.cpp
@@ -32,11 +32,13 @@ int main(int, char**)
     static_assert((std::is_same<std::streambuf::pos_type, std::char_traits<char>::pos_type>::value), "");
     static_assert((std::is_same<std::streambuf::off_type, std::char_traits<char>::off_type>::value), "");
 
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     static_assert((std::is_same<std::wstreambuf::char_type, wchar_t>::value), "");
     static_assert((std::is_same<std::wstreambuf::traits_type, std::char_traits<wchar_t> >::value), "");
     static_assert((std::is_same<std::wstreambuf::int_type, std::char_traits<wchar_t>::int_type>::value), "");
     static_assert((std::is_same<std::wstreambuf::pos_type, std::char_traits<wchar_t>::pos_type>::value), "");
     static_assert((std::is_same<std::wstreambuf::off_type, std::char_traits<wchar_t>::off_type>::value), "");
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/string.streams/istringstream/istringstream.assign/member_swap.pass.cpp b/libcxx/test/std/input.output/string.streams/istringstream/istringstream.assign/member_swap.pass.cpp
index e17bf5a6b1d13..724fe8e54fa72 100644
--- a/libcxx/test/std/input.output/string.streams/istringstream/istringstream.assign/member_swap.pass.cpp
+++ b/libcxx/test/std/input.output/string.streams/istringstream/istringstream.assign/member_swap.pass.cpp
@@ -37,6 +37,7 @@ int main(int, char**)
         ss0 >> i;
         assert(i == 321);
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::wistringstream ss0(L" 123 456");
         std::wistringstream ss(L" 789 321");
@@ -54,6 +55,7 @@ int main(int, char**)
         ss0 >> i;
         assert(i == 321);
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/string.streams/istringstream/istringstream.assign/move.pass.cpp b/libcxx/test/std/input.output/string.streams/istringstream/istringstream.assign/move.pass.cpp
index 93c8313d85909..3fc096798eeba 100644
--- a/libcxx/test/std/input.output/string.streams/istringstream/istringstream.assign/move.pass.cpp
+++ b/libcxx/test/std/input.output/string.streams/istringstream/istringstream.assign/move.pass.cpp
@@ -51,6 +51,7 @@ int main(int, char**)
         s1 >> s;
         assert(s == "Dddddddddddddddddd");
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::wistringstream ss0(L" 123 456");
         std::wistringstream ss;
@@ -82,6 +83,7 @@ int main(int, char**)
         s1 >> s;
         assert(s == L"Dddddddddddddddddd");
     }
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/string.streams/istringstream/istringstream.assign/nonmember_swap.pass.cpp b/libcxx/test/std/input.output/string.streams/istringstream/istringstream.assign/nonmember_swap.pass.cpp
index d16b73fd3effb..be46bb1988892 100644
--- a/libcxx/test/std/input.output/string.streams/istringstream/istringstream.assign/nonmember_swap.pass.cpp
+++ b/libcxx/test/std/input.output/string.streams/istringstream/istringstream.assign/nonmember_swap.pass.cpp
@@ -40,6 +40,7 @@ int main(int, char**)
         ss0 >> i;
         assert(i == 321);
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::wistringstream ss0(L" 123 456");
         std::wistringstream ss(L" 789 321");
@@ -57,6 +58,7 @@ int main(int, char**)
         ss0 >> i;
         assert(i == 321);
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/string.streams/istringstream/istringstream.cons/default.pass.cpp b/libcxx/test/std/input.output/string.streams/istringstream/istringstream.cons/default.pass.cpp
index 22a823e5c4004..056c724f38bd9 100644
--- a/libcxx/test/std/input.output/string.streams/istringstream/istringstream.cons/default.pass.cpp
+++ b/libcxx/test/std/input.output/string.streams/istringstream/istringstream.cons/default.pass.cpp
@@ -43,6 +43,7 @@ int main(int, char**)
         assert(ss.good());
         assert(ss.str() == "");
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::wistringstream ss;
         assert(ss.rdbuf() != 0);
@@ -55,10 +56,13 @@ int main(int, char**)
         assert(ss.good());
         assert(ss.str() == L"");
     }
+#endif
 
 #if TEST_STD_VER >= 11
     test<std::istringstream>();
+#   ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
     test<std::wistringstream>();
+#   endif
 #endif
 
     return 0;

diff  --git a/libcxx/test/std/input.output/string.streams/istringstream/istringstream.cons/move.pass.cpp b/libcxx/test/std/input.output/string.streams/istringstream/istringstream.cons/move.pass.cpp
index 650284d87b706..45ad2d2f76146 100644
--- a/libcxx/test/std/input.output/string.streams/istringstream/istringstream.cons/move.pass.cpp
+++ b/libcxx/test/std/input.output/string.streams/istringstream/istringstream.cons/move.pass.cpp
@@ -32,6 +32,7 @@ int main(int, char**)
         ss >> i;
         assert(i == 456);
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::wistringstream ss0(L" 123 456");
         std::wistringstream ss(std::move(ss0));
@@ -44,6 +45,7 @@ int main(int, char**)
         ss >> i;
         assert(i == 456);
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/string.streams/istringstream/istringstream.cons/string.pass.cpp b/libcxx/test/std/input.output/string.streams/istringstream/istringstream.cons/string.pass.cpp
index a667869f1898b..9b0593f275357 100644
--- a/libcxx/test/std/input.output/string.streams/istringstream/istringstream.cons/string.pass.cpp
+++ b/libcxx/test/std/input.output/string.streams/istringstream/istringstream.cons/string.pass.cpp
@@ -43,6 +43,7 @@ int main(int, char**)
         ss >> i;
         assert(i == 456);
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::wistringstream ss(L" 123 456");
         assert(ss.rdbuf() != 0);
@@ -65,6 +66,7 @@ int main(int, char**)
         ss >> i;
         assert(i == 456);
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/string.streams/istringstream/istringstream.members/str.pass.cpp b/libcxx/test/std/input.output/string.streams/istringstream/istringstream.members/str.pass.cpp
index 4948f80dcb7ec..5ab126a76d586 100644
--- a/libcxx/test/std/input.output/string.streams/istringstream/istringstream.members/str.pass.cpp
+++ b/libcxx/test/std/input.output/string.streams/istringstream/istringstream.members/str.pass.cpp
@@ -37,6 +37,7 @@ int main(int, char**)
         ss >> i;
         assert(i == 789);
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::wistringstream ss(L" 123 456");
         assert(ss.rdbuf() != 0);
@@ -54,6 +55,7 @@ int main(int, char**)
         ss >> i;
         assert(i == 789);
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/string.streams/ostringstream/ostringstream.assign/member_swap.pass.cpp b/libcxx/test/std/input.output/string.streams/ostringstream/ostringstream.assign/member_swap.pass.cpp
index 5991f87e5bf57..33161fe4005f5 100644
--- a/libcxx/test/std/input.output/string.streams/ostringstream/ostringstream.assign/member_swap.pass.cpp
+++ b/libcxx/test/std/input.output/string.streams/ostringstream/ostringstream.assign/member_swap.pass.cpp
@@ -33,6 +33,7 @@ int main(int, char**)
         ss0 << i << ' ' << 567;
         assert(ss0.str() == "234 567");
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::wostringstream ss0(L" 123 456");
         std::wostringstream ss;
@@ -46,6 +47,7 @@ int main(int, char**)
         ss0 << i << ' ' << 567;
         assert(ss0.str() == L"234 567");
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/string.streams/ostringstream/ostringstream.assign/move.pass.cpp b/libcxx/test/std/input.output/string.streams/ostringstream/ostringstream.assign/move.pass.cpp
index 8be3a43fe38db..bd5f9cb8bbfd8 100644
--- a/libcxx/test/std/input.output/string.streams/ostringstream/ostringstream.assign/move.pass.cpp
+++ b/libcxx/test/std/input.output/string.streams/ostringstream/ostringstream.assign/move.pass.cpp
@@ -31,6 +31,7 @@ int main(int, char**)
         ss << i << ' ' << 567;
         assert(ss.str() == "234 5676");
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::wostringstream ss0(L" 123 456");
         std::wostringstream ss;
@@ -42,6 +43,7 @@ int main(int, char**)
         ss << i << ' ' << 567;
         assert(ss.str() == L"234 5676");
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/string.streams/ostringstream/ostringstream.assign/nonmember_swap.pass.cpp b/libcxx/test/std/input.output/string.streams/ostringstream/ostringstream.assign/nonmember_swap.pass.cpp
index f387c74dbfe17..227623cff0ea0 100644
--- a/libcxx/test/std/input.output/string.streams/ostringstream/ostringstream.assign/nonmember_swap.pass.cpp
+++ b/libcxx/test/std/input.output/string.streams/ostringstream/ostringstream.assign/nonmember_swap.pass.cpp
@@ -33,6 +33,7 @@ int main(int, char**)
         ss0 << i << ' ' << 567;
         assert(ss0.str() == "234 567");
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::wostringstream ss0(L" 123 456");
         std::wostringstream ss;
@@ -46,6 +47,7 @@ int main(int, char**)
         ss0 << i << ' ' << 567;
         assert(ss0.str() == L"234 567");
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/string.streams/ostringstream/ostringstream.cons/default.pass.cpp b/libcxx/test/std/input.output/string.streams/ostringstream/ostringstream.cons/default.pass.cpp
index 5ce63367d1c06..feac1441e8707 100644
--- a/libcxx/test/std/input.output/string.streams/ostringstream/ostringstream.cons/default.pass.cpp
+++ b/libcxx/test/std/input.output/string.streams/ostringstream/ostringstream.cons/default.pass.cpp
@@ -43,6 +43,7 @@ int main(int, char**)
         assert(ss.good());
         assert(ss.str() == "");
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::wostringstream ss;
         assert(ss.rdbuf() != 0);
@@ -55,10 +56,13 @@ int main(int, char**)
         assert(ss.good());
         assert(ss.str() == L"");
     }
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
 
 #if TEST_STD_VER >= 11
     test<std::ostringstream>();
+#   ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
     test<std::wostringstream>();
+#   endif
 #endif
 
     return 0;

diff  --git a/libcxx/test/std/input.output/string.streams/ostringstream/ostringstream.cons/move.pass.cpp b/libcxx/test/std/input.output/string.streams/ostringstream/ostringstream.cons/move.pass.cpp
index 6823bb69bc627..6a63cd61d55ed 100644
--- a/libcxx/test/std/input.output/string.streams/ostringstream/ostringstream.cons/move.pass.cpp
+++ b/libcxx/test/std/input.output/string.streams/ostringstream/ostringstream.cons/move.pass.cpp
@@ -30,6 +30,7 @@ int main(int, char**)
         ss << i << ' ' << 567;
         assert(ss.str() == "234 5676");
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::wostringstream ss0(L" 123 456");
         std::wostringstream ss(std::move(ss0));
@@ -40,6 +41,7 @@ int main(int, char**)
         ss << i << ' ' << 567;
         assert(ss.str() == L"234 5676");
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/string.streams/ostringstream/ostringstream.cons/string.pass.cpp b/libcxx/test/std/input.output/string.streams/ostringstream/ostringstream.cons/string.pass.cpp
index 5ff91b4ac7ddc..af3c320ddf5f4 100644
--- a/libcxx/test/std/input.output/string.streams/ostringstream/ostringstream.cons/string.pass.cpp
+++ b/libcxx/test/std/input.output/string.streams/ostringstream/ostringstream.cons/string.pass.cpp
@@ -39,6 +39,7 @@ int main(int, char**)
         ss << i << ' ' << 567;
         assert(ss.str() == "234 5676");
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::wostringstream ss(L" 123 456");
         assert(ss.rdbuf() != 0);
@@ -57,6 +58,7 @@ int main(int, char**)
         ss << i << ' ' << 567;
         assert(ss.str() == L"234 5676");
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/string.streams/ostringstream/ostringstream.members/str.pass.cpp b/libcxx/test/std/input.output/string.streams/ostringstream/ostringstream.members/str.pass.cpp
index e141d4f791ee5..63f6b5e1c74f4 100644
--- a/libcxx/test/std/input.output/string.streams/ostringstream/ostringstream.members/str.pass.cpp
+++ b/libcxx/test/std/input.output/string.streams/ostringstream/ostringstream.members/str.pass.cpp
@@ -35,6 +35,7 @@ int main(int, char**)
         ss << "abc";
         assert(ss.str() == "abc9");
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::wostringstream ss(L" 123 456");
         assert(ss.rdbuf() != 0);
@@ -50,6 +51,7 @@ int main(int, char**)
         ss << L"abc";
         assert(ss.str() == L"abc9");
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.assign/member_swap.pass.cpp b/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.assign/member_swap.pass.cpp
index d63f077299008..edb977a8aeadb 100644
--- a/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.assign/member_swap.pass.cpp
+++ b/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.assign/member_swap.pass.cpp
@@ -41,6 +41,7 @@ int main(int, char**)
         assert(buf.str() == "testing");
         assert(buf1.str() == "");
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::wstringbuf buf1(L"testing");
         std::wstringbuf buf;
@@ -62,6 +63,7 @@ int main(int, char**)
         assert(buf.str() == L"testing");
         assert(buf1.str() == L"");
     }
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.assign/move.pass.cpp b/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.assign/move.pass.cpp
index bdb3bcabb1610..27b9579f5b9da 100644
--- a/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.assign/move.pass.cpp
+++ b/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.assign/move.pass.cpp
@@ -38,6 +38,7 @@ int main(int, char**)
         buf = move(buf1);
         assert(buf.str() == "testing");
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::wstringbuf buf1(L"testing");
         std::wstringbuf buf;
@@ -56,6 +57,7 @@ int main(int, char**)
         buf = move(buf1);
         assert(buf.str() == L"testing");
     }
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.assign/nonmember_swap.pass.cpp b/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.assign/nonmember_swap.pass.cpp
index 70324dabd496e..6ac1381c5ab7b 100644
--- a/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.assign/nonmember_swap.pass.cpp
+++ b/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.assign/nonmember_swap.pass.cpp
@@ -43,6 +43,7 @@ int main(int, char**)
         assert(buf.str() == "testing");
         assert(buf1.str() == "");
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::wstringbuf buf1(L"testing");
         std::wstringbuf buf;
@@ -64,6 +65,7 @@ int main(int, char**)
         assert(buf.str() == L"testing");
         assert(buf1.str() == L"");
     }
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.cons/default.pass.cpp b/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.cons/default.pass.cpp
index 8e87a88114490..6451d44e91b5c 100644
--- a/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.cons/default.pass.cpp
+++ b/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.cons/default.pass.cpp
@@ -44,18 +44,20 @@ int main(int, char**)
         std::stringbuf buf;
         assert(buf.str() == "");
     }
-    {
-        std::wstringbuf buf;
-        assert(buf.str() == L"");
-    }
     {
         testbuf<char> buf;
         buf.check();
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
+    {
+        std::wstringbuf buf;
+        assert(buf.str() == L"");
+    }
     {
         testbuf<wchar_t> buf;
         buf.check();
     }
+#endif
 
 #if TEST_STD_VER >= 11
     {

diff  --git a/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.cons/move.pass.cpp b/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.cons/move.pass.cpp
index af1eb38c349b4..c4846c01d413f 100644
--- a/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.cons/move.pass.cpp
+++ b/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.cons/move.pass.cpp
@@ -35,6 +35,7 @@ int main(int, char**)
         std::stringbuf buf(std::move(buf1));
         assert(buf.str() == "testing");
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::wstringbuf buf1(L"testing");
         std::wstringbuf buf(std::move(buf1));
@@ -50,6 +51,7 @@ int main(int, char**)
         std::wstringbuf buf(std::move(buf1));
         assert(buf.str() == L"testing");
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.cons/string.pass.cpp b/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.cons/string.pass.cpp
index 409d293734b20..92e02a53236b7 100644
--- a/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.cons/string.pass.cpp
+++ b/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.cons/string.pass.cpp
@@ -33,6 +33,7 @@ int main(int, char**)
         std::stringbuf buf("testing", std::ios_base::out);
         assert(buf.str() == "testing");
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::wstringbuf buf(L"testing");
         assert(buf.str() == L"testing");
@@ -45,6 +46,7 @@ int main(int, char**)
         std::wstringbuf buf(L"testing", std::ios_base::out);
         assert(buf.str() == L"testing");
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.members/str.pass.cpp b/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.members/str.pass.cpp
index f536ba25ed703..18a2337f6b783 100644
--- a/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.members/str.pass.cpp
+++ b/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.members/str.pass.cpp
@@ -26,12 +26,14 @@ int main(int, char**)
         buf.str("another test");
         assert(buf.str() == "another test");
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::wstringbuf buf(L"testing");
         assert(buf.str() == L"testing");
         buf.str(L"another test");
         assert(buf.str() == L"another test");
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.virtuals/overflow.pass.cpp b/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.virtuals/overflow.pass.cpp
index 84110d3393d1e..990f918ce51f0 100644
--- a/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.virtuals/overflow.pass.cpp
+++ b/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.virtuals/overflow.pass.cpp
@@ -68,6 +68,7 @@ int main(int, char**)
         assert(sb.sputc('1') == '1');
         assert(sb.str() == "12345678901");
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         testbuf<wchar_t> sb(L"abc");
         assert(sb.sputc(L'1') == L'1');
@@ -93,6 +94,7 @@ int main(int, char**)
         assert(sb.sputc(L'1') == L'1');
         assert(sb.str() == L"12345678901");
     }
+#endif
     {
         testbuf<char> sb("abc", std::ios_base::app | std::ios_base::out);
         assert(sb.sputc('1') == '1');

diff  --git a/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.virtuals/pbackfail.pass.cpp b/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.virtuals/pbackfail.pass.cpp
index 44293298bb554..9a7d30e1e214c 100644
--- a/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.virtuals/pbackfail.pass.cpp
+++ b/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.virtuals/pbackfail.pass.cpp
@@ -68,6 +68,7 @@ int main(int, char**)
         assert(sb.pbackfail(std::char_traits<char>::eof()) == std::char_traits<char>::eof());
         assert(sb.str() == "133");
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         testbuf<wchar_t> sb(L"123", std::ios_base::in);
         assert(sb.sgetc() == L'1');
@@ -95,6 +96,7 @@ int main(int, char**)
         assert(sb.pbackfail(std::char_traits<wchar_t>::eof()) == std::char_traits<wchar_t>::eof());
         assert(sb.str() == L"133");
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.virtuals/seekoff.pass.cpp b/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.virtuals/seekoff.pass.cpp
index a778d03b3f132..2bd558557e833 100644
--- a/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.virtuals/seekoff.pass.cpp
+++ b/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.virtuals/seekoff.pass.cpp
@@ -105,6 +105,7 @@ int main(int, char**)
         assert(sb.sputc('c') == 'c');
         assert(sb.str() == "0123456c89");
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::wstringbuf sb(L"0123456789", std::ios_base::in);
         assert(sb.pubseekoff(3, std::ios_base::beg, std::ios_base::out) == -1);
@@ -165,6 +166,7 @@ int main(int, char**)
         assert(sb.sputc(L'c') == L'c');
         assert(sb.str() == L"0123456c89");
     }
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.virtuals/seekpos.pass.cpp b/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.virtuals/seekpos.pass.cpp
index 1980292edf59d..68bebf56ebf6a 100644
--- a/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.virtuals/seekpos.pass.cpp
+++ b/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.virtuals/seekpos.pass.cpp
@@ -48,6 +48,7 @@ int main(int, char**)
         assert(sb.sputc('3') == '3');
         assert(sb.str() == "0123456789");
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::wstringbuf sb(L"0123456789", std::ios_base::in);
         assert(sb.pubseekpos(3, std::ios_base::out) == -1);
@@ -75,6 +76,7 @@ int main(int, char**)
         assert(sb.sputc(L'3') == L'3');
         assert(sb.str() == L"0123456789");
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.virtuals/setbuf.pass.cpp b/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.virtuals/setbuf.pass.cpp
index 0347ef37b3168..2937cdf95b426 100644
--- a/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.virtuals/setbuf.pass.cpp
+++ b/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.virtuals/setbuf.pass.cpp
@@ -25,11 +25,13 @@ int main(int, char**)
         assert(sb.pubsetbuf(0, 0) == &sb);
         assert(sb.str() == "0123456789");
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::wstringbuf sb(L"0123456789");
         assert(sb.pubsetbuf(0, 0) == &sb);
         assert(sb.str() == L"0123456789");
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.virtuals/underflow.pass.cpp b/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.virtuals/underflow.pass.cpp
index a3490e20d4317..c743609dbed08 100644
--- a/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.virtuals/underflow.pass.cpp
+++ b/libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.virtuals/underflow.pass.cpp
@@ -50,6 +50,7 @@ int main(int, char**)
         assert(sb.underflow() == '4');
         assert(sb.underflow() == '4');
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         testbuf<wchar_t> sb(L"123");
         sb.pbump(3);
@@ -68,6 +69,7 @@ int main(int, char**)
         assert(sb.underflow() == L'4');
         assert(sb.underflow() == L'4');
     }
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/string.streams/stringstream.cons/default.pass.cpp b/libcxx/test/std/input.output/string.streams/stringstream.cons/default.pass.cpp
index f0c8750699c84..095dbf9c9b2e1 100644
--- a/libcxx/test/std/input.output/string.streams/stringstream.cons/default.pass.cpp
+++ b/libcxx/test/std/input.output/string.streams/stringstream.cons/default.pass.cpp
@@ -43,6 +43,7 @@ int main(int, char**)
         assert(ss.good());
         assert(ss.str() == "");
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::wstringstream ss;
         assert(ss.rdbuf() != 0);
@@ -55,10 +56,13 @@ int main(int, char**)
         assert(ss.good());
         assert(ss.str() == L"");
     }
+#endif
 
 #if TEST_STD_VER >= 11
     test<std::stringstream>();
+#   ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
     test<std::wstringstream>();
+#   endif
 #endif
 
     return 0;

diff  --git a/libcxx/test/std/input.output/string.streams/stringstream.cons/move.pass.cpp b/libcxx/test/std/input.output/string.streams/stringstream.cons/move.pass.cpp
index 642fd752a8f46..ec19c6736112d 100644
--- a/libcxx/test/std/input.output/string.streams/stringstream.cons/move.pass.cpp
+++ b/libcxx/test/std/input.output/string.streams/stringstream.cons/move.pass.cpp
@@ -34,6 +34,7 @@ int main(int, char**)
         ss << i << ' ' << 123;
         assert(ss.str() == "456 1236 ");
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::wstringstream ss0(L" 123 456 ");
         std::wstringstream ss(std::move(ss0));
@@ -48,6 +49,7 @@ int main(int, char**)
         ss << i << ' ' << 123;
         assert(ss.str() == L"456 1236 ");
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/string.streams/stringstream.cons/string.pass.cpp b/libcxx/test/std/input.output/string.streams/stringstream.cons/string.pass.cpp
index 55d95dfbe3ebe..0fb8a0288578e 100644
--- a/libcxx/test/std/input.output/string.streams/stringstream.cons/string.pass.cpp
+++ b/libcxx/test/std/input.output/string.streams/stringstream.cons/string.pass.cpp
@@ -44,6 +44,7 @@ int main(int, char**)
         ss << i << ' ' << 123;
         assert(ss.str() == "456 1236 ");
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::wstringstream ss(L" 123 456 ");
         assert(ss.rdbuf() != 0);
@@ -57,13 +58,14 @@ int main(int, char**)
         ss << i << ' ' << 123;
         assert(ss.str() == L"456 1236 ");
     }
+#endif
     { // This is https://llvm.org/PR33727
         typedef std::basic_string   <char, std::char_traits<char>, NoDefaultAllocator<char> > S;
         typedef std::basic_stringbuf<char, std::char_traits<char>, NoDefaultAllocator<char> > SB;
 
         S s(NoDefaultAllocator<char>(1));
         SB sb(s);
-    //  This test is not required by the standard, but *where else* could it get the allocator?
+        // This test is not required by the standard, but *where else* could it get the allocator?
         assert(sb.str().get_allocator() == s.get_allocator());
     }
 

diff  --git a/libcxx/test/std/input.output/string.streams/stringstream.cons/stringstream.assign/member_swap.pass.cpp b/libcxx/test/std/input.output/string.streams/stringstream.cons/stringstream.assign/member_swap.pass.cpp
index ddd117ea36417..1d5ff8b834ca8 100644
--- a/libcxx/test/std/input.output/string.streams/stringstream.cons/stringstream.assign/member_swap.pass.cpp
+++ b/libcxx/test/std/input.output/string.streams/stringstream.cons/stringstream.assign/member_swap.pass.cpp
@@ -37,6 +37,7 @@ int main(int, char**)
         ss0 << i << ' ' << 123;
         assert(ss0.str() == "456 123");
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::wstringstream ss0(L" 123 456 ");
         std::wstringstream ss;
@@ -54,6 +55,7 @@ int main(int, char**)
         ss0 << i << ' ' << 123;
         assert(ss0.str() == L"456 123");
     }
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/string.streams/stringstream.cons/stringstream.assign/move.pass.cpp b/libcxx/test/std/input.output/string.streams/stringstream.cons/stringstream.assign/move.pass.cpp
index 91a685d2db9f7..35c21973be41c 100644
--- a/libcxx/test/std/input.output/string.streams/stringstream.cons/stringstream.assign/move.pass.cpp
+++ b/libcxx/test/std/input.output/string.streams/stringstream.cons/stringstream.assign/move.pass.cpp
@@ -35,6 +35,7 @@ int main(int, char**)
         ss << i << ' ' << 123;
         assert(ss.str() == "456 1236 ");
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::wstringstream ss0(L" 123 456 ");
         std::wstringstream ss;
@@ -50,6 +51,7 @@ int main(int, char**)
         ss << i << ' ' << 123;
         assert(ss.str() == L"456 1236 ");
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/string.streams/stringstream.cons/stringstream.assign/nonmember_swap.pass.cpp b/libcxx/test/std/input.output/string.streams/stringstream.cons/stringstream.assign/nonmember_swap.pass.cpp
index 6304071639a64..a882beca20bbd 100644
--- a/libcxx/test/std/input.output/string.streams/stringstream.cons/stringstream.assign/nonmember_swap.pass.cpp
+++ b/libcxx/test/std/input.output/string.streams/stringstream.cons/stringstream.assign/nonmember_swap.pass.cpp
@@ -40,6 +40,7 @@ int main(int, char**)
         ss0 << i << ' ' << 123;
         assert(ss0.str() == "456 123");
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::wstringstream ss0(L" 123 456 ");
         std::wstringstream ss;
@@ -57,6 +58,7 @@ int main(int, char**)
         ss0 << i << ' ' << 123;
         assert(ss0.str() == L"456 123");
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/input.output/string.streams/stringstream.members/str.pass.cpp b/libcxx/test/std/input.output/string.streams/stringstream.members/str.pass.cpp
index 8645e5703e48d..05b233ed99e7c 100644
--- a/libcxx/test/std/input.output/string.streams/stringstream.members/str.pass.cpp
+++ b/libcxx/test/std/input.output/string.streams/stringstream.members/str.pass.cpp
@@ -40,6 +40,7 @@ int main(int, char**)
         ss << i << ' ' << 321;
         assert(ss.str() == "89 3219 ");
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::wstringstream ss(L" 123 456 ");
         assert(ss.rdbuf() != 0);
@@ -60,6 +61,7 @@ int main(int, char**)
         ss << i << ' ' << 321;
         assert(ss.str() == L"89 3219 ");
     }
+#endif
     {
         std::stringstream ss;
         ss.write("\xd1", 1);

diff  --git a/libcxx/test/std/iterators/stream.iterators/istream.iterator/types.pass.cpp b/libcxx/test/std/iterators/stream.iterators/istream.iterator/types.pass.cpp
index 6b7b1f9cf89bd..33b16c1b2738b 100644
--- a/libcxx/test/std/iterators/stream.iterators/istream.iterator/types.pass.cpp
+++ b/libcxx/test/std/iterators/stream.iterators/istream.iterator/types.pass.cpp
@@ -65,6 +65,7 @@ int main(int, char**)
     static_assert( std::is_trivially_destructible<I1>::value, "");
     }
 
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
     typedef std::istream_iterator<unsigned, wchar_t> I2; // unsigned is trivially destructible
 #if TEST_STD_VER <= 14
@@ -82,6 +83,7 @@ int main(int, char**)
     static_assert( std::is_trivially_copy_constructible<I2>::value, "");
     static_assert( std::is_trivially_destructible<I2>::value, "");
     }
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
 
     typedef std::istream_iterator<std::string> I3; // string is NOT trivially destructible
     static_assert(!std::is_trivially_copy_constructible<I3>::value, "");

diff  --git a/libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator.cons/default.pass.cpp b/libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator.cons/default.pass.cpp
index 9502e0da7b98e..ccda358407a8f 100644
--- a/libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator.cons/default.pass.cpp
+++ b/libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator.cons/default.pass.cpp
@@ -32,6 +32,8 @@ int main(int, char**)
         (void)it2;
 #endif
     }
+
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         typedef std::istreambuf_iterator<wchar_t> T;
         T it;
@@ -41,6 +43,7 @@ int main(int, char**)
         (void)it2;
 #endif
     }
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
 
   return 0;
 }

diff  --git a/libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator.cons/istream.pass.cpp b/libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator.cons/istream.pass.cpp
index 6b52cf5ebcf14..db99f46aa8c2b 100644
--- a/libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator.cons/istream.pass.cpp
+++ b/libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator.cons/istream.pass.cpp
@@ -30,6 +30,7 @@ int main(int, char**)
         std::istreambuf_iterator<char> i(inf);
         assert(i != std::istreambuf_iterator<char>());
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::wistringstream inf;
         std::istreambuf_iterator<wchar_t> i(inf);
@@ -40,6 +41,7 @@ int main(int, char**)
         std::istreambuf_iterator<wchar_t> i(inf);
         assert(i != std::istreambuf_iterator<wchar_t>());
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator.cons/proxy.pass.cpp b/libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator.cons/proxy.pass.cpp
index 4fd650637080f..4ad6c384c6e5d 100644
--- a/libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator.cons/proxy.pass.cpp
+++ b/libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator.cons/proxy.pass.cpp
@@ -27,6 +27,7 @@ int main(int, char**)
         assert(i != std::istreambuf_iterator<char>());
         assert(*i == 'b');
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::wistringstream inf(L"abc");
         std::istreambuf_iterator<wchar_t> j(inf);
@@ -34,6 +35,7 @@ int main(int, char**)
         assert(i != std::istreambuf_iterator<wchar_t>());
         assert(*i == L'b');
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator.cons/streambuf.pass.cpp b/libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator.cons/streambuf.pass.cpp
index e851379ca1e55..bb83a55075451 100644
--- a/libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator.cons/streambuf.pass.cpp
+++ b/libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator.cons/streambuf.pass.cpp
@@ -34,6 +34,7 @@ int main(int, char**)
         std::istreambuf_iterator<char> i(inf.rdbuf());
         assert(i != std::istreambuf_iterator<char>());
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::istreambuf_iterator<wchar_t> i(nullptr);
         assert(i == std::istreambuf_iterator<wchar_t>());
@@ -48,6 +49,7 @@ int main(int, char**)
         std::istreambuf_iterator<wchar_t> i(inf.rdbuf());
         assert(i != std::istreambuf_iterator<wchar_t>());
     }
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
 
   return 0;
 }

diff  --git a/libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator_equal/equal.pass.cpp b/libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator_equal/equal.pass.cpp
index 95db77e67cf66..ba6e2b4779b09 100644
--- a/libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator_equal/equal.pass.cpp
+++ b/libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator_equal/equal.pass.cpp
@@ -59,6 +59,7 @@ int main(int, char**)
         assert( i5.equal(i4));
         assert( i5.equal(i5));
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::wistringstream inf1(L"abc");
         std::wistringstream inf2(L"def");
@@ -98,6 +99,7 @@ int main(int, char**)
         assert( i5.equal(i4));
         assert( i5.equal(i5));
     }
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
 
   return 0;
 }

diff  --git a/libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator_op!=/not_equal.pass.cpp b/libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator_op!=/not_equal.pass.cpp
index daf325c8d46b3..2771911bbae50 100644
--- a/libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator_op!=/not_equal.pass.cpp
+++ b/libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator_op!=/not_equal.pass.cpp
@@ -61,6 +61,7 @@ int main(int, char**)
         assert(!(i5 != i4));
         assert(!(i5 != i5));
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::wistringstream inf1(L"abc");
         std::wistringstream inf2(L"def");
@@ -100,6 +101,7 @@ int main(int, char**)
         assert(!(i5 != i4));
         assert(!(i5 != i5));
     }
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
 
   return 0;
 }

diff  --git a/libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator_op++/dereference.pass.cpp b/libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator_op++/dereference.pass.cpp
index 1309c69c719d1..431e8d88c8ff3 100644
--- a/libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator_op++/dereference.pass.cpp
+++ b/libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator_op++/dereference.pass.cpp
@@ -29,6 +29,7 @@ int main(int, char**)
         ++i;
         assert(*i == 'c');
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::wistringstream inf(L"abc");
         std::istreambuf_iterator<wchar_t> i(inf);
@@ -38,6 +39,7 @@ int main(int, char**)
         ++i;
         assert(*i == L'c');
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator_op==/equal.pass.cpp b/libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator_op==/equal.pass.cpp
index 1c0c88f3e07ea..c0fbf687ef4fb 100644
--- a/libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator_op==/equal.pass.cpp
+++ b/libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator_op==/equal.pass.cpp
@@ -61,6 +61,7 @@ int main(int, char**)
         assert( (i5 == i4));
         assert( (i5 == i5));
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::wistringstream inf1(L"abc");
         std::wistringstream inf2(L"def");
@@ -100,6 +101,7 @@ int main(int, char**)
         assert( (i5 == i4));
         assert( (i5 == i5));
     }
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
 
   return 0;
 }

diff  --git a/libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator_op_astrk/post_increment.pass.cpp b/libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator_op_astrk/post_increment.pass.cpp
index 7c52e1bc712a6..c325e45647402 100644
--- a/libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator_op_astrk/post_increment.pass.cpp
+++ b/libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator_op_astrk/post_increment.pass.cpp
@@ -28,6 +28,7 @@ int main(int, char**)
         assert(*i++ == 'c');
         assert(i == std::istreambuf_iterator<char>());
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::wistringstream inf(L"abc");
         std::istreambuf_iterator<wchar_t> i(inf);
@@ -36,6 +37,7 @@ int main(int, char**)
         assert(*i++ == L'c');
         assert(i == std::istreambuf_iterator<wchar_t>());
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator_op_astrk/pre_increment.pass.cpp b/libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator_op_astrk/pre_increment.pass.cpp
index da11ca0317234..c2e28ed011011 100644
--- a/libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator_op_astrk/pre_increment.pass.cpp
+++ b/libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator_op_astrk/pre_increment.pass.cpp
@@ -29,6 +29,7 @@ int main(int, char**)
         assert(*++i == 'c');
         assert(++i == std::istreambuf_iterator<char>());
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::wistringstream inf(L"abc");
         std::istreambuf_iterator<wchar_t> i(inf);
@@ -37,6 +38,7 @@ int main(int, char**)
         assert(*++i == L'c');
         assert(++i == std::istreambuf_iterator<wchar_t>());
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator_proxy/proxy.pass.cpp b/libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator_proxy/proxy.pass.cpp
index f385a4027ff4e..b70dab2e9ac86 100644
--- a/libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator_proxy/proxy.pass.cpp
+++ b/libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator_proxy/proxy.pass.cpp
@@ -33,11 +33,13 @@ int main(int, char**)
         std::istreambuf_iterator<char> i(inf);
         assert(*i++ == 'a');
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::wistringstream inf(L"abc");
         std::istreambuf_iterator<wchar_t> i(inf);
         assert(*i++ == L'a');
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/types.pass.cpp b/libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/types.pass.cpp
index 257a26627f29f..278470e7359a5 100644
--- a/libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/types.pass.cpp
+++ b/libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/types.pass.cpp
@@ -58,6 +58,7 @@ int main(int, char**)
     static_assert((std::is_trivially_destructible<I1>::value), "" );
     }
 
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
     typedef std::istreambuf_iterator<wchar_t> I2;
 #if TEST_STD_VER <= 14
@@ -78,6 +79,7 @@ int main(int, char**)
     static_assert((std::is_trivially_copy_constructible<I2>::value), "" );
     static_assert((std::is_trivially_destructible<I2>::value), "" );
     }
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
 
   return 0;
 }

diff  --git a/libcxx/test/std/iterators/stream.iterators/ostream.iterator/ostream.iterator.cons.des/ostream_delim.pass.cpp b/libcxx/test/std/iterators/stream.iterators/ostream.iterator/ostream.iterator.cons.des/ostream_delim.pass.cpp
index 766e989b0fd9a..f63aa888fa146 100644
--- a/libcxx/test/std/iterators/stream.iterators/ostream.iterator/ostream.iterator.cons.des/ostream_delim.pass.cpp
+++ b/libcxx/test/std/iterators/stream.iterators/ostream.iterator/ostream.iterator.cons.des/ostream_delim.pass.cpp
@@ -33,11 +33,13 @@ int main(int, char**)
         std::ostream_iterator<int> i(outf, ", ");
         assert(outf.good());
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::wostringstream outf;
         std::ostream_iterator<double, wchar_t> i(outf, L", ");
         assert(outf.good());
     }
+#endif
     {
         StringStream outf;
         std::ostream_iterator<int, char, MyTraits> i(outf, ", ");

diff  --git a/libcxx/test/std/iterators/stream.iterators/ostream.iterator/ostream.iterator.ops/assign_t.pass.cpp b/libcxx/test/std/iterators/stream.iterators/ostream.iterator/ostream.iterator.ops/assign_t.pass.cpp
index 5a2f2cc99f258..fe140c38c7b05 100644
--- a/libcxx/test/std/iterators/stream.iterators/ostream.iterator/ostream.iterator.ops/assign_t.pass.cpp
+++ b/libcxx/test/std/iterators/stream.iterators/ostream.iterator/ostream.iterator.ops/assign_t.pass.cpp
@@ -40,6 +40,7 @@ int main(int, char**)
         i = 2.4;
         assert(outf.str() == "2, ");
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::wostringstream outf;
         std::ostream_iterator<int, wchar_t> i(outf);
@@ -52,6 +53,7 @@ int main(int, char**)
         i = 2.4;
         assert(outf.str() == L"2, ");
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/iterators/stream.iterators/ostream.iterator/types.pass.cpp b/libcxx/test/std/iterators/stream.iterators/ostream.iterator/types.pass.cpp
index 042feebf0a0d6..b2f5b8c6354eb 100644
--- a/libcxx/test/std/iterators/stream.iterators/ostream.iterator/types.pass.cpp
+++ b/libcxx/test/std/iterators/stream.iterators/ostream.iterator/types.pass.cpp
@@ -54,6 +54,7 @@ int main(int, char**)
     static_assert((std::is_same<I1::ostream_type, std::ostream>::value), "");
     }
 
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
     typedef std::ostream_iterator<unsigned, wchar_t> I2;
 #if TEST_STD_VER <= 14
@@ -73,6 +74,7 @@ int main(int, char**)
     static_assert((std::is_same<I2::traits_type, std::char_traits<wchar_t> >::value), "");
     static_assert((std::is_same<I2::ostream_type, std::wostream>::value), "");
     }
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
 
   return 0;
 }

diff  --git a/libcxx/test/std/iterators/stream.iterators/ostreambuf.iterator/ostreambuf.iter.cons/ostream.pass.cpp b/libcxx/test/std/iterators/stream.iterators/ostreambuf.iterator/ostreambuf.iter.cons/ostream.pass.cpp
index 7be77cb404332..12d17565badf1 100644
--- a/libcxx/test/std/iterators/stream.iterators/ostreambuf.iterator/ostreambuf.iter.cons/ostream.pass.cpp
+++ b/libcxx/test/std/iterators/stream.iterators/ostreambuf.iterator/ostreambuf.iter.cons/ostream.pass.cpp
@@ -25,11 +25,13 @@ int main(int, char**)
         std::ostreambuf_iterator<char> i(outf);
         assert(!i.failed());
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::wostringstream outf;
         std::ostreambuf_iterator<wchar_t> i(outf);
         assert(!i.failed());
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/iterators/stream.iterators/ostreambuf.iterator/ostreambuf.iter.cons/streambuf.pass.cpp b/libcxx/test/std/iterators/stream.iterators/ostreambuf.iterator/ostreambuf.iter.cons/streambuf.pass.cpp
index 0fda71b6aac85..9d534e31bcaad 100644
--- a/libcxx/test/std/iterators/stream.iterators/ostreambuf.iterator/ostreambuf.iter.cons/streambuf.pass.cpp
+++ b/libcxx/test/std/iterators/stream.iterators/ostreambuf.iterator/ostreambuf.iter.cons/streambuf.pass.cpp
@@ -25,11 +25,13 @@ int main(int, char**)
         std::ostreambuf_iterator<char> i(outf.rdbuf());
         assert(!i.failed());
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::wostringstream outf;
         std::ostreambuf_iterator<wchar_t> i(outf.rdbuf());
         assert(!i.failed());
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/iterators/stream.iterators/ostreambuf.iterator/ostreambuf.iter.ops/assign_c.pass.cpp b/libcxx/test/std/iterators/stream.iterators/ostreambuf.iterator/ostreambuf.iter.ops/assign_c.pass.cpp
index b33eb5b06cfe0..401d9cb00129c 100644
--- a/libcxx/test/std/iterators/stream.iterators/ostreambuf.iterator/ostreambuf.iter.ops/assign_c.pass.cpp
+++ b/libcxx/test/std/iterators/stream.iterators/ostreambuf.iterator/ostreambuf.iter.ops/assign_c.pass.cpp
@@ -29,6 +29,7 @@ int main(int, char**)
         i = 'b';
         assert(outf.str() == "ab");
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::wostringstream outf;
         std::ostreambuf_iterator<wchar_t> i(outf);
@@ -37,6 +38,7 @@ int main(int, char**)
         i = L'b';
         assert(outf.str() == L"ab");
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/iterators/stream.iterators/ostreambuf.iterator/ostreambuf.iter.ops/deref.pass.cpp b/libcxx/test/std/iterators/stream.iterators/ostreambuf.iterator/ostreambuf.iter.ops/deref.pass.cpp
index fcd88b94dc371..671d452ec5d58 100644
--- a/libcxx/test/std/iterators/stream.iterators/ostreambuf.iterator/ostreambuf.iter.ops/deref.pass.cpp
+++ b/libcxx/test/std/iterators/stream.iterators/ostreambuf.iterator/ostreambuf.iter.ops/deref.pass.cpp
@@ -26,12 +26,14 @@ int main(int, char**)
         std::ostreambuf_iterator<char>& iref = *i;
         assert(&iref == &i);
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::wostringstream outf;
         std::ostreambuf_iterator<wchar_t> i(outf);
         std::ostreambuf_iterator<wchar_t>& iref = *i;
         assert(&iref == &i);
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/iterators/stream.iterators/ostreambuf.iterator/ostreambuf.iter.ops/failed.pass.cpp b/libcxx/test/std/iterators/stream.iterators/ostreambuf.iterator/ostreambuf.iter.ops/failed.pass.cpp
index d2714d1be3730..54b6e4bf171ff 100644
--- a/libcxx/test/std/iterators/stream.iterators/ostreambuf.iterator/ostreambuf.iter.ops/failed.pass.cpp
+++ b/libcxx/test/std/iterators/stream.iterators/ostreambuf.iterator/ostreambuf.iter.ops/failed.pass.cpp
@@ -35,12 +35,14 @@ int main(int, char**)
         i = 'a';
         assert(i.failed());
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         my_streambuf<wchar_t> buf;
         std::ostreambuf_iterator<wchar_t> i(&buf);
         i = L'a';
         assert(i.failed());
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/iterators/stream.iterators/ostreambuf.iterator/ostreambuf.iter.ops/increment.pass.cpp b/libcxx/test/std/iterators/stream.iterators/ostreambuf.iterator/ostreambuf.iter.ops/increment.pass.cpp
index 49f9458f9e437..88d4e27ec74d5 100644
--- a/libcxx/test/std/iterators/stream.iterators/ostreambuf.iterator/ostreambuf.iter.ops/increment.pass.cpp
+++ b/libcxx/test/std/iterators/stream.iterators/ostreambuf.iterator/ostreambuf.iter.ops/increment.pass.cpp
@@ -29,6 +29,7 @@ int main(int, char**)
         std::ostreambuf_iterator<char>& iref2 = i++;
         assert(&iref2 == &i);
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::wostringstream outf;
         std::ostreambuf_iterator<wchar_t> i(outf);
@@ -37,6 +38,7 @@ int main(int, char**)
         std::ostreambuf_iterator<wchar_t>& iref2 = i++;
         assert(&iref2 == &i);
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/iterators/stream.iterators/ostreambuf.iterator/types.pass.cpp b/libcxx/test/std/iterators/stream.iterators/ostreambuf.iterator/types.pass.cpp
index b1260aa1a9708..9562297cb6bb7 100644
--- a/libcxx/test/std/iterators/stream.iterators/ostreambuf.iterator/types.pass.cpp
+++ b/libcxx/test/std/iterators/stream.iterators/ostreambuf.iterator/types.pass.cpp
@@ -56,6 +56,7 @@ int main(int, char**)
     static_assert((std::is_same<I1::ostream_type, std::ostream>::value), "");
     }
 
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
     typedef std::ostreambuf_iterator<wchar_t> I2;
 #if TEST_STD_VER <= 14
@@ -76,6 +77,7 @@ int main(int, char**)
     static_assert((std::is_same<I2::streambuf_type, std::wstreambuf>::value), "");
     static_assert((std::is_same<I2::ostream_type, std::wostream>::value), "");
     }
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
 
   return 0;
 }

diff  --git a/libcxx/test/std/language.support/cstdint/cstdint.syn/cstdint.pass.cpp b/libcxx/test/std/language.support/cstdint/cstdint.syn/cstdint.pass.cpp
index 00c09b774f193..682c3829fceae 100644
--- a/libcxx/test/std/language.support/cstdint/cstdint.syn/cstdint.pass.cpp
+++ b/libcxx/test/std/language.support/cstdint/cstdint.syn/cstdint.pass.cpp
@@ -10,9 +10,7 @@
 
 #include <cstdint>
 #include <cstddef>
-#include <cwchar>
 #include <csignal>
-#include <cwctype>
 #include <climits>
 #include <type_traits>
 #include <limits>
@@ -20,6 +18,11 @@
 
 #include "test_macros.h"
 
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
+#   include <cwchar>
+#   include <cwctype>
+#endif
+
 int main(int, char**)
 {
     // typedef std::int8_t
@@ -239,6 +242,7 @@ int main(int, char**)
     // SIZE_MAX
     assert(SIZE_MAX == std::numeric_limits<std::size_t>::max());
 
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     // WCHAR_MIN
     assert(WCHAR_MIN == std::numeric_limits<wchar_t>::min());
 
@@ -250,6 +254,7 @@ int main(int, char**)
 
     // WINT_MAX
     assert(WINT_MAX == std::numeric_limits<std::wint_t>::max());
+#endif
 
 #ifndef INT8_C
 #error INT8_C not defined

diff  --git a/libcxx/test/std/language.support/support.limits/limits/numeric.limits.members/lowest.pass.cpp b/libcxx/test/std/language.support/support.limits/limits/numeric.limits.members/lowest.pass.cpp
index bc4f7a434e89a..0169f2e27fde7 100644
--- a/libcxx/test/std/language.support/support.limits/limits/numeric.limits.members/lowest.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/limits/numeric.limits.members/lowest.pass.cpp
@@ -12,12 +12,15 @@
 
 #include <limits>
 #include <climits>
-#include <cwchar>
 #include <cfloat>
 #include <cassert>
 
 #include "test_macros.h"
 
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
+#   include <cwchar>
+#endif
+
 template <class T>
 void
 test(T expected)
@@ -38,7 +41,9 @@ int main(int, char**)
     test<char>(CHAR_MIN);
     test<signed char>(SCHAR_MIN);
     test<unsigned char>(0);
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     test<wchar_t>(WCHAR_MIN);
+#endif
 #if TEST_STD_VER > 17 && defined(__cpp_char8_t)
     test<char8_t>(0);
 #endif

diff  --git a/libcxx/test/std/language.support/support.limits/limits/numeric.limits.members/max.pass.cpp b/libcxx/test/std/language.support/support.limits/limits/numeric.limits.members/max.pass.cpp
index d40ac2333acac..dd689963c2ed9 100644
--- a/libcxx/test/std/language.support/support.limits/limits/numeric.limits.members/max.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/limits/numeric.limits.members/max.pass.cpp
@@ -12,12 +12,15 @@
 
 #include <limits>
 #include <climits>
-#include <cwchar>
 #include <cfloat>
 #include <cassert>
 
 #include "test_macros.h"
 
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
+#   include <cwchar>
+#endif
+
 template <class T>
 void
 test(T expected)
@@ -38,7 +41,9 @@ int main(int, char**)
     test<char>(CHAR_MAX);
     test<signed char>(SCHAR_MAX);
     test<unsigned char>(UCHAR_MAX);
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     test<wchar_t>(WCHAR_MAX);
+#endif
 #if TEST_STD_VER > 17 && defined(__cpp_char8_t)
     test<char8_t>(UCHAR_MAX); // ??
 #endif

diff  --git a/libcxx/test/std/language.support/support.limits/limits/numeric.limits.members/min.pass.cpp b/libcxx/test/std/language.support/support.limits/limits/numeric.limits.members/min.pass.cpp
index 25a59f3f3b3ff..525d7db4136e6 100644
--- a/libcxx/test/std/language.support/support.limits/limits/numeric.limits.members/min.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/limits/numeric.limits.members/min.pass.cpp
@@ -12,12 +12,15 @@
 
 #include <limits>
 #include <climits>
-#include <cwchar>
 #include <cfloat>
 #include <cassert>
 
 #include "test_macros.h"
 
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
+#   include <cwchar>
+#endif
+
 template <class T>
 void
 test(T expected)
@@ -38,7 +41,9 @@ int main(int, char**)
     test<char>(CHAR_MIN);
     test<signed char>(SCHAR_MIN);
     test<unsigned char>(0);
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     test<wchar_t>(WCHAR_MIN);
+#endif
 #if TEST_STD_VER > 17 && defined(__cpp_char8_t)
     test<char8_t>(0);
 #endif

diff  --git a/libcxx/test/std/localization/locale.categories/category.collate/locale.collate.byname/compare.pass.cpp b/libcxx/test/std/localization/locale.categories/category.collate/locale.collate.byname/compare.pass.cpp
index 8d759ac7eac89..65baa2a01fc87 100644
--- a/libcxx/test/std/localization/locale.categories/category.collate/locale.collate.byname/compare.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.collate/locale.collate.byname/compare.pass.cpp
@@ -45,6 +45,7 @@ int main(int, char**)
             assert(f.compare(s2.data(), s2.data() + s2.size(),
                              s3.data(), s3.data() + s3.size()) == 1);
         }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
         {
             const std::collate<wchar_t>& f = std::use_facet<std::collate<wchar_t> >(l);
             std::wstring s2(L"aaaaaaA");
@@ -52,6 +53,7 @@ int main(int, char**)
             assert(f.compare(s2.data(), s2.data() + s2.size(),
                              s3.data(), s3.data() + s3.size()) == 1);
         }
+#endif
     }
     {
         std::locale l("C");
@@ -62,6 +64,7 @@ int main(int, char**)
             assert(f.compare(s2.data(), s2.data() + s2.size(),
                              s3.data(), s3.data() + s3.size()) == 1);
         }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
         {
             const std::collate<wchar_t>& f = std::use_facet<std::collate<wchar_t> >(l);
             std::wstring s2(L"aaaaaaA");
@@ -69,6 +72,7 @@ int main(int, char**)
             assert(f.compare(s2.data(), s2.data() + s2.size(),
                              s3.data(), s3.data() + s3.size()) == 1);
         }
+#endif
     }
 
   return 0;

diff  --git a/libcxx/test/std/localization/locale.categories/category.collate/locale.collate.byname/hash.pass.cpp b/libcxx/test/std/localization/locale.categories/category.collate/locale.collate.byname/hash.pass.cpp
index 8be36e3bd1fdd..83757636e051b 100644
--- a/libcxx/test/std/localization/locale.categories/category.collate/locale.collate.byname/hash.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.collate/locale.collate.byname/hash.pass.cpp
@@ -36,6 +36,7 @@ int main(int, char**)
         assert(f.hash(x1.data(), x1.data() + x1.size())
             != f.hash(x2.data(), x2.data() + x2.size()));
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::wstring x1(L"1234");
         std::wstring x2(L"12345");
@@ -43,6 +44,7 @@ int main(int, char**)
         assert(f.hash(x1.data(), x1.data() + x1.size())
             != f.hash(x2.data(), x2.data() + x2.size()));
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/localization/locale.categories/category.collate/locale.collate.byname/transform.pass.cpp b/libcxx/test/std/localization/locale.categories/category.collate/locale.collate.byname/transform.pass.cpp
index cab2f01a5d1f5..8d076fdeba998 100644
--- a/libcxx/test/std/localization/locale.categories/category.collate/locale.collate.byname/transform.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.collate/locale.collate.byname/transform.pass.cpp
@@ -35,11 +35,13 @@ int main(int, char**)
             const std::collate<char>& f = std::use_facet<std::collate<char> >(l);
             assert(f.transform(x.data(), x.data() + x.size()) != x);
         }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
         {
             std::wstring x(L"1234");
             const std::collate<wchar_t>& f = std::use_facet<std::collate<wchar_t> >(l);
             assert(f.transform(x.data(), x.data() + x.size()) != x);
         }
+#endif
     }
     {
         std::locale l("C");
@@ -48,11 +50,13 @@ int main(int, char**)
             const std::collate<char>& f = std::use_facet<std::collate<char> >(l);
             assert(f.transform(x.data(), x.data() + x.size()) == x);
         }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
         {
             std::wstring x(L"1234");
             const std::collate<wchar_t>& f = std::use_facet<std::collate<wchar_t> >(l);
             assert(f.transform(x.data(), x.data() + x.size()) == x);
         }
+#endif
     }
 
   return 0;

diff  --git a/libcxx/test/std/localization/locale.categories/category.collate/locale.collate.byname/types.pass.cpp b/libcxx/test/std/localization/locale.categories/category.collate/locale.collate.byname/types.pass.cpp
index 364783e4c977f..ba70804d99227 100644
--- a/libcxx/test/std/localization/locale.categories/category.collate/locale.collate.byname/types.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.collate/locale.collate.byname/types.pass.cpp
@@ -39,11 +39,13 @@ int main(int, char**)
         assert(&std::use_facet<std::collate<char> >(l)
             == &std::use_facet<std::collate_byname<char> >(l));
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         assert(std::has_facet<std::collate_byname<wchar_t> >(l));
         assert(&std::use_facet<std::collate<wchar_t> >(l)
             == &std::use_facet<std::collate_byname<wchar_t> >(l));
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/localization/locale.categories/category.collate/locale.collate/ctor.pass.cpp b/libcxx/test/std/localization/locale.categories/category.collate/locale.collate/ctor.pass.cpp
index eb8003e826bbd..024d61fe744e5 100644
--- a/libcxx/test/std/localization/locale.categories/category.collate/locale.collate/ctor.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.collate/locale.collate/ctor.pass.cpp
@@ -50,6 +50,8 @@ int main(int, char**)
         assert(my_facet<char>::count == 1);
     }
     assert(my_facet<char>::count == 0);
+
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::locale l(std::locale::classic(), new my_facet<wchar_t>);
         assert(my_facet<wchar_t>::count == 1);
@@ -65,6 +67,7 @@ int main(int, char**)
         assert(my_facet<wchar_t>::count == 1);
     }
     assert(my_facet<wchar_t>::count == 0);
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/localization/locale.categories/category.collate/locale.collate/locale.collate.members/compare.pass.cpp b/libcxx/test/std/localization/locale.categories/category.collate/locale.collate/locale.collate.members/compare.pass.cpp
index 7e2833b436bcf..a3023cf9ba363 100644
--- a/libcxx/test/std/localization/locale.categories/category.collate/locale.collate/locale.collate.members/compare.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.collate/locale.collate/locale.collate.members/compare.pass.cpp
@@ -37,6 +37,7 @@ int main(int, char**)
         assert(f.compare(ib+1, ib+3, ia, ia+sa) == 1);
         assert(f.compare(ia, ia+3, ib, ib+3) == 0);
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         const wchar_t ia[] = L"1234";
         const unsigned sa = sizeof(ia)/sizeof(ia[0]);
@@ -50,6 +51,7 @@ int main(int, char**)
         assert(f.compare(ib+1, ib+3, ia, ia+sa) == 1);
         assert(f.compare(ia, ia+3, ib, ib+3) == 0);
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/localization/locale.categories/category.collate/locale.collate/locale.collate.members/hash.pass.cpp b/libcxx/test/std/localization/locale.categories/category.collate/locale.collate/locale.collate.members/hash.pass.cpp
index 777ba4b4c6da5..7a298c5dab907 100644
--- a/libcxx/test/std/localization/locale.categories/category.collate/locale.collate/locale.collate.members/hash.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.collate/locale.collate/locale.collate.members/hash.pass.cpp
@@ -33,6 +33,7 @@ int main(int, char**)
         assert(f.hash(x1.data(), x1.data() + x1.size())
             != f.hash(x2.data(), x2.data() + x2.size()));
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::wstring x1(L"1234");
         std::wstring x2(L"12345");
@@ -40,6 +41,7 @@ int main(int, char**)
         assert(f.hash(x1.data(), x1.data() + x1.size())
             != f.hash(x2.data(), x2.data() + x2.size()));
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/localization/locale.categories/category.collate/locale.collate/locale.collate.members/transform.pass.cpp b/libcxx/test/std/localization/locale.categories/category.collate/locale.collate/locale.collate.members/transform.pass.cpp
index 0f1bf2296d21c..fdee9d75a6595 100644
--- a/libcxx/test/std/localization/locale.categories/category.collate/locale.collate/locale.collate.members/transform.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.collate/locale.collate/locale.collate.members/transform.pass.cpp
@@ -26,11 +26,13 @@ int main(int, char**)
         const std::collate<char>& f = std::use_facet<std::collate<char> >(l);
         assert(f.transform(x.data(), x.data() + x.size()) == x);
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::wstring x(L"1234");
         const std::collate<wchar_t>& f = std::use_facet<std::collate<wchar_t> >(l);
         assert(f.transform(x.data(), x.data() + x.size()) == x);
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/localization/locale.categories/category.collate/locale.collate/types.pass.cpp b/libcxx/test/std/localization/locale.categories/category.collate/locale.collate/types.pass.cpp
index 1742e6a6d19a5..6990fff67f1b1 100644
--- a/libcxx/test/std/localization/locale.categories/category.collate/locale.collate/types.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.collate/locale.collate/types.pass.cpp
@@ -38,6 +38,7 @@ int main(int, char**)
         static_assert((std::is_same<std::collate<char>::string_type, std::string>::value), "");
         static_assert((std::is_base_of<std::locale::facet, std::collate<char> >::value), "");
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         assert(std::has_facet<std::collate<wchar_t> >(l));
         const std::collate<wchar_t>& f = std::use_facet<std::collate<wchar_t> >(l);
@@ -49,6 +50,7 @@ int main(int, char**)
         static_assert((std::is_same<std::collate<wchar_t>::string_type, std::wstring>::value), "");
         static_assert((std::is_base_of<std::locale::facet, std::collate<wchar_t> >::value), "");
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt.byname/ctor_wchar_t.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt.byname/ctor_wchar_t.pass.cpp
index 8b1ae464f4148..a5dd77bd449bf 100644
--- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt.byname/ctor_wchar_t.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt.byname/ctor_wchar_t.pass.cpp
@@ -15,6 +15,8 @@
 // explicit codecvt_byname(const char* nm, size_t refs = 0);
 // explicit codecvt_byname(const string& nm, size_t refs = 0);
 
+// XFAIL: libcpp-has-no-wide-characters
+
 #include <locale>
 #include <cassert>
 

diff  --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/ctor_wchar_t.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/ctor_wchar_t.pass.cpp
index c5abf8a3b4e18..a10aa7566f7b6 100644
--- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/ctor_wchar_t.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/ctor_wchar_t.pass.cpp
@@ -12,6 +12,8 @@
 
 // explicit codecvt(size_t refs = 0);
 
+// XFAIL: libcpp-has-no-wide-characters
+
 #include <locale>
 #include <cassert>
 

diff  --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_always_noconv.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_always_noconv.pass.cpp
index 10ea879ed4bc7..dde838575255d 100644
--- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_always_noconv.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_always_noconv.pass.cpp
@@ -12,6 +12,8 @@
 
 // bool always_noconv() const throw();
 
+// XFAIL: libcpp-has-no-wide-characters
+
 #include <locale>
 #include <cassert>
 

diff  --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_encoding.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_encoding.pass.cpp
index e46754e0aa09f..5a6a99d0ab054 100644
--- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_encoding.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_encoding.pass.cpp
@@ -12,6 +12,8 @@
 
 // int encoding() const throw();
 
+// XFAIL: libcpp-has-no-wide-characters
+
 #include <locale>
 #include <cassert>
 

diff  --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_in.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_in.pass.cpp
index 832aedfff33b8..b3c6f714969f8 100644
--- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_in.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_in.pass.cpp
@@ -14,6 +14,8 @@
 //           const externT* from, const externT* from_end, const externT*& from_next,
 //           internT* to, internT* to_end, internT*& to_next) const;
 
+// XFAIL: libcpp-has-no-wide-characters
+
 #include <locale>
 #include <string>
 #include <vector>

diff  --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_length.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_length.pass.cpp
index 536bab4871318..997712be299b1 100644
--- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_length.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_length.pass.cpp
@@ -12,6 +12,8 @@
 
 // int length(stateT& state, const externT* from, const externT* from_end, size_t max) const;
 
+// XFAIL: libcpp-has-no-wide-characters
+
 #include <locale>
 #include <cassert>
 

diff  --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_max_length.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_max_length.pass.cpp
index 8e58726bf919f..2831e26d59431 100644
--- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_max_length.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_max_length.pass.cpp
@@ -12,6 +12,8 @@
 
 // int max_length() const throw();
 
+// XFAIL: libcpp-has-no-wide-characters
+
 #include <locale>
 #include <cassert>
 

diff  --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_out.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_out.pass.cpp
index 90caf5e585078..1fd7fafa388b1 100644
--- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_out.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_out.pass.cpp
@@ -14,6 +14,8 @@
 //            const internT* from, const internT* from_end, const internT*& from_next,
 //            externT* to, externT* to_end, externT*& to_next) const;
 
+// XFAIL: libcpp-has-no-wide-characters
+
 #include <locale>
 #include <string>
 #include <vector>

diff  --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_unshift.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_unshift.pass.cpp
index bc7246f19b109..ad61fb6824e24 100644
--- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_unshift.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_unshift.pass.cpp
@@ -13,6 +13,8 @@
 // result unshift(stateT& state,
 //                externT* to, externT* to_end, externT*& to_next) const;
 
+// XFAIL: libcpp-has-no-wide-characters
+
 // This is pretty much just an "are you breathing" test
 
 #include <locale>

diff  --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/types_wchar_t.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/types_wchar_t.pass.cpp
index da367747ba621..e108491cdcd21 100644
--- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/types_wchar_t.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/types_wchar_t.pass.cpp
@@ -20,6 +20,8 @@
 //     ...
 // };
 
+// XFAIL: libcpp-has-no-wide-characters
+
 #include <locale>
 #include <type_traits>
 #include <cassert>

diff  --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/is_1.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/is_1.pass.cpp
index d033ec99870cd..04ab9101a544c 100644
--- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/is_1.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/is_1.pass.cpp
@@ -14,6 +14,7 @@
 
 // REQUIRES: locale.en_US.UTF-8
 // XFAIL: LIBCXX-WINDOWS-FIXME
+// XFAIL: libcpp-has-no-wide-characters
 
 #include <locale>
 #include <type_traits>

diff  --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/is_many.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/is_many.pass.cpp
index 97ffeb2f7c60d..4f163d7f24621 100644
--- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/is_many.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/is_many.pass.cpp
@@ -14,6 +14,7 @@
 
 // REQUIRES: locale.en_US.UTF-8
 // XFAIL: LIBCXX-WINDOWS-FIXME
+// XFAIL: libcpp-has-no-wide-characters
 
 #include <locale>
 #include <string>

diff  --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/mask.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/mask.pass.cpp
index d9ca398d3accf..6f2452ea1a218 100644
--- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/mask.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/mask.pass.cpp
@@ -20,37 +20,42 @@
 
 int main(int, char**)
 {
+    std::locale l("C");
     {
-        std::locale l("C");
-        {
-            typedef std::ctype<wchar_t> WF;
-            const WF& wf = std::use_facet<WF>(l);
-            typedef std::ctype<char> CF;
-            const CF& cf = std::use_facet<CF>(l);
-
-            // The ctype masks in Newlib don't form a proper bitmask because
-            // the mask is only 8 bits wide, and there are more than 8 mask
-            // kinds. This means that the mask for alpha is (_U | _L), which
-            // is tricky to match in the do_is implementation because in
-            // [22.4.1.1.2 2] the standard specifies that the match code behaves
-            // like (m & M) != 0, but following this exactly would give false
-            // positives for characters that are both 'upper' and 'alpha', but
-            // not 'lower', for example.
-            assert( wf.is(WF::upper, L'A'));
-            assert( cf.is(CF::upper,  'A'));
-            assert(!wf.is(WF::lower, L'A'));
-            assert(!cf.is(CF::lower,  'A'));
-            assert( wf.is(WF::alpha, L'A'));
-            assert( cf.is(CF::alpha,  'A'));
-
-            assert(!wf.is(WF::upper, L'a'));
-            assert(!cf.is(CF::upper,  'a'));
-            assert( wf.is(WF::lower, L'a'));
-            assert( cf.is(CF::lower,  'a'));
-            assert( wf.is(WF::alpha, L'a'));
-            assert( cf.is(CF::alpha,  'a'));
-        }
+        typedef std::ctype<char> CF;
+        const CF& cf = std::use_facet<CF>(l);
+
+        // NOTE:
+        // The ctype masks in Newlib don't form a proper bitmask because
+        // the mask is only 8 bits wide, and there are more than 8 mask
+        // kinds. This means that the mask for alpha is (_U | _L), which
+        // is tricky to match in the do_is implementation because in
+        // [22.4.1.1.2 2] the standard specifies that the match code behaves
+        // like (m & M) != 0, but following this exactly would give false
+        // positives for characters that are both 'upper' and 'alpha', but
+        // not 'lower', for example.
+        assert( cf.is(CF::upper,  'A'));
+        assert(!cf.is(CF::lower,  'A'));
+        assert( cf.is(CF::alpha,  'A'));
+
+        assert(!cf.is(CF::upper,  'a'));
+        assert( cf.is(CF::lower,  'a'));
+        assert( cf.is(CF::alpha,  'a'));
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
+    {
+        typedef std::ctype<wchar_t> WF;
+        const WF& wf = std::use_facet<WF>(l);
+
+        assert( wf.is(WF::upper, L'A'));
+        assert(!wf.is(WF::lower, L'A'));
+        assert( wf.is(WF::alpha, L'A'));
+
+        assert(!wf.is(WF::upper, L'a'));
+        assert( wf.is(WF::lower, L'a'));
+        assert( wf.is(WF::alpha, L'a'));
+    }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/narrow_1.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/narrow_1.pass.cpp
index b819b62431956..2c2f9b676a076 100644
--- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/narrow_1.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/narrow_1.pass.cpp
@@ -9,6 +9,7 @@
 // REQUIRES: locale.en_US.UTF-8
 // REQUIRES: locale.fr_CA.ISO8859-1
 // XFAIL: LIBCXX-WINDOWS-FIXME
+// XFAIL: libcpp-has-no-wide-characters
 
 // <locale>
 

diff  --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/narrow_many.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/narrow_many.pass.cpp
index 3f8e538782e3a..8cb1e22a52afe 100644
--- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/narrow_many.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/narrow_many.pass.cpp
@@ -9,6 +9,7 @@
 // REQUIRES: locale.en_US.UTF-8
 // REQUIRES: locale.fr_CA.ISO8859-1
 // XFAIL: LIBCXX-WINDOWS-FIXME
+// XFAIL: libcpp-has-no-wide-characters
 
 // <locale>
 

diff  --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/scan_is.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/scan_is.pass.cpp
index 2329d9bdadeb4..24d001000af70 100644
--- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/scan_is.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/scan_is.pass.cpp
@@ -14,6 +14,7 @@
 
 // REQUIRES: locale.en_US.UTF-8
 // XFAIL: LIBCXX-WINDOWS-FIXME
+// XFAIL: libcpp-has-no-wide-characters
 
 #include <locale>
 #include <string>

diff  --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/scan_not.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/scan_not.pass.cpp
index 39e1bd5db30f2..7e3c8183b1518 100644
--- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/scan_not.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/scan_not.pass.cpp
@@ -14,6 +14,7 @@
 
 // REQUIRES: locale.en_US.UTF-8
 // XFAIL: LIBCXX-WINDOWS-FIXME
+// XFAIL: libcpp-has-no-wide-characters
 
 #include <locale>
 #include <string>

diff  --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_1.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_1.pass.cpp
index 702d84a437f90..a85f89f46a527 100644
--- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_1.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_1.pass.cpp
@@ -55,6 +55,7 @@ int main(int, char**)
             assert(f.tolower('\xFA') == '\xFA');
         }
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::locale l;
         {
@@ -89,6 +90,7 @@ int main(int, char**)
             assert(f.tolower(L'\xFA') == L'\xFA');
         }
     }
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
 
   return 0;
 }

diff  --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_many.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_many.pass.cpp
index 7965239621715..8363b57a504d3 100644
--- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_many.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_many.pass.cpp
@@ -59,6 +59,7 @@ int main(int, char**)
             assert(in[6] == '1');
         }
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::locale l;
         {
@@ -95,6 +96,7 @@ int main(int, char**)
             assert(in[6] == L'1');
         }
     }
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
 
   return 0;
 }

diff  --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_1.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_1.pass.cpp
index dd4f80d94da6e..503cb198e3142 100644
--- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_1.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_1.pass.cpp
@@ -57,6 +57,7 @@ int main(int, char**)
             assert(f.toupper('\xFA') == '\xFA');
         }
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::locale l;
         {
@@ -91,6 +92,7 @@ int main(int, char**)
             assert(f.toupper(L'\xFA') == L'\xFA');
         }
     }
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
 
   return 0;
 }

diff  --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_many.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_many.pass.cpp
index d66b5f1c5a2f3..ffb3b7ecdc1e2 100644
--- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_many.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_many.pass.cpp
@@ -59,6 +59,7 @@ int main(int, char**)
             assert(in[6] == '1');
         }
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::locale l;
         {
@@ -95,6 +96,7 @@ int main(int, char**)
             assert(in[6] == L'1');
         }
     }
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
 
   return 0;
 }

diff  --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/types.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/types.pass.cpp
index 9fb4c44c4d826..81760b82a0a00 100644
--- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/types.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/types.pass.cpp
@@ -38,11 +38,13 @@ int main(int, char**)
             assert(&std::use_facet<std::ctype<char> >(l)
                 == &std::use_facet<std::ctype_byname<char> >(l));
         }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
         {
             assert(std::has_facet<std::ctype_byname<wchar_t> >(l));
             assert(&std::use_facet<std::ctype<wchar_t> >(l)
                 == &std::use_facet<std::ctype_byname<wchar_t> >(l));
         }
+#endif
     }
     {
         std::locale l("C");
@@ -51,11 +53,13 @@ int main(int, char**)
             assert(&std::use_facet<std::ctype<char> >(l)
                 == &std::use_facet<std::ctype_byname<char> >(l));
         }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
         {
             assert(std::has_facet<std::ctype_byname<wchar_t> >(l));
             assert(&std::use_facet<std::ctype<wchar_t> >(l)
                 == &std::use_facet<std::ctype_byname<wchar_t> >(l));
         }
+#endif
     }
 
   return 0;

diff  --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/widen_1.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/widen_1.pass.cpp
index 2d096e9f7f572..f737feb35f736 100644
--- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/widen_1.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/widen_1.pass.cpp
@@ -8,6 +8,7 @@
 
 // REQUIRES: locale.en_US.UTF-8
 // XFAIL: LIBCXX-WINDOWS-FIXME
+// XFAIL: libcpp-has-no-wide-characters
 
 // <locale>
 

diff  --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/widen_many.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/widen_many.pass.cpp
index 3550c5474f5b3..d50639b998f96 100644
--- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/widen_many.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/widen_many.pass.cpp
@@ -8,6 +8,7 @@
 
 // REQUIRES: locale.en_US.UTF-8
 // XFAIL: LIBCXX-WINDOWS-FIXME
+// XFAIL: libcpp-has-no-wide-characters
 
 // <locale>
 

diff  --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/ctor.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/ctor.pass.cpp
index ab7d149fc1e68..c43e9e6123de6 100644
--- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/ctor.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/ctor.pass.cpp
@@ -12,6 +12,8 @@
 
 // explicit ctype(size_t refs = 0);
 
+// XFAIL: libcpp-has-no-wide-characters
+
 #include <locale>
 #include <cassert>
 

diff  --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/is_1.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/is_1.pass.cpp
index b5c897b95fa35..df7981a33111a 100644
--- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/is_1.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/is_1.pass.cpp
@@ -12,6 +12,8 @@
 
 // bool is(mask m, charT c) const;
 
+// XFAIL: libcpp-has-no-wide-characters
+
 #include <locale>
 #include <cassert>
 

diff  --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/is_many.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/is_many.pass.cpp
index 6f0da92b8fbd1..f95e58e8273eb 100644
--- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/is_many.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/is_many.pass.cpp
@@ -12,6 +12,8 @@
 
 // const charT* do_is(const charT* low, const charT* high, mask* vec) const;
 
+// XFAIL: libcpp-has-no-wide-characters
+
 #include <locale>
 #include <string>
 #include <vector>

diff  --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/narrow_1.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/narrow_1.pass.cpp
index d9732144f265d..647724758c9a6 100644
--- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/narrow_1.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/narrow_1.pass.cpp
@@ -12,6 +12,8 @@
 
 // char narrow(charT c, char dfault) const;
 
+// XFAIL: libcpp-has-no-wide-characters
+
 #include <locale>
 #include <cassert>
 

diff  --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/narrow_many.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/narrow_many.pass.cpp
index 9709620dc3672..db5f8ae85a2ab 100644
--- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/narrow_many.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/narrow_many.pass.cpp
@@ -12,6 +12,8 @@
 
 // const charT* narrow(const charT* low, const charT*, char dfault, char* to) const;
 
+// XFAIL: libcpp-has-no-wide-characters
+
 #include <locale>
 #include <string>
 #include <vector>

diff  --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/scan_is.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/scan_is.pass.cpp
index 95921a4c06512..864c20fdf5f96 100644
--- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/scan_is.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/scan_is.pass.cpp
@@ -12,6 +12,8 @@
 
 // const charT* scan_is(mask m, const charT* low, const charT* high) const;
 
+// XFAIL: libcpp-has-no-wide-characters
+
 #include <locale>
 #include <string>
 #include <vector>

diff  --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/scan_not.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/scan_not.pass.cpp
index 6e778d3807b8d..41362cf0b6480 100644
--- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/scan_not.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/scan_not.pass.cpp
@@ -12,6 +12,8 @@
 
 // const charT* scan_not(mask m, const charT* low, const charT* high) const;
 
+// XFAIL: libcpp-has-no-wide-characters
+
 #include <locale>
 #include <string>
 #include <vector>

diff  --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/tolower_1.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/tolower_1.pass.cpp
index e8fbb514559df..50628ad26f19a 100644
--- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/tolower_1.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/tolower_1.pass.cpp
@@ -12,6 +12,8 @@
 
 // charT tolower(charT) const;
 
+// XFAIL: libcpp-has-no-wide-characters
+
 #include <locale>
 #include <cassert>
 

diff  --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/tolower_many.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/tolower_many.pass.cpp
index 29a4dcddc95d4..d93d51d6f3fb9 100644
--- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/tolower_many.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/tolower_many.pass.cpp
@@ -12,6 +12,8 @@
 
 // const charT* tolower(charT* low, const charT* high) const;
 
+// XFAIL: libcpp-has-no-wide-characters
+
 #include <locale>
 #include <string>
 #include <cassert>

diff  --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/toupper_1.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/toupper_1.pass.cpp
index 15e036f739b95..3905161f10814 100644
--- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/toupper_1.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/toupper_1.pass.cpp
@@ -12,6 +12,8 @@
 
 // charT toupper(charT) const;
 
+// XFAIL: libcpp-has-no-wide-characters
+
 #include <locale>
 #include <cassert>
 

diff  --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/toupper_many.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/toupper_many.pass.cpp
index 431b01a62f780..70bb0fd9d4fd7 100644
--- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/toupper_many.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/toupper_many.pass.cpp
@@ -12,6 +12,8 @@
 
 // const charT* toupper(charT* low, const charT* high) const;
 
+// XFAIL: libcpp-has-no-wide-characters
+
 #include <locale>
 #include <string>
 #include <cassert>

diff  --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/widen_1.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/widen_1.pass.cpp
index 03d753e0b896a..7cdc8327f7ebf 100644
--- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/widen_1.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/widen_1.pass.cpp
@@ -12,6 +12,8 @@
 
 // charT widen(char c) const;
 
+// XFAIL: libcpp-has-no-wide-characters
+
 #include <locale>
 #include <cassert>
 

diff  --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/widen_many.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/widen_many.pass.cpp
index de3027f05a2f3..eb600d77cb5b2 100644
--- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/widen_many.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/locale.ctype.members/widen_many.pass.cpp
@@ -12,6 +12,8 @@
 
 // const char* widen(const char* low, const char* high, charT* to) const;
 
+// XFAIL: libcpp-has-no-wide-characters
+
 #include <locale>
 #include <string>
 #include <vector>

diff  --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/types.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/types.pass.cpp
index 4dd30bbedb8fc..a1e7cedcef901 100644
--- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/types.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype/types.pass.cpp
@@ -17,6 +17,8 @@
 //     typedef CharT char_type;
 // };
 
+// XFAIL: libcpp-has-no-wide-characters
+
 #include <locale>
 #include <type_traits>
 #include <cassert>

diff  --git a/libcxx/test/std/localization/locale.categories/category.messages/locale.messages/types.pass.cpp b/libcxx/test/std/localization/locale.categories/category.messages/locale.messages/types.pass.cpp
index 58b785478e04c..58348dea93036 100644
--- a/libcxx/test/std/localization/locale.categories/category.messages/locale.messages/types.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.messages/locale.messages/types.pass.cpp
@@ -26,12 +26,15 @@ int main(int, char**)
 {
     static_assert((std::is_base_of<std::locale::facet, std::messages<char> >::value), "");
     static_assert((std::is_base_of<std::messages_base, std::messages<char> >::value), "");
+    static_assert((std::is_same<std::messages<char>::char_type, char>::value), "");
+    static_assert((std::is_same<std::messages<char>::string_type, std::string>::value), "");
+
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     static_assert((std::is_base_of<std::locale::facet, std::messages<wchar_t> >::value), "");
     static_assert((std::is_base_of<std::messages_base, std::messages<wchar_t> >::value), "");
-    static_assert((std::is_same<std::messages<char>::char_type, char>::value), "");
     static_assert((std::is_same<std::messages<wchar_t>::char_type, wchar_t>::value), "");
-    static_assert((std::is_same<std::messages<char>::string_type, std::string>::value), "");
     static_assert((std::is_same<std::messages<wchar_t>::string_type, std::wstring>::value), "");
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_en_US.pass.cpp b/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_en_US.pass.cpp
index 24167bb4f8564..df51cd98ef811 100644
--- a/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_en_US.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_en_US.pass.cpp
@@ -35,6 +35,7 @@ class my_facet
         : Fn(refs) {}
 };
 
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
 typedef std::money_get<wchar_t, cpp17_input_iterator<const wchar_t*> > Fw;
 
 class my_facetw
@@ -44,6 +45,7 @@ class my_facetw
     explicit my_facetw(std::size_t refs = 0)
         : Fw(refs) {}
 };
+#endif
 
 int main(int, char**)
 {
@@ -53,10 +55,12 @@ int main(int, char**)
                           new std::moneypunct_byname<char, false>(loc_name)));
     ios.imbue(std::locale(ios.getloc(),
                           new std::moneypunct_byname<char, true>(loc_name)));
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     ios.imbue(std::locale(ios.getloc(),
                           new std::moneypunct_byname<wchar_t, false>(loc_name)));
     ios.imbue(std::locale(ios.getloc(),
                           new std::moneypunct_byname<wchar_t, true>(loc_name)));
+#endif
     {
         const my_facet f(1);
         // char, national
@@ -389,6 +393,7 @@ int main(int, char**)
             assert(err == std::ios_base::failbit);
         }
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         const my_facetw f(1);
         // wchar_t, national
@@ -721,6 +726,7 @@ int main(int, char**)
             assert(err == std::ios_base::failbit);
         }
     }
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
     {
       // test for err
       const my_facet f(1);

diff  --git a/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_fr_FR.pass.cpp b/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_fr_FR.pass.cpp
index 20bcfdd706728..591d7f46b32e0 100644
--- a/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_fr_FR.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_fr_FR.pass.cpp
@@ -41,6 +41,7 @@ class my_facet
         : Fn(refs) {}
 };
 
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
 typedef std::money_get<wchar_t, cpp17_input_iterator<const wchar_t*> > Fw;
 
 class my_facetw
@@ -77,6 +78,7 @@ static std::wstring convert_thousands_sep(std::wstring const& in) {
   return in;
 #endif
 }
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
 
 int main(int, char**)
 {
@@ -86,10 +88,12 @@ int main(int, char**)
                           new std::moneypunct_byname<char, false>(loc_name)));
     ios.imbue(std::locale(ios.getloc(),
                           new std::moneypunct_byname<char, true>(loc_name)));
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     ios.imbue(std::locale(ios.getloc(),
                           new std::moneypunct_byname<wchar_t, false>(loc_name)));
     ios.imbue(std::locale(ios.getloc(),
                           new std::moneypunct_byname<wchar_t, true>(loc_name)));
+#endif
     {
         const my_facet f(1);
         // char, national
@@ -423,6 +427,7 @@ int main(int, char**)
             assert(ex == 123456789);
         }
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         const my_facetw f(1);
         // wchar_t, national
@@ -755,6 +760,7 @@ int main(int, char**)
             assert(ex == 123456789);
         }
     }
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
 
   return 0;
 }

diff  --git a/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_ru_RU.pass.cpp b/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_ru_RU.pass.cpp
index 5963aeed12cd8..ff33764d2683b 100644
--- a/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_ru_RU.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_ru_RU.pass.cpp
@@ -58,6 +58,7 @@ class my_facet
         : Fn(refs) {}
 };
 
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
 typedef std::money_get<wchar_t, cpp17_input_iterator<const wchar_t*> > Fw;
 
 class my_facetw
@@ -67,6 +68,7 @@ class my_facetw
     explicit my_facetw(std::size_t refs = 0)
         : Fw(refs) {}
 };
+#endif
 
 int main(int, char**)
 {
@@ -76,10 +78,12 @@ int main(int, char**)
                           new std::moneypunct_byname<char, false>(loc_name)));
     ios.imbue(std::locale(ios.getloc(),
                           new std::moneypunct_byname<char, true>(loc_name)));
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     ios.imbue(std::locale(ios.getloc(),
                           new std::moneypunct_byname<wchar_t, false>(loc_name)));
     ios.imbue(std::locale(ios.getloc(),
                           new std::moneypunct_byname<wchar_t, true>(loc_name)));
+#endif
     {
         const my_facet f(1);
         // char, national
@@ -422,6 +426,7 @@ int main(int, char**)
             assert(ex == -123456789);
         }
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         const my_facetw f(1);
         // wchar_t, national
@@ -764,6 +769,7 @@ int main(int, char**)
             assert(ex == -123456789);
         }
     }
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
 
   return 0;
 }

diff  --git a/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_zh_CN.pass.cpp b/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_zh_CN.pass.cpp
index 8cf77b47a0bd5..3e59cfd013aa7 100644
--- a/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_zh_CN.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_zh_CN.pass.cpp
@@ -42,6 +42,7 @@ class my_facet
         : Fn(refs) {}
 };
 
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
 typedef std::money_get<wchar_t, cpp17_input_iterator<const wchar_t*> > Fw;
 
 class my_facetw
@@ -51,6 +52,7 @@ class my_facetw
     explicit my_facetw(std::size_t refs = 0)
         : Fw(refs) {}
 };
+#endif
 
 int main(int, char**)
 {
@@ -60,10 +62,12 @@ int main(int, char**)
                           new std::moneypunct_byname<char, false>(loc_name)));
     ios.imbue(std::locale(ios.getloc(),
                           new std::moneypunct_byname<char, true>(loc_name)));
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     ios.imbue(std::locale(ios.getloc(),
                           new std::moneypunct_byname<wchar_t, false>(loc_name)));
     ios.imbue(std::locale(ios.getloc(),
                           new std::moneypunct_byname<wchar_t, true>(loc_name)));
+#endif
     {
         const my_facet f(1);
         // char, national
@@ -396,6 +400,7 @@ int main(int, char**)
             assert(err == std::ios_base::failbit);
         }
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         const my_facetw f(1);
         // wchar_t, national
@@ -728,6 +733,7 @@ int main(int, char**)
             assert(err == std::ios_base::failbit);
         }
     }
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
 
   return 0;
 }

diff  --git a/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_string_en_US.pass.cpp b/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_string_en_US.pass.cpp
index 08119ec7333a8..4e0c0595fc38a 100644
--- a/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_string_en_US.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_string_en_US.pass.cpp
@@ -35,6 +35,7 @@ class my_facet
         : Fn(refs) {}
 };
 
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
 typedef std::money_get<wchar_t, cpp17_input_iterator<const wchar_t*> > Fw;
 
 class my_facetw
@@ -44,6 +45,7 @@ class my_facetw
     explicit my_facetw(std::size_t refs = 0)
         : Fw(refs) {}
 };
+#endif
 
 int main(int, char**)
 {
@@ -53,10 +55,12 @@ int main(int, char**)
                           new std::moneypunct_byname<char, false>(loc_name)));
     ios.imbue(std::locale(ios.getloc(),
                           new std::moneypunct_byname<char, true>(loc_name)));
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     ios.imbue(std::locale(ios.getloc(),
                           new std::moneypunct_byname<wchar_t, false>(loc_name)));
     ios.imbue(std::locale(ios.getloc(),
                           new std::moneypunct_byname<wchar_t, true>(loc_name)));
+#endif
     {
         const my_facet f(1);
         // char, national
@@ -393,6 +397,7 @@ int main(int, char**)
             assert(ex == "");
         }
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         const my_facetw f(1);
         // wchar_t, national
@@ -729,6 +734,7 @@ int main(int, char**)
             assert(ex == L"");
         }
     }
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
     {
       // test for err
       const my_facet f(1);

diff  --git a/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/types.pass.cpp b/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/types.pass.cpp
index ed4baadbdfaf8..5459f9e74714e 100644
--- a/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/types.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/types.pass.cpp
@@ -25,13 +25,16 @@
 int main(int, char**)
 {
     static_assert((std::is_base_of<std::locale::facet, std::money_get<char> >::value), "");
-    static_assert((std::is_base_of<std::locale::facet, std::money_get<wchar_t> >::value), "");
     static_assert((std::is_same<std::money_get<char>::char_type, char>::value), "");
-    static_assert((std::is_same<std::money_get<wchar_t>::char_type, wchar_t>::value), "");
     static_assert((std::is_same<std::money_get<char>::iter_type, std::istreambuf_iterator<char> >::value), "");
-    static_assert((std::is_same<std::money_get<wchar_t>::iter_type, std::istreambuf_iterator<wchar_t> >::value), "");
     static_assert((std::is_same<std::money_get<char>::string_type, std::string>::value), "");
+
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
+    static_assert((std::is_base_of<std::locale::facet, std::money_get<wchar_t> >::value), "");
+    static_assert((std::is_same<std::money_get<wchar_t>::char_type, wchar_t>::value), "");
+    static_assert((std::is_same<std::money_get<wchar_t>::iter_type, std::istreambuf_iterator<wchar_t> >::value), "");
     static_assert((std::is_same<std::money_get<wchar_t>::string_type, std::wstring>::value), "");
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_en_US.pass.cpp b/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_en_US.pass.cpp
index bf47e1427364f..d74f25bb7d9a9 100644
--- a/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_en_US.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_en_US.pass.cpp
@@ -35,6 +35,7 @@ class my_facet
         : Fn(refs) {}
 };
 
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
 typedef std::money_put<wchar_t, output_iterator<wchar_t*> > Fw;
 
 class my_facetw
@@ -44,6 +45,7 @@ class my_facetw
     explicit my_facetw(std::size_t refs = 0)
         : Fw(refs) {}
 };
+#endif
 
 int main(int, char**)
 {
@@ -53,10 +55,12 @@ int main(int, char**)
                           new std::moneypunct_byname<char, false>(loc_name)));
     ios.imbue(std::locale(ios.getloc(),
                           new std::moneypunct_byname<char, true>(loc_name)));
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     ios.imbue(std::locale(ios.getloc(),
                           new std::moneypunct_byname<wchar_t, false>(loc_name)));
     ios.imbue(std::locale(ios.getloc(),
                           new std::moneypunct_byname<wchar_t, true>(loc_name)));
+#endif
 {
     const my_facet f(1);
     // char, national
@@ -273,8 +277,8 @@ int main(int, char**)
         assert(ios.width() == 0);
     }
 }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
 {
-
     const my_facetw f(1);
     // wchar_t, national
     noshowbase(ios);
@@ -492,6 +496,7 @@ int main(int, char**)
         assert(ios.width() == 0);
     }
 }
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
 
   return 0;
 }

diff  --git a/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_fr_FR.pass.cpp b/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_fr_FR.pass.cpp
index 6b233430250aa..e20cb972e2a95 100644
--- a/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_fr_FR.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_fr_FR.pass.cpp
@@ -41,6 +41,7 @@ class my_facet
         : Fn(refs) {}
 };
 
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
 typedef std::money_put<wchar_t, output_iterator<wchar_t*> > Fw;
 
 class my_facetw
@@ -79,6 +80,7 @@ static std::wstring convert_thousands_sep(std::wstring const& in) {
   return in;
 #endif
 }
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
 
 int main(int, char**)
 {
@@ -88,10 +90,12 @@ int main(int, char**)
                           new std::moneypunct_byname<char, false>(loc_name)));
     ios.imbue(std::locale(ios.getloc(),
                           new std::moneypunct_byname<char, true>(loc_name)));
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     ios.imbue(std::locale(ios.getloc(),
                           new std::moneypunct_byname<wchar_t, false>(loc_name)));
     ios.imbue(std::locale(ios.getloc(),
                           new std::moneypunct_byname<wchar_t, true>(loc_name)));
+#endif
 {
     const my_facet f(1);
     // char, national
@@ -308,6 +312,7 @@ int main(int, char**)
         assert(ios.width() == 0);
     }
 }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
 {
     const my_facetw f(1);
     // wchar_t, national
@@ -526,6 +531,7 @@ int main(int, char**)
         assert(ios.width() == 0);
     }
 }
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
 
   return 0;
 }

diff  --git a/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_ru_RU.pass.cpp b/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_ru_RU.pass.cpp
index 1d73718709f60..81b2b394e092e 100644
--- a/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_ru_RU.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_ru_RU.pass.cpp
@@ -58,6 +58,7 @@ class my_facet
         : Fn(refs) {}
 };
 
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
 typedef std::money_put<wchar_t, output_iterator<wchar_t*> > Fw;
 
 class my_facetw
@@ -67,6 +68,7 @@ class my_facetw
     explicit my_facetw(std::size_t refs = 0)
         : Fw(refs) {}
 };
+#endif
 
 int main(int, char**)
 {
@@ -76,10 +78,12 @@ int main(int, char**)
                           new std::moneypunct_byname<char, false>(loc_name)));
     ios.imbue(std::locale(ios.getloc(),
                           new std::moneypunct_byname<char, true>(loc_name)));
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     ios.imbue(std::locale(ios.getloc(),
                           new std::moneypunct_byname<wchar_t, false>(loc_name)));
     ios.imbue(std::locale(ios.getloc(),
                           new std::moneypunct_byname<wchar_t, true>(loc_name)));
+#endif
 {
     const my_facet f(1);
     // char, national
@@ -116,7 +120,7 @@ int main(int, char**)
         std::string ex(str, iter.base());
         assert(ex == "-1 234 567,89 ");
     }
-#endif
+#endif // APPLE_FIXME
     {   // zero, showbase
         long double v = 0;
         showbase(ios);
@@ -262,7 +266,7 @@ int main(int, char**)
         std::string ex(str, iter.base());
         assert(ex == "-1 234 567,89 RUB ");
     }
-#endif
+#endif // APPLE_FIXME
     {   // negative, showbase, left
         long double v = -123456789;
         showbase(ios);
@@ -300,8 +304,9 @@ int main(int, char**)
         assert(ex == "  -1 234 567,89 RUB ");
         assert(ios.width() == 0);
     }
-#endif
+#endif // APPLE_FIXME
 }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
 {
     const my_facetw f(1);
     // wchar_t, national
@@ -340,7 +345,7 @@ int main(int, char**)
         std::wstring ex(str, iter.base());
         assert(ex == L"-1 234 567,89 ");
     }
-#endif
+#endif // APPLE_FIXME
     {   // zero, showbase
         long double v = 0;
         showbase(ios);
@@ -486,7 +491,7 @@ int main(int, char**)
         std::wstring ex(str, iter.base());
         assert(ex == L"-1 234 567,89 RUB ");
     }
-#endif
+#endif // APPLE_FIXME
     {   // negative, showbase, left
         long double v = -123456789;
         showbase(ios);
@@ -524,8 +529,9 @@ int main(int, char**)
         assert(ex == L"  -1 234 567,89 RUB ");
         assert(ios.width() == 0);
     }
-#endif
+#endif // APPLE_FIXME
 }
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
 
   return 0;
 }

diff  --git a/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_zh_CN.pass.cpp b/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_zh_CN.pass.cpp
index 0e5254cb9bd65..a19b17c7822a4 100644
--- a/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_zh_CN.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_zh_CN.pass.cpp
@@ -42,6 +42,7 @@ class my_facet
         : Fn(refs) {}
 };
 
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
 typedef std::money_put<wchar_t, output_iterator<wchar_t*> > Fw;
 
 class my_facetw
@@ -51,6 +52,7 @@ class my_facetw
     explicit my_facetw(std::size_t refs = 0)
         : Fw(refs) {}
 };
+#endif
 
 int main(int, char**)
 {
@@ -60,10 +62,12 @@ int main(int, char**)
                           new std::moneypunct_byname<char, false>(loc_name)));
     ios.imbue(std::locale(ios.getloc(),
                           new std::moneypunct_byname<char, true>(loc_name)));
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     ios.imbue(std::locale(ios.getloc(),
                           new std::moneypunct_byname<wchar_t, false>(loc_name)));
     ios.imbue(std::locale(ios.getloc(),
                           new std::moneypunct_byname<wchar_t, true>(loc_name)));
+#endif
 {
     const my_facet f(1);
     // char, national
@@ -280,6 +284,7 @@ int main(int, char**)
         assert(ios.width() == 0);
     }
 }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
 {
     const my_facetw f(1);
     // wchar_t, national
@@ -498,6 +503,7 @@ int main(int, char**)
         assert(ios.width() == 0);
     }
 }
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
 
   return 0;
 }

diff  --git a/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_string_en_US.pass.cpp b/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_string_en_US.pass.cpp
index a0602502463b9..1f300ef70dce5 100644
--- a/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_string_en_US.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_string_en_US.pass.cpp
@@ -36,6 +36,7 @@ class my_facet
         : Fn(refs) {}
 };
 
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
 typedef std::money_put<wchar_t, output_iterator<wchar_t*> > Fw;
 
 class my_facetw
@@ -45,6 +46,7 @@ class my_facetw
     explicit my_facetw(std::size_t refs = 0)
         : Fw(refs) {}
 };
+#endif
 
 int main(int, char**)
 {
@@ -54,10 +56,12 @@ int main(int, char**)
                           new std::moneypunct_byname<char, false>(loc_name)));
     ios.imbue(std::locale(ios.getloc(),
                           new std::moneypunct_byname<char, true>(loc_name)));
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     ios.imbue(std::locale(ios.getloc(),
                           new std::moneypunct_byname<wchar_t, false>(loc_name)));
     ios.imbue(std::locale(ios.getloc(),
                           new std::moneypunct_byname<wchar_t, true>(loc_name)));
+#endif
 {
     const my_facet f(1);
     // char, national
@@ -274,8 +278,8 @@ int main(int, char**)
         assert(ios.width() == 0);
     }
 }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
 {
-
     const my_facetw f(1);
     // wchar_t, national
     noshowbase(ios);
@@ -493,6 +497,7 @@ int main(int, char**)
         assert(ios.width() == 0);
     }
 }
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
 
   return 0;
 }

diff  --git a/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.put/types.pass.cpp b/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.put/types.pass.cpp
index 4ac5487b1e959..a79ce5c10ff5b 100644
--- a/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.put/types.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.put/types.pass.cpp
@@ -25,13 +25,16 @@
 int main(int, char**)
 {
     static_assert((std::is_base_of<std::locale::facet, std::money_put<char> >::value), "");
-    static_assert((std::is_base_of<std::locale::facet, std::money_put<wchar_t> >::value), "");
     static_assert((std::is_same<std::money_put<char>::char_type, char>::value), "");
-    static_assert((std::is_same<std::money_put<wchar_t>::char_type, wchar_t>::value), "");
     static_assert((std::is_same<std::money_put<char>::iter_type, std::ostreambuf_iterator<char> >::value), "");
-    static_assert((std::is_same<std::money_put<wchar_t>::iter_type, std::ostreambuf_iterator<wchar_t> >::value), "");
     static_assert((std::is_same<std::money_put<char>::string_type, std::string>::value), "");
+
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
+    static_assert((std::is_base_of<std::locale::facet, std::money_put<wchar_t> >::value), "");
+    static_assert((std::is_same<std::money_put<wchar_t>::char_type, wchar_t>::value), "");
+    static_assert((std::is_same<std::money_put<wchar_t>::iter_type, std::ostreambuf_iterator<wchar_t> >::value), "");
     static_assert((std::is_same<std::money_put<wchar_t>::string_type, std::wstring>::value), "");
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/curr_symbol.pass.cpp b/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/curr_symbol.pass.cpp
index df0d538442155..99c509776fd31 100644
--- a/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/curr_symbol.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/curr_symbol.pass.cpp
@@ -47,6 +47,7 @@ class Fnt
         : std::moneypunct_byname<char, true>(nm, refs) {}
 };
 
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
 class Fwf
     : public std::moneypunct_byname<wchar_t, false>
 {
@@ -62,6 +63,7 @@ class Fwt
     explicit Fwt(const std::string& nm, std::size_t refs = 0)
         : std::moneypunct_byname<wchar_t, true>(nm, refs) {}
 };
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
 
 int main(int, char**)
 {
@@ -73,6 +75,7 @@ int main(int, char**)
         Fnt f("C", 1);
         assert(f.curr_symbol() == std::string());
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         Fwf f("C", 1);
         assert(f.curr_symbol() == std::wstring());
@@ -81,6 +84,7 @@ int main(int, char**)
         Fwt f("C", 1);
         assert(f.curr_symbol() == std::wstring());
     }
+#endif
 
     {
         Fnf f(LOCALE_en_US_UTF_8, 1);
@@ -90,6 +94,7 @@ int main(int, char**)
         Fnt f(LOCALE_en_US_UTF_8, 1);
         assert(f.curr_symbol() == "USD ");
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         Fwf f(LOCALE_en_US_UTF_8, 1);
         assert(f.curr_symbol() == L"$");
@@ -98,6 +103,7 @@ int main(int, char**)
         Fwt f(LOCALE_en_US_UTF_8, 1);
         assert(f.curr_symbol() == L"USD ");
     }
+#endif
 
     {
         Fnf f(LOCALE_fr_FR_UTF_8, 1);
@@ -107,6 +113,7 @@ int main(int, char**)
         Fnt f(LOCALE_fr_FR_UTF_8, 1);
         assert(f.curr_symbol() == " EUR");
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         Fwf f(LOCALE_fr_FR_UTF_8, 1);
         assert(f.curr_symbol() == L" \u20ac");
@@ -115,6 +122,7 @@ int main(int, char**)
         Fwt f(LOCALE_fr_FR_UTF_8, 1);
         assert(f.curr_symbol() == L" EUR");
     }
+#endif
 
     {
         Fnf f(LOCALE_ru_RU_UTF_8, 1);
@@ -134,6 +142,7 @@ int main(int, char**)
         Fnt f(LOCALE_ru_RU_UTF_8, 1);
         assert(f.curr_symbol() == " RUB");
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         Fwf f(LOCALE_ru_RU_UTF_8, 1);
 #if defined(_CS_GNU_LIBC_VERSION)
@@ -150,6 +159,7 @@ int main(int, char**)
         Fwt f(LOCALE_ru_RU_UTF_8, 1);
         assert(f.curr_symbol() == L" RUB");
     }
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
 
     {
         Fnf f(LOCALE_zh_CN_UTF_8, 1);
@@ -159,6 +169,7 @@ int main(int, char**)
         Fnt f(LOCALE_zh_CN_UTF_8, 1);
         assert(f.curr_symbol() == "CNY ");
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         Fwf f(LOCALE_zh_CN_UTF_8, 1);
         assert(f.curr_symbol() == L"\xFFE5");
@@ -167,6 +178,7 @@ int main(int, char**)
         Fwt f(LOCALE_zh_CN_UTF_8, 1);
         assert(f.curr_symbol() == L"CNY ");
     }
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
 
   return 0;
 }

diff  --git a/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/decimal_point.pass.cpp b/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/decimal_point.pass.cpp
index 783e4ec86da6a..2d449633737d8 100644
--- a/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/decimal_point.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/decimal_point.pass.cpp
@@ -40,6 +40,7 @@ class Fnt
         : std::moneypunct_byname<char, true>(nm, refs) {}
 };
 
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
 class Fwf
     : public std::moneypunct_byname<wchar_t, false>
 {
@@ -55,6 +56,7 @@ class Fwt
     explicit Fwt(const std::string& nm, std::size_t refs = 0)
         : std::moneypunct_byname<wchar_t, true>(nm, refs) {}
 };
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
 
 int main(int, char**)
 {
@@ -66,6 +68,7 @@ int main(int, char**)
         Fnt f("C", 1);
         assert(f.decimal_point() == std::numeric_limits<char>::max());
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         Fwf f("C", 1);
         assert(f.decimal_point() == std::numeric_limits<wchar_t>::max());
@@ -74,6 +77,7 @@ int main(int, char**)
         Fwt f("C", 1);
         assert(f.decimal_point() == std::numeric_limits<wchar_t>::max());
     }
+#endif
 
     {
         Fnf f(LOCALE_en_US_UTF_8, 1);
@@ -83,6 +87,7 @@ int main(int, char**)
         Fnt f(LOCALE_en_US_UTF_8, 1);
         assert(f.decimal_point() == '.');
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         Fwf f(LOCALE_en_US_UTF_8, 1);
         assert(f.decimal_point() == L'.');
@@ -91,6 +96,7 @@ int main(int, char**)
         Fwt f(LOCALE_en_US_UTF_8, 1);
         assert(f.decimal_point() == L'.');
     }
+#endif
 
     {
         Fnf f(LOCALE_fr_FR_UTF_8, 1);
@@ -100,6 +106,7 @@ int main(int, char**)
         Fnt f(LOCALE_fr_FR_UTF_8, 1);
         assert(f.decimal_point() == ',');
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         Fwf f(LOCALE_fr_FR_UTF_8, 1);
         assert(f.decimal_point() == L',');
@@ -108,14 +115,20 @@ int main(int, char**)
         Fwt f(LOCALE_fr_FR_UTF_8, 1);
         assert(f.decimal_point() == L',');
     }
+#endif
+
 // GLIBC 2.23 uses '.' as the decimal point while other C libraries use ','
 // GLIBC 2.27 corrects this
 #if defined(_CS_GNU_LIBC_VERSION)
     const char sep = glibc_version_less_than("2.27") ? '.' : ',';
+#   ifndef TEST_HAS_NO_WIDE_CHARACTERS
     const wchar_t wsep = glibc_version_less_than("2.27") ? L'.' : L',';
+#   endif
 #else
     const char sep = ',';
+#   ifndef TEST_HAS_NO_WIDE_CHARACTERS
     const wchar_t wsep = L',';
+#   endif
 #endif
     {
         Fnf f(LOCALE_ru_RU_UTF_8, 1);
@@ -125,6 +138,7 @@ int main(int, char**)
         Fnt f(LOCALE_ru_RU_UTF_8, 1);
         assert(f.decimal_point() == sep);
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         Fwf f(LOCALE_ru_RU_UTF_8, 1);
         assert(f.decimal_point() == wsep);
@@ -133,6 +147,7 @@ int main(int, char**)
         Fwt f(LOCALE_ru_RU_UTF_8, 1);
         assert(f.decimal_point() == wsep);
     }
+#endif
 
     {
         Fnf f(LOCALE_zh_CN_UTF_8, 1);
@@ -142,6 +157,7 @@ int main(int, char**)
         Fnt f(LOCALE_zh_CN_UTF_8, 1);
         assert(f.decimal_point() == '.');
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         Fwf f(LOCALE_zh_CN_UTF_8, 1);
         assert(f.decimal_point() == L'.');
@@ -150,6 +166,7 @@ int main(int, char**)
         Fwt f(LOCALE_zh_CN_UTF_8, 1);
         assert(f.decimal_point() == L'.');
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/frac_digits.pass.cpp b/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/frac_digits.pass.cpp
index d022afeb328bc..b490ed44342f1 100644
--- a/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/frac_digits.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/frac_digits.pass.cpp
@@ -40,6 +40,7 @@ class Fnt
         : std::moneypunct_byname<char, true>(nm, refs) {}
 };
 
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
 class Fwf
     : public std::moneypunct_byname<wchar_t, false>
 {
@@ -55,6 +56,7 @@ class Fwt
     explicit Fwt(const std::string& nm, std::size_t refs = 0)
         : std::moneypunct_byname<wchar_t, true>(nm, refs) {}
 };
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
 
 int main(int, char**)
 {
@@ -66,6 +68,7 @@ int main(int, char**)
         Fnt f("C", 1);
         assert(f.frac_digits() == 0);
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         Fwf f("C", 1);
         assert(f.frac_digits() == 0);
@@ -74,6 +77,7 @@ int main(int, char**)
         Fwt f("C", 1);
         assert(f.frac_digits() == 0);
     }
+#endif
 
     {
         Fnf f(LOCALE_en_US_UTF_8, 1);
@@ -83,6 +87,7 @@ int main(int, char**)
         Fnt f(LOCALE_en_US_UTF_8, 1);
         assert(f.frac_digits() == 2);
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         Fwf f(LOCALE_en_US_UTF_8, 1);
         assert(f.frac_digits() == 2);
@@ -91,6 +96,7 @@ int main(int, char**)
         Fwt f(LOCALE_en_US_UTF_8, 1);
         assert(f.frac_digits() == 2);
     }
+#endif
 
     {
         Fnf f(LOCALE_fr_FR_UTF_8, 1);
@@ -100,6 +106,7 @@ int main(int, char**)
         Fnt f(LOCALE_fr_FR_UTF_8, 1);
         assert(f.frac_digits() == 2);
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         Fwf f(LOCALE_fr_FR_UTF_8, 1);
         assert(f.frac_digits() == 2);
@@ -108,6 +115,7 @@ int main(int, char**)
         Fwt f(LOCALE_fr_FR_UTF_8, 1);
         assert(f.frac_digits() == 2);
     }
+#endif
 
     {
         Fnf f(LOCALE_ru_RU_UTF_8, 1);
@@ -117,6 +125,7 @@ int main(int, char**)
         Fnt f(LOCALE_ru_RU_UTF_8, 1);
         assert(f.frac_digits() == 2);
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         Fwf f(LOCALE_ru_RU_UTF_8, 1);
         assert(f.frac_digits() == 2);
@@ -125,6 +134,7 @@ int main(int, char**)
         Fwt f(LOCALE_ru_RU_UTF_8, 1);
         assert(f.frac_digits() == 2);
     }
+#endif
 
     {
         Fnf f(LOCALE_zh_CN_UTF_8, 1);
@@ -134,6 +144,7 @@ int main(int, char**)
         Fnt f(LOCALE_zh_CN_UTF_8, 1);
         assert(f.frac_digits() == 2);
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         Fwf f(LOCALE_zh_CN_UTF_8, 1);
         assert(f.frac_digits() == 2);
@@ -142,6 +153,7 @@ int main(int, char**)
         Fwt f(LOCALE_zh_CN_UTF_8, 1);
         assert(f.frac_digits() == 2);
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/grouping.pass.cpp b/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/grouping.pass.cpp
index 53e54c2b89df1..3dae97f873dd8 100644
--- a/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/grouping.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/grouping.pass.cpp
@@ -47,6 +47,7 @@ class Fnt
         : std::moneypunct_byname<char, true>(nm, refs) {}
 };
 
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
 class Fwf
     : public std::moneypunct_byname<wchar_t, false>
 {
@@ -62,6 +63,7 @@ class Fwt
     explicit Fwt(const std::string& nm, std::size_t refs = 0)
         : std::moneypunct_byname<wchar_t, true>(nm, refs) {}
 };
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
 
 int main(int, char**)
 {
@@ -76,6 +78,7 @@ int main(int, char**)
         Fnt f("C", 1);
         assert(f.grouping() == s || f.grouping() == "");
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         Fwf f("C", 1);
         assert(f.grouping() == s || f.grouping() == "");
@@ -84,6 +87,7 @@ int main(int, char**)
         Fwt f("C", 1);
         assert(f.grouping() == s || f.grouping() == "");
     }
+#endif
 
     {
         Fnf f(LOCALE_en_US_UTF_8, 1);
@@ -93,6 +97,7 @@ int main(int, char**)
         Fnt f(LOCALE_en_US_UTF_8, 1);
         assert(f.grouping() == "\3\3");
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         Fwf f(LOCALE_en_US_UTF_8, 1);
         assert(f.grouping() == "\3\3");
@@ -101,6 +106,7 @@ int main(int, char**)
         Fwt f(LOCALE_en_US_UTF_8, 1);
         assert(f.grouping() == "\3\3");
     }
+#endif
 
     {
         Fnf f(LOCALE_fr_FR_UTF_8, 1);
@@ -110,6 +116,7 @@ int main(int, char**)
         Fnt f(LOCALE_fr_FR_UTF_8, 1);
         assert(f.grouping() == "\3");
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         Fwf f(LOCALE_fr_FR_UTF_8, 1);
         assert(f.grouping() == "\3");
@@ -118,6 +125,7 @@ int main(int, char**)
         Fwt f(LOCALE_fr_FR_UTF_8, 1);
         assert(f.grouping() == "\3");
     }
+#endif
 
     {
         Fnf f(LOCALE_ru_RU_UTF_8, 1);
@@ -127,6 +135,7 @@ int main(int, char**)
         Fnt f(LOCALE_ru_RU_UTF_8, 1);
         assert(f.grouping() == "\3\3");
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         Fwf f(LOCALE_ru_RU_UTF_8, 1);
         assert(f.grouping() == "\3\3");
@@ -135,6 +144,7 @@ int main(int, char**)
         Fwt f(LOCALE_ru_RU_UTF_8, 1);
         assert(f.grouping() == "\3\3");
     }
+#endif
 
     {
         Fnf f(LOCALE_zh_CN_UTF_8, 1);
@@ -144,6 +154,7 @@ int main(int, char**)
         Fnt f(LOCALE_zh_CN_UTF_8, 1);
         assert(f.grouping() == "\3");
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         Fwf f(LOCALE_zh_CN_UTF_8, 1);
         assert(f.grouping() == "\3");
@@ -152,6 +163,7 @@ int main(int, char**)
         Fwt f(LOCALE_zh_CN_UTF_8, 1);
         assert(f.grouping() == "\3");
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/neg_format.pass.cpp b/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/neg_format.pass.cpp
index 5cb42164da10a..8b85dc07a90b0 100644
--- a/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/neg_format.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/neg_format.pass.cpp
@@ -47,6 +47,7 @@ class Fnt
         : std::moneypunct_byname<char, true>(nm, refs) {}
 };
 
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
 class Fwf
     : public std::moneypunct_byname<wchar_t, false>
 {
@@ -62,6 +63,7 @@ class Fwt
     explicit Fwt(const std::string& nm, std::size_t refs = 0)
         : std::moneypunct_byname<wchar_t, true>(nm, refs) {}
 };
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
 
 int main(int, char**)
 {
@@ -81,6 +83,7 @@ int main(int, char**)
         assert(p.field[2] == std::money_base::none);
         assert(p.field[3] == std::money_base::value);
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         Fwf f("C", 1);
         std::money_base::pattern p = f.neg_format();
@@ -97,6 +100,7 @@ int main(int, char**)
         assert(p.field[2] == std::money_base::none);
         assert(p.field[3] == std::money_base::value);
     }
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
 
     {
         Fnf f(LOCALE_en_US_UTF_8, 1);
@@ -114,6 +118,7 @@ int main(int, char**)
         assert(p.field[2] == std::money_base::none);
         assert(p.field[3] == std::money_base::value);
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         Fwf f(LOCALE_en_US_UTF_8, 1);
         std::money_base::pattern p = f.neg_format();
@@ -130,6 +135,7 @@ int main(int, char**)
         assert(p.field[2] == std::money_base::none);
         assert(p.field[3] == std::money_base::value);
     }
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
 
     {
         Fnf f(LOCALE_fr_FR_UTF_8, 1);
@@ -147,6 +153,7 @@ int main(int, char**)
         assert(p.field[2] == std::money_base::none);
         assert(p.field[3] == std::money_base::symbol);
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         Fwf f(LOCALE_fr_FR_UTF_8, 1);
         std::money_base::pattern p = f.neg_format();
@@ -163,6 +170,7 @@ int main(int, char**)
         assert(p.field[2] == std::money_base::none);
         assert(p.field[3] == std::money_base::symbol);
     }
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
 
     {
         Fnf f(LOCALE_ru_RU_UTF_8, 1);
@@ -180,6 +188,7 @@ int main(int, char**)
         assert(p.field[2] == std::money_base::none);
         assert(p.field[3] == std::money_base::symbol);
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         Fwf f(LOCALE_ru_RU_UTF_8, 1);
         std::money_base::pattern p = f.neg_format();
@@ -196,6 +205,7 @@ int main(int, char**)
         assert(p.field[2] == std::money_base::none);
         assert(p.field[3] == std::money_base::symbol);
     }
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
 
     {
         Fnf f(LOCALE_zh_CN_UTF_8, 1);
@@ -213,6 +223,7 @@ int main(int, char**)
         assert(p.field[2] == std::money_base::none);
         assert(p.field[3] == std::money_base::value);
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         Fwf f(LOCALE_zh_CN_UTF_8, 1);
         std::money_base::pattern p = f.neg_format();
@@ -229,6 +240,7 @@ int main(int, char**)
         assert(p.field[2] == std::money_base::none);
         assert(p.field[3] == std::money_base::value);
     }
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
 
   return 0;
 }

diff  --git a/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/negative_sign.pass.cpp b/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/negative_sign.pass.cpp
index 19ae001550144..11904d396d6ed 100644
--- a/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/negative_sign.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/negative_sign.pass.cpp
@@ -42,6 +42,7 @@ class Fnt
         : std::moneypunct_byname<char, true>(nm, refs) {}
 };
 
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
 class Fwf
     : public std::moneypunct_byname<wchar_t, false>
 {
@@ -57,6 +58,7 @@ class Fwt
     explicit Fwt(const std::string& nm, std::size_t refs = 0)
         : std::moneypunct_byname<wchar_t, true>(nm, refs) {}
 };
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
 
 int main(int, char**)
 {
@@ -68,6 +70,7 @@ int main(int, char**)
         Fnt f("C", 1);
         assert(f.negative_sign() == std::string());
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         Fwf f("C", 1);
         assert(f.negative_sign() == std::wstring());
@@ -76,6 +79,7 @@ int main(int, char**)
         Fwt f("C", 1);
         assert(f.negative_sign() == std::wstring());
     }
+#endif
 
     {
         Fnf f(LOCALE_en_US_UTF_8, 1);
@@ -85,6 +89,7 @@ int main(int, char**)
         Fnt f(LOCALE_en_US_UTF_8, 1);
         assert(f.negative_sign() == "-");
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         Fwf f(LOCALE_en_US_UTF_8, 1);
         assert(f.negative_sign() == L"-");
@@ -93,6 +98,7 @@ int main(int, char**)
         Fwt f(LOCALE_en_US_UTF_8, 1);
         assert(f.negative_sign() == L"-");
     }
+#endif
 
     {
         Fnf f(LOCALE_fr_FR_UTF_8, 1);
@@ -102,6 +108,7 @@ int main(int, char**)
         Fnt f(LOCALE_fr_FR_UTF_8, 1);
         assert(f.negative_sign() == "-");
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         Fwf f(LOCALE_fr_FR_UTF_8, 1);
         assert(f.negative_sign() == L"-");
@@ -110,6 +117,7 @@ int main(int, char**)
         Fwt f(LOCALE_fr_FR_UTF_8, 1);
         assert(f.negative_sign() == L"-");
     }
+#endif
 
     {
         Fnf f(LOCALE_ru_RU_UTF_8, 1);
@@ -119,6 +127,7 @@ int main(int, char**)
         Fnt f(LOCALE_ru_RU_UTF_8, 1);
         assert(f.negative_sign() == "-");
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         Fwf f(LOCALE_ru_RU_UTF_8, 1);
         assert(f.negative_sign() == L"-");
@@ -127,6 +136,7 @@ int main(int, char**)
         Fwt f(LOCALE_ru_RU_UTF_8, 1);
         assert(f.negative_sign() == L"-");
     }
+#endif
 
     {
         Fnf f(LOCALE_zh_CN_UTF_8, 1);
@@ -136,6 +146,7 @@ int main(int, char**)
         Fnt f(LOCALE_zh_CN_UTF_8, 1);
         assert(f.negative_sign() == "-");
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         Fwf f(LOCALE_zh_CN_UTF_8, 1);
         assert(f.negative_sign() == L"-");
@@ -144,6 +155,7 @@ int main(int, char**)
         Fwt f(LOCALE_zh_CN_UTF_8, 1);
         assert(f.negative_sign() == L"-");
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/pos_format.pass.cpp b/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/pos_format.pass.cpp
index 225c2464b70e3..900d55f7001d3 100644
--- a/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/pos_format.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/pos_format.pass.cpp
@@ -47,6 +47,7 @@ class Fnt
         : std::moneypunct_byname<char, true>(nm, refs) {}
 };
 
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
 class Fwf
     : public std::moneypunct_byname<wchar_t, false>
 {
@@ -62,6 +63,7 @@ class Fwt
     explicit Fwt(const std::string& nm, std::size_t refs = 0)
         : std::moneypunct_byname<wchar_t, true>(nm, refs) {}
 };
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
 
 int main(int, char**)
 {
@@ -81,6 +83,7 @@ int main(int, char**)
         assert(p.field[2] == std::money_base::none);
         assert(p.field[3] == std::money_base::value);
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         Fwf f("C", 1);
         std::money_base::pattern p = f.pos_format();
@@ -97,6 +100,7 @@ int main(int, char**)
         assert(p.field[2] == std::money_base::none);
         assert(p.field[3] == std::money_base::value);
     }
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
 
     {
         Fnf f(LOCALE_en_US_UTF_8, 1);
@@ -114,6 +118,7 @@ int main(int, char**)
         assert(p.field[2] == std::money_base::none);
         assert(p.field[3] == std::money_base::value);
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         Fwf f(LOCALE_en_US_UTF_8, 1);
         std::money_base::pattern p = f.pos_format();
@@ -130,6 +135,7 @@ int main(int, char**)
         assert(p.field[2] == std::money_base::none);
         assert(p.field[3] == std::money_base::value);
     }
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
 
     {
         Fnf f(LOCALE_fr_FR_UTF_8, 1);
@@ -147,6 +153,7 @@ int main(int, char**)
         assert(p.field[2] == std::money_base::none);
         assert(p.field[3] == std::money_base::symbol);
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         Fwf f(LOCALE_fr_FR_UTF_8, 1);
         std::money_base::pattern p = f.pos_format();
@@ -163,6 +170,7 @@ int main(int, char**)
         assert(p.field[2] == std::money_base::none);
         assert(p.field[3] == std::money_base::symbol);
     }
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
 
     {
         Fnf f(LOCALE_ru_RU_UTF_8, 1);
@@ -180,6 +188,7 @@ int main(int, char**)
         assert(p.field[2] == std::money_base::none);
         assert(p.field[3] == std::money_base::symbol);
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         Fwf f(LOCALE_ru_RU_UTF_8, 1);
         std::money_base::pattern p = f.pos_format();
@@ -196,6 +205,7 @@ int main(int, char**)
         assert(p.field[2] == std::money_base::none);
         assert(p.field[3] == std::money_base::symbol);
     }
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
 
     {
         Fnf f(LOCALE_zh_CN_UTF_8, 1);
@@ -213,6 +223,7 @@ int main(int, char**)
         assert(p.field[2] == std::money_base::none);
         assert(p.field[3] == std::money_base::value);
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         Fwf f(LOCALE_zh_CN_UTF_8, 1);
         std::money_base::pattern p = f.pos_format();
@@ -229,6 +240,7 @@ int main(int, char**)
         assert(p.field[2] == std::money_base::none);
         assert(p.field[3] == std::money_base::value);
     }
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
 
   return 0;
 }

diff  --git a/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/positive_sign.pass.cpp b/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/positive_sign.pass.cpp
index 7aac27bf6fb67..088a09c72138c 100644
--- a/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/positive_sign.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/positive_sign.pass.cpp
@@ -40,6 +40,7 @@ class Fnt
         : std::moneypunct_byname<char, true>(nm, refs) {}
 };
 
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
 class Fwf
     : public std::moneypunct_byname<wchar_t, false>
 {
@@ -55,6 +56,7 @@ class Fwt
     explicit Fwt(const std::string& nm, std::size_t refs = 0)
         : std::moneypunct_byname<wchar_t, true>(nm, refs) {}
 };
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
 
 int main(int, char**)
 {
@@ -66,6 +68,7 @@ int main(int, char**)
         Fnt f("C", 1);
         assert(f.positive_sign() == std::string());
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         Fwf f("C", 1);
         assert(f.positive_sign() == std::wstring());
@@ -74,6 +77,7 @@ int main(int, char**)
         Fwt f("C", 1);
         assert(f.positive_sign() == std::wstring());
     }
+#endif
 
     {
         Fnf f(LOCALE_en_US_UTF_8, 1);
@@ -83,6 +87,7 @@ int main(int, char**)
         Fnt f(LOCALE_en_US_UTF_8, 1);
         assert(f.positive_sign() == "");
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         Fwf f(LOCALE_en_US_UTF_8, 1);
         assert(f.positive_sign() == L"");
@@ -91,6 +96,7 @@ int main(int, char**)
         Fwt f(LOCALE_en_US_UTF_8, 1);
         assert(f.positive_sign() == L"");
     }
+#endif
 
     {
         Fnf f(LOCALE_fr_FR_UTF_8, 1);
@@ -100,6 +106,7 @@ int main(int, char**)
         Fnt f(LOCALE_fr_FR_UTF_8, 1);
         assert(f.positive_sign() == "");
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         Fwf f(LOCALE_fr_FR_UTF_8, 1);
         assert(f.positive_sign() == L"");
@@ -108,6 +115,7 @@ int main(int, char**)
         Fwt f(LOCALE_fr_FR_UTF_8, 1);
         assert(f.positive_sign() == L"");
     }
+#endif
 
     {
         Fnf f(LOCALE_ru_RU_UTF_8, 1);
@@ -117,6 +125,7 @@ int main(int, char**)
         Fnt f(LOCALE_ru_RU_UTF_8, 1);
         assert(f.positive_sign() == "");
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         Fwf f(LOCALE_ru_RU_UTF_8, 1);
         assert(f.positive_sign() == L"");
@@ -125,6 +134,7 @@ int main(int, char**)
         Fwt f(LOCALE_ru_RU_UTF_8, 1);
         assert(f.positive_sign() == L"");
     }
+#endif
 
     {
         Fnf f(LOCALE_zh_CN_UTF_8, 1);
@@ -134,6 +144,7 @@ int main(int, char**)
         Fnt f(LOCALE_zh_CN_UTF_8, 1);
         assert(f.positive_sign() == "");
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         Fwf f(LOCALE_zh_CN_UTF_8, 1);
         assert(f.positive_sign() == L"");
@@ -142,6 +153,7 @@ int main(int, char**)
         Fwt f(LOCALE_zh_CN_UTF_8, 1);
         assert(f.positive_sign() == L"");
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/thousands_sep.pass.cpp b/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/thousands_sep.pass.cpp
index e360124c42f27..7e8c0f09e5040 100644
--- a/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/thousands_sep.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/thousands_sep.pass.cpp
@@ -45,6 +45,7 @@ class Fnt
         : std::moneypunct_byname<char, true>(nm, refs) {}
 };
 
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
 class Fwf
     : public std::moneypunct_byname<wchar_t, false>
 {
@@ -60,6 +61,7 @@ class Fwt
     explicit Fwt(const std::string& nm, std::size_t refs = 0)
         : std::moneypunct_byname<wchar_t, true>(nm, refs) {}
 };
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
 
 int main(int, char**)
 {
@@ -71,6 +73,7 @@ int main(int, char**)
         Fnt f("C", 1);
         assert(f.thousands_sep() == std::numeric_limits<char>::max());
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         Fwf f("C", 1);
         assert(f.thousands_sep() == std::numeric_limits<wchar_t>::max());
@@ -79,6 +82,7 @@ int main(int, char**)
         Fwt f("C", 1);
         assert(f.thousands_sep() == std::numeric_limits<wchar_t>::max());
     }
+#endif
 
     {
         Fnf f(LOCALE_en_US_UTF_8, 1);
@@ -88,6 +92,7 @@ int main(int, char**)
         Fnt f(LOCALE_en_US_UTF_8, 1);
         assert(f.thousands_sep() == ',');
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         Fwf f(LOCALE_en_US_UTF_8, 1);
         assert(f.thousands_sep() == L',');
@@ -96,6 +101,7 @@ int main(int, char**)
         Fwt f(LOCALE_en_US_UTF_8, 1);
         assert(f.thousands_sep() == L',');
     }
+#endif
     {
         Fnf f(LOCALE_fr_FR_UTF_8, 1);
         assert(f.thousands_sep() == ' ');
@@ -104,7 +110,8 @@ int main(int, char**)
         Fnt f(LOCALE_fr_FR_UTF_8, 1);
         assert(f.thousands_sep() == ' ');
     }
-// The below tests work around GLIBC's use of U202F as mon_thousands_sep.
+    // The below tests work around GLIBC's use of U202F as mon_thousands_sep.
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
 #if defined(_CS_GNU_LIBC_VERSION)
     const wchar_t fr_sep = glibc_version_less_than("2.27") ? L' ' : L'\u202F';
 #else
@@ -118,19 +125,8 @@ int main(int, char**)
         Fwt f(LOCALE_fr_FR_UTF_8, 1);
         assert(f.thousands_sep() == fr_sep);
     }
-// The below tests work around GLIBC's use of U00A0 as mon_thousands_sep
-// and U002E as mon_decimal_point.
-// TODO: Fix thousands_sep for 'char'.
-// related to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=16006
-#if defined(_CS_GNU_LIBC_VERSION)
-    const char sep = ' ';
-    // FIXME libc++ specifically works around \u00A0 by translating it into
-    // a regular space.
-    const wchar_t wsep = glibc_version_less_than("2.27") ? L'\u00A0' : L'\u202F';
-#else
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
     const char sep = ' ';
-    const wchar_t wsep = L' ';
-#endif
     {
         Fnf f(LOCALE_ru_RU_UTF_8, 1);
         assert(f.thousands_sep() == sep);
@@ -139,6 +135,18 @@ int main(int, char**)
         Fnt f(LOCALE_ru_RU_UTF_8, 1);
         assert(f.thousands_sep() == sep);
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
+    // The below tests work around GLIBC's use of U00A0 as mon_thousands_sep
+    // and U002E as mon_decimal_point.
+    // TODO: Fix thousands_sep for 'char'.
+    // related to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=16006
+#   if defined(_CS_GNU_LIBC_VERSION)
+    // FIXME libc++ specifically works around \u00A0 by translating it into
+    // a regular space.
+    const wchar_t wsep = glibc_version_less_than("2.27") ? L'\u00A0' : L'\u202F';
+#   else
+    const wchar_t wsep = L' ';
+#   endif
     {
         Fwf f(LOCALE_ru_RU_UTF_8, 1);
         assert(f.thousands_sep() == wsep);
@@ -147,6 +155,7 @@ int main(int, char**)
         Fwt f(LOCALE_ru_RU_UTF_8, 1);
         assert(f.thousands_sep() == wsep);
     }
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
 
     {
         Fnf f(LOCALE_zh_CN_UTF_8, 1);
@@ -156,6 +165,7 @@ int main(int, char**)
         Fnt f(LOCALE_zh_CN_UTF_8, 1);
         assert(f.thousands_sep() == ',');
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         Fwf f(LOCALE_zh_CN_UTF_8, 1);
         assert(f.thousands_sep() == L',');
@@ -164,6 +174,7 @@ int main(int, char**)
         Fwt f(LOCALE_zh_CN_UTF_8, 1);
         assert(f.thousands_sep() == L',');
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.members/curr_symbol.pass.cpp b/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.members/curr_symbol.pass.cpp
index 9786fc2106416..51b4a1674a48e 100644
--- a/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.members/curr_symbol.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.members/curr_symbol.pass.cpp
@@ -39,6 +39,7 @@ class Fnt
         : std::moneypunct<char, true>(refs) {}
 };
 
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
 class Fwf
     : public std::moneypunct<wchar_t, false>
 {
@@ -54,6 +55,7 @@ class Fwt
     explicit Fwt(std::size_t refs = 0)
         : std::moneypunct<wchar_t, true>(refs) {}
 };
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
 
 int main(int, char**)
 {
@@ -65,6 +67,7 @@ int main(int, char**)
         Fnt f(1);
         assert(f.curr_symbol() == std::string());
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         Fwf f(1);
         assert(f.curr_symbol() == std::wstring());
@@ -73,6 +76,7 @@ int main(int, char**)
         Fwt f(1);
         assert(f.curr_symbol() == std::wstring());
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.members/decimal_point.pass.cpp b/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.members/decimal_point.pass.cpp
index 6af4826c2d88f..5109c66307967 100644
--- a/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.members/decimal_point.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.members/decimal_point.pass.cpp
@@ -39,6 +39,7 @@ class Fnt
         : std::moneypunct<char, true>(refs) {}
 };
 
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
 class Fwf
     : public std::moneypunct<wchar_t, false>
 {
@@ -54,6 +55,7 @@ class Fwt
     explicit Fwt(std::size_t refs = 0)
         : std::moneypunct<wchar_t, true>(refs) {}
 };
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
 
 int main(int, char**)
 {
@@ -65,6 +67,7 @@ int main(int, char**)
         Fnt f(1);
         assert(f.decimal_point() == std::numeric_limits<char>::max());
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         Fwf f(1);
         assert(f.decimal_point() == std::numeric_limits<wchar_t>::max());
@@ -73,6 +76,7 @@ int main(int, char**)
         Fwt f(1);
         assert(f.decimal_point() == std::numeric_limits<wchar_t>::max());
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.members/frac_digits.pass.cpp b/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.members/frac_digits.pass.cpp
index 5b1404a88115a..07c1f41a5cde3 100644
--- a/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.members/frac_digits.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.members/frac_digits.pass.cpp
@@ -39,6 +39,7 @@ class Fnt
         : std::moneypunct<char, true>(refs) {}
 };
 
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
 class Fwf
     : public std::moneypunct<wchar_t, false>
 {
@@ -54,6 +55,7 @@ class Fwt
     explicit Fwt(std::size_t refs = 0)
         : std::moneypunct<wchar_t, true>(refs) {}
 };
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
 
 int main(int, char**)
 {
@@ -65,6 +67,7 @@ int main(int, char**)
         Fnt f(1);
         assert(f.frac_digits() == 0);
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         Fwf f(1);
         assert(f.frac_digits() == 0);
@@ -73,6 +76,7 @@ int main(int, char**)
         Fwt f(1);
         assert(f.frac_digits() == 0);
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.members/grouping.pass.cpp b/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.members/grouping.pass.cpp
index c4423e518f455..19b1dc86230f7 100644
--- a/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.members/grouping.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.members/grouping.pass.cpp
@@ -39,6 +39,7 @@ class Fnt
         : std::moneypunct<char, true>(refs) {}
 };
 
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
 class Fwf
     : public std::moneypunct<wchar_t, false>
 {
@@ -54,6 +55,7 @@ class Fwt
     explicit Fwt(std::size_t refs = 0)
         : std::moneypunct<wchar_t, true>(refs) {}
 };
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
 
 int main(int, char**)
 {
@@ -65,6 +67,7 @@ int main(int, char**)
         Fnt f(1);
         assert(f.grouping() == std::string());
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         Fwf f(1);
         assert(f.grouping() == std::string());
@@ -73,6 +76,7 @@ int main(int, char**)
         Fwt f(1);
         assert(f.grouping() == std::string());
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.members/neg_format.pass.cpp b/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.members/neg_format.pass.cpp
index 69f124570adb6..4b3ac5695342d 100644
--- a/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.members/neg_format.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.members/neg_format.pass.cpp
@@ -36,6 +36,7 @@ class Fnt
         : std::moneypunct<char, true>(refs) {}
 };
 
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
 class Fwf
     : public std::moneypunct<wchar_t, false>
 {
@@ -51,6 +52,7 @@ class Fwt
     explicit Fwt(std::size_t refs = 0)
         : std::moneypunct<wchar_t, true>(refs) {}
 };
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
 
 int main(int, char**)
 {
@@ -70,6 +72,7 @@ int main(int, char**)
         assert(p.field[2] == std::money_base::none);
         assert(p.field[3] == std::money_base::value);
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         Fwf f(1);
         std::money_base::pattern p = f.neg_format();
@@ -86,6 +89,7 @@ int main(int, char**)
         assert(p.field[2] == std::money_base::none);
         assert(p.field[3] == std::money_base::value);
     }
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
 
   return 0;
 }

diff  --git a/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.members/negative_sign.pass.cpp b/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.members/negative_sign.pass.cpp
index 6dab0b34bdad7..f102bd5117304 100644
--- a/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.members/negative_sign.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.members/negative_sign.pass.cpp
@@ -40,6 +40,7 @@ class Fnt
         : std::moneypunct<char, true>(refs) {}
 };
 
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
 class Fwf
     : public std::moneypunct<wchar_t, false>
 {
@@ -55,6 +56,7 @@ class Fwt
     explicit Fwt(std::size_t refs = 0)
         : std::moneypunct<wchar_t, true>(refs) {}
 };
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
 
 int main(int, char**)
 {
@@ -66,6 +68,7 @@ int main(int, char**)
         Fnt f(1);
         assert(f.negative_sign() == "-");
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         Fwf f(1);
         assert(f.negative_sign() == L"-");
@@ -74,6 +77,7 @@ int main(int, char**)
         Fwt f(1);
         assert(f.negative_sign() == L"-");
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.members/pos_format.pass.cpp b/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.members/pos_format.pass.cpp
index 4df85b4177ab5..b64dac63a12df 100644
--- a/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.members/pos_format.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.members/pos_format.pass.cpp
@@ -36,6 +36,7 @@ class Fnt
         : std::moneypunct<char, true>(refs) {}
 };
 
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
 class Fwf
     : public std::moneypunct<wchar_t, false>
 {
@@ -51,6 +52,7 @@ class Fwt
     explicit Fwt(std::size_t refs = 0)
         : std::moneypunct<wchar_t, true>(refs) {}
 };
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
 
 int main(int, char**)
 {
@@ -70,6 +72,7 @@ int main(int, char**)
         assert(p.field[2] == std::money_base::none);
         assert(p.field[3] == std::money_base::value);
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         Fwf f(1);
         std::money_base::pattern p = f.pos_format();
@@ -86,6 +89,7 @@ int main(int, char**)
         assert(p.field[2] == std::money_base::none);
         assert(p.field[3] == std::money_base::value);
     }
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
 
   return 0;
 }

diff  --git a/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.members/positive_sign.pass.cpp b/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.members/positive_sign.pass.cpp
index d6db0e96b71de..df413f0535e40 100644
--- a/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.members/positive_sign.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.members/positive_sign.pass.cpp
@@ -39,6 +39,7 @@ class Fnt
         : std::moneypunct<char, true>(refs) {}
 };
 
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
 class Fwf
     : public std::moneypunct<wchar_t, false>
 {
@@ -54,6 +55,7 @@ class Fwt
     explicit Fwt(std::size_t refs = 0)
         : std::moneypunct<wchar_t, true>(refs) {}
 };
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
 
 int main(int, char**)
 {
@@ -65,6 +67,7 @@ int main(int, char**)
         Fnt f(1);
         assert(f.positive_sign() == std::string());
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         Fwf f(1);
         assert(f.positive_sign() == std::wstring());
@@ -73,6 +76,7 @@ int main(int, char**)
         Fwt f(1);
         assert(f.positive_sign() == std::wstring());
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.members/thousands_sep.pass.cpp b/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.members/thousands_sep.pass.cpp
index 2cb8b9ccc1f1e..57600b584d3fb 100644
--- a/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.members/thousands_sep.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct/locale.moneypunct.members/thousands_sep.pass.cpp
@@ -39,6 +39,7 @@ class Fnt
         : std::moneypunct<char, true>(refs) {}
 };
 
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
 class Fwf
     : public std::moneypunct<wchar_t, false>
 {
@@ -54,6 +55,7 @@ class Fwt
     explicit Fwt(std::size_t refs = 0)
         : std::moneypunct<wchar_t, true>(refs) {}
 };
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
 
 int main(int, char**)
 {
@@ -65,6 +67,7 @@ int main(int, char**)
         Fnt f(1);
         assert(f.thousands_sep() == std::numeric_limits<char>::max());
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         Fwf f(1);
         assert(f.thousands_sep() == std::numeric_limits<wchar_t>::max());
@@ -73,6 +76,7 @@ int main(int, char**)
         Fwt f(1);
         assert(f.thousands_sep() == std::numeric_limits<wchar_t>::max());
     }
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
 
   return 0;
 }

diff  --git a/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct/types.pass.cpp b/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct/types.pass.cpp
index 9efd7fcb7f4bb..7768cb754f68c 100644
--- a/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct/types.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct/types.pass.cpp
@@ -29,18 +29,20 @@ void test(const T &) {}
 int main(int, char**)
 {
     static_assert((std::is_base_of<std::locale::facet, std::moneypunct<char> >::value), "");
-    static_assert((std::is_base_of<std::locale::facet, std::moneypunct<wchar_t> >::value), "");
     static_assert((std::is_base_of<std::money_base, std::moneypunct<char> >::value), "");
-    static_assert((std::is_base_of<std::money_base, std::moneypunct<wchar_t> >::value), "");
     static_assert((std::is_same<std::moneypunct<char>::char_type, char>::value), "");
-    static_assert((std::is_same<std::moneypunct<wchar_t>::char_type, wchar_t>::value), "");
     static_assert((std::is_same<std::moneypunct<char>::string_type, std::string>::value), "");
-    static_assert((std::is_same<std::moneypunct<wchar_t>::string_type, std::wstring>::value), "");
-
     test(std::moneypunct<char, false>::intl);
     test(std::moneypunct<char, true>::intl);
+
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
+    static_assert((std::is_base_of<std::locale::facet, std::moneypunct<wchar_t> >::value), "");
+    static_assert((std::is_base_of<std::money_base, std::moneypunct<wchar_t> >::value), "");
+    static_assert((std::is_same<std::moneypunct<wchar_t>::char_type, wchar_t>::value), "");
+    static_assert((std::is_same<std::moneypunct<wchar_t>::string_type, std::wstring>::value), "");
     test(std::moneypunct<wchar_t, false>::intl);
     test(std::moneypunct<wchar_t, true>::intl);
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/localization/locale.categories/category.numeric/locale.nm.put/types.pass.cpp b/libcxx/test/std/localization/locale.categories/category.numeric/locale.nm.put/types.pass.cpp
index a2617ddadfb7c..aef9494d47936 100644
--- a/libcxx/test/std/localization/locale.categories/category.numeric/locale.nm.put/types.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.numeric/locale.nm.put/types.pass.cpp
@@ -25,11 +25,14 @@
 int main(int, char**)
 {
     static_assert((std::is_base_of<std::locale::facet, std::num_put<char> >::value), "");
-    static_assert((std::is_base_of<std::locale::facet, std::num_put<wchar_t> >::value), "");
     static_assert((std::is_same<std::num_put<char>::char_type, char>::value), "");
-    static_assert((std::is_same<std::num_put<wchar_t>::char_type, wchar_t>::value), "");
     static_assert((std::is_same<std::num_put<char>::iter_type, std::ostreambuf_iterator<char> >::value), "");
+
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
+    static_assert((std::is_base_of<std::locale::facet, std::num_put<wchar_t> >::value), "");
+    static_assert((std::is_same<std::num_put<wchar_t>::char_type, wchar_t>::value), "");
     static_assert((std::is_same<std::num_put<wchar_t>::iter_type, std::ostreambuf_iterator<wchar_t> >::value), "");
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/date_order_wide.pass.cpp b/libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/date_order_wide.pass.cpp
index 22248ea15daf2..1560125338bd5 100644
--- a/libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/date_order_wide.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/date_order_wide.pass.cpp
@@ -6,6 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+// XFAIL: libcpp-has-no-wide-characters
+
 // REQUIRES: locale.en_US.UTF-8
 // REQUIRES: locale.fr_FR.UTF-8
 // REQUIRES: locale.ru_RU.UTF-8

diff  --git a/libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_date_wide.pass.cpp b/libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_date_wide.pass.cpp
index 0cb95a6fa78f5..69dd3893e3faf 100644
--- a/libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_date_wide.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_date_wide.pass.cpp
@@ -9,6 +9,8 @@
 // NetBSD does not support LC_TIME at the moment
 // XFAIL: netbsd
 
+// XFAIL: libcpp-has-no-wide-characters
+
 // REQUIRES: locale.en_US.UTF-8
 // REQUIRES: locale.fr_FR.UTF-8
 // REQUIRES: locale.ru_RU.UTF-8

diff  --git a/libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_monthname_wide.pass.cpp b/libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_monthname_wide.pass.cpp
index 4771468b4e210..bd8b7b97ac55e 100644
--- a/libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_monthname_wide.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_monthname_wide.pass.cpp
@@ -9,6 +9,7 @@
 // REQUIRES: locale.en_US.UTF-8
 // REQUIRES: locale.fr_FR.UTF-8
 // REQUIRES: locale.zh_CN.UTF-8
+// XFAIL: libcpp-has-no-wide-characters
 
 // <locale>
 

diff  --git a/libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_one_wide.pass.cpp b/libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_one_wide.pass.cpp
index d3315d6faee68..c762f970016ba 100644
--- a/libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_one_wide.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_one_wide.pass.cpp
@@ -11,6 +11,8 @@
 
 // XFAIL: LIBCXX-WINDOWS-FIXME
 
+// XFAIL: libcpp-has-no-wide-characters
+
 // REQUIRES: locale.en_US.UTF-8
 // REQUIRES: locale.fr_FR.UTF-8
 // REQUIRES: locale.ru_RU.UTF-8

diff  --git a/libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_time_wide.pass.cpp b/libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_time_wide.pass.cpp
index 849b358f8193b..dc83f3063057e 100644
--- a/libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_time_wide.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_time_wide.pass.cpp
@@ -6,6 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+// XFAIL: libcpp-has-no-wide-characters
+
 // REQUIRES: locale.en_US.UTF-8
 // REQUIRES: locale.fr_FR.UTF-8
 // REQUIRES: locale.ru_RU.UTF-8

diff  --git a/libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_weekday_wide.pass.cpp b/libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_weekday_wide.pass.cpp
index 9ff73e9c2ad0b..d96e4c2c0d033 100644
--- a/libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_weekday_wide.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_weekday_wide.pass.cpp
@@ -6,6 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+// XFAIL: libcpp-has-no-wide-characters
+
 // REQUIRES: locale.en_US.UTF-8
 // REQUIRES: locale.fr_FR.UTF-8
 // REQUIRES: locale.ru_RU.UTF-8

diff  --git a/libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_year_wide.pass.cpp b/libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_year_wide.pass.cpp
index 85c4a3f9ab992..465e0ad68b762 100644
--- a/libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_year_wide.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_year_wide.pass.cpp
@@ -6,6 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+// XFAIL: libcpp-has-no-wide-characters
+
 // REQUIRES: locale.en_US.UTF-8
 // REQUIRES: locale.fr_FR.UTF-8
 // REQUIRES: locale.ru_RU.UTF-8

diff  --git a/libcxx/test/std/localization/locale.categories/category.time/locale.time.get/locale.time.get.members/get_date_wide.pass.cpp b/libcxx/test/std/localization/locale.categories/category.time/locale.time.get/locale.time.get.members/get_date_wide.pass.cpp
index ea0432b34abf8..91097406b98f7 100644
--- a/libcxx/test/std/localization/locale.categories/category.time/locale.time.get/locale.time.get.members/get_date_wide.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.time/locale.time.get/locale.time.get.members/get_date_wide.pass.cpp
@@ -14,6 +14,8 @@
 // get_date(iter_type s, iter_type end, ios_base& str,
 //          ios_base::iostate& err, tm* t) const;
 
+// XFAIL: libcpp-has-no-wide-characters
+
 #include <locale>
 #include <cassert>
 #include <ios>

diff  --git a/libcxx/test/std/localization/locale.categories/category.time/locale.time.get/locale.time.get.members/get_monthname_wide.pass.cpp b/libcxx/test/std/localization/locale.categories/category.time/locale.time.get/locale.time.get.members/get_monthname_wide.pass.cpp
index 08c851b4b6f8e..261bb686e58b9 100644
--- a/libcxx/test/std/localization/locale.categories/category.time/locale.time.get/locale.time.get.members/get_monthname_wide.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.time/locale.time.get/locale.time.get.members/get_monthname_wide.pass.cpp
@@ -14,6 +14,8 @@
 // get_monthname(iter_type s, iter_type end, ios_base& str,
 //               ios_base::iostate& err, tm* t) const;
 
+// XFAIL: libcpp-has-no-wide-characters
+
 #include <locale>
 #include <cassert>
 #include "test_macros.h"

diff  --git a/libcxx/test/std/localization/locale.categories/category.time/locale.time.get/locale.time.get.members/get_time_wide.pass.cpp b/libcxx/test/std/localization/locale.categories/category.time/locale.time.get/locale.time.get.members/get_time_wide.pass.cpp
index 9107ef890e8d3..5ff5404ee46fe 100644
--- a/libcxx/test/std/localization/locale.categories/category.time/locale.time.get/locale.time.get.members/get_time_wide.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.time/locale.time.get/locale.time.get.members/get_time_wide.pass.cpp
@@ -14,6 +14,8 @@
 // get_time(iter_type s, iter_type end, ios_base& str,
 //          ios_base::iostate& err, tm* t) const;
 
+// XFAIL: libcpp-has-no-wide-characters
+
 #include <locale>
 #include <cassert>
 #include "test_macros.h"

diff  --git a/libcxx/test/std/localization/locale.categories/category.time/locale.time.get/locale.time.get.members/get_weekday_wide.pass.cpp b/libcxx/test/std/localization/locale.categories/category.time/locale.time.get/locale.time.get.members/get_weekday_wide.pass.cpp
index 00929846383b6..0a1399e695baa 100644
--- a/libcxx/test/std/localization/locale.categories/category.time/locale.time.get/locale.time.get.members/get_weekday_wide.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.time/locale.time.get/locale.time.get.members/get_weekday_wide.pass.cpp
@@ -14,6 +14,8 @@
 // get_weekday(iter_type s, iter_type end, ios_base& str,
 //             ios_base::iostate& err, tm* t) const;
 
+// XFAIL: libcpp-has-no-wide-characters
+
 #include <locale>
 #include <cassert>
 #include "test_macros.h"

diff  --git a/libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct.byname/decimal_point.pass.cpp b/libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct.byname/decimal_point.pass.cpp
index b93d1c432d714..9d074a7bd0cf0 100644
--- a/libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct.byname/decimal_point.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct.byname/decimal_point.pass.cpp
@@ -30,11 +30,13 @@ int main(int, char**)
             const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l);
             assert(np.decimal_point() == '.');
         }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
         {
             typedef wchar_t C;
             const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l);
             assert(np.decimal_point() == L'.');
         }
+#endif
     }
     {
         std::locale l(LOCALE_en_US_UTF_8);
@@ -43,11 +45,13 @@ int main(int, char**)
             const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l);
             assert(np.decimal_point() == '.');
         }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
         {
             typedef wchar_t C;
             const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l);
             assert(np.decimal_point() == L'.');
         }
+#endif
     }
     {
         std::locale l(LOCALE_fr_FR_UTF_8);
@@ -56,11 +60,13 @@ int main(int, char**)
             const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l);
             assert(np.decimal_point() == ',');
         }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
         {
             typedef wchar_t C;
             const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l);
             assert(np.decimal_point() == L',');
         }
+#endif
     }
 
   return 0;

diff  --git a/libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct.byname/grouping.pass.cpp b/libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct.byname/grouping.pass.cpp
index 3bd1c855ea916..b9c41459cf246 100644
--- a/libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct.byname/grouping.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct.byname/grouping.pass.cpp
@@ -35,11 +35,13 @@ int main(int, char**)
             const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l);
             assert(np.grouping() == "");
         }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
         {
             typedef wchar_t C;
             const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l);
             assert(np.grouping() == "");
         }
+#endif
     }
     {
         std::locale l(LOCALE_en_US_UTF_8);
@@ -48,11 +50,13 @@ int main(int, char**)
             const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l);
             assert(np.grouping() == "\3\3");
         }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
         {
             typedef wchar_t C;
             const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l);
             assert(np.grouping() == "\3\3");
         }
+#endif
     }
     {
         std::locale l(LOCALE_fr_FR_UTF_8);
@@ -66,11 +70,13 @@ int main(int, char**)
             const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l);
             assert(np.grouping() ==  group);
         }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
         {
             typedef wchar_t C;
             const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l);
             assert(np.grouping() == group);
         }
+#endif
     }
 
   return 0;

diff  --git a/libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct.byname/thousands_sep.pass.cpp b/libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct.byname/thousands_sep.pass.cpp
index 627bc6a7fa8a6..009fbc7d98958 100644
--- a/libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct.byname/thousands_sep.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct.byname/thousands_sep.pass.cpp
@@ -36,11 +36,13 @@ int main(int, char**)
             const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l);
             assert(np.thousands_sep() == ',');
         }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
         {
             typedef wchar_t C;
             const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l);
             assert(np.thousands_sep() == L',');
         }
+#endif
     }
     {
         std::locale l(LOCALE_en_US_UTF_8);
@@ -49,32 +51,39 @@ int main(int, char**)
             const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l);
             assert(np.thousands_sep() == ',');
         }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
         {
             typedef wchar_t C;
             const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l);
             assert(np.thousands_sep() == L',');
         }
+#endif
     }
     {
+        // The below tests work around GLIBC's use of U202F as LC_NUMERIC thousands_sep.
         std::locale l(LOCALE_fr_FR_UTF_8);
-// The below tests work around GLIBC's use of U202F as LC_NUMERIC thousands_sep.
+        {
 #if defined(_CS_GNU_LIBC_VERSION)
-        const char sep = ' ';
-        const wchar_t wsep = glibc_version_less_than("2.27") ? L' ' : L'\u202f';
+            const char sep = ' ';
 #else
-        const char sep = ',';
-        const wchar_t wsep = L',';
+            const char sep = ',';
 #endif
-        {
             typedef char C;
             const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l);
             assert(np.thousands_sep() == sep);
         }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
         {
+#if defined(_CS_GNU_LIBC_VERSION)
+            const wchar_t wsep = glibc_version_less_than("2.27") ? L' ' : L'\u202f';
+#else
+            const wchar_t wsep = L',';
+#endif
             typedef wchar_t C;
             const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l);
             assert(np.thousands_sep() == wsep);
         }
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
     }
 
     return 0;

diff  --git a/libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct/ctor.pass.cpp b/libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct/ctor.pass.cpp
index a48ba0efc48bb..28e0d4e47e2e7 100644
--- a/libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct/ctor.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct/ctor.pass.cpp
@@ -49,6 +49,8 @@ int main(int, char**)
         assert(my_facet<char>::count == 1);
     }
     assert(my_facet<char>::count == 0);
+
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::locale l(std::locale::classic(), new my_facet<wchar_t>);
         assert(my_facet<wchar_t>::count == 1);
@@ -64,6 +66,7 @@ int main(int, char**)
         assert(my_facet<wchar_t>::count == 1);
     }
     assert(my_facet<wchar_t>::count == 0);
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
 
   return 0;
 }

diff  --git a/libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct/facet.numpunct.members/decimal_point.pass.cpp b/libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct/facet.numpunct.members/decimal_point.pass.cpp
index 0c25943f0ff3a..78212c30dda6d 100644
--- a/libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct/facet.numpunct.members/decimal_point.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct/facet.numpunct.members/decimal_point.pass.cpp
@@ -25,11 +25,13 @@ int main(int, char**)
         const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l);
         assert(np.decimal_point() == '.');
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         typedef wchar_t C;
         const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l);
         assert(np.decimal_point() == L'.');
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct/facet.numpunct.members/falsename.pass.cpp b/libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct/facet.numpunct.members/falsename.pass.cpp
index c238604bde56d..e3ee165c48519 100644
--- a/libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct/facet.numpunct.members/falsename.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct/facet.numpunct.members/falsename.pass.cpp
@@ -25,11 +25,13 @@ int main(int, char**)
         const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l);
         assert(np.falsename() == std::string("false"));
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         typedef wchar_t C;
         const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l);
         assert(np.falsename() == std::wstring(L"false"));
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct/facet.numpunct.members/grouping.pass.cpp b/libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct/facet.numpunct.members/grouping.pass.cpp
index ee84fcb5e3e30..6c7f766cb5c4c 100644
--- a/libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct/facet.numpunct.members/grouping.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct/facet.numpunct.members/grouping.pass.cpp
@@ -25,11 +25,13 @@ int main(int, char**)
         const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l);
         assert(np.grouping() == std::string());
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         typedef wchar_t C;
         const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l);
         assert(np.grouping() == std::string());
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct/facet.numpunct.members/thousands_sep.pass.cpp b/libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct/facet.numpunct.members/thousands_sep.pass.cpp
index 92a32eda115c0..fb5331a69bb72 100644
--- a/libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct/facet.numpunct.members/thousands_sep.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct/facet.numpunct.members/thousands_sep.pass.cpp
@@ -25,11 +25,13 @@ int main(int, char**)
         const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l);
         assert(np.thousands_sep() == ',');
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         typedef wchar_t C;
         const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l);
         assert(np.thousands_sep() == L',');
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct/facet.numpunct.members/truename.pass.cpp b/libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct/facet.numpunct.members/truename.pass.cpp
index e89c95c89903e..0f08a676dbb08 100644
--- a/libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct/facet.numpunct.members/truename.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct/facet.numpunct.members/truename.pass.cpp
@@ -25,11 +25,13 @@ int main(int, char**)
         const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l);
         assert(np.truename() == std::string("true"));
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         typedef wchar_t C;
         const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l);
         assert(np.truename() == std::wstring(L"true"));
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct/types.pass.cpp b/libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct/types.pass.cpp
index eb59310ab7e02..3837172a5201a 100644
--- a/libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct/types.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct/types.pass.cpp
@@ -37,6 +37,7 @@ int main(int, char**)
         static_assert((std::is_same<std::numpunct<char>::string_type, std::string>::value), "");
         static_assert((std::is_base_of<std::locale::facet, std::numpunct<char> >::value), "");
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         assert(std::has_facet<std::numpunct<wchar_t> >(l));
         const std::numpunct<wchar_t>& f = std::use_facet<std::numpunct<wchar_t> >(l);
@@ -48,6 +49,7 @@ int main(int, char**)
         static_assert((std::is_same<std::numpunct<wchar_t>::string_type, std::wstring>::value), "");
         static_assert((std::is_base_of<std::locale::facet, std::numpunct<wchar_t> >::value), "");
     }
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
 
   return 0;
 }

diff  --git a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf16.pass.cpp b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf16.pass.cpp
index 40f8ae299206a..47b9ea434f94c 100644
--- a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf16.pass.cpp
+++ b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf16.pass.cpp
@@ -16,6 +16,8 @@
 //     // unspecified
 // };
 
+// XFAIL: libcpp-has-no-wide-characters
+
 // Not a portable test
 
 #include <codecvt>

diff  --git a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_always_noconv.pass.cpp b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_always_noconv.pass.cpp
index 7788fad2eac6f..e9a1e7a4bc7f9 100644
--- a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_always_noconv.pass.cpp
+++ b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_always_noconv.pass.cpp
@@ -25,12 +25,14 @@
 
 int main(int, char**)
 {
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         typedef std::codecvt_utf16<wchar_t> C;
         C c;
         bool r = c.always_noconv();
         assert(r == false);
     }
+#endif
     {
         typedef std::codecvt_utf16<char16_t> C;
         C c;

diff  --git a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_encoding.pass.cpp b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_encoding.pass.cpp
index c968cf61882c8..2407644243fc4 100644
--- a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_encoding.pass.cpp
+++ b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_encoding.pass.cpp
@@ -25,12 +25,14 @@
 
 int main(int, char**)
 {
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         typedef std::codecvt_utf16<wchar_t> C;
         C c;
         int r = c.encoding();
         assert(r == 0);
     }
+#endif
     {
         typedef std::codecvt_utf16<char16_t> C;
         C c;

diff  --git a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_max_length.pass.cpp b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_max_length.pass.cpp
index c392fda7217b0..6f31d744130e0 100644
--- a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_max_length.pass.cpp
+++ b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_max_length.pass.cpp
@@ -69,7 +69,9 @@ void TestHelper<CharT, 4>::test() {
 }
 
 int main(int, char**) {
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
   TestHelper<wchar_t>::test();
+#endif
   TestHelper<char16_t>::test();
   TestHelper<char32_t>::test();
   return 0;

diff  --git a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_out.pass.cpp b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_out.pass.cpp
index f99f8f4c35724..da94fb6683f3e 100644
--- a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_out.pass.cpp
+++ b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_out.pass.cpp
@@ -350,7 +350,9 @@ void TestHelper<CharT, 4>::test() {
 
 int main(int, char**) {
   TestHelper<char32_t>::test();
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
   TestHelper<wchar_t>::test();
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_unshift.pass.cpp b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_unshift.pass.cpp
index 261363f563057..0a7adaf24c34c 100644
--- a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_unshift.pass.cpp
+++ b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf16_unshift.pass.cpp
@@ -27,6 +27,7 @@
 
 int main(int, char**)
 {
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         typedef std::codecvt_utf16<wchar_t> C;
         C c;
@@ -36,6 +37,7 @@ int main(int, char**)
         std::codecvt_base::result r = c.unshift(m, n, n+4, np);
         assert(r == std::codecvt_base::noconv);
     }
+#endif
     {
         typedef std::codecvt_utf16<char16_t> C;
         C c;

diff  --git a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8.pass.cpp b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8.pass.cpp
index 08f98fa2999af..e281f1ae51bfb 100644
--- a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8.pass.cpp
+++ b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8.pass.cpp
@@ -16,6 +16,8 @@
 //     // unspecified
 // };
 
+// XFAIL: libcpp-has-no-wide-characters
+
 // Not a portable test
 
 #include <codecvt>

diff  --git a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_always_noconv.pass.cpp b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_always_noconv.pass.cpp
index 2235e7b275a17..23f29df1f09e7 100644
--- a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_always_noconv.pass.cpp
+++ b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_always_noconv.pass.cpp
@@ -25,12 +25,14 @@
 
 int main(int, char**)
 {
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         typedef std::codecvt_utf8<wchar_t> C;
         C c;
         bool r = c.always_noconv();
         assert(r == false);
     }
+#endif
     {
         typedef std::codecvt_utf8<char16_t> C;
         C c;

diff  --git a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_encoding.pass.cpp b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_encoding.pass.cpp
index 70862e4ccd639..eddf665f0d357 100644
--- a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_encoding.pass.cpp
+++ b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_encoding.pass.cpp
@@ -25,12 +25,14 @@
 
 int main(int, char**)
 {
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         typedef std::codecvt_utf8<wchar_t> C;
         C c;
         int r = c.encoding();
         assert(r == 0);
     }
+#endif
     {
         typedef std::codecvt_utf8<char16_t> C;
         C c;

diff  --git a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_length.pass.cpp b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_length.pass.cpp
index 5e2cf831b347a..bd4aa1d098ef5 100644
--- a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_length.pass.cpp
+++ b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_length.pass.cpp
@@ -190,7 +190,9 @@ void TestHelper<CharT, 4>::test() {
 }
 
 int main(int, char**) {
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
   TestHelper<wchar_t>::test();
+#endif
   TestHelper<char32_t>::test();
   TestHelper<char16_t>::test();
   return 0;

diff  --git a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_max_length.pass.cpp b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_max_length.pass.cpp
index 8da24a254b87e..8afb5bc3adddc 100644
--- a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_max_length.pass.cpp
+++ b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_max_length.pass.cpp
@@ -69,7 +69,9 @@ void TestHelper<CharT, 4>::test() {
 }
 
 int main(int, char**) {
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
   TestHelper<wchar_t>::test();
+#endif
   TestHelper<char16_t>::test();
   TestHelper<char32_t>::test();
   return 0;

diff  --git a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_out.pass.cpp b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_out.pass.cpp
index 96089fbb05435..99dc2192c873f 100644
--- a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_out.pass.cpp
+++ b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_out.pass.cpp
@@ -321,7 +321,9 @@ void TestHelper<CharT, 4>::test() {
 }
 
 int main(int, char**) {
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
   TestHelper<wchar_t>::test();
+#endif
   TestHelper<char32_t>::test();
   TestHelper<char16_t>::test();
 

diff  --git a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_unshift.pass.cpp b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_unshift.pass.cpp
index 6aa021a8d1640..239dbfc06dd42 100644
--- a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_unshift.pass.cpp
+++ b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_unshift.pass.cpp
@@ -27,6 +27,7 @@
 
 int main(int, char**)
 {
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         typedef std::codecvt_utf8<wchar_t> C;
         C c;
@@ -36,6 +37,7 @@ int main(int, char**)
         std::codecvt_base::result r = c.unshift(m, n, n+4, np);
         assert(r == std::codecvt_base::noconv);
     }
+#endif
     {
         typedef std::codecvt_utf8<char16_t> C;
         C c;

diff  --git a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_utf16_always_noconv.pass.cpp b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_utf16_always_noconv.pass.cpp
index 6b65978ba706a..7aa5591bca903 100644
--- a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_utf16_always_noconv.pass.cpp
+++ b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_utf16_always_noconv.pass.cpp
@@ -25,12 +25,14 @@
 
 int main(int, char**)
 {
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         typedef std::codecvt_utf8_utf16<wchar_t> C;
         C c;
         bool r = c.always_noconv();
         assert(r == false);
     }
+#endif
     {
         typedef std::codecvt_utf8_utf16<char16_t> C;
         C c;

diff  --git a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_utf16_encoding.pass.cpp b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_utf16_encoding.pass.cpp
index 3b4fa34b2a7fc..3e8aa3afc1e43 100644
--- a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_utf16_encoding.pass.cpp
+++ b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_utf16_encoding.pass.cpp
@@ -25,12 +25,14 @@
 
 int main(int, char**)
 {
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         typedef std::codecvt_utf8_utf16<wchar_t> C;
         C c;
         int r = c.encoding();
         assert(r == 0);
     }
+#endif
     {
         typedef std::codecvt_utf8_utf16<char16_t> C;
         C c;

diff  --git a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_utf16_in.pass.cpp b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_utf16_in.pass.cpp
index 2ec13bb9834dd..8b235339983b0 100644
--- a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_utf16_in.pass.cpp
+++ b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_utf16_in.pass.cpp
@@ -237,7 +237,7 @@ void TestHelper<CharT, 4>::test() {
 }
 
 int main(int, char**) {
-#ifndef _WIN32
+#if !defined(_WIN32) && !defined(TEST_HAS_NO_WIDE_CHARACTERS)
   TestHelper<wchar_t>::test();
 #endif
   TestHelper<char32_t>::test();

diff  --git a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_utf16_length.pass.cpp b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_utf16_length.pass.cpp
index 2dc4ce5bef706..3847fad4cb5dd 100644
--- a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_utf16_length.pass.cpp
+++ b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_utf16_length.pass.cpp
@@ -26,6 +26,7 @@
 
 int main(int, char**)
 {
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         typedef std::codecvt_utf8_utf16<wchar_t> C;
         C c;
@@ -95,6 +96,7 @@ int main(int, char**)
         r = c.length(m, n, n+1, 2);
         assert(r == 1);
     }
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
     {
         typedef std::codecvt_utf8_utf16<char32_t> C;
         C c;

diff  --git a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_utf16_max_length.pass.cpp b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_utf16_max_length.pass.cpp
index 6459b2eaabbc4..f7f7ce3251096 100644
--- a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_utf16_max_length.pass.cpp
+++ b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_utf16_max_length.pass.cpp
@@ -25,6 +25,7 @@
 
 int main(int, char**)
 {
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         typedef std::codecvt_utf8_utf16<wchar_t> C;
         C c;
@@ -37,6 +38,7 @@ int main(int, char**)
         int r = c.max_length();
         assert(r == 7);
     }
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
     {
         typedef std::codecvt_utf8_utf16<char16_t> C;
         C c;

diff  --git a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_utf16_out.pass.cpp b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_utf16_out.pass.cpp
index 4b3f02d6550c0..895db46c5ecd0 100644
--- a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_utf16_out.pass.cpp
+++ b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_utf16_out.pass.cpp
@@ -302,7 +302,7 @@ void TestHelper<CharT, 4>::test() {
 }
 
 int main(int, char**) {
-#ifndef _WIN32
+#if !defined(_WIN32) && !defined(TEST_HAS_NO_WIDE_CHARACTERS)
   TestHelper<wchar_t>::test();
 #endif
   TestHelper<char32_t>::test();

diff  --git a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_utf16_unshift.pass.cpp b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_utf16_unshift.pass.cpp
index ccecf79110381..c36239749934b 100644
--- a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_utf16_unshift.pass.cpp
+++ b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8_utf16_unshift.pass.cpp
@@ -27,6 +27,7 @@
 
 int main(int, char**)
 {
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         typedef std::codecvt_utf8_utf16<wchar_t> C;
         C c;
@@ -36,6 +37,7 @@ int main(int, char**)
         std::codecvt_base::result r = c.unshift(m, n, n+4, np);
         assert(r == std::codecvt_base::noconv);
     }
+#endif
     {
         typedef std::codecvt_utf8_utf16<char16_t> C;
         C c;

diff  --git a/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/ctor.pass.cpp b/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/ctor.pass.cpp
index d70804e6b86c7..bc179f4d6d01f 100644
--- a/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/ctor.pass.cpp
+++ b/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/ctor.pass.cpp
@@ -18,6 +18,8 @@
 // explicit wbuffer_convert(streambuf* bytebuf, Codecvt* pcvt = new Codecvt,
 //                          state_type state = state_type()); // C++20
 
+// XFAIL: libcpp-has-no-wide-characters
+
 #include <locale>
 #include <codecvt>
 #include <sstream>

diff  --git a/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/overflow.pass.cpp b/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/overflow.pass.cpp
index b29fce578540d..27ced20f23841 100644
--- a/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/overflow.pass.cpp
+++ b/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/overflow.pass.cpp
@@ -14,6 +14,8 @@
 
 // This test is not entirely portable
 
+// XFAIL: libcpp-has-no-wide-characters
+
 #include <locale>
 #include <codecvt>
 #include <fstream>

diff  --git a/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/pbackfail.pass.cpp b/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/pbackfail.pass.cpp
index 264a67ee530f7..b07b5ee1f96d1 100644
--- a/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/pbackfail.pass.cpp
+++ b/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/pbackfail.pass.cpp
@@ -16,6 +16,8 @@
 
 // This test is not entirely portable
 
+// XFAIL: libcpp-has-no-wide-characters
+
 #include <locale>
 #include <codecvt>
 #include <fstream>

diff  --git a/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/rdbuf.pass.cpp b/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/rdbuf.pass.cpp
index 1d6e34388da0d..72c7c8c6e823e 100644
--- a/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/rdbuf.pass.cpp
+++ b/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/rdbuf.pass.cpp
@@ -12,6 +12,8 @@
 
 // streambuf *rdbuf(streambuf *bytebuf);
 
+// XFAIL: libcpp-has-no-wide-characters
+
 #include <locale>
 #include <codecvt>
 #include <sstream>

diff  --git a/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/seekoff.pass.cpp b/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/seekoff.pass.cpp
index 33fc9f23bed5b..8a3ca75766f80 100644
--- a/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/seekoff.pass.cpp
+++ b/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/seekoff.pass.cpp
@@ -17,6 +17,8 @@
 
 // This test is not entirely portable
 
+// XFAIL: libcpp-has-no-wide-characters
+
 #include <locale>
 #include <codecvt>
 #include <fstream>

diff  --git a/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/state.pass.cpp b/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/state.pass.cpp
index 84a0fdcf1f343..8736da7a6e91a 100644
--- a/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/state.pass.cpp
+++ b/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/state.pass.cpp
@@ -12,6 +12,8 @@
 
 // state_type state() const;
 
+// XFAIL: libcpp-has-no-wide-characters
+
 #include <locale>
 #include <codecvt>
 #include <sstream>

diff  --git a/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/test.pass.cpp b/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/test.pass.cpp
index 2d5564a5bffb1..0f4a49b84fcb1 100644
--- a/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/test.pass.cpp
+++ b/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/test.pass.cpp
@@ -10,6 +10,8 @@
 
 // wbuffer_convert<Codecvt, Elem, Tr>
 
+// XFAIL: libcpp-has-no-wide-characters
+
 #include <fstream>
 #include <locale>
 #include <codecvt>

diff  --git a/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/underflow.pass.cpp b/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/underflow.pass.cpp
index 6642488cf0c9c..a198a9577dbf7 100644
--- a/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/underflow.pass.cpp
+++ b/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/underflow.pass.cpp
@@ -16,6 +16,8 @@
 
 // This test is not entirely portable
 
+// XFAIL: libcpp-has-no-wide-characters
+
 #include <locale>
 #include <codecvt>
 #include <fstream>

diff  --git a/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/converted.pass.cpp b/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/converted.pass.cpp
index 955bbb09c65d8..5ce556101e820 100644
--- a/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/converted.pass.cpp
+++ b/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/converted.pass.cpp
@@ -12,6 +12,8 @@
 
 // size_t converted() const;
 
+// XFAIL: libcpp-has-no-wide-characters
+
 #include <locale>
 #include <codecvt>
 #include <cassert>

diff  --git a/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/ctor_codecvt.pass.cpp b/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/ctor_codecvt.pass.cpp
index bc39fd7b3897f..d4b19125ac3dc 100644
--- a/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/ctor_codecvt.pass.cpp
+++ b/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/ctor_codecvt.pass.cpp
@@ -15,6 +15,8 @@
 // wstring_convert() : wstring_convert(new Codecvt) {}    // C++20
 // explicit wstring_convert(Codecvt* pcvt);               // C++20
 
+// XFAIL: libcpp-has-no-wide-characters
+
 #include <locale>
 #include <codecvt>
 #include <cassert>

diff  --git a/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/ctor_codecvt_state.pass.cpp b/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/ctor_codecvt_state.pass.cpp
index 292777ae4002e..c5a3dd8f8cd06 100644
--- a/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/ctor_codecvt_state.pass.cpp
+++ b/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/ctor_codecvt_state.pass.cpp
@@ -12,6 +12,8 @@
 
 // wstring_convert(Codecvt* pcvt, state_type state);
 
+// XFAIL: libcpp-has-no-wide-characters
+
 #include <locale>
 #include <codecvt>
 #include <cassert>

diff  --git a/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/ctor_copy.pass.cpp b/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/ctor_copy.pass.cpp
index fb7ce018e2254..df386dfbd4708 100644
--- a/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/ctor_copy.pass.cpp
+++ b/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/ctor_copy.pass.cpp
@@ -17,6 +17,8 @@
 // wstring_convert(wstring_convert const&) = delete;
 // wstring_convert& operator=(wstring_convert const&) = delete;
 
+// XFAIL: libcpp-has-no-wide-characters
+
 #include <locale>
 #include <codecvt>
 #include <cassert>

diff  --git a/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/ctor_err_string.pass.cpp b/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/ctor_err_string.pass.cpp
index e284c13c0629e..5ad3dbe4e9f2f 100644
--- a/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/ctor_err_string.pass.cpp
+++ b/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/ctor_err_string.pass.cpp
@@ -13,6 +13,8 @@
 // wstring_convert(const byte_string& byte_err,
 //                 const wide_string& wide_err = wide_string());
 
+// XFAIL: libcpp-has-no-wide-characters
+
 #include <locale>
 #include <codecvt>
 #include <cassert>

diff  --git a/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/from_bytes.pass.cpp b/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/from_bytes.pass.cpp
index deb4b96cf72d9..bd0191de0cc19 100644
--- a/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/from_bytes.pass.cpp
+++ b/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/from_bytes.pass.cpp
@@ -15,6 +15,8 @@
 // wide_string from_bytes(const byte_string& str);
 // wide_string from_bytes(const char* first, const char* last);
 
+// XFAIL: libcpp-has-no-wide-characters
+
 #include <locale>
 #include <codecvt>
 #include <cassert>

diff  --git a/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/state.pass.cpp b/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/state.pass.cpp
index f6dcd063d7777..1602b1a336023 100644
--- a/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/state.pass.cpp
+++ b/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/state.pass.cpp
@@ -12,6 +12,8 @@
 
 // state_type state() const;
 
+// XFAIL: libcpp-has-no-wide-characters
+
 #include <locale>
 #include <codecvt>
 

diff  --git a/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/to_bytes.pass.cpp b/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/to_bytes.pass.cpp
index 849b99022c9aa..5ccaca01c7a60 100644
--- a/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/to_bytes.pass.cpp
+++ b/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/to_bytes.pass.cpp
@@ -15,6 +15,8 @@
 // byte_string to_bytes(const wide_string& wstr);
 // byte_string to_bytes(const Elem* first, const Elem* last);
 
+// XFAIL: libcpp-has-no-wide-characters
+
 #include <locale>
 #include <codecvt>
 #include <cassert>

diff  --git a/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/types.pass.cpp b/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/types.pass.cpp
index a73739e0061c7..88c4bcc012a26 100644
--- a/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/types.pass.cpp
+++ b/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/types.pass.cpp
@@ -19,6 +19,8 @@
 //     typedef typename Codecvt::state_type                      state_type;
 //     typedef typename wide_string::traits_type::int_type       int_type;
 
+// XFAIL: libcpp-has-no-wide-characters
+
 #include <locale>
 #include <codecvt>
 

diff  --git a/libcxx/test/std/localization/locales/locale/locale.cons/assign.pass.cpp b/libcxx/test/std/localization/locales/locale/locale.cons/assign.pass.cpp
index 94e2d26f2c63e..e897cc58898f7 100644
--- a/libcxx/test/std/localization/locales/locale/locale.cons/assign.pass.cpp
+++ b/libcxx/test/std/localization/locales/locale/locale.cons/assign.pass.cpp
@@ -30,43 +30,42 @@
 #include "platform_support.h" // locale name macros
 
 
+template<class CharT>
+void check_for(const std::locale& loc)
+{
+    assert(std::has_facet<std::collate<CharT> >(loc));
+
+    assert(std::has_facet<std::ctype<CharT> >(loc));
+
+    assert((std::has_facet<std::codecvt<CharT, char, std::mbstate_t> >(loc)));
+
+    assert(std::has_facet<std::moneypunct<CharT> >(loc));
+    assert(std::has_facet<std::money_get<CharT> >(loc));
+    assert(std::has_facet<std::money_put<CharT> >(loc));
+
+    assert(std::has_facet<std::numpunct<CharT> >(loc));
+    assert(std::has_facet<std::num_get<CharT> >(loc));
+    assert(std::has_facet<std::num_put<CharT> >(loc));
+
+    assert(std::has_facet<std::time_get<CharT> >(loc));
+    assert(std::has_facet<std::time_put<CharT> >(loc));
+
+    assert(std::has_facet<std::messages<CharT> >(loc));
+}
+
 void check(const std::locale& loc)
 {
-    assert(std::has_facet<std::collate<char> >(loc));
-    assert(std::has_facet<std::collate<wchar_t> >(loc));
+    check_for<char>(loc);
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
+    check_for<wchar_t>(loc);
+#endif
 
-    assert(std::has_facet<std::ctype<char> >(loc));
-    assert(std::has_facet<std::ctype<wchar_t> >(loc));
-    assert((std::has_facet<std::codecvt<char, char, std::mbstate_t> >(loc)));
     assert((std::has_facet<std::codecvt<char16_t, char, std::mbstate_t> >(loc)));
     assert((std::has_facet<std::codecvt<char32_t, char, std::mbstate_t> >(loc)));
 #if TEST_STD_VER > 17
     assert((std::has_facet<std::codecvt<char16_t, char8_t, std::mbstate_t> >(loc)));
     assert((std::has_facet<std::codecvt<char32_t, char8_t, std::mbstate_t> >(loc)));
 #endif
-    assert((std::has_facet<std::codecvt<wchar_t, char, std::mbstate_t> >(loc)));
-
-    assert((std::has_facet<std::moneypunct<char> >(loc)));
-    assert((std::has_facet<std::moneypunct<wchar_t> >(loc)));
-    assert((std::has_facet<std::money_get<char> >(loc)));
-    assert((std::has_facet<std::money_get<wchar_t> >(loc)));
-    assert((std::has_facet<std::money_put<char> >(loc)));
-    assert((std::has_facet<std::money_put<wchar_t> >(loc)));
-
-    assert((std::has_facet<std::numpunct<char> >(loc)));
-    assert((std::has_facet<std::numpunct<wchar_t> >(loc)));
-    assert((std::has_facet<std::num_get<char> >(loc)));
-    assert((std::has_facet<std::num_get<wchar_t> >(loc)));
-    assert((std::has_facet<std::num_put<char> >(loc)));
-    assert((std::has_facet<std::num_put<wchar_t> >(loc)));
-
-    assert((std::has_facet<std::time_get<char> >(loc)));
-    assert((std::has_facet<std::time_get<wchar_t> >(loc)));
-    assert((std::has_facet<std::time_put<char> >(loc)));
-    assert((std::has_facet<std::time_put<wchar_t> >(loc)));
-
-    assert((std::has_facet<std::messages<char> >(loc)));
-    assert((std::has_facet<std::messages<wchar_t> >(loc)));
 }
 
 int main(int, char**)

diff  --git a/libcxx/test/std/localization/locales/locale/locale.cons/char_pointer.pass.cpp b/libcxx/test/std/localization/locales/locale/locale.cons/char_pointer.pass.cpp
index 42b99d3347e02..cda9fe3b37024 100644
--- a/libcxx/test/std/localization/locales/locale/locale.cons/char_pointer.pass.cpp
+++ b/libcxx/test/std/localization/locales/locale/locale.cons/char_pointer.pass.cpp
@@ -33,44 +33,42 @@
 
 #include "test_macros.h"
 
+template<class CharT>
+void check_for(const std::locale& loc)
+{
+    assert(std::has_facet<std::collate<CharT> >(loc));
+
+    assert(std::has_facet<std::ctype<CharT> >(loc));
+
+    assert((std::has_facet<std::codecvt<CharT, char, std::mbstate_t> >(loc)));
+
+    assert(std::has_facet<std::moneypunct<CharT> >(loc));
+    assert(std::has_facet<std::money_get<CharT> >(loc));
+    assert(std::has_facet<std::money_put<CharT> >(loc));
+
+    assert(std::has_facet<std::numpunct<CharT> >(loc));
+    assert(std::has_facet<std::num_get<CharT> >(loc));
+    assert(std::has_facet<std::num_put<CharT> >(loc));
+
+    assert(std::has_facet<std::time_get<CharT> >(loc));
+    assert(std::has_facet<std::time_put<CharT> >(loc));
+
+    assert(std::has_facet<std::messages<CharT> >(loc));
+}
 
 void check(const std::locale& loc)
 {
-    assert(std::has_facet<std::collate<char> >(loc));
-    assert(std::has_facet<std::collate<wchar_t> >(loc));
+    check_for<char>(loc);
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
+    check_for<wchar_t>(loc);
+#endif
 
-    assert(std::has_facet<std::ctype<char> >(loc));
-    assert(std::has_facet<std::ctype<wchar_t> >(loc));
-    assert((std::has_facet<std::codecvt<char, char, std::mbstate_t> >(loc)));
     assert((std::has_facet<std::codecvt<char16_t, char, std::mbstate_t> >(loc)));
     assert((std::has_facet<std::codecvt<char32_t, char, std::mbstate_t> >(loc)));
 #if TEST_STD_VER > 17
     assert((std::has_facet<std::codecvt<char16_t, char8_t, std::mbstate_t> >(loc)));
     assert((std::has_facet<std::codecvt<char32_t, char8_t, std::mbstate_t> >(loc)));
 #endif
-    assert((std::has_facet<std::codecvt<wchar_t, char, std::mbstate_t> >(loc)));
-
-    assert((std::has_facet<std::moneypunct<char> >(loc)));
-    assert((std::has_facet<std::moneypunct<wchar_t> >(loc)));
-    assert((std::has_facet<std::money_get<char> >(loc)));
-    assert((std::has_facet<std::money_get<wchar_t> >(loc)));
-    assert((std::has_facet<std::money_put<char> >(loc)));
-    assert((std::has_facet<std::money_put<wchar_t> >(loc)));
-
-    assert((std::has_facet<std::numpunct<char> >(loc)));
-    assert((std::has_facet<std::numpunct<wchar_t> >(loc)));
-    assert((std::has_facet<std::num_get<char> >(loc)));
-    assert((std::has_facet<std::num_get<wchar_t> >(loc)));
-    assert((std::has_facet<std::num_put<char> >(loc)));
-    assert((std::has_facet<std::num_put<wchar_t> >(loc)));
-
-    assert((std::has_facet<std::time_get<char> >(loc)));
-    assert((std::has_facet<std::time_get<wchar_t> >(loc)));
-    assert((std::has_facet<std::time_put<char> >(loc)));
-    assert((std::has_facet<std::time_put<wchar_t> >(loc)));
-
-    assert((std::has_facet<std::messages<char> >(loc)));
-    assert((std::has_facet<std::messages<wchar_t> >(loc)));
 }
 
 int main(int, char**)

diff  --git a/libcxx/test/std/localization/locales/locale/locale.cons/copy.pass.cpp b/libcxx/test/std/localization/locales/locale/locale.cons/copy.pass.cpp
index 012086a626d7f..58cc5446ec86f 100644
--- a/libcxx/test/std/localization/locales/locale/locale.cons/copy.pass.cpp
+++ b/libcxx/test/std/localization/locales/locale/locale.cons/copy.pass.cpp
@@ -28,43 +28,42 @@
 #include "test_macros.h"
 #include "platform_support.h" // locale name macros
 
+template<class CharT>
+void check_for(const std::locale& loc)
+{
+    assert(std::has_facet<std::collate<CharT> >(loc));
+
+    assert(std::has_facet<std::ctype<CharT> >(loc));
+
+    assert((std::has_facet<std::codecvt<CharT, char, std::mbstate_t> >(loc)));
+
+    assert(std::has_facet<std::moneypunct<CharT> >(loc));
+    assert(std::has_facet<std::money_get<CharT> >(loc));
+    assert(std::has_facet<std::money_put<CharT> >(loc));
+
+    assert(std::has_facet<std::numpunct<CharT> >(loc));
+    assert(std::has_facet<std::num_get<CharT> >(loc));
+    assert(std::has_facet<std::num_put<CharT> >(loc));
+
+    assert(std::has_facet<std::time_get<CharT> >(loc));
+    assert(std::has_facet<std::time_put<CharT> >(loc));
+
+    assert(std::has_facet<std::messages<CharT> >(loc));
+}
+
 void check(const std::locale& loc)
 {
-    assert(std::has_facet<std::collate<char> >(loc));
-    assert(std::has_facet<std::collate<wchar_t> >(loc));
+    check_for<char>(loc);
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
+    check_for<wchar_t>(loc);
+#endif
 
-    assert(std::has_facet<std::ctype<char> >(loc));
-    assert(std::has_facet<std::ctype<wchar_t> >(loc));
-    assert((std::has_facet<std::codecvt<char, char, std::mbstate_t> >(loc)));
     assert((std::has_facet<std::codecvt<char16_t, char, std::mbstate_t> >(loc)));
     assert((std::has_facet<std::codecvt<char32_t, char, std::mbstate_t> >(loc)));
 #if TEST_STD_VER > 17
     assert((std::has_facet<std::codecvt<char16_t, char8_t, std::mbstate_t> >(loc)));
     assert((std::has_facet<std::codecvt<char32_t, char8_t, std::mbstate_t> >(loc)));
 #endif
-    assert((std::has_facet<std::codecvt<wchar_t, char, std::mbstate_t> >(loc)));
-
-    assert((std::has_facet<std::moneypunct<char> >(loc)));
-    assert((std::has_facet<std::moneypunct<wchar_t> >(loc)));
-    assert((std::has_facet<std::money_get<char> >(loc)));
-    assert((std::has_facet<std::money_get<wchar_t> >(loc)));
-    assert((std::has_facet<std::money_put<char> >(loc)));
-    assert((std::has_facet<std::money_put<wchar_t> >(loc)));
-
-    assert((std::has_facet<std::numpunct<char> >(loc)));
-    assert((std::has_facet<std::numpunct<wchar_t> >(loc)));
-    assert((std::has_facet<std::num_get<char> >(loc)));
-    assert((std::has_facet<std::num_get<wchar_t> >(loc)));
-    assert((std::has_facet<std::num_put<char> >(loc)));
-    assert((std::has_facet<std::num_put<wchar_t> >(loc)));
-
-    assert((std::has_facet<std::time_get<char> >(loc)));
-    assert((std::has_facet<std::time_get<wchar_t> >(loc)));
-    assert((std::has_facet<std::time_put<char> >(loc)));
-    assert((std::has_facet<std::time_put<wchar_t> >(loc)));
-
-    assert((std::has_facet<std::messages<char> >(loc)));
-    assert((std::has_facet<std::messages<wchar_t> >(loc)));
 }
 
 int main(int, char**)

diff  --git a/libcxx/test/std/localization/locales/locale/locale.cons/default.pass.cpp b/libcxx/test/std/localization/locales/locale/locale.cons/default.pass.cpp
index c7a67595d1755..1f5b0b54bd193 100644
--- a/libcxx/test/std/localization/locales/locale/locale.cons/default.pass.cpp
+++ b/libcxx/test/std/localization/locales/locale/locale.cons/default.pass.cpp
@@ -27,43 +27,42 @@
 #include "platform_support.h" // locale name macros
 #include "count_new.h"
 
+template<class CharT>
+void check_for(const std::locale& loc)
+{
+    assert(std::has_facet<std::collate<CharT> >(loc));
+
+    assert(std::has_facet<std::ctype<CharT> >(loc));
+
+    assert((std::has_facet<std::codecvt<CharT, char, std::mbstate_t> >(loc)));
+
+    assert(std::has_facet<std::moneypunct<CharT> >(loc));
+    assert(std::has_facet<std::money_get<CharT> >(loc));
+    assert(std::has_facet<std::money_put<CharT> >(loc));
+
+    assert(std::has_facet<std::numpunct<CharT> >(loc));
+    assert(std::has_facet<std::num_get<CharT> >(loc));
+    assert(std::has_facet<std::num_put<CharT> >(loc));
+
+    assert(std::has_facet<std::time_get<CharT> >(loc));
+    assert(std::has_facet<std::time_put<CharT> >(loc));
+
+    assert(std::has_facet<std::messages<CharT> >(loc));
+}
+
 void check(const std::locale& loc)
 {
-    assert(std::has_facet<std::collate<char> >(loc));
-    assert(std::has_facet<std::collate<wchar_t> >(loc));
+    check_for<char>(loc);
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
+    check_for<wchar_t>(loc);
+#endif
 
-    assert(std::has_facet<std::ctype<char> >(loc));
-    assert(std::has_facet<std::ctype<wchar_t> >(loc));
-    assert((std::has_facet<std::codecvt<char, char, std::mbstate_t> >(loc)));
     assert((std::has_facet<std::codecvt<char16_t, char, std::mbstate_t> >(loc)));
     assert((std::has_facet<std::codecvt<char32_t, char, std::mbstate_t> >(loc)));
 #if TEST_STD_VER > 17
     assert((std::has_facet<std::codecvt<char16_t, char8_t, std::mbstate_t> >(loc)));
     assert((std::has_facet<std::codecvt<char32_t, char8_t, std::mbstate_t> >(loc)));
 #endif
-    assert((std::has_facet<std::codecvt<wchar_t, char, std::mbstate_t> >(loc)));
-
-    assert((std::has_facet<std::moneypunct<char> >(loc)));
-    assert((std::has_facet<std::moneypunct<wchar_t> >(loc)));
-    assert((std::has_facet<std::money_get<char> >(loc)));
-    assert((std::has_facet<std::money_get<wchar_t> >(loc)));
-    assert((std::has_facet<std::money_put<char> >(loc)));
-    assert((std::has_facet<std::money_put<wchar_t> >(loc)));
-
-    assert((std::has_facet<std::numpunct<char> >(loc)));
-    assert((std::has_facet<std::numpunct<wchar_t> >(loc)));
-    assert((std::has_facet<std::num_get<char> >(loc)));
-    assert((std::has_facet<std::num_get<wchar_t> >(loc)));
-    assert((std::has_facet<std::num_put<char> >(loc)));
-    assert((std::has_facet<std::num_put<wchar_t> >(loc)));
-
-    assert((std::has_facet<std::time_get<char> >(loc)));
-    assert((std::has_facet<std::time_get<wchar_t> >(loc)));
-    assert((std::has_facet<std::time_put<char> >(loc)));
-    assert((std::has_facet<std::time_put<wchar_t> >(loc)));
-
-    assert((std::has_facet<std::messages<char> >(loc)));
-    assert((std::has_facet<std::messages<wchar_t> >(loc)));
 }
 
 int main(int, char**)

diff  --git a/libcxx/test/std/localization/locales/locale/locale.cons/locale_char_pointer_cat.pass.cpp b/libcxx/test/std/localization/locales/locale/locale.cons/locale_char_pointer_cat.pass.cpp
index 694af889dc0e1..c5760b67de53b 100644
--- a/libcxx/test/std/localization/locales/locale/locale.cons/locale_char_pointer_cat.pass.cpp
+++ b/libcxx/test/std/localization/locales/locale/locale.cons/locale_char_pointer_cat.pass.cpp
@@ -30,43 +30,42 @@
 #include "test_macros.h"
 #include "platform_support.h" // locale name macros
 
+template<class CharT>
+void check_for(const std::locale& loc)
+{
+    assert(std::has_facet<std::collate<CharT> >(loc));
+
+    assert(std::has_facet<std::ctype<CharT> >(loc));
+
+    assert((std::has_facet<std::codecvt<CharT, char, std::mbstate_t> >(loc)));
+
+    assert(std::has_facet<std::moneypunct<CharT> >(loc));
+    assert(std::has_facet<std::money_get<CharT> >(loc));
+    assert(std::has_facet<std::money_put<CharT> >(loc));
+
+    assert(std::has_facet<std::numpunct<CharT> >(loc));
+    assert(std::has_facet<std::num_get<CharT> >(loc));
+    assert(std::has_facet<std::num_put<CharT> >(loc));
+
+    assert(std::has_facet<std::time_get<CharT> >(loc));
+    assert(std::has_facet<std::time_put<CharT> >(loc));
+
+    assert(std::has_facet<std::messages<CharT> >(loc));
+}
+
 void check(const std::locale& loc)
 {
-    assert(std::has_facet<std::collate<char> >(loc));
-    assert(std::has_facet<std::collate<wchar_t> >(loc));
+    check_for<char>(loc);
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
+    check_for<wchar_t>(loc);
+#endif
 
-    assert(std::has_facet<std::ctype<char> >(loc));
-    assert(std::has_facet<std::ctype<wchar_t> >(loc));
-    assert((std::has_facet<std::codecvt<char, char, std::mbstate_t> >(loc)));
     assert((std::has_facet<std::codecvt<char16_t, char, std::mbstate_t> >(loc)));
     assert((std::has_facet<std::codecvt<char32_t, char, std::mbstate_t> >(loc)));
 #if TEST_STD_VER > 17
     assert((std::has_facet<std::codecvt<char16_t, char8_t, std::mbstate_t> >(loc)));
     assert((std::has_facet<std::codecvt<char32_t, char8_t, std::mbstate_t> >(loc)));
 #endif
-    assert((std::has_facet<std::codecvt<wchar_t, char, std::mbstate_t> >(loc)));
-
-    assert((std::has_facet<std::moneypunct<char> >(loc)));
-    assert((std::has_facet<std::moneypunct<wchar_t> >(loc)));
-    assert((std::has_facet<std::money_get<char> >(loc)));
-    assert((std::has_facet<std::money_get<wchar_t> >(loc)));
-    assert((std::has_facet<std::money_put<char> >(loc)));
-    assert((std::has_facet<std::money_put<wchar_t> >(loc)));
-
-    assert((std::has_facet<std::numpunct<char> >(loc)));
-    assert((std::has_facet<std::numpunct<wchar_t> >(loc)));
-    assert((std::has_facet<std::num_get<char> >(loc)));
-    assert((std::has_facet<std::num_get<wchar_t> >(loc)));
-    assert((std::has_facet<std::num_put<char> >(loc)));
-    assert((std::has_facet<std::num_put<wchar_t> >(loc)));
-
-    assert((std::has_facet<std::time_get<char> >(loc)));
-    assert((std::has_facet<std::time_get<wchar_t> >(loc)));
-    assert((std::has_facet<std::time_put<char> >(loc)));
-    assert((std::has_facet<std::time_put<wchar_t> >(loc)));
-
-    assert((std::has_facet<std::messages<char> >(loc)));
-    assert((std::has_facet<std::messages<wchar_t> >(loc)));
 }
 
 int main(int, char**)

diff  --git a/libcxx/test/std/localization/locales/locale/locale.cons/locale_facetptr.pass.cpp b/libcxx/test/std/localization/locales/locale/locale.cons/locale_facetptr.pass.cpp
index 1ae3f59a8bd8a..7243e11a7c894 100644
--- a/libcxx/test/std/localization/locales/locale/locale.cons/locale_facetptr.pass.cpp
+++ b/libcxx/test/std/localization/locales/locale/locale.cons/locale_facetptr.pass.cpp
@@ -29,43 +29,42 @@
 #include "platform_support.h" // locale name macros
 
 
+template<class CharT>
+void check_for(const std::locale& loc)
+{
+    assert(std::has_facet<std::collate<CharT> >(loc));
+
+    assert(std::has_facet<std::ctype<CharT> >(loc));
+
+    assert((std::has_facet<std::codecvt<CharT, char, std::mbstate_t> >(loc)));
+
+    assert(std::has_facet<std::moneypunct<CharT> >(loc));
+    assert(std::has_facet<std::money_get<CharT> >(loc));
+    assert(std::has_facet<std::money_put<CharT> >(loc));
+
+    assert(std::has_facet<std::numpunct<CharT> >(loc));
+    assert(std::has_facet<std::num_get<CharT> >(loc));
+    assert(std::has_facet<std::num_put<CharT> >(loc));
+
+    assert(std::has_facet<std::time_get<CharT> >(loc));
+    assert(std::has_facet<std::time_put<CharT> >(loc));
+
+    assert(std::has_facet<std::messages<CharT> >(loc));
+}
+
 void check(const std::locale& loc)
 {
-    assert(std::has_facet<std::collate<char> >(loc));
-    assert(std::has_facet<std::collate<wchar_t> >(loc));
+    check_for<char>(loc);
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
+    check_for<wchar_t>(loc);
+#endif
 
-    assert(std::has_facet<std::ctype<char> >(loc));
-    assert(std::has_facet<std::ctype<wchar_t> >(loc));
-    assert((std::has_facet<std::codecvt<char, char, std::mbstate_t> >(loc)));
     assert((std::has_facet<std::codecvt<char16_t, char, std::mbstate_t> >(loc)));
     assert((std::has_facet<std::codecvt<char32_t, char, std::mbstate_t> >(loc)));
 #if TEST_STD_VER > 17
     assert((std::has_facet<std::codecvt<char16_t, char8_t, std::mbstate_t> >(loc)));
     assert((std::has_facet<std::codecvt<char32_t, char8_t, std::mbstate_t> >(loc)));
 #endif
-    assert((std::has_facet<std::codecvt<wchar_t, char, std::mbstate_t> >(loc)));
-
-    assert((std::has_facet<std::moneypunct<char> >(loc)));
-    assert((std::has_facet<std::moneypunct<wchar_t> >(loc)));
-    assert((std::has_facet<std::money_get<char> >(loc)));
-    assert((std::has_facet<std::money_get<wchar_t> >(loc)));
-    assert((std::has_facet<std::money_put<char> >(loc)));
-    assert((std::has_facet<std::money_put<wchar_t> >(loc)));
-
-    assert((std::has_facet<std::numpunct<char> >(loc)));
-    assert((std::has_facet<std::numpunct<wchar_t> >(loc)));
-    assert((std::has_facet<std::num_get<char> >(loc)));
-    assert((std::has_facet<std::num_get<wchar_t> >(loc)));
-    assert((std::has_facet<std::num_put<char> >(loc)));
-    assert((std::has_facet<std::num_put<wchar_t> >(loc)));
-
-    assert((std::has_facet<std::time_get<char> >(loc)));
-    assert((std::has_facet<std::time_get<wchar_t> >(loc)));
-    assert((std::has_facet<std::time_put<char> >(loc)));
-    assert((std::has_facet<std::time_put<wchar_t> >(loc)));
-
-    assert((std::has_facet<std::messages<char> >(loc)));
-    assert((std::has_facet<std::messages<wchar_t> >(loc)));
 }
 
 struct my_facet

diff  --git a/libcxx/test/std/localization/locales/locale/locale.cons/locale_locale_cat.pass.cpp b/libcxx/test/std/localization/locales/locale/locale.cons/locale_locale_cat.pass.cpp
index 09889087890c6..1c5bfe21e9e8e 100644
--- a/libcxx/test/std/localization/locales/locale/locale.cons/locale_locale_cat.pass.cpp
+++ b/libcxx/test/std/localization/locales/locale/locale.cons/locale_locale_cat.pass.cpp
@@ -30,43 +30,42 @@
 #include "test_macros.h"
 #include "platform_support.h" // locale name macros
 
+template<class CharT>
+void check_for(const std::locale& loc)
+{
+    assert(std::has_facet<std::collate<CharT> >(loc));
+
+    assert(std::has_facet<std::ctype<CharT> >(loc));
+
+    assert((std::has_facet<std::codecvt<CharT, char, std::mbstate_t> >(loc)));
+
+    assert(std::has_facet<std::moneypunct<CharT> >(loc));
+    assert(std::has_facet<std::money_get<CharT> >(loc));
+    assert(std::has_facet<std::money_put<CharT> >(loc));
+
+    assert(std::has_facet<std::numpunct<CharT> >(loc));
+    assert(std::has_facet<std::num_get<CharT> >(loc));
+    assert(std::has_facet<std::num_put<CharT> >(loc));
+
+    assert(std::has_facet<std::time_get<CharT> >(loc));
+    assert(std::has_facet<std::time_put<CharT> >(loc));
+
+    assert(std::has_facet<std::messages<CharT> >(loc));
+}
+
 void check(const std::locale& loc)
 {
-    assert(std::has_facet<std::collate<char> >(loc));
-    assert(std::has_facet<std::collate<wchar_t> >(loc));
+    check_for<char>(loc);
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
+    check_for<wchar_t>(loc);
+#endif
 
-    assert(std::has_facet<std::ctype<char> >(loc));
-    assert(std::has_facet<std::ctype<wchar_t> >(loc));
-    assert((std::has_facet<std::codecvt<char, char, std::mbstate_t> >(loc)));
     assert((std::has_facet<std::codecvt<char16_t, char, std::mbstate_t> >(loc)));
     assert((std::has_facet<std::codecvt<char32_t, char, std::mbstate_t> >(loc)));
 #if TEST_STD_VER > 17
     assert((std::has_facet<std::codecvt<char16_t, char8_t, std::mbstate_t> >(loc)));
     assert((std::has_facet<std::codecvt<char32_t, char8_t, std::mbstate_t> >(loc)));
 #endif
-    assert((std::has_facet<std::codecvt<wchar_t, char, std::mbstate_t> >(loc)));
-
-    assert((std::has_facet<std::moneypunct<char> >(loc)));
-    assert((std::has_facet<std::moneypunct<wchar_t> >(loc)));
-    assert((std::has_facet<std::money_get<char> >(loc)));
-    assert((std::has_facet<std::money_get<wchar_t> >(loc)));
-    assert((std::has_facet<std::money_put<char> >(loc)));
-    assert((std::has_facet<std::money_put<wchar_t> >(loc)));
-
-    assert((std::has_facet<std::numpunct<char> >(loc)));
-    assert((std::has_facet<std::numpunct<wchar_t> >(loc)));
-    assert((std::has_facet<std::num_get<char> >(loc)));
-    assert((std::has_facet<std::num_get<wchar_t> >(loc)));
-    assert((std::has_facet<std::num_put<char> >(loc)));
-    assert((std::has_facet<std::num_put<wchar_t> >(loc)));
-
-    assert((std::has_facet<std::time_get<char> >(loc)));
-    assert((std::has_facet<std::time_get<wchar_t> >(loc)));
-    assert((std::has_facet<std::time_put<char> >(loc)));
-    assert((std::has_facet<std::time_put<wchar_t> >(loc)));
-
-    assert((std::has_facet<std::messages<char> >(loc)));
-    assert((std::has_facet<std::messages<wchar_t> >(loc)));
 }
 
 int main(int, char**)

diff  --git a/libcxx/test/std/localization/locales/locale/locale.cons/locale_string_cat.pass.cpp b/libcxx/test/std/localization/locales/locale/locale.cons/locale_string_cat.pass.cpp
index 5745f8a8448c7..9ab8d0fc7f95b 100644
--- a/libcxx/test/std/localization/locales/locale/locale.cons/locale_string_cat.pass.cpp
+++ b/libcxx/test/std/localization/locales/locale/locale.cons/locale_string_cat.pass.cpp
@@ -30,44 +30,42 @@
 #include "test_macros.h"
 #include "platform_support.h" // locale name macros
 
+template<class CharT>
+void check_for(const std::locale& loc)
+{
+    assert(std::has_facet<std::collate<CharT> >(loc));
+
+    assert(std::has_facet<std::ctype<CharT> >(loc));
+
+    assert((std::has_facet<std::codecvt<CharT, char, std::mbstate_t> >(loc)));
+
+    assert(std::has_facet<std::moneypunct<CharT> >(loc));
+    assert(std::has_facet<std::money_get<CharT> >(loc));
+    assert(std::has_facet<std::money_put<CharT> >(loc));
+
+    assert(std::has_facet<std::numpunct<CharT> >(loc));
+    assert(std::has_facet<std::num_get<CharT> >(loc));
+    assert(std::has_facet<std::num_put<CharT> >(loc));
+
+    assert(std::has_facet<std::time_get<CharT> >(loc));
+    assert(std::has_facet<std::time_put<CharT> >(loc));
+
+    assert(std::has_facet<std::messages<CharT> >(loc));
+}
 
 void check(const std::locale& loc)
 {
-    assert(std::has_facet<std::collate<char> >(loc));
-    assert(std::has_facet<std::collate<wchar_t> >(loc));
+    check_for<char>(loc);
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
+    check_for<wchar_t>(loc);
+#endif
 
-    assert(std::has_facet<std::ctype<char> >(loc));
-    assert(std::has_facet<std::ctype<wchar_t> >(loc));
-    assert((std::has_facet<std::codecvt<char, char, std::mbstate_t> >(loc)));
     assert((std::has_facet<std::codecvt<char16_t, char, std::mbstate_t> >(loc)));
     assert((std::has_facet<std::codecvt<char32_t, char, std::mbstate_t> >(loc)));
 #if TEST_STD_VER > 17
     assert((std::has_facet<std::codecvt<char16_t, char8_t, std::mbstate_t> >(loc)));
     assert((std::has_facet<std::codecvt<char32_t, char8_t, std::mbstate_t> >(loc)));
 #endif
-    assert((std::has_facet<std::codecvt<wchar_t, char, std::mbstate_t> >(loc)));
-
-    assert((std::has_facet<std::moneypunct<char> >(loc)));
-    assert((std::has_facet<std::moneypunct<wchar_t> >(loc)));
-    assert((std::has_facet<std::money_get<char> >(loc)));
-    assert((std::has_facet<std::money_get<wchar_t> >(loc)));
-    assert((std::has_facet<std::money_put<char> >(loc)));
-    assert((std::has_facet<std::money_put<wchar_t> >(loc)));
-
-    assert((std::has_facet<std::numpunct<char> >(loc)));
-    assert((std::has_facet<std::numpunct<wchar_t> >(loc)));
-    assert((std::has_facet<std::num_get<char> >(loc)));
-    assert((std::has_facet<std::num_get<wchar_t> >(loc)));
-    assert((std::has_facet<std::num_put<char> >(loc)));
-    assert((std::has_facet<std::num_put<wchar_t> >(loc)));
-
-    assert((std::has_facet<std::time_get<char> >(loc)));
-    assert((std::has_facet<std::time_get<wchar_t> >(loc)));
-    assert((std::has_facet<std::time_put<char> >(loc)));
-    assert((std::has_facet<std::time_put<wchar_t> >(loc)));
-
-    assert((std::has_facet<std::messages<char> >(loc)));
-    assert((std::has_facet<std::messages<wchar_t> >(loc)));
 }
 
 int main(int, char**)

diff  --git a/libcxx/test/std/localization/locales/locale/locale.cons/string.pass.cpp b/libcxx/test/std/localization/locales/locale/locale.cons/string.pass.cpp
index 733c7e93275b0..4e51125974214 100644
--- a/libcxx/test/std/localization/locales/locale/locale.cons/string.pass.cpp
+++ b/libcxx/test/std/localization/locales/locale/locale.cons/string.pass.cpp
@@ -29,43 +29,42 @@
 #include "test_macros.h"
 #include "platform_support.h" // locale name macros
 
+template<class CharT>
+void check_for(const std::locale& loc)
+{
+    assert(std::has_facet<std::collate<CharT> >(loc));
+
+    assert(std::has_facet<std::ctype<CharT> >(loc));
+
+    assert((std::has_facet<std::codecvt<CharT, char, std::mbstate_t> >(loc)));
+
+    assert(std::has_facet<std::moneypunct<CharT> >(loc));
+    assert(std::has_facet<std::money_get<CharT> >(loc));
+    assert(std::has_facet<std::money_put<CharT> >(loc));
+
+    assert(std::has_facet<std::numpunct<CharT> >(loc));
+    assert(std::has_facet<std::num_get<CharT> >(loc));
+    assert(std::has_facet<std::num_put<CharT> >(loc));
+
+    assert(std::has_facet<std::time_get<CharT> >(loc));
+    assert(std::has_facet<std::time_put<CharT> >(loc));
+
+    assert(std::has_facet<std::messages<CharT> >(loc));
+}
+
 void check(const std::locale& loc)
 {
-    assert(std::has_facet<std::collate<char> >(loc));
-    assert(std::has_facet<std::collate<wchar_t> >(loc));
+    check_for<char>(loc);
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
+    check_for<wchar_t>(loc);
+#endif
 
-    assert(std::has_facet<std::ctype<char> >(loc));
-    assert(std::has_facet<std::ctype<wchar_t> >(loc));
-    assert((std::has_facet<std::codecvt<char, char, std::mbstate_t> >(loc)));
     assert((std::has_facet<std::codecvt<char16_t, char, std::mbstate_t> >(loc)));
     assert((std::has_facet<std::codecvt<char32_t, char, std::mbstate_t> >(loc)));
 #if TEST_STD_VER > 17
     assert((std::has_facet<std::codecvt<char16_t, char8_t, std::mbstate_t> >(loc)));
     assert((std::has_facet<std::codecvt<char32_t, char8_t, std::mbstate_t> >(loc)));
 #endif
-    assert((std::has_facet<std::codecvt<wchar_t, char, std::mbstate_t> >(loc)));
-
-    assert((std::has_facet<std::moneypunct<char> >(loc)));
-    assert((std::has_facet<std::moneypunct<wchar_t> >(loc)));
-    assert((std::has_facet<std::money_get<char> >(loc)));
-    assert((std::has_facet<std::money_get<wchar_t> >(loc)));
-    assert((std::has_facet<std::money_put<char> >(loc)));
-    assert((std::has_facet<std::money_put<wchar_t> >(loc)));
-
-    assert((std::has_facet<std::numpunct<char> >(loc)));
-    assert((std::has_facet<std::numpunct<wchar_t> >(loc)));
-    assert((std::has_facet<std::num_get<char> >(loc)));
-    assert((std::has_facet<std::num_get<wchar_t> >(loc)));
-    assert((std::has_facet<std::num_put<char> >(loc)));
-    assert((std::has_facet<std::num_put<wchar_t> >(loc)));
-
-    assert((std::has_facet<std::time_get<char> >(loc)));
-    assert((std::has_facet<std::time_get<wchar_t> >(loc)));
-    assert((std::has_facet<std::time_put<char> >(loc)));
-    assert((std::has_facet<std::time_put<wchar_t> >(loc)));
-
-    assert((std::has_facet<std::messages<char> >(loc)));
-    assert((std::has_facet<std::messages<wchar_t> >(loc)));
 }
 
 int main(int, char**)

diff  --git a/libcxx/test/std/localization/locales/locale/locale.members/combine.pass.cpp b/libcxx/test/std/localization/locales/locale/locale.members/combine.pass.cpp
index 5914bb7774434..27a533a04a0f6 100644
--- a/libcxx/test/std/localization/locales/locale/locale.members/combine.pass.cpp
+++ b/libcxx/test/std/localization/locales/locale/locale.members/combine.pass.cpp
@@ -26,43 +26,42 @@
 
 #include "test_macros.h"
 
+template<class CharT>
+void check_for(const std::locale& loc)
+{
+    assert(std::has_facet<std::collate<CharT> >(loc));
+
+    assert(std::has_facet<std::ctype<CharT> >(loc));
+
+    assert((std::has_facet<std::codecvt<CharT, char, std::mbstate_t> >(loc)));
+
+    assert(std::has_facet<std::moneypunct<CharT> >(loc));
+    assert(std::has_facet<std::money_get<CharT> >(loc));
+    assert(std::has_facet<std::money_put<CharT> >(loc));
+
+    assert(std::has_facet<std::numpunct<CharT> >(loc));
+    assert(std::has_facet<std::num_get<CharT> >(loc));
+    assert(std::has_facet<std::num_put<CharT> >(loc));
+
+    assert(std::has_facet<std::time_get<CharT> >(loc));
+    assert(std::has_facet<std::time_put<CharT> >(loc));
+
+    assert(std::has_facet<std::messages<CharT> >(loc));
+}
+
 void check(const std::locale& loc)
 {
-    assert(std::has_facet<std::collate<char> >(loc));
-    assert(std::has_facet<std::collate<wchar_t> >(loc));
+    check_for<char>(loc);
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
+    check_for<wchar_t>(loc);
+#endif
 
-    assert(std::has_facet<std::ctype<char> >(loc));
-    assert(std::has_facet<std::ctype<wchar_t> >(loc));
-    assert((std::has_facet<std::codecvt<char, char, std::mbstate_t> >(loc)));
     assert((std::has_facet<std::codecvt<char16_t, char, std::mbstate_t> >(loc)));
     assert((std::has_facet<std::codecvt<char32_t, char, std::mbstate_t> >(loc)));
 #if TEST_STD_VER > 17
     assert((std::has_facet<std::codecvt<char16_t, char8_t, std::mbstate_t> >(loc)));
     assert((std::has_facet<std::codecvt<char32_t, char8_t, std::mbstate_t> >(loc)));
 #endif
-    assert((std::has_facet<std::codecvt<wchar_t, char, std::mbstate_t> >(loc)));
-
-    assert((std::has_facet<std::moneypunct<char> >(loc)));
-    assert((std::has_facet<std::moneypunct<wchar_t> >(loc)));
-    assert((std::has_facet<std::money_get<char> >(loc)));
-    assert((std::has_facet<std::money_get<wchar_t> >(loc)));
-    assert((std::has_facet<std::money_put<char> >(loc)));
-    assert((std::has_facet<std::money_put<wchar_t> >(loc)));
-
-    assert((std::has_facet<std::numpunct<char> >(loc)));
-    assert((std::has_facet<std::numpunct<wchar_t> >(loc)));
-    assert((std::has_facet<std::num_get<char> >(loc)));
-    assert((std::has_facet<std::num_get<wchar_t> >(loc)));
-    assert((std::has_facet<std::num_put<char> >(loc)));
-    assert((std::has_facet<std::num_put<wchar_t> >(loc)));
-
-    assert((std::has_facet<std::time_get<char> >(loc)));
-    assert((std::has_facet<std::time_get<wchar_t> >(loc)));
-    assert((std::has_facet<std::time_put<char> >(loc)));
-    assert((std::has_facet<std::time_put<wchar_t> >(loc)));
-
-    assert((std::has_facet<std::messages<char> >(loc)));
-    assert((std::has_facet<std::messages<wchar_t> >(loc)));
 }
 
 struct my_facet

diff  --git a/libcxx/test/std/localization/locales/locale/locale.operators/compare.pass.cpp b/libcxx/test/std/localization/locales/locale/locale.operators/compare.pass.cpp
index f912dc63a2e99..a93aa18224616 100644
--- a/libcxx/test/std/localization/locales/locale/locale.operators/compare.pass.cpp
+++ b/libcxx/test/std/localization/locales/locale/locale.operators/compare.pass.cpp
@@ -29,11 +29,13 @@ int main(int, char**)
             std::string s3("BaaaaaA");
             assert(l(s3, s2));
         }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
         {
             std::wstring s2(L"aaaaaaA");
             std::wstring s3(L"BaaaaaA");
             assert(l(s3, s2));
         }
+#endif
     }
 
   return 0;

diff  --git a/libcxx/test/std/localization/locales/locale/locale.statics/classic.pass.cpp b/libcxx/test/std/localization/locales/locale/locale.statics/classic.pass.cpp
index f32c2432123a2..d7bffbd8c1242 100644
--- a/libcxx/test/std/localization/locales/locale/locale.statics/classic.pass.cpp
+++ b/libcxx/test/std/localization/locales/locale/locale.statics/classic.pass.cpp
@@ -23,43 +23,42 @@
 
 #include "test_macros.h"
 
+template<class CharT>
+void check_for(const std::locale& loc)
+{
+    assert(std::has_facet<std::collate<CharT> >(loc));
+
+    assert(std::has_facet<std::ctype<CharT> >(loc));
+
+    assert((std::has_facet<std::codecvt<CharT, char, std::mbstate_t> >(loc)));
+
+    assert(std::has_facet<std::moneypunct<CharT> >(loc));
+    assert(std::has_facet<std::money_get<CharT> >(loc));
+    assert(std::has_facet<std::money_put<CharT> >(loc));
+
+    assert(std::has_facet<std::numpunct<CharT> >(loc));
+    assert(std::has_facet<std::num_get<CharT> >(loc));
+    assert(std::has_facet<std::num_put<CharT> >(loc));
+
+    assert(std::has_facet<std::time_get<CharT> >(loc));
+    assert(std::has_facet<std::time_put<CharT> >(loc));
+
+    assert(std::has_facet<std::messages<CharT> >(loc));
+}
+
 void check(const std::locale& loc)
 {
-    assert(std::has_facet<std::collate<char> >(loc));
-    assert(std::has_facet<std::collate<wchar_t> >(loc));
+    check_for<char>(loc);
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
+    check_for<wchar_t>(loc);
+#endif
 
-    assert(std::has_facet<std::ctype<char> >(loc));
-    assert(std::has_facet<std::ctype<wchar_t> >(loc));
-    assert((std::has_facet<std::codecvt<char, char, std::mbstate_t> >(loc)));
     assert((std::has_facet<std::codecvt<char16_t, char, std::mbstate_t> >(loc)));
     assert((std::has_facet<std::codecvt<char32_t, char, std::mbstate_t> >(loc)));
 #if TEST_STD_VER > 17
     assert((std::has_facet<std::codecvt<char16_t, char8_t, std::mbstate_t> >(loc)));
     assert((std::has_facet<std::codecvt<char32_t, char8_t, std::mbstate_t> >(loc)));
 #endif
-    assert((std::has_facet<std::codecvt<wchar_t, char, std::mbstate_t> >(loc)));
-
-    assert((std::has_facet<std::moneypunct<char> >(loc)));
-    assert((std::has_facet<std::moneypunct<wchar_t> >(loc)));
-    assert((std::has_facet<std::money_get<char> >(loc)));
-    assert((std::has_facet<std::money_get<wchar_t> >(loc)));
-    assert((std::has_facet<std::money_put<char> >(loc)));
-    assert((std::has_facet<std::money_put<wchar_t> >(loc)));
-
-    assert((std::has_facet<std::numpunct<char> >(loc)));
-    assert((std::has_facet<std::numpunct<wchar_t> >(loc)));
-    assert((std::has_facet<std::num_get<char> >(loc)));
-    assert((std::has_facet<std::num_get<wchar_t> >(loc)));
-    assert((std::has_facet<std::num_put<char> >(loc)));
-    assert((std::has_facet<std::num_put<wchar_t> >(loc)));
-
-    assert((std::has_facet<std::time_get<char> >(loc)));
-    assert((std::has_facet<std::time_get<wchar_t> >(loc)));
-    assert((std::has_facet<std::time_put<char> >(loc)));
-    assert((std::has_facet<std::time_put<wchar_t> >(loc)));
-
-    assert((std::has_facet<std::messages<char> >(loc)));
-    assert((std::has_facet<std::messages<wchar_t> >(loc)));
 }
 
 int main(int, char**)

diff  --git a/libcxx/test/std/localization/locales/locale/locale.statics/global.pass.cpp b/libcxx/test/std/localization/locales/locale/locale.statics/global.pass.cpp
index 458fe0866a1b0..314d4ab9df7e9 100644
--- a/libcxx/test/std/localization/locales/locale/locale.statics/global.pass.cpp
+++ b/libcxx/test/std/localization/locales/locale/locale.statics/global.pass.cpp
@@ -26,43 +26,42 @@
 #include "test_macros.h"
 #include "platform_support.h" // locale name macros
 
+template<class CharT>
+void check_for(const std::locale& loc)
+{
+    assert(std::has_facet<std::collate<CharT> >(loc));
+
+    assert(std::has_facet<std::ctype<CharT> >(loc));
+
+    assert((std::has_facet<std::codecvt<CharT, char, std::mbstate_t> >(loc)));
+
+    assert(std::has_facet<std::moneypunct<CharT> >(loc));
+    assert(std::has_facet<std::money_get<CharT> >(loc));
+    assert(std::has_facet<std::money_put<CharT> >(loc));
+
+    assert(std::has_facet<std::numpunct<CharT> >(loc));
+    assert(std::has_facet<std::num_get<CharT> >(loc));
+    assert(std::has_facet<std::num_put<CharT> >(loc));
+
+    assert(std::has_facet<std::time_get<CharT> >(loc));
+    assert(std::has_facet<std::time_put<CharT> >(loc));
+
+    assert(std::has_facet<std::messages<CharT> >(loc));
+}
+
 void check(const std::locale& loc)
 {
-    assert(std::has_facet<std::collate<char> >(loc));
-    assert(std::has_facet<std::collate<wchar_t> >(loc));
+    check_for<char>(loc);
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
+    check_for<wchar_t>(loc);
+#endif
 
-    assert(std::has_facet<std::ctype<char> >(loc));
-    assert(std::has_facet<std::ctype<wchar_t> >(loc));
-    assert((std::has_facet<std::codecvt<char, char, std::mbstate_t> >(loc)));
     assert((std::has_facet<std::codecvt<char16_t, char, std::mbstate_t> >(loc)));
     assert((std::has_facet<std::codecvt<char32_t, char, std::mbstate_t> >(loc)));
 #if TEST_STD_VER > 17
     assert((std::has_facet<std::codecvt<char16_t, char8_t, std::mbstate_t> >(loc)));
     assert((std::has_facet<std::codecvt<char32_t, char8_t, std::mbstate_t> >(loc)));
 #endif
-    assert((std::has_facet<std::codecvt<wchar_t, char, std::mbstate_t> >(loc)));
-
-    assert((std::has_facet<std::moneypunct<char> >(loc)));
-    assert((std::has_facet<std::moneypunct<wchar_t> >(loc)));
-    assert((std::has_facet<std::money_get<char> >(loc)));
-    assert((std::has_facet<std::money_get<wchar_t> >(loc)));
-    assert((std::has_facet<std::money_put<char> >(loc)));
-    assert((std::has_facet<std::money_put<wchar_t> >(loc)));
-
-    assert((std::has_facet<std::numpunct<char> >(loc)));
-    assert((std::has_facet<std::numpunct<wchar_t> >(loc)));
-    assert((std::has_facet<std::num_get<char> >(loc)));
-    assert((std::has_facet<std::num_get<wchar_t> >(loc)));
-    assert((std::has_facet<std::num_put<char> >(loc)));
-    assert((std::has_facet<std::num_put<wchar_t> >(loc)));
-
-    assert((std::has_facet<std::time_get<char> >(loc)));
-    assert((std::has_facet<std::time_get<wchar_t> >(loc)));
-    assert((std::has_facet<std::time_put<char> >(loc)));
-    assert((std::has_facet<std::time_put<wchar_t> >(loc)));
-
-    assert((std::has_facet<std::messages<char> >(loc)));
-    assert((std::has_facet<std::messages<wchar_t> >(loc)));
 }
 
 int main(int, char**)

diff  --git a/libcxx/test/std/namespace/addressable_functions.sh.cpp b/libcxx/test/std/namespace/addressable_functions.sh.cpp
index de44ba42fb84d..d149a6bb24492 100644
--- a/libcxx/test/std/namespace/addressable_functions.sh.cpp
+++ b/libcxx/test/std/namespace/addressable_functions.sh.cpp
@@ -28,25 +28,32 @@
 #include <string>
 #include <utility>
 
+#include "test_macros.h"
 
 typedef std::ios_base& (FormatFlagFunction)(std::ios_base&);
 typedef std::basic_ostream<char>& (OstreamManipFunction)(std::basic_ostream<char>&);
-typedef std::basic_ostream<wchar_t>& (WOstreamManipFunction)(std::basic_ostream<wchar_t>&);
 typedef std::basic_istream<char>& (IstreamManipFunction)(std::basic_istream<char>&);
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
+typedef std::basic_ostream<wchar_t>& (WOstreamManipFunction)(std::basic_ostream<wchar_t>&);
 typedef std::basic_istream<wchar_t>& (WIstreamManipFunction)(std::basic_istream<wchar_t>&);
+#endif
 
 extern FormatFlagFunction* get_formatflag_tu1(std::string);
 extern FormatFlagFunction* get_formatflag_tu2(std::string);
 
 extern OstreamManipFunction* get_ostreammanip_tu1(std::string);
 extern OstreamManipFunction* get_ostreammanip_tu2(std::string);
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
 extern WOstreamManipFunction* get_wostreammanip_tu1(std::string);
 extern WOstreamManipFunction* get_wostreammanip_tu2(std::string);
+#endif
 
 extern IstreamManipFunction* get_istreammanip_tu1(std::string);
 extern IstreamManipFunction* get_istreammanip_tu2(std::string);
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
 extern WIstreamManipFunction* get_wistreammanip_tu1(std::string);
 extern WIstreamManipFunction* get_wistreammanip_tu2(std::string);
+#endif
 
 #ifdef TU1
 FormatFlagFunction* get_formatflag_tu1(std::string func)
@@ -107,11 +114,12 @@ OstreamManipFunction* get_ostreammanip_tu2(std::string func)
 }
 
 // [ostream.manip] (wchar_t)
-#ifdef TU1
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
+#   ifdef TU1
 WOstreamManipFunction* get_wostreammanip_tu1(std::string func)
-#else
+#   else
 WOstreamManipFunction* get_wostreammanip_tu2(std::string func)
-#endif
+#   endif
 {
     std::map<std::string, WOstreamManipFunction*> all_funcs;
     typedef std::char_traits<wchar_t> Traits;
@@ -120,6 +128,7 @@ WOstreamManipFunction* get_wostreammanip_tu2(std::string func)
     all_funcs.insert(std::make_pair("flush", &std::flush<wchar_t, Traits>));
     return all_funcs.at(func);
 }
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
 
 // [istream.manip] (char)
 #ifdef TU1
@@ -135,18 +144,19 @@ IstreamManipFunction* get_istreammanip_tu2(std::string func)
 }
 
 // [istream.manip] (wchar_t)
-#ifdef TU1
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
+#   ifdef TU1
 WIstreamManipFunction* get_wistreammanip_tu1(std::string func)
-#else
+#   else
 WIstreamManipFunction* get_wistreammanip_tu2(std::string func)
-#endif
+#   endif
 {
     std::map<std::string, WIstreamManipFunction*> all_funcs;
     typedef std::char_traits<wchar_t> Traits;
     all_funcs.insert(std::make_pair("ws", &std::ws<wchar_t, Traits>));
     return all_funcs.at(func);
 }
-
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
 
 #ifdef TU2
     int main(int, char**) {
@@ -179,13 +189,17 @@ WIstreamManipFunction* get_wistreammanip_tu2(std::string func)
         assert(get_ostreammanip_tu1("ends") == get_ostreammanip_tu2("ends"));
         assert(get_ostreammanip_tu1("flush") == get_ostreammanip_tu2("flush"));
 
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
         assert(get_wostreammanip_tu1("endl") == get_wostreammanip_tu2("endl"));
         assert(get_wostreammanip_tu1("ends") == get_wostreammanip_tu2("ends"));
         assert(get_wostreammanip_tu1("flush") == get_wostreammanip_tu2("flush"));
+#endif
 
         assert(get_istreammanip_tu1("ws") == get_istreammanip_tu2("ws"));
 
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
         assert(get_wistreammanip_tu1("ws") == get_wistreammanip_tu2("ws"));
+#endif
 
         return 0;
     }

diff  --git a/libcxx/test/std/ranges/range.utility/range.subrange/ctad.compile.pass.cpp b/libcxx/test/std/ranges/range.utility/range.subrange/ctad.compile.pass.cpp
index 8ab3aa7838dab..a473fbe47d58c 100644
--- a/libcxx/test/std/ranges/range.utility/range.subrange/ctad.compile.pass.cpp
+++ b/libcxx/test/std/ranges/range.utility/range.subrange/ctad.compile.pass.cpp
@@ -27,7 +27,7 @@ static_assert(std::same_as<decltype(std::ranges::subrange(fi, fi)),
 static_assert(std::same_as<decltype(std::ranges::subrange(ptr, ptr, 0)),
                            std::ranges::subrange<int*, int*, std::ranges::subrange_kind::sized>>);
 static_assert(std::same_as<decltype(std::ranges::subrange(ptr, nullptr, 0)),
-                           std::ranges::subrange<int*, nullptr_t, std::ranges::subrange_kind::sized>>);
+                           std::ranges::subrange<int*, std::nullptr_t, std::ranges::subrange_kind::sized>>);
 
 struct ForwardRange {
   forward_iterator<int*> begin() const;

diff  --git a/libcxx/test/std/re/re.alg/re.alg.match/awk.locale.pass.cpp b/libcxx/test/std/re/re.alg/re.alg.match/awk.locale.pass.cpp
index 7588f2d365442..e4ed37d0e23cf 100644
--- a/libcxx/test/std/re/re.alg/re.alg.match/awk.locale.pass.cpp
+++ b/libcxx/test/std/re/re.alg/re.alg.match/awk.locale.pass.cpp
@@ -71,6 +71,8 @@ int main(int, char**)
                                                  std::regex_constants::awk)));
         assert(m.size() == 0);
     }
+
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     std::locale::global(std::locale(LOCALE_cs_CZ_ISO8859_2));
     {
         std::wcmatch m;
@@ -112,5 +114,6 @@ int main(int, char**)
                                                  std::regex_constants::awk)));
         assert(m.size() == 0);
     }
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
     return 0;
 }

diff  --git a/libcxx/test/std/re/re.alg/re.alg.match/awk.pass.cpp b/libcxx/test/std/re/re.alg/re.alg.match/awk.pass.cpp
index b92374dfce683..f3385f4891aa6 100644
--- a/libcxx/test/std/re/re.alg/re.alg.match/awk.pass.cpp
+++ b/libcxx/test/std/re/re.alg/re.alg.match/awk.pass.cpp
@@ -663,6 +663,8 @@ int main(int, char**)
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
+
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::wcmatch m;
         const wchar_t s[] = L"a";
@@ -1303,5 +1305,6 @@ int main(int, char**)
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
     return 0;
 }

diff  --git a/libcxx/test/std/re/re.alg/re.alg.match/basic.locale.pass.cpp b/libcxx/test/std/re/re.alg/re.alg.match/basic.locale.pass.cpp
index 3b9b8e2a83018..f2a8d9a9622e5 100644
--- a/libcxx/test/std/re/re.alg/re.alg.match/basic.locale.pass.cpp
+++ b/libcxx/test/std/re/re.alg/re.alg.match/basic.locale.pass.cpp
@@ -73,6 +73,8 @@ int main(int, char**)
                                                  std::regex_constants::basic)));
         assert(m.size() == 0);
     }
+
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     std::locale::global(std::locale(LOCALE_cs_CZ_ISO8859_2));
     {
         std::wcmatch m;
@@ -114,5 +116,7 @@ int main(int, char**)
                                                  std::regex_constants::basic)));
         assert(m.size() == 0);
     }
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
+
     return 0;
 }

diff  --git a/libcxx/test/std/re/re.alg/re.alg.match/basic.pass.cpp b/libcxx/test/std/re/re.alg/re.alg.match/basic.pass.cpp
index aacf3ec7f1a12..d77349d59ec0f 100644
--- a/libcxx/test/std/re/re.alg/re.alg.match/basic.pass.cpp
+++ b/libcxx/test/std/re/re.alg/re.alg.match/basic.pass.cpp
@@ -650,6 +650,7 @@ int main(int, char**)
         assert(m.str(0) == s);
     }
 
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::wcmatch m;
         assert(!std::regex_match(L"a", m, std::wregex()));
@@ -1276,6 +1277,8 @@ int main(int, char**)
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
+
     { // LWG 2273
         std::regex re("Foo|FooBar");
         std::cmatch m;

diff  --git a/libcxx/test/std/re/re.alg/re.alg.match/ecma.locale.pass.cpp b/libcxx/test/std/re/re.alg/re.alg.match/ecma.locale.pass.cpp
index 26be2069fab5e..330f04a22401d 100644
--- a/libcxx/test/std/re/re.alg/re.alg.match/ecma.locale.pass.cpp
+++ b/libcxx/test/std/re/re.alg/re.alg.match/ecma.locale.pass.cpp
@@ -32,6 +32,47 @@
 
 int main(int, char**)
 {
+    std::locale::global(std::locale(LOCALE_cs_CZ_ISO8859_2));
+    {
+        std::cmatch m;
+        const char s[] = "m";
+        assert(std::regex_match(s, m, std::regex("[a[=M=]z]")));
+        assert(m.size() == 1);
+        assert(!m.prefix().matched);
+        assert(m.prefix().first == s);
+        assert(m.prefix().second == m[0].first);
+        assert(!m.suffix().matched);
+        assert(m.suffix().first == m[0].second);
+        assert(m.suffix().second == m[0].second);
+        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+        assert(m.position(0) == 0);
+        assert(m.str(0) == s);
+    }
+    {
+        std::cmatch m;
+        const char s[] = "Ch";
+        assert(std::regex_match(s, m, std::regex("[a[.ch.]z]",
+                   std::regex_constants::icase)));
+        assert(m.size() == 1);
+        assert(!m.prefix().matched);
+        assert(m.prefix().first == s);
+        assert(m.prefix().second == m[0].first);
+        assert(!m.suffix().matched);
+        assert(m.suffix().first == m[0].second);
+        assert(m.suffix().second == m[0].second);
+        assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
+        assert(m.position(0) == 0);
+        assert(m.str(0) == s);
+    }
+    std::locale::global(std::locale("C"));
+    {
+        std::cmatch m;
+        const char s[] = "m";
+        assert(!std::regex_match(s, m, std::regex("[a[=M=]z]")));
+        assert(m.size() == 0);
+    }
+
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     std::locale::global(std::locale(LOCALE_cs_CZ_ISO8859_2));
     {
         std::wcmatch m;
@@ -71,5 +112,7 @@ int main(int, char**)
         assert(!std::regex_match(s, m, std::wregex(L"[a[=M=]z]")));
         assert(m.size() == 0);
     }
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
+
     return 0;
 }

diff  --git a/libcxx/test/std/re/re.alg/re.alg.match/ecma.pass.cpp b/libcxx/test/std/re/re.alg/re.alg.match/ecma.pass.cpp
index 64be590257fe2..58502aa6e1970 100644
--- a/libcxx/test/std/re/re.alg/re.alg.match/ecma.pass.cpp
+++ b/libcxx/test/std/re/re.alg/re.alg.match/ecma.pass.cpp
@@ -670,6 +670,7 @@ int main(int, char**)
         assert(m.str(0) == s);
     }
 
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::wcmatch m;
         const wchar_t s[] = L"a";
@@ -1304,6 +1305,7 @@ int main(int, char**)
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
 
   return 0;
 }

diff  --git a/libcxx/test/std/re/re.alg/re.alg.match/extended.locale.pass.cpp b/libcxx/test/std/re/re.alg/re.alg.match/extended.locale.pass.cpp
index 5a0dd18c821e2..b314fcda42cda 100644
--- a/libcxx/test/std/re/re.alg/re.alg.match/extended.locale.pass.cpp
+++ b/libcxx/test/std/re/re.alg/re.alg.match/extended.locale.pass.cpp
@@ -73,6 +73,8 @@ int main(int, char**)
                                                  std::regex_constants::extended)));
         assert(m.size() == 0);
     }
+
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     std::locale::global(std::locale(LOCALE_cs_CZ_ISO8859_2));
     {
         std::wcmatch m;
@@ -114,5 +116,7 @@ int main(int, char**)
                                                  std::regex_constants::extended)));
         assert(m.size() == 0);
     }
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
+
     return 0;
 }

diff  --git a/libcxx/test/std/re/re.alg/re.alg.match/extended.pass.cpp b/libcxx/test/std/re/re.alg/re.alg.match/extended.pass.cpp
index e9d44917c8a4e..b3be567d2ab24 100644
--- a/libcxx/test/std/re/re.alg/re.alg.match/extended.pass.cpp
+++ b/libcxx/test/std/re/re.alg/re.alg.match/extended.pass.cpp
@@ -665,6 +665,7 @@ int main(int, char**)
         assert(m.str(0) == s);
     }
 
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::wcmatch m;
         const wchar_t s[] = L"a";
@@ -1307,6 +1308,7 @@ int main(int, char**)
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
 
   return 0;
 }

diff  --git a/libcxx/test/std/re/re.alg/re.alg.search/awk.locale.pass.cpp b/libcxx/test/std/re/re.alg/re.alg.search/awk.locale.pass.cpp
index 275927841c242..8108c2b524834 100644
--- a/libcxx/test/std/re/re.alg/re.alg.search/awk.locale.pass.cpp
+++ b/libcxx/test/std/re/re.alg/re.alg.search/awk.locale.pass.cpp
@@ -73,6 +73,8 @@ int main(int, char**)
                                                  std::regex_constants::awk)));
         assert(m.size() == 0);
     }
+
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     std::locale::global(std::locale(LOCALE_cs_CZ_ISO8859_2));
     {
         std::wcmatch m;
@@ -114,5 +116,7 @@ int main(int, char**)
                                                  std::regex_constants::awk)));
         assert(m.size() == 0);
     }
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
+
     return 0;
 }

diff  --git a/libcxx/test/std/re/re.alg/re.alg.search/awk.pass.cpp b/libcxx/test/std/re/re.alg/re.alg.search/awk.pass.cpp
index e33f583559ff9..741a74f319043 100644
--- a/libcxx/test/std/re/re.alg/re.alg.search/awk.pass.cpp
+++ b/libcxx/test/std/re/re.alg/re.alg.search/awk.pass.cpp
@@ -753,6 +753,8 @@ int main(int, char**)
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
+
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::wcmatch m;
         const wchar_t s[] = L"a";
@@ -1483,6 +1485,7 @@ int main(int, char**)
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
 
   return 0;
 }

diff  --git a/libcxx/test/std/re/re.alg/re.alg.search/basic.locale.pass.cpp b/libcxx/test/std/re/re.alg/re.alg.search/basic.locale.pass.cpp
index 130ef49e81e41..4d1532eebdb78 100644
--- a/libcxx/test/std/re/re.alg/re.alg.search/basic.locale.pass.cpp
+++ b/libcxx/test/std/re/re.alg/re.alg.search/basic.locale.pass.cpp
@@ -73,6 +73,8 @@ int main(int, char**)
                                                  std::regex_constants::basic)));
         assert(m.size() == 0);
     }
+
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     std::locale::global(std::locale(LOCALE_cs_CZ_ISO8859_2));
     {
         std::wcmatch m;
@@ -114,5 +116,7 @@ int main(int, char**)
                                                  std::regex_constants::basic)));
         assert(m.size() == 0);
     }
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
+
     return 0;
 }

diff  --git a/libcxx/test/std/re/re.alg/re.alg.search/basic.pass.cpp b/libcxx/test/std/re/re.alg/re.alg.search/basic.pass.cpp
index 0ea290e2b78f1..287ca9999b48c 100644
--- a/libcxx/test/std/re/re.alg/re.alg.search/basic.pass.cpp
+++ b/libcxx/test/std/re/re.alg/re.alg.search/basic.pass.cpp
@@ -740,6 +740,7 @@ int main(int, char**)
         assert(m.str(0) == s);
     }
 
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::wcmatch m;
         assert(!std::regex_search(L"a", m, std::wregex()));
@@ -1456,6 +1457,8 @@ int main(int, char**)
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
+
     { // LWG 2273
         std::regex re("Foo|FooBar");
         std::cmatch m;

diff  --git a/libcxx/test/std/re/re.alg/re.alg.search/ecma.locale.pass.cpp b/libcxx/test/std/re/re.alg/re.alg.search/ecma.locale.pass.cpp
index e97c4df3473ff..3da1e58cbfe49 100644
--- a/libcxx/test/std/re/re.alg/re.alg.search/ecma.locale.pass.cpp
+++ b/libcxx/test/std/re/re.alg/re.alg.search/ecma.locale.pass.cpp
@@ -71,6 +71,8 @@ int main(int, char**)
         assert(!std::regex_search(s, m, std::regex("[a[=M=]z]")));
         assert(m.size() == 0);
     }
+
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     std::locale::global(std::locale(LOCALE_cs_CZ_ISO8859_2));
     {
         std::wcmatch m;
@@ -110,5 +112,7 @@ int main(int, char**)
         assert(!std::regex_search(s, m, std::wregex(L"[a[=M=]z]")));
         assert(m.size() == 0);
     }
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
+
     return 0;
 }

diff  --git a/libcxx/test/std/re/re.alg/re.alg.search/ecma.pass.cpp b/libcxx/test/std/re/re.alg/re.alg.search/ecma.pass.cpp
index 57f71824961fa..00977d398dee3 100644
--- a/libcxx/test/std/re/re.alg/re.alg.search/ecma.pass.cpp
+++ b/libcxx/test/std/re/re.alg/re.alg.search/ecma.pass.cpp
@@ -763,6 +763,7 @@ int main(int, char**)
         assert(m.str(0) == s);
     }
 
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::wcmatch m;
         const wchar_t s[] = L"a";
@@ -1502,6 +1503,7 @@ int main(int, char**)
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
 
   return 0;
 }

diff  --git a/libcxx/test/std/re/re.alg/re.alg.search/extended.locale.pass.cpp b/libcxx/test/std/re/re.alg/re.alg.search/extended.locale.pass.cpp
index 8902d06183b16..2030602fad526 100644
--- a/libcxx/test/std/re/re.alg/re.alg.search/extended.locale.pass.cpp
+++ b/libcxx/test/std/re/re.alg/re.alg.search/extended.locale.pass.cpp
@@ -73,6 +73,8 @@ int main(int, char**)
                                                  std::regex_constants::extended)));
         assert(m.size() == 0);
     }
+
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     std::locale::global(std::locale(LOCALE_cs_CZ_ISO8859_2));
     {
         std::wcmatch m;
@@ -114,5 +116,7 @@ int main(int, char**)
                                                  std::regex_constants::extended)));
         assert(m.size() == 0);
     }
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
+
     return 0;
 }

diff  --git a/libcxx/test/std/re/re.alg/re.alg.search/extended.pass.cpp b/libcxx/test/std/re/re.alg/re.alg.search/extended.pass.cpp
index b5b7718d57683..8ffedfcb263eb 100644
--- a/libcxx/test/std/re/re.alg/re.alg.search/extended.pass.cpp
+++ b/libcxx/test/std/re/re.alg/re.alg.search/extended.pass.cpp
@@ -756,6 +756,7 @@ int main(int, char**)
         assert(m.str(0) == s);
     }
 
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::wcmatch m;
         const wchar_t s[] = L"a";
@@ -1488,6 +1489,7 @@ int main(int, char**)
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
 
   return 0;
 }

diff  --git a/libcxx/test/std/re/re.iter/re.regiter/re.regiter.cnstr/default.pass.cpp b/libcxx/test/std/re/re.iter/re.regiter/re.regiter.cnstr/default.pass.cpp
index 75bd9cab5f21f..52b33097ae9b9 100644
--- a/libcxx/test/std/re/re.iter/re.regiter/re.regiter.cnstr/default.pass.cpp
+++ b/libcxx/test/std/re/re.iter/re.regiter/re.regiter.cnstr/default.pass.cpp
@@ -28,7 +28,9 @@ test()
 int main(int, char**)
 {
     test<char>();
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     test<wchar_t>();
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/re/re.iter/re.regiter/types.pass.cpp b/libcxx/test/std/re/re.iter/re.regiter/types.pass.cpp
index b96fec78a3c05..7d30b0adcc234 100644
--- a/libcxx/test/std/re/re.iter/re.regiter/types.pass.cpp
+++ b/libcxx/test/std/re/re.iter/re.regiter/types.pass.cpp
@@ -41,7 +41,9 @@ test()
 int main(int, char**)
 {
     test<char>();
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     test<wchar_t>();
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/re/re.regex/re.regex.construct/deduct.pass.cpp b/libcxx/test/std/re/re.regex/re.regex.construct/deduct.pass.cpp
index feabcfc588f14..db4fba0e2495a 100644
--- a/libcxx/test/std/re/re.regex/re.regex.construct/deduct.pass.cpp
+++ b/libcxx/test/std/re/re.regex/re.regex.construct/deduct.pass.cpp
@@ -42,6 +42,7 @@ int main(int, char**)
     assert(re.mark_count() == 0);
     }
 
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
     std::wstring s1(L"\\(a\\)");
     std::basic_regex re(s1.begin(), s1.end(), std::regex_constants::basic);
@@ -50,6 +51,7 @@ int main(int, char**)
     assert(re.flags() == std::regex_constants::basic);
     assert(re.mark_count() == 1);
     }
+#endif
 
 //  Test the implicit deduction guides
     {
@@ -60,6 +62,7 @@ int main(int, char**)
     assert(re.mark_count() == 2);
     }
 
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
 //  basic_regex(string, flag_type);
     std::basic_regex re(L"(a([bc]))"s, std::regex_constants::awk);
@@ -67,6 +70,7 @@ int main(int, char**)
     assert(re.flags() == std::regex_constants::awk);
     assert(re.mark_count() == 2);
     }
+#endif
 
     {
 //  basic_regex(const charT*);
@@ -76,6 +80,7 @@ int main(int, char**)
     assert(re.mark_count() == 0);
     }
 
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
 //  basic_regex(const charT*, flag_type);
     std::basic_regex re(L"ABCDE", std::regex_constants::grep);
@@ -83,6 +88,7 @@ int main(int, char**)
     assert(re.flags() == std::regex_constants::grep);
     assert(re.mark_count() == 0);
     }
+#endif
 
     {
 //  basic_regex(const charT*, size_t);
@@ -92,6 +98,7 @@ int main(int, char**)
     assert(re.mark_count() == 0);
     }
 
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
 //  basic_regex(const charT*, size_t, flag_type);
     std::basic_regex re(L"ABCDEDEF", 8, std::regex_constants::awk);
@@ -99,6 +106,7 @@ int main(int, char**)
     assert(re.flags() == std::regex_constants::awk);
     assert(re.mark_count() == 0);
     }
+#endif
 
     {
 //  basic_regex(const basic_regex &);
@@ -123,6 +131,7 @@ int main(int, char**)
     assert(re.mark_count() == 0);
     }
 
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
 //  basic_regex(initializer_list, flag_type);
     std::basic_regex re({L'A', L'B', L'F', L'E', L'D'}, std::regex_constants::grep);
@@ -130,6 +139,7 @@ int main(int, char**)
     assert(re.flags() == std::regex_constants::grep);
     assert(re.mark_count() == 0);
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/re/re.regex/re.regex.construct/default.pass.cpp b/libcxx/test/std/re/re.regex/re.regex.construct/default.pass.cpp
index 9705d7040ba72..f0abdbfb98b54 100644
--- a/libcxx/test/std/re/re.regex/re.regex.construct/default.pass.cpp
+++ b/libcxx/test/std/re/re.regex/re.regex.construct/default.pass.cpp
@@ -28,7 +28,9 @@ test()
 int main(int, char**)
 {
     test<char>();
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     test<wchar_t>();
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/re/re.results/re.results.all/get_allocator.pass.cpp b/libcxx/test/std/re/re.results/re.results.all/get_allocator.pass.cpp
index 33b5970d88b54..84ef708c29681 100644
--- a/libcxx/test/std/re/re.results/re.results.all/get_allocator.pass.cpp
+++ b/libcxx/test/std/re/re.results/re.results.all/get_allocator.pass.cpp
@@ -31,7 +31,9 @@ test(const Allocator& a)
 int main(int, char**)
 {
     test<char>(test_allocator<std::sub_match<const char*> >(3));
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     test<wchar_t>(test_allocator<std::sub_match<const wchar_t*> >(3));
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/re/re.results/re.results.const/allocator.pass.cpp b/libcxx/test/std/re/re.results/re.results.const/allocator.pass.cpp
index 659954607cae5..5d152c4a8e048 100644
--- a/libcxx/test/std/re/re.results/re.results.const/allocator.pass.cpp
+++ b/libcxx/test/std/re/re.results/re.results.const/allocator.pass.cpp
@@ -31,7 +31,9 @@ test(const Allocator& a)
 int main(int, char**)
 {
     test<char>(test_allocator<std::sub_match<const char*> >(3));
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     test<wchar_t>(test_allocator<std::sub_match<const wchar_t*> >(3));
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/re/re.results/re.results.const/copy.pass.cpp b/libcxx/test/std/re/re.results/re.results.const/copy.pass.cpp
index 88b8093449e93..be9585edc7778 100644
--- a/libcxx/test/std/re/re.results/re.results.const/copy.pass.cpp
+++ b/libcxx/test/std/re/re.results/re.results.const/copy.pass.cpp
@@ -33,10 +33,14 @@ test(const Allocator& a)
 int main(int, char**)
 {
     test<char>   (std::allocator<std::sub_match<const char *> >());
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     test<wchar_t>(std::allocator<std::sub_match<const wchar_t *> >());
+#endif
 
     test<char>   (test_allocator<std::sub_match<const char*> >(3));
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     test<wchar_t>(test_allocator<std::sub_match<const wchar_t*> >(3));
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/re/re.results/re.results.const/copy_assign.pass.cpp b/libcxx/test/std/re/re.results/re.results.const/copy_assign.pass.cpp
index 1b220dfb89931..33dbeb9e556f7 100644
--- a/libcxx/test/std/re/re.results/re.results.const/copy_assign.pass.cpp
+++ b/libcxx/test/std/re/re.results/re.results.const/copy_assign.pass.cpp
@@ -37,15 +37,21 @@ test(const Allocator& a)
 int main(int, char**)
 {
     test<char>   (std::allocator<std::sub_match<const char *> >());
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     test<wchar_t>(std::allocator<std::sub_match<const wchar_t *> >());
+#endif
 
-//  test_allocator has POCCA -> false
+    // test_allocator has POCCA -> false
     test<char>   (test_allocator<std::sub_match<const char*> >(3));
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     test<wchar_t>(test_allocator<std::sub_match<const wchar_t*> >(3));
+#endif
 
-//  other_allocator has POCCA -> true
+    // other_allocator has POCCA -> true
     test<char>   (other_allocator<std::sub_match<const char*> >(3));
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     test<wchar_t>(other_allocator<std::sub_match<const wchar_t*> >(3));
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/re/re.results/re.results.const/default.pass.cpp b/libcxx/test/std/re/re.results/re.results.const/default.pass.cpp
index 52a7282c6e769..bcb2462610ee1 100644
--- a/libcxx/test/std/re/re.results/re.results.const/default.pass.cpp
+++ b/libcxx/test/std/re/re.results/re.results.const/default.pass.cpp
@@ -46,7 +46,9 @@ test()
 int main(int, char**)
 {
     test<char>();
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     test<wchar_t>();
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/re/re.results/re.results.const/move.pass.cpp b/libcxx/test/std/re/re.results/re.results.const/move.pass.cpp
index e960cc654a6a9..82f2b3e655310 100644
--- a/libcxx/test/std/re/re.results/re.results.const/move.pass.cpp
+++ b/libcxx/test/std/re/re.results/re.results.const/move.pass.cpp
@@ -38,12 +38,16 @@ test(const Allocator& a)
 int main(int, char**)
 {
     test<char>   (std::allocator<std::sub_match<const char *> >());
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     test<wchar_t>(std::allocator<std::sub_match<const wchar_t *> >());
+#endif
 
     test<char>   (test_allocator<std::sub_match<const char*> >(3));
     assert(test_alloc_base::moved == 1);
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     test<wchar_t>(test_allocator<std::sub_match<const wchar_t*> >(3));
     assert(test_alloc_base::moved == 2);
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/re/re.results/re.results.const/move_assign.pass.cpp b/libcxx/test/std/re/re.results/re.results.const/move_assign.pass.cpp
index 42393f1d2c8e1..a8c269db70b75 100644
--- a/libcxx/test/std/re/re.results/re.results.const/move_assign.pass.cpp
+++ b/libcxx/test/std/re/re.results/re.results.const/move_assign.pass.cpp
@@ -38,15 +38,21 @@ test(const Allocator& a)
 int main(int, char**)
 {
     test<char>   (std::allocator<std::sub_match<const char *> >());
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     test<wchar_t>(std::allocator<std::sub_match<const wchar_t *> >());
+#endif
 
-//  test_allocator has POCMA -> false
+    // test_allocator has POCMA -> false
     test<char>   (test_allocator<std::sub_match<const char*> >(3));
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     test<wchar_t>(test_allocator<std::sub_match<const wchar_t*> >(3));
+#endif
 
-//  other_allocator has POCMA -> true
+    // other_allocator has POCMA -> true
     test<char>   (other_allocator<std::sub_match<const char*> >(3));
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     test<wchar_t>(other_allocator<std::sub_match<const wchar_t*> >(3));
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/re/re.results/re.results.form/form1.pass.cpp b/libcxx/test/std/re/re.results/re.results.form/form1.pass.cpp
index f435de8276bb7..4bf888dbc8c1e 100644
--- a/libcxx/test/std/re/re.results/re.results.form/form1.pass.cpp
+++ b/libcxx/test/std/re/re.results/re.results.form/form1.pass.cpp
@@ -114,6 +114,7 @@ int main(int, char**)
         assert(std::string(out) == "match: cdefghi, m[1]: , m[2]: ");
     }
 
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::match_results<const wchar_t*> m;
         const wchar_t s[] = L"abcdefghijk";
@@ -152,6 +153,7 @@ int main(int, char**)
         assert(r == out + 34);
         assert(std::wstring(out) == L"match: cdefghi, m[1]: efg, m[2]: e");
     }
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
 
   return 0;
 }

diff  --git a/libcxx/test/std/re/re.results/re.results.form/form2.pass.cpp b/libcxx/test/std/re/re.results/re.results.form/form2.pass.cpp
index fc0c0ad0afe80..91b7137706e5c 100644
--- a/libcxx/test/std/re/re.results/re.results.form/form2.pass.cpp
+++ b/libcxx/test/std/re/re.results/re.results.form/form2.pass.cpp
@@ -25,7 +25,6 @@
 int main(int, char**)
 {
     typedef std::basic_string<char, std::char_traits<char>, test_allocator<char> > nstr;
-    typedef std::basic_string<wchar_t, std::char_traits<wchar_t>, test_allocator<wchar_t> > wstr;
     {
         std::match_results<const char*> m;
         const char s[] = "abcdefghijk";
@@ -62,6 +61,8 @@ int main(int, char**)
         assert(std::string(out) == "match: cdefghi, m[1]: efg, m[2]: e");
     }
 
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
+    typedef std::basic_string<wchar_t, std::char_traits<wchar_t>, test_allocator<wchar_t> > wstr;
     {
         std::match_results<const wchar_t*> m;
         const wchar_t s[] = L"abcdefghijk";
@@ -97,6 +98,7 @@ int main(int, char**)
         assert(r == out + 34);
         assert(std::wstring(out) == L"match: cdefghi, m[1]: efg, m[2]: e");
     }
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
 
   return 0;
 }

diff  --git a/libcxx/test/std/re/re.results/re.results.form/form3.pass.cpp b/libcxx/test/std/re/re.results/re.results.form/form3.pass.cpp
index 67bd66a24c339..384cf177b13cb 100644
--- a/libcxx/test/std/re/re.results/re.results.form/form3.pass.cpp
+++ b/libcxx/test/std/re/re.results/re.results.form/form3.pass.cpp
@@ -24,7 +24,6 @@
 int main(int, char**)
 {
     typedef std::basic_string<char, std::char_traits<char>, test_allocator<char> > nstr;
-    typedef std::basic_string<wchar_t, std::char_traits<wchar_t>, test_allocator<wchar_t> > wstr;
     {
         std::match_results<const char*> m;
         const char s[] = "abcdefghijk";
@@ -53,6 +52,8 @@ int main(int, char**)
         assert(out == "match: cdefghi, m[1]: efg, m[2]: e");
     }
 
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
+    typedef std::basic_string<wchar_t, std::char_traits<wchar_t>, test_allocator<wchar_t> > wstr;
     {
         std::match_results<const wchar_t*> m;
         const wchar_t s[] = L"abcdefghijk";
@@ -80,6 +81,7 @@ int main(int, char**)
         wstr out = m.format(fmt, std::regex_constants::format_sed);
         assert(out == L"match: cdefghi, m[1]: efg, m[2]: e");
     }
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
 
   return 0;
 }

diff  --git a/libcxx/test/std/re/re.results/re.results.form/form4.pass.cpp b/libcxx/test/std/re/re.results/re.results.form/form4.pass.cpp
index 69152f74fa262..7bd25d98b2ba6 100644
--- a/libcxx/test/std/re/re.results/re.results.form/form4.pass.cpp
+++ b/libcxx/test/std/re/re.results/re.results.form/form4.pass.cpp
@@ -48,6 +48,7 @@ int main(int, char**)
         assert(out == "match: cdefghi, m[1]: efg, m[2]: e");
     }
 
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::match_results<const wchar_t*> m;
         const wchar_t s[] = L"abcdefghijk";
@@ -75,6 +76,7 @@ int main(int, char**)
         std::wstring out = m.format(fmt, std::regex_constants::format_sed);
         assert(out == L"match: cdefghi, m[1]: efg, m[2]: e");
     }
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
 
   return 0;
 }

diff  --git a/libcxx/test/std/re/re.submatch/re.submatch.members/compare_string_type.pass.cpp b/libcxx/test/std/re/re.submatch/re.submatch.members/compare_string_type.pass.cpp
index 6b57a193aeda4..31f273749afdd 100644
--- a/libcxx/test/std/re/re.submatch/re.submatch.members/compare_string_type.pass.cpp
+++ b/libcxx/test/std/re/re.submatch/re.submatch.members/compare_string_type.pass.cpp
@@ -31,6 +31,7 @@ int main(int, char**)
         assert(sm.compare(string()) > 0);
         assert(sm.compare(string("123")) == 0);
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         typedef wchar_t CharT;
         typedef std::sub_match<const CharT*> SM;
@@ -44,6 +45,7 @@ int main(int, char**)
         assert(sm.compare(string()) > 0);
         assert(sm.compare(string(L"123")) == 0);
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/re/re.submatch/re.submatch.members/compare_sub_match.pass.cpp b/libcxx/test/std/re/re.submatch/re.submatch.members/compare_sub_match.pass.cpp
index 6d0976bbf2164..fbd21e32195a0 100644
--- a/libcxx/test/std/re/re.submatch/re.submatch.members/compare_sub_match.pass.cpp
+++ b/libcxx/test/std/re/re.submatch/re.submatch.members/compare_sub_match.pass.cpp
@@ -34,6 +34,7 @@ int main(int, char**)
         sm2.matched = true;
         assert(sm.compare(sm2) == 0);
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         typedef wchar_t CharT;
         typedef std::sub_match<const CharT*> SM;
@@ -50,6 +51,7 @@ int main(int, char**)
         sm2.matched = true;
         assert(sm.compare(sm2) == 0);
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/re/re.submatch/re.submatch.members/compare_value_type_ptr.pass.cpp b/libcxx/test/std/re/re.submatch/re.submatch.members/compare_value_type_ptr.pass.cpp
index 42e6ab94a1726..b213a51323d6f 100644
--- a/libcxx/test/std/re/re.submatch/re.submatch.members/compare_value_type_ptr.pass.cpp
+++ b/libcxx/test/std/re/re.submatch/re.submatch.members/compare_value_type_ptr.pass.cpp
@@ -30,6 +30,7 @@ int main(int, char**)
         assert(sm.compare("") > 0);
         assert(sm.compare("123") == 0);
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         typedef wchar_t CharT;
         typedef std::sub_match<const CharT*> SM;
@@ -42,6 +43,7 @@ int main(int, char**)
         assert(sm.compare(L"") > 0);
         assert(sm.compare(L"123") == 0);
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/re/re.submatch/re.submatch.members/default.pass.cpp b/libcxx/test/std/re/re.submatch/re.submatch.members/default.pass.cpp
index c34591f228430..c828f4942be50 100644
--- a/libcxx/test/std/re/re.submatch/re.submatch.members/default.pass.cpp
+++ b/libcxx/test/std/re/re.submatch/re.submatch.members/default.pass.cpp
@@ -24,12 +24,14 @@ int main(int, char**)
         SM sm;
         assert(sm.matched == false);
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         typedef wchar_t CharT;
         typedef std::sub_match<const CharT*> SM;
         SM sm;
         assert(sm.matched == false);
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/re/re.submatch/re.submatch.members/length.pass.cpp b/libcxx/test/std/re/re.submatch/re.submatch.members/length.pass.cpp
index 5246eb3511bae..1027bd775a27a 100644
--- a/libcxx/test/std/re/re.submatch/re.submatch.members/length.pass.cpp
+++ b/libcxx/test/std/re/re.submatch/re.submatch.members/length.pass.cpp
@@ -29,6 +29,7 @@ int main(int, char**)
         sm.matched = true;
         assert(sm.length() == 3);
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         typedef wchar_t CharT;
         typedef std::sub_match<const CharT*> SM;
@@ -40,6 +41,7 @@ int main(int, char**)
         sm.matched = true;
         assert(sm.length() == 3);
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/re/re.submatch/re.submatch.members/operator_string.pass.cpp b/libcxx/test/std/re/re.submatch/re.submatch.members/operator_string.pass.cpp
index 051ecc3e873d3..08a9dbfbadd8d 100644
--- a/libcxx/test/std/re/re.submatch/re.submatch.members/operator_string.pass.cpp
+++ b/libcxx/test/std/re/re.submatch/re.submatch.members/operator_string.pass.cpp
@@ -31,6 +31,7 @@ int main(int, char**)
         str = sm;
         assert(str == std::string("123"));
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         typedef wchar_t CharT;
         typedef std::sub_match<const CharT*> SM;
@@ -44,6 +45,7 @@ int main(int, char**)
         str = sm;
         assert(str == std::wstring(L"123"));
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/re/re.submatch/re.submatch.members/str.pass.cpp b/libcxx/test/std/re/re.submatch/re.submatch.members/str.pass.cpp
index af39ee9c30fc9..ffdcbaabb44f7 100644
--- a/libcxx/test/std/re/re.submatch/re.submatch.members/str.pass.cpp
+++ b/libcxx/test/std/re/re.submatch/re.submatch.members/str.pass.cpp
@@ -31,6 +31,7 @@ int main(int, char**)
         str = sm.str();
         assert(str == std::string("123"));
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         typedef wchar_t CharT;
         typedef std::sub_match<const CharT*> SM;
@@ -44,6 +45,7 @@ int main(int, char**)
         str = sm.str();
         assert(str == std::wstring(L"123"));
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/re/re.submatch/re.submatch.op/compare.pass.cpp b/libcxx/test/std/re/re.submatch/re.submatch.op/compare.pass.cpp
index e332a8379837e..be072b1b8b307 100644
--- a/libcxx/test/std/re/re.submatch/re.submatch.op/compare.pass.cpp
+++ b/libcxx/test/std/re/re.submatch/re.submatch.op/compare.pass.cpp
@@ -280,10 +280,12 @@ int main(int, char**)
 {
     test(std::string("123"), std::string("123"));
     test(std::string("1234"), std::string("123"));
+    test(std::string("123\000" "56", 6), std::string("123\000" "56", 6), false);
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     test(std::wstring(L"123"), std::wstring(L"123"));
     test(std::wstring(L"1234"), std::wstring(L"123"));
-    test(std::string("123\000" "56", 6), std::string("123\000" "56", 6), false);
     test(std::wstring(L"123\000" L"56", 6), std::wstring(L"123\000" L"56", 6), false);
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/re/re.submatch/re.submatch.op/stream.pass.cpp b/libcxx/test/std/re/re.submatch/re.submatch.op/stream.pass.cpp
index 070266d9e58a2..244d78d120f35 100644
--- a/libcxx/test/std/re/re.submatch/re.submatch.op/stream.pass.cpp
+++ b/libcxx/test/std/re/re.submatch/re.submatch.op/stream.pass.cpp
@@ -38,7 +38,9 @@ test(const std::basic_string<CharT>& s)
 int main(int, char**)
 {
     test(std::string("123"));
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     test(std::wstring(L"123"));
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/re/re.submatch/types.pass.cpp b/libcxx/test/std/re/re.submatch/types.pass.cpp
index 831eec1da05bf..3c23d72eb9aa7 100644
--- a/libcxx/test/std/re/re.submatch/types.pass.cpp
+++ b/libcxx/test/std/re/re.submatch/types.pass.cpp
@@ -37,11 +37,16 @@ int main(int, char**)
         static_assert((std::is_same<SM::string_type, std::string>::value), "");
         static_assert((std::is_convertible<SM*, std::pair<char*, char*>*>::value), "");
 
+        static_assert((std::is_same<std::csub_match, std::sub_match<const char*> >::value), "");
+        static_assert((std::is_same<std::ssub_match, std::sub_match<std::string::const_iterator> >::value), "");
+
         SM sm;
         sm.first = nullptr;
         sm.second = nullptr;
         sm.matched = false;
     }
+
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         typedef std::sub_match<wchar_t*> SM;
         static_assert((std::is_same<SM::iterator, wchar_t*>::value), "");
@@ -50,17 +55,15 @@ int main(int, char**)
         static_assert((std::is_same<SM::string_type, std::wstring>::value), "");
         static_assert((std::is_convertible<SM*, std::pair<wchar_t*, wchar_t*>*>::value), "");
 
+        static_assert((std::is_same<std::wcsub_match, std::sub_match<const wchar_t*> >::value), "");
+        static_assert((std::is_same<std::wssub_match, std::sub_match<std::wstring::const_iterator> >::value), "");
+
         SM sm;
         sm.first = nullptr;
         sm.second = nullptr;
         sm.matched = false;
     }
-    {
-        static_assert((std::is_same<std::csub_match, std::sub_match<const char*> >::value), "");
-        static_assert((std::is_same<std::wcsub_match, std::sub_match<const wchar_t*> >::value), "");
-        static_assert((std::is_same<std::ssub_match, std::sub_match<std::string::const_iterator> >::value), "");
-        static_assert((std::is_same<std::wssub_match, std::sub_match<std::wstring::const_iterator> >::value), "");
-    }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/re/re.syn/wcmatch.pass.cpp b/libcxx/test/std/re/re.syn/wcmatch.pass.cpp
index f373e57ac465a..3f35901cb4a39 100644
--- a/libcxx/test/std/re/re.syn/wcmatch.pass.cpp
+++ b/libcxx/test/std/re/re.syn/wcmatch.pass.cpp
@@ -10,6 +10,8 @@
 
 // typedef match_results<const wchar_t*>   wcmatch;
 
+// XFAIL: libcpp-has-no-wide-characters
+
 #include <regex>
 #include <type_traits>
 #include "test_macros.h"

diff  --git a/libcxx/test/std/re/re.syn/wcregex_iterator.pass.cpp b/libcxx/test/std/re/re.syn/wcregex_iterator.pass.cpp
index 3425c98fe8c3e..78d354c21421c 100644
--- a/libcxx/test/std/re/re.syn/wcregex_iterator.pass.cpp
+++ b/libcxx/test/std/re/re.syn/wcregex_iterator.pass.cpp
@@ -10,6 +10,8 @@
 
 // typedef regex_iterator<const wchar_t*>   wcregex_iterator;
 
+// XFAIL: libcpp-has-no-wide-characters
+
 #include <regex>
 #include <type_traits>
 #include "test_macros.h"

diff  --git a/libcxx/test/std/re/re.syn/wcregex_token_iterator.pass.cpp b/libcxx/test/std/re/re.syn/wcregex_token_iterator.pass.cpp
index 217653837e0ae..2f88b895455cb 100644
--- a/libcxx/test/std/re/re.syn/wcregex_token_iterator.pass.cpp
+++ b/libcxx/test/std/re/re.syn/wcregex_token_iterator.pass.cpp
@@ -10,6 +10,8 @@
 
 // typedef regex_token_iterator<const wchar_t*>   wcregex_token_iterator;
 
+// XFAIL: libcpp-has-no-wide-characters
+
 #include <regex>
 #include <type_traits>
 #include "test_macros.h"

diff  --git a/libcxx/test/std/re/re.syn/wcsub_match.pass.cpp b/libcxx/test/std/re/re.syn/wcsub_match.pass.cpp
index 86a2103b8bd55..0b71ee71a4b33 100644
--- a/libcxx/test/std/re/re.syn/wcsub_match.pass.cpp
+++ b/libcxx/test/std/re/re.syn/wcsub_match.pass.cpp
@@ -10,6 +10,8 @@
 
 // typedef sub_match<const wchar_t*>   wcsub_match;
 
+// XFAIL: libcpp-has-no-wide-characters
+
 #include <regex>
 #include <type_traits>
 #include "test_macros.h"

diff  --git a/libcxx/test/std/re/re.syn/wregex.pass.cpp b/libcxx/test/std/re/re.syn/wregex.pass.cpp
index 5be6f6fb59ec8..15df351c42e18 100644
--- a/libcxx/test/std/re/re.syn/wregex.pass.cpp
+++ b/libcxx/test/std/re/re.syn/wregex.pass.cpp
@@ -10,6 +10,8 @@
 
 // typedef basic_regex<wchar_t> wregex;
 
+// XFAIL: libcpp-has-no-wide-characters
+
 #include <regex>
 #include <type_traits>
 #include "test_macros.h"

diff  --git a/libcxx/test/std/re/re.syn/wsmatch.pass.cpp b/libcxx/test/std/re/re.syn/wsmatch.pass.cpp
index 760057e6a7458..5518a5c2a26ad 100644
--- a/libcxx/test/std/re/re.syn/wsmatch.pass.cpp
+++ b/libcxx/test/std/re/re.syn/wsmatch.pass.cpp
@@ -10,6 +10,8 @@
 
 // typedef match_results<wstring::const_iterator>   wsmatch;
 
+// XFAIL: libcpp-has-no-wide-characters
+
 #include <regex>
 #include <type_traits>
 #include "test_macros.h"

diff  --git a/libcxx/test/std/re/re.syn/wsregex_iterator.pass.cpp b/libcxx/test/std/re/re.syn/wsregex_iterator.pass.cpp
index b1d7edf87702e..461b1471d9fd5 100644
--- a/libcxx/test/std/re/re.syn/wsregex_iterator.pass.cpp
+++ b/libcxx/test/std/re/re.syn/wsregex_iterator.pass.cpp
@@ -10,6 +10,8 @@
 
 // typedef regex_iterator<wstring::const_iterator>   wsregex_iterator;
 
+// XFAIL: libcpp-has-no-wide-characters
+
 #include <regex>
 #include <type_traits>
 #include "test_macros.h"

diff  --git a/libcxx/test/std/re/re.syn/wsregex_token_iterator.pass.cpp b/libcxx/test/std/re/re.syn/wsregex_token_iterator.pass.cpp
index 58454a59e938a..520671c723fe7 100644
--- a/libcxx/test/std/re/re.syn/wsregex_token_iterator.pass.cpp
+++ b/libcxx/test/std/re/re.syn/wsregex_token_iterator.pass.cpp
@@ -10,6 +10,8 @@
 
 // typedef regex_token_iterator<wstring::const_iterator>   wsregex_token_iterator;
 
+// XFAIL: libcpp-has-no-wide-characters
+
 #include <regex>
 #include <type_traits>
 #include "test_macros.h"

diff  --git a/libcxx/test/std/re/re.syn/wssub_match.pass.cpp b/libcxx/test/std/re/re.syn/wssub_match.pass.cpp
index 7ca6dc7734c5d..cf53f2888d140 100644
--- a/libcxx/test/std/re/re.syn/wssub_match.pass.cpp
+++ b/libcxx/test/std/re/re.syn/wssub_match.pass.cpp
@@ -10,6 +10,8 @@
 
 // typedef sub_match<wstring::const_iterator>   wssub_match;
 
+// XFAIL: libcpp-has-no-wide-characters
+
 #include <regex>
 #include <type_traits>
 #include "test_macros.h"

diff  --git a/libcxx/test/std/re/re.traits/default.pass.cpp b/libcxx/test/std/re/re.traits/default.pass.cpp
index 432de84455fa4..ff817cb56f2c8 100644
--- a/libcxx/test/std/re/re.traits/default.pass.cpp
+++ b/libcxx/test/std/re/re.traits/default.pass.cpp
@@ -23,18 +23,27 @@
 int main(int, char**)
 {
     {
-        std::regex_traits<char> t1;
-        assert(t1.getloc().name() == "C");
-        std::regex_traits<wchar_t> t2;
-        assert(t2.getloc().name() == "C");
+        std::regex_traits<char> t;
+        assert(t.getloc().name() == "C");
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
+    {
+        std::regex_traits<wchar_t> t;
+        assert(t.getloc().name() == "C");
+    }
+#endif
+    {
+        std::locale::global(std::locale(LOCALE_en_US_UTF_8));
+        std::regex_traits<char> t;
+        assert(t.getloc().name() == LOCALE_en_US_UTF_8);
+    }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::locale::global(std::locale(LOCALE_en_US_UTF_8));
-        std::regex_traits<char> t1;
-        assert(t1.getloc().name() == LOCALE_en_US_UTF_8);
-        std::regex_traits<wchar_t> t2;
-        assert(t2.getloc().name() == LOCALE_en_US_UTF_8);
+        std::regex_traits<wchar_t> t;
+        assert(t.getloc().name() == LOCALE_en_US_UTF_8);
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/re/re.traits/getloc.pass.cpp b/libcxx/test/std/re/re.traits/getloc.pass.cpp
index dbc35dec39aa3..55820cc0cc611 100644
--- a/libcxx/test/std/re/re.traits/getloc.pass.cpp
+++ b/libcxx/test/std/re/re.traits/getloc.pass.cpp
@@ -23,18 +23,27 @@
 int main(int, char**)
 {
     {
-        std::regex_traits<char> t1;
-        assert(t1.getloc().name() == "C");
-        std::regex_traits<wchar_t> t2;
-        assert(t2.getloc().name() == "C");
+        std::regex_traits<char> t;
+        assert(t.getloc().name() == "C");
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
+    {
+        std::regex_traits<wchar_t> t;
+        assert(t.getloc().name() == "C");
+    }
+#endif
+    {
+        std::locale::global(std::locale(LOCALE_en_US_UTF_8));
+        std::regex_traits<char> t;
+        assert(t.getloc().name() == LOCALE_en_US_UTF_8);
+    }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::locale::global(std::locale(LOCALE_en_US_UTF_8));
-        std::regex_traits<char> t1;
-        assert(t1.getloc().name() == LOCALE_en_US_UTF_8);
-        std::regex_traits<wchar_t> t2;
-        assert(t2.getloc().name() == LOCALE_en_US_UTF_8);
+        std::regex_traits<wchar_t> t;
+        assert(t.getloc().name() == LOCALE_en_US_UTF_8);
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/re/re.traits/isctype.pass.cpp b/libcxx/test/std/re/re.traits/isctype.pass.cpp
index 3563f8a37fd3a..c6bba18a1227d 100644
--- a/libcxx/test/std/re/re.traits/isctype.pass.cpp
+++ b/libcxx/test/std/re/re.traits/isctype.pass.cpp
@@ -150,6 +150,8 @@ int main(int, char**)
         assert(!t.isctype('-', t.lookup_classname(s.begin(), s.end())));
         assert(!t.isctype('@', t.lookup_classname(s.begin(), s.end())));
     }
+
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::regex_traits<wchar_t> t;
 
@@ -279,6 +281,7 @@ int main(int, char**)
         assert(!t.isctype(L'-', t.lookup_classname(s.begin(), s.end())));
         assert(!t.isctype(L'@', t.lookup_classname(s.begin(), s.end())));
     }
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
 
   return 0;
 }

diff  --git a/libcxx/test/std/re/re.traits/length.pass.cpp b/libcxx/test/std/re/re.traits/length.pass.cpp
index b0be1649388f7..e14df640197b2 100644
--- a/libcxx/test/std/re/re.traits/length.pass.cpp
+++ b/libcxx/test/std/re/re.traits/length.pass.cpp
@@ -23,10 +23,12 @@ int main(int, char**)
     assert(std::regex_traits<char>::length("12") == 2);
     assert(std::regex_traits<char>::length("123") == 3);
 
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     assert(std::regex_traits<wchar_t>::length(L"") == 0);
     assert(std::regex_traits<wchar_t>::length(L"1") == 1);
     assert(std::regex_traits<wchar_t>::length(L"12") == 2);
     assert(std::regex_traits<wchar_t>::length(L"123") == 3);
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/re/re.traits/lookup_classname.pass.cpp b/libcxx/test/std/re/re.traits/lookup_classname.pass.cpp
index 31d93cbed8c78..ddf4663697554 100644
--- a/libcxx/test/std/re/re.traits/lookup_classname.pass.cpp
+++ b/libcxx/test/std/re/re.traits/lookup_classname.pass.cpp
@@ -158,6 +158,7 @@ int main(int, char**)
     test("", std::ctype_base::mask());
     test("digits", std::ctype_base::mask());
 
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     test(L"d", std::ctype_base::digit);
     test(L"D", std::ctype_base::digit);
     test(L"d", std::ctype_base::digit, true);
@@ -245,6 +246,7 @@ int main(int, char**)
     test(L"dig", std::ctype_base::mask());
     test(L"", std::ctype_base::mask());
     test(L"digits", std::ctype_base::mask());
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/re/re.traits/lookup_collatename.pass.cpp b/libcxx/test/std/re/re.traits/lookup_collatename.pass.cpp
index 27ff6eef38dc9..72586924ab162 100644
--- a/libcxx/test/std/re/re.traits/lookup_collatename.pass.cpp
+++ b/libcxx/test/std/re/re.traits/lookup_collatename.pass.cpp
@@ -117,6 +117,7 @@ int main(int, char**)
     test("ch", std::string("ch"));
     std::locale::global(std::locale("C"));
 
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     test(L"NUL", std::wstring(L"\x00", 1));
     test(L"alert", std::wstring(L"\x07"));
     test(L"backspace", std::wstring(L"\x08"));
@@ -192,6 +193,7 @@ int main(int, char**)
     std::locale::global(std::locale(LOCALE_cs_CZ_ISO8859_2));
     test(L"ch", std::wstring(L"ch"));
     std::locale::global(std::locale("C"));
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
 
   return 0;
 }

diff  --git a/libcxx/test/std/re/re.traits/transform.pass.cpp b/libcxx/test/std/re/re.traits/transform.pass.cpp
index cbc5eaa32c579..80cd3f01faff2 100644
--- a/libcxx/test/std/re/re.traits/transform.pass.cpp
+++ b/libcxx/test/std/re/re.traits/transform.pass.cpp
@@ -35,6 +35,7 @@ int main(int, char**)
         t.imbue(std::locale(LOCALE_cs_CZ_ISO8859_2));
         assert(t.transform(F(a), F(a+1)) < t.transform(F(B), F(B+1)));
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::regex_traits<wchar_t> t;
         const wchar_t a[] = L"a";
@@ -44,6 +45,7 @@ int main(int, char**)
         t.imbue(std::locale(LOCALE_cs_CZ_ISO8859_2));
         assert(t.transform(F(a), F(a+1)) < t.transform(F(B), F(B+1)));
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/re/re.traits/transform_primary.pass.cpp b/libcxx/test/std/re/re.traits/transform_primary.pass.cpp
index 3b1be1dda8980..4f793aab78464 100644
--- a/libcxx/test/std/re/re.traits/transform_primary.pass.cpp
+++ b/libcxx/test/std/re/re.traits/transform_primary.pass.cpp
@@ -39,6 +39,7 @@ int main(int, char**)
         assert(t.transform_primary(F(A), F(A+1)) ==
                t.transform_primary(F(Aacute), F(Aacute+1)));
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::regex_traits<wchar_t> t;
         const wchar_t A[] = L"A";
@@ -50,6 +51,7 @@ int main(int, char**)
         assert(t.transform_primary(F(A), F(A+1)) ==
                t.transform_primary(F(Aacute), F(Aacute+1)));
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/re/re.traits/translate.pass.cpp b/libcxx/test/std/re/re.traits/translate.pass.cpp
index e9e32e9dd20d1..a3e597863eda2 100644
--- a/libcxx/test/std/re/re.traits/translate.pass.cpp
+++ b/libcxx/test/std/re/re.traits/translate.pass.cpp
@@ -24,12 +24,14 @@ int main(int, char**)
         assert(t.translate('B') == 'B');
         assert(t.translate('c') == 'c');
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::regex_traits<wchar_t> t;
         assert(t.translate(L'a') == L'a');
         assert(t.translate(L'B') == L'B');
         assert(t.translate(L'c') == L'c');
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/re/re.traits/translate_nocase.pass.cpp b/libcxx/test/std/re/re.traits/translate_nocase.pass.cpp
index 47f521d905da0..d7eabc919812d 100644
--- a/libcxx/test/std/re/re.traits/translate_nocase.pass.cpp
+++ b/libcxx/test/std/re/re.traits/translate_nocase.pass.cpp
@@ -40,6 +40,7 @@ int main(int, char**)
         assert(t.translate_nocase('a') == 'a');
         assert(t.translate_nocase('1') == '1');
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::regex_traits<wchar_t> t;
         assert(t.translate_nocase(L' ') == L' ');
@@ -60,6 +61,7 @@ int main(int, char**)
         assert(t.translate_nocase(L'\xDA') == L'\xFA');
         assert(t.translate_nocase(L'\xFA') == L'\xFA');
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/re/re.traits/types.pass.cpp b/libcxx/test/std/re/re.traits/types.pass.cpp
index 5816cb2efdeed..f15a6476d50ce 100644
--- a/libcxx/test/std/re/re.traits/types.pass.cpp
+++ b/libcxx/test/std/re/re.traits/types.pass.cpp
@@ -25,9 +25,11 @@ int main(int, char**)
     static_assert((std::is_same<std::regex_traits<char>::char_type, char>::value), "");
     static_assert((std::is_same<std::regex_traits<char>::string_type, std::string>::value), "");
     static_assert((std::is_same<std::regex_traits<char>::locale_type, std::locale>::value), "");
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     static_assert((std::is_same<std::regex_traits<wchar_t>::char_type, wchar_t>::value), "");
     static_assert((std::is_same<std::regex_traits<wchar_t>::string_type, std::wstring>::value), "");
     static_assert((std::is_same<std::regex_traits<wchar_t>::locale_type, std::locale>::value), "");
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/re/re.traits/value.pass.cpp b/libcxx/test/std/re/re.traits/value.pass.cpp
index b7ca1fb7c07a4..d4b7b0a131bdf 100644
--- a/libcxx/test/std/re/re.traits/value.pass.cpp
+++ b/libcxx/test/std/re/re.traits/value.pass.cpp
@@ -70,6 +70,7 @@ int main(int, char**)
             assert(t.value(char(c), 16) == -1);
         }
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::regex_traits<wchar_t> t;
 
@@ -122,6 +123,7 @@ int main(int, char**)
             assert(t.value(c, 16) == -1);
         }
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/strings/basic.string.hash/enabled_hashes.pass.cpp b/libcxx/test/std/strings/basic.string.hash/enabled_hashes.pass.cpp
index 0935b891fce3a..67e22eae910bb 100644
--- a/libcxx/test/std/strings/basic.string.hash/enabled_hashes.pass.cpp
+++ b/libcxx/test/std/strings/basic.string.hash/enabled_hashes.pass.cpp
@@ -23,7 +23,9 @@ int main(int, char**) {
   test_library_hash_specializations_available();
   {
     test_hash_enabled_for_type<std::string>();
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     test_hash_enabled_for_type<std::wstring>();
+#endif
 #if defined(__cpp_lib_char8_t) && __cpp_lib_char8_t >= 201811L
     test_hash_enabled_for_type<std::u8string>();
 #endif

diff  --git a/libcxx/test/std/strings/basic.string.hash/strings.pass.cpp b/libcxx/test/std/strings/basic.string.hash/strings.pass.cpp
index dbed700d6c110..9f7299b4999ac 100644
--- a/libcxx/test/std/strings/basic.string.hash/strings.pass.cpp
+++ b/libcxx/test/std/strings/basic.string.hash/strings.pass.cpp
@@ -50,7 +50,9 @@ int main(int, char**)
     test<std::u16string>();
     test<std::u32string>();
 #endif
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     test<std::wstring>();
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/strings/basic.string.literals/literal.pass.cpp b/libcxx/test/std/strings/basic.string.literals/literal.pass.cpp
index d8274bc559d73..6d48e745ced5b 100644
--- a/libcxx/test/std/strings/basic.string.literals/literal.pass.cpp
+++ b/libcxx/test/std/strings/basic.string.literals/literal.pass.cpp
@@ -25,31 +25,41 @@ int main(int, char**) {
 
         ASSERT_SAME_TYPE(decltype(  "Hi"s), std::string);
         ASSERT_SAME_TYPE(decltype(u8"Hi"s), u8string);
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
         ASSERT_SAME_TYPE(decltype( L"Hi"s), std::wstring);
+#endif
         ASSERT_SAME_TYPE(decltype( u"Hi"s), std::u16string);
         ASSERT_SAME_TYPE(decltype( U"Hi"s), std::u32string);
 
         std::string foo;
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
         std::wstring Lfoo;
+#endif
         u8string u8foo;
         std::u16string ufoo;
         std::u32string Ufoo;
 
         foo   =   ""s;     assert(  foo.size() == 0);
         u8foo = u8""s;     assert(u8foo.size() == 0);
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
         Lfoo  =  L""s;     assert( Lfoo.size() == 0);
+#endif
         ufoo  =  u""s;     assert( ufoo.size() == 0);
         Ufoo  =  U""s;     assert( Ufoo.size() == 0);
 
         foo   =   " "s;    assert(  foo.size() == 1);
         u8foo = u8" "s;    assert(u8foo.size() == 1);
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
         Lfoo  =  L" "s;    assert( Lfoo.size() == 1);
+#endif
         ufoo  =  u" "s;    assert( ufoo.size() == 1);
         Ufoo  =  U" "s;    assert( Ufoo.size() == 1);
 
         foo   =   "ABC"s;     assert(  foo ==   "ABC");   assert(  foo == std::string   (  "ABC"));
         u8foo = u8"ABC"s;     assert(u8foo == u8"ABC");   assert(u8foo == u8string      (u8"ABC"));
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
         Lfoo  =  L"ABC"s;     assert( Lfoo ==  L"ABC");   assert( Lfoo == std::wstring  ( L"ABC"));
+#endif
         ufoo  =  u"ABC"s;     assert( ufoo ==  u"ABC");   assert( ufoo == std::u16string( u"ABC"));
         Ufoo  =  U"ABC"s;     assert( Ufoo ==  U"ABC");   assert( Ufoo == std::u32string( U"ABC"));
     }

diff  --git a/libcxx/test/std/strings/basic.string/string.cons/dtor_noexcept.pass.cpp b/libcxx/test/std/strings/basic.string/string.cons/dtor_noexcept.pass.cpp
index 31afc7048576c..83d2a929cec7e 100644
--- a/libcxx/test/std/strings/basic.string/string.cons/dtor_noexcept.pass.cpp
+++ b/libcxx/test/std/strings/basic.string/string.cons/dtor_noexcept.pass.cpp
@@ -30,7 +30,9 @@ struct throwing_alloc
 // Test that it's possible to take the address of basic_string's destructors
 // by creating globals which will register their destructors with cxa_atexit.
 std::string s;
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
 std::wstring ws;
+#endif
 
 int main(int, char**)
 {

diff  --git a/libcxx/test/std/strings/basic.string/string.cons/implicit_deduction_guides.pass.cpp b/libcxx/test/std/strings/basic.string/string.cons/implicit_deduction_guides.pass.cpp
index e7dd236571ada..ec48740d7cbb5 100644
--- a/libcxx/test/std/strings/basic.string/string.cons/implicit_deduction_guides.pass.cpp
+++ b/libcxx/test/std/strings/basic.string/string.cons/implicit_deduction_guides.pass.cpp
@@ -62,18 +62,22 @@ int main(int, char**)
     ASSERT_SAME_TYPE(decltype(s), std::string);
     assert(s == "aaaaaa");
 
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     std::basic_string w(2ull, L'b');
     ASSERT_SAME_TYPE(decltype(w), std::wstring);
     assert(w == L"bb");
+#endif
   }
   { // Testing (3) w/ allocator
     std::basic_string s(6ull, 'a', test_allocator<char>{});
     ASSERT_SAME_TYPE(decltype(s), BStr<char,test_allocator<char>>);
     assert(s == "aaaaaa");
 
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     std::basic_string w(2ull, L'b', test_allocator<wchar_t>{});
     ASSERT_SAME_TYPE(decltype(w), BStr<wchar_t, test_allocator<wchar_t>>);
     assert(w == L"bb");
+#endif
   }
   { // Testing (4) w/o allocator
     const std::string sin("abc");
@@ -81,6 +85,7 @@ int main(int, char**)
     ASSERT_SAME_TYPE(decltype(s), std::string);
     assert(s == "bc");
 
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     using WStr = std::basic_string<wchar_t,
                                   constexpr_char_traits<wchar_t>,
                                   test_allocator<wchar_t>>;
@@ -88,6 +93,7 @@ int main(int, char**)
     std::basic_string w(win, (TestSizeT)3);
     ASSERT_SAME_TYPE(decltype(w), WStr);
     assert(w == L"def");
+#endif
   }
   { // Testing (4) w/ allocator
     const std::string sin("abc");
@@ -95,6 +101,7 @@ int main(int, char**)
     ASSERT_SAME_TYPE(decltype(s), std::string);
     assert(s == "bc");
 
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     using WStr = std::basic_string<wchar_t,
                                   constexpr_char_traits<wchar_t>,
                                   test_allocator<wchar_t>>;
@@ -102,6 +109,7 @@ int main(int, char**)
     std::basic_string w(win, (TestSizeT)3, test_allocator<wchar_t>{});
     ASSERT_SAME_TYPE(decltype(w), WStr);
     assert(w == L"def");
+#endif
   }
   { // Testing (5) w/o allocator
     const std::string sin("abc");
@@ -109,6 +117,7 @@ int main(int, char**)
     ASSERT_SAME_TYPE(decltype(s), std::string);
     assert(s == "bc");
 
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     using WStr = std::basic_string<wchar_t,
                                   constexpr_char_traits<wchar_t>,
                                   test_allocator<wchar_t>>;
@@ -116,6 +125,7 @@ int main(int, char**)
     std::basic_string w(win, (TestSizeT)2, (TestSizeT)3);
     ASSERT_SAME_TYPE(decltype(w), WStr);
     assert(w == L"cde");
+#endif
   }
   { // Testing (5) w/ allocator
     const std::string sin("abc");
@@ -123,6 +133,7 @@ int main(int, char**)
     ASSERT_SAME_TYPE(decltype(s), std::string);
     assert(s == "bc");
 
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     using WStr = std::basic_string<wchar_t,
                                   constexpr_char_traits<wchar_t>,
                                   test_allocator<wchar_t>>;
@@ -130,48 +141,57 @@ int main(int, char**)
     std::basic_string w(win, (TestSizeT)2, (TestSizeT)3, test_allocator<wchar_t>{});
     ASSERT_SAME_TYPE(decltype(w), WStr);
     assert(w == L"cde");
+#endif
   }
   { // Testing (6) w/o allocator
     std::basic_string s("abc", (size_t)2);
     ASSERT_SAME_TYPE(decltype(s), std::string);
     assert(s == "ab");
 
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     std::basic_string w(L"abcdef", (size_t)3);
     ASSERT_SAME_TYPE(decltype(w), std::wstring);
     assert(w == L"abc");
+#endif
   }
   { // Testing (6) w/ allocator
     std::basic_string s("abc", (size_t)2, std::allocator<char>{});
     ASSERT_SAME_TYPE(decltype(s), std::string);
     assert(s == "ab");
 
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     using WStr = std::basic_string<wchar_t,
                                   std::char_traits<wchar_t>,
                                   test_allocator<wchar_t>>;
     std::basic_string w(L"abcdef", (TestSizeT)3, test_allocator<wchar_t>{});
     ASSERT_SAME_TYPE(decltype(w), WStr);
     assert(w == L"abc");
+#endif
   }
   { // Testing (7) w/o allocator
     std::basic_string s("abc");
     ASSERT_SAME_TYPE(decltype(s), std::string);
     assert(s == "abc");
 
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     std::basic_string w(L"abcdef");
     ASSERT_SAME_TYPE(decltype(w), std::wstring);
     assert(w == L"abcdef");
+#endif
   }
   { // Testing (7) w/ allocator
     std::basic_string s("abc", std::allocator<char>{});
     ASSERT_SAME_TYPE(decltype(s), std::string);
     assert(s == "abc");
 
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     using WStr = std::basic_string<wchar_t,
                                   std::char_traits<wchar_t>,
                                   test_allocator<wchar_t>>;
     std::basic_string w(L"abcdef", test_allocator<wchar_t>{});
     ASSERT_SAME_TYPE(decltype(w), WStr);
     assert(w == L"abcdef");
+#endif
   }
   { // (8) w/o allocator
     using It = cpp17_input_iterator<const char*>;
@@ -181,12 +201,24 @@ int main(int, char**)
     assert(s == "abc");
   }
   { // (8) w/ allocator
-    using ExpectW = std::basic_string<wchar_t, std::char_traits<wchar_t>, test_allocator<wchar_t>>;
-    using It = cpp17_input_iterator<const wchar_t*>;
-    const wchar_t* input = L"abcdef";
-    std::basic_string s(It(input), It(input + 3), test_allocator<wchar_t>{});
-    ASSERT_SAME_TYPE(decltype(s), ExpectW);
-    assert(s == L"abc");
+    {
+      using Expect = std::basic_string<char, std::char_traits<char>, test_allocator<char>>;
+      using It = cpp17_input_iterator<const char*>;
+      const char* input = "abcdef";
+      std::basic_string s(It(input), It(input + 3), test_allocator<char>{});
+      ASSERT_SAME_TYPE(decltype(s), Expect);
+      assert(s == "abc");
+    }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
+    {
+      using ExpectW = std::basic_string<wchar_t, std::char_traits<wchar_t>, test_allocator<wchar_t>>;
+      using It = cpp17_input_iterator<const wchar_t*>;
+      const wchar_t* input = L"abcdef";
+      std::basic_string s(It(input), It(input + 3), test_allocator<wchar_t>{});
+      ASSERT_SAME_TYPE(decltype(s), ExpectW);
+      assert(s == L"abc");
+    }
+#endif
   }
   { // Testing (9)
     const std::string sin("abc");
@@ -194,6 +226,7 @@ int main(int, char**)
     ASSERT_SAME_TYPE(decltype(s), std::string);
     assert(s == "abc");
 
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     using WStr = std::basic_string<wchar_t,
                                   constexpr_char_traits<wchar_t>,
                                   test_allocator<wchar_t>>;
@@ -201,6 +234,7 @@ int main(int, char**)
     std::basic_string w(win);
     ASSERT_SAME_TYPE(decltype(w), WStr);
     assert(w == L"abcdef");
+#endif
   }
   { // Testing (10)
     const std::string sin("abc");
@@ -208,6 +242,7 @@ int main(int, char**)
     ASSERT_SAME_TYPE(decltype(s), std::string);
     assert(s == "abc");
 
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     using WStr = std::basic_string<wchar_t,
                                   constexpr_char_traits<wchar_t>,
                                   test_allocator<wchar_t>>;
@@ -215,6 +250,7 @@ int main(int, char**)
     std::basic_string w(win, test_allocator<wchar_t>{});
     ASSERT_SAME_TYPE(decltype(w), WStr);
     assert(w == L"abcdef");
+#endif
   }
   { // Testing (11)
     std::string sin("abc");
@@ -222,6 +258,7 @@ int main(int, char**)
     ASSERT_SAME_TYPE(decltype(s), std::string);
     assert(s == "abc");
 
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     using WStr = std::basic_string<wchar_t,
                                   constexpr_char_traits<wchar_t>,
                                   test_allocator<wchar_t>>;
@@ -229,6 +266,7 @@ int main(int, char**)
     std::basic_string w(std::move(win));
     ASSERT_SAME_TYPE(decltype(w), WStr);
     assert(w == L"abcdef");
+#endif
   }
   { // Testing (12)
     std::string sin("abc");
@@ -236,6 +274,7 @@ int main(int, char**)
     ASSERT_SAME_TYPE(decltype(s), std::string);
     assert(s == "abc");
 
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     using WStr = std::basic_string<wchar_t,
                                   constexpr_char_traits<wchar_t>,
                                   test_allocator<wchar_t>>;
@@ -243,24 +282,29 @@ int main(int, char**)
     std::basic_string w(std::move(win), test_allocator<wchar_t>{});
     ASSERT_SAME_TYPE(decltype(w), WStr);
     assert(w == L"abcdef");
+#endif
   }
   { // Testing (13) w/o allocator
     std::basic_string s({'a', 'b', 'c'});
     ASSERT_SAME_TYPE(decltype(s), std::string);
     assert(s == "abc");
 
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     std::basic_string w({L'a', L'b', L'c'});
     ASSERT_SAME_TYPE(decltype(w), std::wstring);
     assert(w == L"abc");
+#endif
   }
   { // Testing (13) w/ allocator
     std::basic_string s({'a', 'b', 'c'}, test_allocator<char>{});
     ASSERT_SAME_TYPE(decltype(s), BStr<char, test_allocator<char>>);
     assert(s == "abc");
 
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     std::basic_string w({L'a', L'b', L'c'}, test_allocator<wchar_t>{});
     ASSERT_SAME_TYPE(decltype(w), BStr<wchar_t, test_allocator<wchar_t>>);
     assert(w == L"abc");
+#endif
   }
   { // Testing (14) w/o allocator
     std::string_view sv("abc");
@@ -268,11 +312,13 @@ int main(int, char**)
     ASSERT_SAME_TYPE(decltype(s), std::string);
     assert(s == "abc");
 
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     using Expect = std::basic_string<wchar_t, constexpr_char_traits<wchar_t>>;
     std::basic_string_view<wchar_t, constexpr_char_traits<wchar_t>> BSV(L"abcdef");
     std::basic_string w(BSV);
     ASSERT_SAME_TYPE(decltype(w), Expect);
     assert(w == L"abcdef");
+#endif
   }
   { // Testing (14) w/ allocator
     using ExpectS = std::basic_string<char, std::char_traits<char>, test_allocator<char>>;
@@ -281,12 +327,14 @@ int main(int, char**)
     ASSERT_SAME_TYPE(decltype(s), ExpectS);
     assert(s == "abc");
 
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     using ExpectW = std::basic_string<wchar_t, constexpr_char_traits<wchar_t>,
                                       test_allocator<wchar_t>>;
     std::basic_string_view<wchar_t, constexpr_char_traits<wchar_t>> BSV(L"abcdef");
     std::basic_string w(BSV, test_allocator<wchar_t>{});
     ASSERT_SAME_TYPE(decltype(w), ExpectW);
     assert(w == L"abcdef");
+#endif
   }
   { // Testing (15) w/o allocator
     std::string s0("abc");
@@ -294,10 +342,12 @@ int main(int, char**)
     ASSERT_SAME_TYPE(decltype(s), std::string);
     assert(s == "b");
 
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     std::wstring w0(L"abcdef");
     std::basic_string w(w0, 2, 2);
     ASSERT_SAME_TYPE(decltype(w), std::wstring);
     assert(w == L"cd");
+#endif
   }
   { // Testing (15) w/ allocator
     using ExpectS = std::basic_string<char, std::char_traits<char>, test_allocator<char>>;
@@ -306,11 +356,13 @@ int main(int, char**)
     ASSERT_SAME_TYPE(decltype(s), ExpectS);
     assert(s == "b");
 
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     using ExpectW = std::basic_string<wchar_t, std::char_traits<wchar_t>, test_allocator<wchar_t>>;
     ExpectW w0(L"abcdef");
     std::basic_string w(w0, 2, 2, test_allocator<wchar_t>{6});
     ASSERT_SAME_TYPE(decltype(w), ExpectW);
     assert(w == L"cd");
+#endif
   }
 
   return 0;

diff  --git a/libcxx/test/std/strings/basic.string/string.cons/initializer_list.pass.cpp b/libcxx/test/std/strings/basic.string/string.cons/initializer_list.pass.cpp
index aeb0fcff20d3a..92f0d44010222 100644
--- a/libcxx/test/std/strings/basic.string/string.cons/initializer_list.pass.cpp
+++ b/libcxx/test/std/strings/basic.string/string.cons/initializer_list.pass.cpp
@@ -25,22 +25,26 @@ int main(int, char**)
         std::string s = {'a', 'b', 'c'};
         assert(s == "abc");
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::wstring s;
         s = {L'a', L'b', L'c'};
         assert(s == L"abc");
     }
+#endif
     {
         typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S;
         S s = {'a', 'b', 'c'};
         assert(s == "abc");
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         typedef std::basic_string<wchar_t, std::char_traits<wchar_t>, min_allocator<wchar_t>> S;
         S s;
         s = {L'a', L'b', L'c'};
         assert(s == L"abc");
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/strings/basic.string/string.cons/string_view_deduction.pass.cpp b/libcxx/test/std/strings/basic.string/string.cons/string_view_deduction.pass.cpp
index 46b3b8fe20250..a9b48d6ab1625 100644
--- a/libcxx/test/std/strings/basic.string/string.cons/string_view_deduction.pass.cpp
+++ b/libcxx/test/std/strings/basic.string/string.cons/string_view_deduction.pass.cpp
@@ -59,6 +59,7 @@ int main(int, char**)
     assert(s1.size() == sv.size());
     assert(s1.compare(0, s1.size(), sv.data(), s1.size()) == 0);
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
     std::wstring_view sv = L"12345678901234";
     std::basic_string s1{sv, test_allocator<wchar_t>{}};
@@ -69,6 +70,7 @@ int main(int, char**)
     assert(s1.size() == sv.size());
     assert(s1.compare(0, s1.size(), sv.data(), s1.size()) == 0);
     }
+#endif
 #if defined(__cpp_lib_char8_t) && __cpp_lib_char8_t >= 201811L
     {
     std::u8string_view sv = u8"12345678901234";

diff  --git a/libcxx/test/std/strings/basic.string/string.cons/string_view_size_size_deduction.pass.cpp b/libcxx/test/std/strings/basic.string/string.cons/string_view_size_size_deduction.pass.cpp
index 69e94ada9e38d..305194dd54872 100644
--- a/libcxx/test/std/strings/basic.string/string.cons/string_view_size_size_deduction.pass.cpp
+++ b/libcxx/test/std/strings/basic.string/string.cons/string_view_size_size_deduction.pass.cpp
@@ -63,6 +63,7 @@ int main(int, char**)
     assert(s1.size() == 4);
     assert(s1.compare(0, s1.size(), sv.data(), s1.size()) == 0);
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
     std::wstring_view sv = L"12345678901234";
     std::basic_string s1{sv, 0, 4, test_allocator<wchar_t>{}};
@@ -73,6 +74,7 @@ int main(int, char**)
     assert(s1.size() == 4);
     assert(s1.compare(0, s1.size(), sv.data(), s1.size()) == 0);
     }
+#endif
 #if defined(__cpp_lib_char8_t) && __cpp_lib_char8_t >= 201811L
     {
     std::u8string_view sv = u8"12345678901234";

diff  --git a/libcxx/test/std/strings/basic.string/string.iterators/iterators.pass.cpp b/libcxx/test/std/strings/basic.string/string.iterators/iterators.pass.cpp
index 4ca75d288dc0c..c7c1eb25eeb6e 100644
--- a/libcxx/test/std/strings/basic.string/string.iterators/iterators.pass.cpp
+++ b/libcxx/test/std/strings/basic.string/string.iterators/iterators.pass.cpp
@@ -54,7 +54,9 @@ void test()
 int main(int, char**)
 {
     test<std::string>();
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     test<std::wstring>();
+#endif
 
 #if defined(__cpp_lib_char8_t) && __cpp_lib_char8_t >= 201811L
     test<std::u8string>();

diff  --git a/libcxx/test/std/strings/basic.string/string.nonmembers/string.io/get_line.pass.cpp b/libcxx/test/std/strings/basic.string/string.nonmembers/string.io/get_line.pass.cpp
index 6069f8e377e40..b1fdf57a236c8 100644
--- a/libcxx/test/std/strings/basic.string/string.nonmembers/string.io/get_line.pass.cpp
+++ b/libcxx/test/std/strings/basic.string/string.nonmembers/string.io/get_line.pass.cpp
@@ -35,6 +35,7 @@ int main(int, char**)
         assert(in.eof());
         assert(s == "   ghij");
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::wistringstream in(L" abc\n  def\n   ghij");
         std::wstring s(L"initial text");
@@ -48,6 +49,7 @@ int main(int, char**)
         assert(in.eof());
         assert(s == L"   ghij");
     }
+#endif
 #if TEST_STD_VER >= 11
     {
         typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S;
@@ -63,6 +65,7 @@ int main(int, char**)
         assert(in.eof());
         assert(s == "   ghij");
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         typedef std::basic_string<wchar_t, std::char_traits<wchar_t>, min_allocator<wchar_t>> S;
         std::wistringstream in(L" abc\n  def\n   ghij");
@@ -77,7 +80,8 @@ int main(int, char**)
         assert(in.eof());
         assert(s == L"   ghij");
     }
-#endif
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
+#endif // TEST_STD_VER >= 11
 #ifndef TEST_HAS_NO_EXCEPTIONS
     {
         std::basic_stringbuf<char> sb("hello");
@@ -98,6 +102,7 @@ int main(int, char**)
         assert(threw);
         assert(s == "hello");
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::basic_stringbuf<wchar_t> sb(L"hello");
         std::basic_istream<wchar_t> is(&sb);
@@ -117,6 +122,7 @@ int main(int, char**)
         assert(threw);
         assert(s == L"hello");
     }
+#endif
 
     {
         std::basic_stringbuf<char> sb;
@@ -137,6 +143,7 @@ int main(int, char**)
         assert(threw);
         assert(s == "");
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::basic_stringbuf<wchar_t> sb;
         std::basic_istream<wchar_t> is(&sb);
@@ -156,6 +163,7 @@ int main(int, char**)
         assert(threw);
         assert(s == L"");
     }
+#endif
 #endif // TEST_HAS_NO_EXCEPTIONS
 
     return 0;

diff  --git a/libcxx/test/std/strings/basic.string/string.nonmembers/string.io/get_line_delim.pass.cpp b/libcxx/test/std/strings/basic.string/string.nonmembers/string.io/get_line_delim.pass.cpp
index d7d271bf02cd8..c94e6c24a13f8 100644
--- a/libcxx/test/std/strings/basic.string/string.nonmembers/string.io/get_line_delim.pass.cpp
+++ b/libcxx/test/std/strings/basic.string/string.nonmembers/string.io/get_line_delim.pass.cpp
@@ -38,6 +38,7 @@ int main(int, char**)
         assert(in.eof());
         assert(s == "   ghij");
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::wistringstream in(L" abc*  def**   ghij");
         std::wstring s(L"initial text");
@@ -54,6 +55,7 @@ int main(int, char**)
         assert(in.eof());
         assert(s == L"   ghij");
     }
+#endif
 #if TEST_STD_VER >= 11
     {
         typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S;
@@ -72,6 +74,7 @@ int main(int, char**)
         assert(in.eof());
         assert(s == "   ghij");
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         typedef std::basic_string<wchar_t, std::char_traits<wchar_t>, min_allocator<wchar_t>> S;
         std::wistringstream in(L" abc*  def**   ghij");
@@ -89,7 +92,8 @@ int main(int, char**)
         assert(in.eof());
         assert(s == L"   ghij");
     }
-#endif
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
+#endif // TEST_STD_VER >= 11
 #ifndef TEST_HAS_NO_EXCEPTIONS
     {
         std::basic_stringbuf<char> sb("hello");
@@ -110,6 +114,7 @@ int main(int, char**)
         assert(threw);
         assert(s == "hello");
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::basic_stringbuf<wchar_t> sb(L"hello");
         std::basic_istream<wchar_t> is(&sb);
@@ -129,6 +134,7 @@ int main(int, char**)
         assert(threw);
         assert(s == L"hello");
     }
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::basic_stringbuf<char> sb;
         std::basic_istream<char> is(&sb);
@@ -148,6 +154,7 @@ int main(int, char**)
         assert(threw);
         assert(s == "");
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::basic_stringbuf<wchar_t> sb;
         std::basic_istream<wchar_t> is(&sb);
@@ -167,6 +174,7 @@ int main(int, char**)
         assert(threw);
         assert(s == L"");
     }
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
 #endif // TEST_HAS_NO_EXCEPTIONS
 
     return 0;

diff  --git a/libcxx/test/std/strings/basic.string/string.nonmembers/string.io/get_line_delim_rv.pass.cpp b/libcxx/test/std/strings/basic.string/string.nonmembers/string.io/get_line_delim_rv.pass.cpp
index d2e5ab5488bdd..077a1a8e0bfcb 100644
--- a/libcxx/test/std/strings/basic.string/string.nonmembers/string.io/get_line_delim_rv.pass.cpp
+++ b/libcxx/test/std/strings/basic.string/string.nonmembers/string.io/get_line_delim_rv.pass.cpp
@@ -27,23 +27,27 @@ int main(int, char**)
         getline(std::istringstream(" abc*  def*   ghij"), s, '*');
         assert(s == " abc");
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::wstring s(L"initial text");
         getline(std::wistringstream(L" abc*  def*   ghij"), s, L'*');
         assert(s == L" abc");
     }
+#endif
     {
         typedef std::basic_string<char, std::char_traits<char>, min_allocator<char> > S;
         S s("initial text");
         getline(std::istringstream(" abc*  def*   ghij"), s, '*');
         assert(s == " abc");
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         typedef std::basic_string<wchar_t, std::char_traits<wchar_t>, min_allocator<wchar_t> > S;
         S s(L"initial text");
         getline(std::wistringstream(L" abc*  def*   ghij"), s, L'*');
         assert(s == L" abc");
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/strings/basic.string/string.nonmembers/string.io/get_line_rv.pass.cpp b/libcxx/test/std/strings/basic.string/string.nonmembers/string.io/get_line_rv.pass.cpp
index 3fb35cc24d66b..aef90477eeb68 100644
--- a/libcxx/test/std/strings/basic.string/string.nonmembers/string.io/get_line_rv.pass.cpp
+++ b/libcxx/test/std/strings/basic.string/string.nonmembers/string.io/get_line_rv.pass.cpp
@@ -27,23 +27,27 @@ int main(int, char**)
         getline(std::istringstream(" abc\n  def\n   ghij"), s);
         assert(s == " abc");
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::wstring s(L"initial text");
         getline(std::wistringstream(L" abc\n  def\n   ghij"), s);
         assert(s == L" abc");
     }
+#endif
     {
         typedef std::basic_string<char, std::char_traits<char>, min_allocator<char> > S;
         S s("initial text");
         getline(std::istringstream(" abc\n  def\n   ghij"), s);
         assert(s == " abc");
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         typedef std::basic_string<wchar_t, std::char_traits<wchar_t>, min_allocator<wchar_t> > S;
         S s(L"initial text");
         getline(std::wistringstream(L" abc\n  def\n   ghij"), s);
         assert(s == L" abc");
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/strings/basic.string/string.nonmembers/string.io/stream_extract.pass.cpp b/libcxx/test/std/strings/basic.string/string.nonmembers/string.io/stream_extract.pass.cpp
index 92061e2c476a5..686b7a97e4f2d 100644
--- a/libcxx/test/std/strings/basic.string/string.nonmembers/string.io/stream_extract.pass.cpp
+++ b/libcxx/test/std/strings/basic.string/string.nonmembers/string.io/stream_extract.pass.cpp
@@ -44,6 +44,7 @@ int main(int, char**)
         in >> s;
         assert(in.fail());
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::wistringstream in(L"a bc defghij");
         std::wstring s(L"initial text");
@@ -66,6 +67,7 @@ int main(int, char**)
         in >> s;
         assert(in.fail());
     }
+#endif
 #ifndef TEST_HAS_NO_EXCEPTIONS
     {
         std::stringbuf sb;
@@ -128,6 +130,7 @@ int main(int, char**)
         in >> s;
         assert(in.fail());
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         typedef std::basic_string<wchar_t, std::char_traits<wchar_t>, min_allocator<wchar_t>> S;
         std::wistringstream in(L"a bc defghij");
@@ -151,7 +154,8 @@ int main(int, char**)
         in >> s;
         assert(in.fail());
     }
-#endif
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
+#endif // TEST_STD_VER >= 11
 
   return 0;
 }

diff  --git a/libcxx/test/std/strings/basic.string/string.nonmembers/string.io/stream_insert.pass.cpp b/libcxx/test/std/strings/basic.string/string.nonmembers/string.io/stream_insert.pass.cpp
index b60fc338b2f56..d2b289084455a 100644
--- a/libcxx/test/std/strings/basic.string/string.nonmembers/string.io/stream_insert.pass.cpp
+++ b/libcxx/test/std/strings/basic.string/string.nonmembers/string.io/stream_insert.pass.cpp
@@ -37,6 +37,7 @@ int main(int, char**)
         assert(out.good());
         assert("   " + s == out.str());
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::wostringstream out;
         std::wstring s(L"some text");
@@ -52,6 +53,7 @@ int main(int, char**)
         assert(out.good());
         assert(L"   " + s == out.str());
     }
+#endif
 #if TEST_STD_VER >= 11
     {
         typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S;
@@ -70,6 +72,7 @@ int main(int, char**)
         assert(out.good());
         assert("   " + s == out.str());
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         typedef std::basic_string<wchar_t, std::char_traits<wchar_t>, min_allocator<wchar_t>> S;
         std::basic_ostringstream<S::value_type, S::traits_type, S::allocator_type> out;
@@ -87,7 +90,8 @@ int main(int, char**)
         assert(out.good());
         assert(L"   " + s == out.str());
     }
-#endif
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
+#endif // TEST_STD_VER >= 11
 
   return 0;
 }

diff  --git a/libcxx/test/std/strings/c.strings/cwchar.pass.cpp b/libcxx/test/std/strings/c.strings/cwchar.pass.cpp
index 1d2742bf9260c..1ac1f28800910 100644
--- a/libcxx/test/std/strings/c.strings/cwchar.pass.cpp
+++ b/libcxx/test/std/strings/c.strings/cwchar.pass.cpp
@@ -8,6 +8,8 @@
 
 // <cwchar>
 
+// XFAIL: libcpp-has-no-wide-characters
+
 #include <cwchar>
 #include <ctime>
 #include <cstdarg>

diff  --git a/libcxx/test/std/strings/c.strings/cwctype.pass.cpp b/libcxx/test/std/strings/c.strings/cwctype.pass.cpp
index 99027d9e93462..294b8de8bb55f 100644
--- a/libcxx/test/std/strings/c.strings/cwctype.pass.cpp
+++ b/libcxx/test/std/strings/c.strings/cwctype.pass.cpp
@@ -8,6 +8,8 @@
 
 // <cwctype>
 
+// XFAIL: libcpp-has-no-wide-characters
+
 #include <cwctype>
 #include <type_traits>
 

diff  --git a/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/assign2.pass.cpp b/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/assign2.pass.cpp
index 25e427014483f..8ef8cfe6290a1 100644
--- a/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/assign2.pass.cpp
+++ b/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/assign2.pass.cpp
@@ -13,6 +13,8 @@
 // static void assign(char_type& c1, const char_type& c2);
 // constexpr in C++17
 
+// UNSUPPORTED: libcpp-has-no-wide-characters
+
 #include <string>
 #include <cassert>
 

diff  --git a/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/assign3.pass.cpp b/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/assign3.pass.cpp
index e1b2945cefdf4..8c58696725a80 100644
--- a/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/assign3.pass.cpp
+++ b/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/assign3.pass.cpp
@@ -12,6 +12,8 @@
 
 // static char_type* assign(char_type* s, size_t n, char_type a);
 
+// UNSUPPORTED: libcpp-has-no-wide-characters
+
 #include <string>
 #include <cassert>
 

diff  --git a/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/compare.pass.cpp b/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/compare.pass.cpp
index 1c2e11912f83f..493e3d0cf4a41 100644
--- a/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/compare.pass.cpp
+++ b/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/compare.pass.cpp
@@ -13,6 +13,8 @@
 // static int compare(const char_type* s1, const char_type* s2, size_t n);
 // constexpr in C++17
 
+// UNSUPPORTED: libcpp-has-no-wide-characters
+
 #include <string>
 #include <cassert>
 

diff  --git a/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/copy.pass.cpp b/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/copy.pass.cpp
index 3191f61e5b0e3..02fdb8198a1e4 100644
--- a/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/copy.pass.cpp
+++ b/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/copy.pass.cpp
@@ -12,6 +12,8 @@
 
 // static char_type* copy(char_type* s1, const char_type* s2, size_t n);
 
+// UNSUPPORTED: libcpp-has-no-wide-characters
+
 #include <string>
 #include <cassert>
 

diff  --git a/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/eof.pass.cpp b/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/eof.pass.cpp
index cc4f1eac923f6..a1f9be8f51f8f 100644
--- a/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/eof.pass.cpp
+++ b/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/eof.pass.cpp
@@ -12,6 +12,8 @@
 
 // static constexpr int_type eof();
 
+// UNSUPPORTED: libcpp-has-no-wide-characters
+
 #include <string>
 #include <cassert>
 

diff  --git a/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/eq.pass.cpp b/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/eq.pass.cpp
index 400c293267b69..51b31d9eff6f0 100644
--- a/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/eq.pass.cpp
+++ b/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/eq.pass.cpp
@@ -12,6 +12,8 @@
 
 // static constexpr bool eq(char_type c1, char_type c2);
 
+// UNSUPPORTED: libcpp-has-no-wide-characters
+
 #include <string>
 #include <cassert>
 

diff  --git a/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/eq_int_type.pass.cpp b/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/eq_int_type.pass.cpp
index fbb1709000dfa..f5a5cc047d159 100644
--- a/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/eq_int_type.pass.cpp
+++ b/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/eq_int_type.pass.cpp
@@ -12,6 +12,8 @@
 
 // static constexpr bool eq_int_type(int_type c1, int_type c2);
 
+// UNSUPPORTED: libcpp-has-no-wide-characters
+
 #include <string>
 #include <cassert>
 

diff  --git a/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/find.pass.cpp b/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/find.pass.cpp
index 78a9ad5c3f90e..11e0f8e0d1d3d 100644
--- a/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/find.pass.cpp
+++ b/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/find.pass.cpp
@@ -13,6 +13,8 @@
 // static const char_type* find(const char_type* s, size_t n, const char_type& a);
 // constexpr in C++17
 
+// UNSUPPORTED: libcpp-has-no-wide-characters
+
 #include <string>
 #include <cassert>
 

diff  --git a/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/length.pass.cpp b/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/length.pass.cpp
index 742189205ab91..12ebe97c3af3e 100644
--- a/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/length.pass.cpp
+++ b/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/length.pass.cpp
@@ -13,6 +13,8 @@
 // static size_t length(const char_type* s);
 // constexpr in C++17
 
+// UNSUPPORTED: libcpp-has-no-wide-characters
+
 #include <string>
 #include <cassert>
 

diff  --git a/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/lt.pass.cpp b/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/lt.pass.cpp
index 5664692addb41..2bd23e99db1be 100644
--- a/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/lt.pass.cpp
+++ b/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/lt.pass.cpp
@@ -12,6 +12,8 @@
 
 // static constexpr bool lt(char_type c1, char_type c2);
 
+// UNSUPPORTED: libcpp-has-no-wide-characters
+
 #include <string>
 #include <cassert>
 

diff  --git a/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/move.pass.cpp b/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/move.pass.cpp
index 2e275354832f8..d09663346462d 100644
--- a/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/move.pass.cpp
+++ b/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/move.pass.cpp
@@ -12,6 +12,8 @@
 
 // static char_type* move(char_type* s1, const char_type* s2, size_t n);
 
+// UNSUPPORTED: libcpp-has-no-wide-characters
+
 #include <string>
 #include <cassert>
 

diff  --git a/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/not_eof.pass.cpp b/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/not_eof.pass.cpp
index 6ae2763b83ff5..c20ba810d1bf2 100644
--- a/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/not_eof.pass.cpp
+++ b/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/not_eof.pass.cpp
@@ -12,6 +12,8 @@
 
 // static constexpr int_type not_eof(int_type c);
 
+// UNSUPPORTED: libcpp-has-no-wide-characters
+
 #include <string>
 #include <cassert>
 

diff  --git a/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/to_char_type.pass.cpp b/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/to_char_type.pass.cpp
index 6d5ef1122d549..cea9e46616a25 100644
--- a/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/to_char_type.pass.cpp
+++ b/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/to_char_type.pass.cpp
@@ -12,6 +12,8 @@
 
 // static constexpr char_type to_char_type(int_type c);
 
+// UNSUPPORTED: libcpp-has-no-wide-characters
+
 #include <string>
 #include <cassert>
 

diff  --git a/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/to_int_type.pass.cpp b/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/to_int_type.pass.cpp
index 74f8e68dec1ea..02cc92e4e15b3 100644
--- a/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/to_int_type.pass.cpp
+++ b/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/to_int_type.pass.cpp
@@ -12,6 +12,8 @@
 
 // static constexpr int_type to_int_type(char_type c);
 
+// UNSUPPORTED: libcpp-has-no-wide-characters
+
 #include <string>
 #include <cassert>
 

diff  --git a/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/types.pass.cpp b/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/types.pass.cpp
index 810a142854acc..165b766b69909 100644
--- a/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/types.pass.cpp
+++ b/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar.t/types.pass.cpp
@@ -16,6 +16,8 @@
 // typedef streampos pos_type;
 // typedef mbstate_t state_type;
 
+// UNSUPPORTED: libcpp-has-no-wide-characters
+
 #include <string>
 #include <type_traits>
 

diff  --git a/libcxx/test/std/strings/string.classes/typedefs.pass.cpp b/libcxx/test/std/strings/string.classes/typedefs.pass.cpp
index 55717e3555194..0369f2546e8b1 100644
--- a/libcxx/test/std/strings/string.classes/typedefs.pass.cpp
+++ b/libcxx/test/std/strings/string.classes/typedefs.pass.cpp
@@ -25,7 +25,9 @@
 int main(int, char**)
 {
     static_assert((std::is_same<std::string, std::basic_string<char> >::value), "");
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     static_assert((std::is_same<std::wstring, std::basic_string<wchar_t> >::value), "");
+#endif
 #if defined(__cpp_lib_char8_t) && __cpp_lib_char8_t >= 201811L
     static_assert((std::is_same<std::u8string, std::basic_string<char8_t> >::value), "");
 #endif

diff  --git a/libcxx/test/std/strings/string.conversions/stod.pass.cpp b/libcxx/test/std/strings/string.conversions/stod.pass.cpp
index d13b695f21c28..2bab34d3cb23b 100644
--- a/libcxx/test/std/strings/string.conversions/stod.pass.cpp
+++ b/libcxx/test/std/strings/string.conversions/stod.pass.cpp
@@ -20,171 +20,140 @@
 
 int main(int, char**)
 {
-    assert(std::stod("0") == 0);
-    assert(std::stod(L"0") == 0);
-    assert(std::stod("-0") == 0);
-    assert(std::stod(L"-0") == 0);
-    assert(std::stod("-10") == -10);
-    assert(std::stod(L"-10.5") == -10.5);
-    assert(std::stod(" 10") == 10);
-    assert(std::stod(L" 10") == 10);
-    size_t idx = 0;
-    assert(std::stod("10g", &idx) == 10);
-    assert(idx == 2);
-    idx = 0;
-    assert(std::stod(L"10g", &idx) == 10);
-    assert(idx == 2);
-#ifndef TEST_HAS_NO_EXCEPTIONS
-    try
-#endif
-    {
-        assert(std::stod("1.e60", &idx) == 1.e60);
-        assert(idx == 5);
-    }
-#ifndef TEST_HAS_NO_EXCEPTIONS
-    catch (const std::out_of_range&)
-    {
-        assert(false);
-    }
-    try
-#endif
-    {
-        assert(std::stod(L"1.e60", &idx) == 1.e60);
-        assert(idx == 5);
-    }
-#ifndef TEST_HAS_NO_EXCEPTIONS
-    catch (const std::out_of_range&)
-    {
-        assert(false);
-    }
-    idx = 0;
-    try
-    {
-        assert(std::stod("1.e360", &idx) == INFINITY);
-        assert(false);
-    }
-    catch (const std::out_of_range&)
-    {
-        assert(idx == 0);
-    }
-    try
-    {
-        assert(std::stod(L"1.e360", &idx) == INFINITY);
-        assert(false);
-    }
-    catch (const std::out_of_range&)
-    {
-        assert(idx == 0);
-    }
-    try
-#endif
-    {
-        assert(std::stod("INF", &idx) == INFINITY);
-        assert(idx == 3);
-    }
-#ifndef TEST_HAS_NO_EXCEPTIONS
-    catch (const std::out_of_range&)
-    {
-        assert(false);
-    }
-#endif
-    idx = 0;
-#ifndef TEST_HAS_NO_EXCEPTIONS
-    try
-#endif
-    {
-        assert(std::stod(L"INF", &idx) == INFINITY);
-        assert(idx == 3);
-    }
-#ifndef TEST_HAS_NO_EXCEPTIONS
-    catch (const std::out_of_range&)
-    {
-        assert(false);
-    }
-#endif
-    idx = 0;
-#ifndef TEST_HAS_NO_EXCEPTIONS
-    try
-#endif
-    {
-        assert(std::isnan(std::stod("NAN", &idx)));
-        assert(idx == 3);
-    }
-#ifndef TEST_HAS_NO_EXCEPTIONS
-    catch (const std::out_of_range&)
-    {
-        assert(false);
-    }
-#endif
-    idx = 0;
+    // char
+    {
+        assert(std::stod("0") == 0);
+        assert(std::stod("-0") == 0);
+        assert(std::stod("-10") == -10);
+        assert(std::stod(" 10") == 10);
+        {
+            size_t idx = 0;
+            assert(std::stod("10g", &idx) == 10);
+            assert(idx == 2);
+        }
+        {
+            size_t idx = 0;
+            assert(std::stod("1.e60", &idx) == 1.e60);
+            assert(idx == 5);
+        }
+        {
+            size_t idx = 0;
+            assert(std::stod("INF", &idx) == INFINITY);
+            assert(idx == 3);
+        }
+        {
+            size_t idx = 0;
+            assert(std::isnan(std::stod("NAN", &idx)));
+            assert(idx == 3);
+        }
+
 #ifndef TEST_HAS_NO_EXCEPTIONS
-    try
-#endif
-    {
-        assert(std::isnan(std::stod(L"NAN", &idx)));
-        assert(idx == 3);
+        {
+            size_t idx = 0;
+            try {
+                assert(std::stod("1.e360", &idx) == INFINITY);
+                assert(false);
+            } catch (const std::out_of_range&) {
+                assert(idx == 0);
+            }
+        }
+        {
+            size_t idx = 0;
+            try {
+                std::stod("", &idx);
+                assert(false);
+            } catch (const std::invalid_argument&) {
+                assert(idx == 0);
+            }
+        }
+        {
+            size_t idx = 0;
+            try {
+                std::stod("  - 8", &idx);
+                assert(false);
+            } catch (const std::invalid_argument&) {
+                assert(idx == 0);
+            }
+        }
+        {
+            size_t idx = 0;
+            try {
+                std::stod("a1", &idx);
+                assert(false);
+            } catch (const std::invalid_argument&) {
+                assert(idx == 0);
+            }
+        }
+#endif // TEST_HAS_NO_EXCEPTIONS
     }
+
+    // wchar_t
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
+    {
+        assert(std::stod(L"0") == 0);
+        assert(std::stod(L"-0") == 0);
+        assert(std::stod(L"-10.5") == -10.5);
+        assert(std::stod(L" 10") == 10);
+        {
+            size_t idx = 0;
+            assert(std::stod(L"10g", &idx) == 10);
+            assert(idx == 2);
+        }
+        {
+            size_t idx = 0;
+            assert(std::stod(L"1.e60", &idx) == 1.e60);
+            assert(idx == 5);
+        }
+        {
+            size_t idx = 0;
+            assert(std::stod(L"INF", &idx) == INFINITY);
+            assert(idx == 3);
+        }
+        {
+            size_t idx = 0;
+            assert(std::isnan(std::stod(L"NAN", &idx)));
+            assert(idx == 3);
+        }
 #ifndef TEST_HAS_NO_EXCEPTIONS
-    catch (const std::out_of_range&)
-    {
-        assert(false);
-    }
-    idx = 0;
-    try
-    {
-        std::stod("", &idx);
-        assert(false);
-    }
-    catch (const std::invalid_argument&)
-    {
-        assert(idx == 0);
-    }
-    try
-    {
-        std::stod(L"", &idx);
-        assert(false);
-    }
-    catch (const std::invalid_argument&)
-    {
-        assert(idx == 0);
-    }
-    try
-    {
-        std::stod("  - 8", &idx);
-        assert(false);
-    }
-    catch (const std::invalid_argument&)
-    {
-        assert(idx == 0);
-    }
-    try
-    {
-        std::stod(L"  - 8", &idx);
-        assert(false);
-    }
-    catch (const std::invalid_argument&)
-    {
-        assert(idx == 0);
-    }
-    try
-    {
-        std::stod("a1", &idx);
-        assert(false);
-    }
-    catch (const std::invalid_argument&)
-    {
-        assert(idx == 0);
-    }
-    try
-    {
-        std::stod(L"a1", &idx);
-        assert(false);
-    }
-    catch (const std::invalid_argument&)
-    {
-        assert(idx == 0);
-    }
-#endif
+        {
+            size_t idx = 0;
+            try {
+                assert(std::stod(L"1.e360", &idx) == INFINITY);
+                assert(false);
+            } catch (const std::out_of_range&) {
+                assert(idx == 0);
+            }
+        }
+        {
+            size_t idx = 0;
+            try {
+                std::stod(L"", &idx);
+                assert(false);
+            } catch (const std::invalid_argument&) {
+                assert(idx == 0);
+            }
+        }
+        {
+            size_t idx = 0;
+            try {
+                std::stod(L"  - 8", &idx);
+                assert(false);
+            } catch (const std::invalid_argument&) {
+                assert(idx == 0);
+            }
+        }
+        {
+            size_t idx = 0;
+            try {
+                std::stod(L"a1", &idx);
+                assert(false);
+            } catch (const std::invalid_argument&) {
+                assert(idx == 0);
+            }
+        }
+#endif // TEST_HAS_NO_EXCEPTIONS
+    }
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
 
   return 0;
 }

diff  --git a/libcxx/test/std/strings/string.conversions/stof.pass.cpp b/libcxx/test/std/strings/string.conversions/stof.pass.cpp
index 22dda0bdb62ae..4f320ea30941d 100644
--- a/libcxx/test/std/strings/string.conversions/stof.pass.cpp
+++ b/libcxx/test/std/strings/string.conversions/stof.pass.cpp
@@ -21,167 +21,140 @@
 int main(int, char**)
 {
     assert(std::stof("0") == 0);
-    assert(std::stof(L"0") == 0);
     assert(std::stof("-0") == 0);
-    assert(std::stof(L"-0") == 0);
     assert(std::stof("-10") == -10);
-    assert(std::stof(L"-10.5") == -10.5);
     assert(std::stof(" 10") == 10);
-    assert(std::stof(L" 10") == 10);
-    size_t idx = 0;
-    assert(std::stof("10g", &idx) == 10);
-    assert(idx == 2);
-    idx = 0;
-    assert(std::stof(L"10g", &idx) == 10);
-    assert(idx == 2);
-#ifndef TEST_HAS_NO_EXCEPTIONS
-    idx = 0;
-    try
-    {
-        assert(std::stof("1.e60", &idx) == INFINITY);
-        assert(false);
-    }
-    catch (const std::out_of_range&)
-    {
-        assert(idx == 0);
-    }
-    try
-    {
-        assert(std::stof(L"1.e60", &idx) == INFINITY);
-        assert(false);
-    }
-    catch (const std::out_of_range&)
-    {
-        assert(idx == 0);
-    }
-    idx = 0;
-    try
-    {
-        assert(std::stof("1.e360", &idx) == INFINITY);
-        assert(false);
-    }
-    catch (const std::out_of_range&)
-    {
-        assert(idx == 0);
-    }
-    try
-    {
-        assert(std::stof(L"1.e360", &idx) == INFINITY);
-        assert(false);
-    }
-    catch (const std::out_of_range&)
     {
-        assert(idx == 0);
+        size_t idx = 0;
+        assert(std::stof("10g", &idx) == 10);
+        assert(idx == 2);
     }
-    try
-#endif
     {
+        size_t idx = 0;
         assert(std::stof("INF", &idx) == INFINITY);
         assert(idx == 3);
     }
-#ifndef TEST_HAS_NO_EXCEPTIONS
-    catch (const std::out_of_range&)
-    {
-        assert(false);
-    }
-#endif
-    idx = 0;
-#ifndef TEST_HAS_NO_EXCEPTIONS
-    try
-#endif
     {
-        assert(std::stof(L"INF", &idx) == INFINITY);
+        size_t idx = 0;
+        assert(std::isnan(std::stof("NAN", &idx)));
         assert(idx == 3);
     }
 #ifndef TEST_HAS_NO_EXCEPTIONS
-    catch (const std::out_of_range&)
     {
-        assert(false);
-    }
-#endif
-    idx = 0;
-#ifndef TEST_HAS_NO_EXCEPTIONS
-    try
-#endif
+        size_t idx = 0;
+        try {
+            assert(std::stof("1.e60", &idx) == INFINITY);
+            assert(false);
+        } catch (const std::out_of_range&) {
+            assert(idx == 0);
+        }
+    }
+    {
+        size_t idx = 0;
+        try {
+            assert(std::stof("1.e360", &idx) == INFINITY);
+            assert(false);
+        } catch (const std::out_of_range&) {
+            assert(idx == 0);
+        }
+    }
+    {
+        size_t idx = 0;
+        try {
+            std::stof("", &idx);
+            assert(false);
+        } catch (const std::invalid_argument&) {
+            assert(idx == 0);
+        }
+    }
+    {
+        size_t idx = 0;
+        try {
+            std::stof("  - 8", &idx);
+            assert(false);
+        } catch (const std::invalid_argument&) {
+            assert(idx == 0);
+        }
+    }
+    {
+        size_t idx = 0;
+        try {
+            std::stof("a1", &idx);
+            assert(false);
+        } catch (const std::invalid_argument&) {
+            assert(idx == 0);
+        }
+    }
+#endif // TEST_HAS_NO_EXCEPTIONS
+
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
+    assert(std::stof(L"0") == 0);
+    assert(std::stof(L"-0") == 0);
+    assert(std::stof(L"-10.5") == -10.5);
+    assert(std::stof(L" 10") == 10);
     {
-        assert(std::isnan(std::stof("NAN", &idx)));
-        assert(idx == 3);
+        size_t idx = 0;
+        assert(std::stof(L"10g", &idx) == 10);
+        assert(idx == 2);
     }
-#ifndef TEST_HAS_NO_EXCEPTIONS
-    catch (const std::out_of_range&)
     {
-        assert(false);
+        size_t idx = 0;
+        assert(std::stof(L"INF", &idx) == INFINITY);
+        assert(idx == 3);
     }
-#endif
-    idx = 0;
-#ifndef TEST_HAS_NO_EXCEPTIONS
-    try
-#endif
     {
+        size_t idx = 0;
         assert(std::isnan(std::stof(L"NAN", &idx)));
         assert(idx == 3);
     }
 #ifndef TEST_HAS_NO_EXCEPTIONS
-    catch (const std::out_of_range&)
-    {
-        assert(false);
-    }
-    idx = 0;
-    try
-    {
-        std::stof("", &idx);
-        assert(false);
-    }
-    catch (const std::invalid_argument&)
-    {
-        assert(idx == 0);
-    }
-    try
-    {
-        std::stof(L"", &idx);
-        assert(false);
-    }
-    catch (const std::invalid_argument&)
-    {
-        assert(idx == 0);
-    }
-    try
     {
-        std::stof("  - 8", &idx);
-        assert(false);
-    }
-    catch (const std::invalid_argument&)
-    {
-        assert(idx == 0);
-    }
-    try
-    {
-        std::stof(L"  - 8", &idx);
-        assert(false);
-    }
-    catch (const std::invalid_argument&)
-    {
-        assert(idx == 0);
-    }
-    try
-    {
-        std::stof("a1", &idx);
-        assert(false);
-    }
-    catch (const std::invalid_argument&)
-    {
-        assert(idx == 0);
-    }
-    try
-    {
-        std::stof(L"a1", &idx);
-        assert(false);
-    }
-    catch (const std::invalid_argument&)
-    {
-        assert(idx == 0);
-    }
-#endif
+        size_t idx = 0;
+        try {
+            assert(std::stof(L"1.e60", &idx) == INFINITY);
+            assert(false);
+        } catch (const std::out_of_range&) {
+            assert(idx == 0);
+        }
+    }
+    {
+        size_t idx = 0;
+        try {
+            assert(std::stof(L"1.e360", &idx) == INFINITY);
+            assert(false);
+        } catch (const std::out_of_range&) {
+            assert(idx == 0);
+        }
+    }
+    {
+        size_t idx = 0;
+        try {
+            std::stof(L"", &idx);
+            assert(false);
+        } catch (const std::invalid_argument&) {
+            assert(idx == 0);
+        }
+    }
+    {
+        size_t idx = 0;
+        try {
+            std::stof(L"  - 8", &idx);
+            assert(false);
+        } catch (const std::invalid_argument&) {
+            assert(idx == 0);
+        }
+    }
+    {
+        size_t idx = 0;
+        try {
+            std::stof(L"a1", &idx);
+            assert(false);
+        } catch (const std::invalid_argument&) {
+            assert(idx == 0);
+        }
+    }
+#endif // TEST_HAS_NO_EXCEPTIONS
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
 
   return 0;
 }

diff  --git a/libcxx/test/std/strings/string.conversions/stoi.pass.cpp b/libcxx/test/std/strings/string.conversions/stoi.pass.cpp
index b3e41633126e2..d6290431e94e0 100644
--- a/libcxx/test/std/strings/string.conversions/stoi.pass.cpp
+++ b/libcxx/test/std/strings/string.conversions/stoi.pass.cpp
@@ -20,95 +20,102 @@
 int main(int, char**)
 {
     assert(std::stoi("0") == 0);
-    assert(std::stoi(L"0") == 0);
     assert(std::stoi("-0") == 0);
-    assert(std::stoi(L"-0") == 0);
     assert(std::stoi("-10") == -10);
-    assert(std::stoi(L"-10") == -10);
     assert(std::stoi(" 10") == 10);
-    assert(std::stoi(L" 10") == 10);
-    size_t idx = 0;
-    assert(std::stoi("10g", &idx, 16) == 16);
-    assert(idx == 2);
-    idx = 0;
-    assert(std::stoi(L"10g", &idx, 16) == 16);
-    assert(idx == 2);
-#ifndef TEST_HAS_NO_EXCEPTIONS
-    if (std::numeric_limits<long>::max() > std::numeric_limits<int>::max())
     {
-        try
-        {
+        size_t idx = 0;
+        assert(std::stoi("10g", &idx, 16) == 16);
+        assert(idx == 2);
+    }
+#ifndef TEST_HAS_NO_EXCEPTIONS
+    if (std::numeric_limits<long>::max() > std::numeric_limits<int>::max()) {
+        size_t idx = 0;
+        try {
             std::stoi("0x100000000", &idx, 16);
             assert(false);
+        } catch (const std::out_of_range&) {
+
         }
-        catch (const std::out_of_range&)
-        {
-        }
-        try
-        {
-            std::stoi(L"0x100000000", &idx, 16);
-            assert(false);
-        }
-        catch (const std::out_of_range&)
-        {
-        }
-    }
-    idx = 0;
-    try
-    {
-        std::stoi("", &idx);
-        assert(false);
-    }
-    catch (const std::invalid_argument&)
-    {
-        assert(idx == 0);
     }
-    try
     {
-        std::stoi(L"", &idx);
-        assert(false);
-    }
-    catch (const std::invalid_argument&)
-    {
-        assert(idx == 0);
-    }
-    try
-    {
-        std::stoi("  - 8", &idx);
-        assert(false);
+        size_t idx = 0;
+        try {
+            std::stoi("", &idx);
+            assert(false);
+        } catch (const std::invalid_argument&) {
+            assert(idx == 0);
+        }
     }
-    catch (const std::invalid_argument&)
     {
-        assert(idx == 0);
+        size_t idx = 0;
+        try {
+            std::stoi("  - 8", &idx);
+            assert(false);
+        } catch (const std::invalid_argument&) {
+            assert(idx == 0);
+        }
     }
-    try
     {
-        std::stoi(L"  - 8", &idx);
-        assert(false);
+        size_t idx = 0;
+        try {
+            std::stoi("a1", &idx);
+            assert(false);
+        } catch (const std::invalid_argument&) {
+            assert(idx == 0);
+        }
     }
-    catch (const std::invalid_argument&)
+#endif // TEST_HAS_NO_EXCEPTIONS
+
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
+    assert(std::stoi(L"0") == 0);
+    assert(std::stoi(L"-0") == 0);
+    assert(std::stoi(L"-10") == -10);
+    assert(std::stoi(L" 10") == 10);
     {
-        assert(idx == 0);
+        size_t idx = 0;
+        assert(std::stoi(L"10g", &idx, 16) == 16);
+        assert(idx == 2);
     }
-    try
-    {
-        std::stoi("a1", &idx);
-        assert(false);
+#ifndef TEST_HAS_NO_EXCEPTIONS
+    if (std::numeric_limits<long>::max() > std::numeric_limits<int>::max()) {
+        size_t idx = 0;
+        try {
+            std::stoi(L"0x100000000", &idx, 16);
+            assert(false);
+        } catch (const std::out_of_range&) {
+
+        }
     }
-    catch (const std::invalid_argument&)
     {
-        assert(idx == 0);
+        size_t idx = 0;
+        try {
+            std::stoi(L"", &idx);
+            assert(false);
+        } catch (const std::invalid_argument&) {
+            assert(idx == 0);
+        }
     }
-    try
     {
-        std::stoi(L"a1", &idx);
-        assert(false);
+        size_t idx = 0;
+        try {
+            std::stoi(L"  - 8", &idx);
+            assert(false);
+        } catch (const std::invalid_argument&) {
+            assert(idx == 0);
+        }
     }
-    catch (const std::invalid_argument&)
     {
-        assert(idx == 0);
+        size_t idx = 0;
+        try {
+            std::stoi(L"a1", &idx);
+            assert(false);
+        } catch (const std::invalid_argument&) {
+            assert(idx == 0);
+        }
     }
-#endif
+#endif // TEST_HAS_NO_EXCEPTIONS
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
 
   return 0;
 }

diff  --git a/libcxx/test/std/strings/string.conversions/stol.pass.cpp b/libcxx/test/std/strings/string.conversions/stol.pass.cpp
index a05a4b162148d..4196646f84c3c 100644
--- a/libcxx/test/std/strings/string.conversions/stol.pass.cpp
+++ b/libcxx/test/std/strings/string.conversions/stol.pass.cpp
@@ -20,96 +20,104 @@
 int main(int, char**)
 {
     assert(std::stol("0") == 0);
-    assert(std::stol(L"0") == 0);
     assert(std::stol("-0") == 0);
-    assert(std::stol(L"-0") == 0);
     assert(std::stol("-10") == -10);
-    assert(std::stol(L"-10") == -10);
     assert(std::stol(" 10") == 10);
-    assert(std::stol(L" 10") == 10);
-    size_t idx = 0;
-    assert(std::stol("10g", &idx, 16) == 16);
-    assert(idx == 2);
-    idx = 0;
-    assert(std::stol(L"10g", &idx, 16) == 16);
-    assert(idx == 2);
-#ifndef TEST_HAS_NO_EXCEPTIONS
-    idx = 0;
-    try
-    {
-        std::stol("", &idx);
-        assert(false);
-    }
-    catch (const std::invalid_argument&)
-    {
-        assert(idx == 0);
-    }
-    try
-    {
-        std::stol(L"", &idx);
-        assert(false);
-    }
-    catch (const std::invalid_argument&)
-    {
-        assert(idx == 0);
-    }
-    try
-    {
-        std::stol("  - 8", &idx);
-        assert(false);
-    }
-    catch (const std::invalid_argument&)
-    {
-        assert(idx == 0);
-    }
-    try
-    {
-        std::stol(L"  - 8", &idx);
-        assert(false);
-    }
-    catch (const std::invalid_argument&)
     {
-        assert(idx == 0);
+        size_t idx = 0;
+        assert(std::stol("10g", &idx, 16) == 16);
+        assert(idx == 2);
     }
-    try
-    {
-        std::stol("a1", &idx);
-        assert(false);
-    }
-    catch (const std::invalid_argument&)
-    {
-        assert(idx == 0);
-    }
-    try
-    {
-        std::stol(L"a1", &idx);
-        assert(false);
-    }
-    catch (const std::invalid_argument&)
-    {
-        assert(idx == 0);
-    }
-    try
-    {
-        // LWG#2009 and PR14919
-        std::stol("9999999999999999999999999999999999999999999999999", &idx);
-        assert(false);
-    }
-    catch (const std::out_of_range&)
+#ifndef TEST_HAS_NO_EXCEPTIONS
     {
-        assert(idx == 0);
-    }
-    try
+        size_t idx = 0;
+        try {
+            std::stol("", &idx);
+            assert(false);
+        } catch (const std::invalid_argument&) {
+            assert(idx == 0);
+        }
+    }
+    {
+        size_t idx = 0;
+        try {
+            std::stol("  - 8", &idx);
+            assert(false);
+        } catch (const std::invalid_argument&) {
+            assert(idx == 0);
+        }
+    }
+    {
+        size_t idx = 0;
+        try {
+            std::stol("a1", &idx);
+            assert(false);
+        } catch (const std::invalid_argument&) {
+            assert(idx == 0);
+        }
+    }
+    {
+        size_t idx = 0;
+        try {
+            // LWG#2009 and PR14919
+            std::stol("9999999999999999999999999999999999999999999999999", &idx);
+            assert(false);
+        } catch (const std::out_of_range&) {
+            assert(idx == 0);
+        }
+    }
+#endif // TEST_HAS_NO_EXCEPTIONS
+
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
+    assert(std::stol(L"0") == 0);
+    assert(std::stol(L"-0") == 0);
+    assert(std::stol(L"-10") == -10);
+    assert(std::stol(L" 10") == 10);
     {
-        // LWG#2009 and PR14919
-        std::stol(L"9999999999999999999999999999999999999999999999999", &idx);
-        assert(false);
+        size_t idx = 0;
+        assert(std::stol(L"10g", &idx, 16) == 16);
+        assert(idx == 2);
     }
-    catch (const std::out_of_range&)
+#ifndef TEST_HAS_NO_EXCEPTIONS
     {
-        assert(idx == 0);
-    }
-#endif
+        size_t idx = 0;
+        try {
+            std::stol(L"", &idx);
+            assert(false);
+        } catch (const std::invalid_argument&) {
+            assert(idx == 0);
+        }
+    }
+    {
+        size_t idx = 0;
+        try {
+            std::stol(L"  - 8", &idx);
+            assert(false);
+        } catch (const std::invalid_argument&) {
+            assert(idx == 0);
+        }
+    }
+    {
+        size_t idx = 0;
+        try {
+            std::stol(L"a1", &idx);
+            assert(false);
+        } catch (const std::invalid_argument&) {
+            assert(idx == 0);
+        }
+    }
+    {
+        size_t idx = 0;
+        try {
+            // LWG#2009 and PR14919
+            std::stol(L"9999999999999999999999999999999999999999999999999", &idx);
+            assert(false);
+        } catch (const std::out_of_range&) {
+            assert(idx == 0);
+        }
+    }
+#endif // TEST_HAS_NO_EXCEPTIONS
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
 
   return 0;
 }

diff  --git a/libcxx/test/std/strings/string.conversions/stold.pass.cpp b/libcxx/test/std/strings/string.conversions/stold.pass.cpp
index 4b1b1b1292d18..fd228c6a52624 100644
--- a/libcxx/test/std/strings/string.conversions/stold.pass.cpp
+++ b/libcxx/test/std/strings/string.conversions/stold.pass.cpp
@@ -21,172 +21,133 @@
 int main(int, char**)
 {
     assert(std::stold("0") == 0);
-    assert(std::stold(L"0") == 0);
     assert(std::stold("-0") == 0);
-    assert(std::stold(L"-0") == 0);
     assert(std::stold("-10") == -10);
-    assert(std::stold(L"-10.5") == -10.5);
     assert(std::stold(" 10") == 10);
-    assert(std::stold(L" 10") == 10);
-    size_t idx = 0;
-    assert(std::stold("10g", &idx) == 10);
-    assert(idx == 2);
-    idx = 0;
-    assert(std::stold(L"10g", &idx) == 10);
-    assert(idx == 2);
-#ifndef TEST_HAS_NO_EXCEPTIONS
-    try
-#endif
-    {
-        assert(std::stold("1.e60", &idx) == 1.e60L);
-        assert(idx == 5);
-    }
-#ifndef TEST_HAS_NO_EXCEPTIONS
-    catch (const std::out_of_range&)
     {
-        assert(false);
+        size_t idx = 0;
+        assert(std::stold("10g", &idx) == 10);
+        assert(idx == 2);
     }
-    try
-#endif
     {
-        assert(std::stold(L"1.e60", &idx) == 1.e60L);
+        size_t idx = 0;
+        assert(std::stold("1.e60", &idx) == 1.e60L);
         assert(idx == 5);
     }
-#ifndef TEST_HAS_NO_EXCEPTIONS
-    catch (const std::out_of_range&)
-    {
-        assert(false);
-    }
-#endif
-    idx = 0;
-#ifndef TEST_HAS_NO_EXCEPTIONS
-    try
-    {
-        assert(std::stold("1.e6000", &idx) == INFINITY);
-        assert(false);
-    }
-    catch (const std::out_of_range&)
-    {
-        assert(idx == 0);
-    }
-    try
-    {
-        assert(std::stold(L"1.e6000", &idx) == INFINITY);
-        assert(false);
-    }
-    catch (const std::out_of_range&)
-    {
-        assert(idx == 0);
-    }
-    try
-#endif
     {
+        size_t idx = 0;
         assert(std::stold("INF", &idx) == INFINITY);
         assert(idx == 3);
     }
-#ifndef TEST_HAS_NO_EXCEPTIONS
-    catch (const std::out_of_range&)
-    {
-        assert(false);
-    }
-#endif
-    idx = 0;
-#ifndef TEST_HAS_NO_EXCEPTIONS
-    try
-#endif
     {
-        assert(std::stold(L"INF", &idx) == INFINITY);
+        size_t idx = 0;
+        assert(std::isnan(std::stold("NAN", &idx)));
         assert(idx == 3);
     }
+
 #ifndef TEST_HAS_NO_EXCEPTIONS
-    catch (const std::out_of_range&)
     {
-        assert(false);
+        size_t idx = 0;
+        try {
+            std::stold("", &idx);
+            assert(false);
+        } catch (const std::invalid_argument&) {
+            assert(idx == 0);
+        }
+    }
+    {
+        size_t idx = 0;
+        try {
+            std::stold("  - 8", &idx);
+            assert(false);
+        } catch (const std::invalid_argument&) {
+            assert(idx == 0);
+        }
+    }
+    {
+        size_t idx = 0;
+        try {
+            std::stold("a1", &idx);
+            assert(false);
+        } catch (const std::invalid_argument&) {
+            assert(idx == 0);
+        }
+    }
+    {
+        size_t idx = 0;
+        try {
+            assert(std::stold("1.e6000", &idx) == INFINITY);
+            assert(false);
+        } catch (const std::out_of_range&) {
+            assert(idx == 0);
+        }
+    }
+#endif // TEST_HAS_NO_EXCEPTIONS
+
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
+    assert(std::stold(L"0") == 0);
+    assert(std::stold(L"-0") == 0);
+    assert(std::stold(L"-10.5") == -10.5);
+    assert(std::stold(L" 10") == 10);
+    {
+        size_t idx = 0;
+        assert(std::stold(L"10g", &idx) == 10);
+        assert(idx == 2);
     }
-#endif
-    idx = 0;
-#ifndef TEST_HAS_NO_EXCEPTIONS
-    try
-#endif
     {
-        assert(std::isnan(std::stold("NAN", &idx)));
-        assert(idx == 3);
+        size_t idx = 0;
+        assert(std::stold(L"1.e60", &idx) == 1.e60L);
+        assert(idx == 5);
     }
-#ifndef TEST_HAS_NO_EXCEPTIONS
-    catch (const std::out_of_range&)
     {
-        assert(false);
+        size_t idx = 0;
+        assert(std::stold(L"INF", &idx) == INFINITY);
+        assert(idx == 3);
     }
-#endif
-    idx = 0;
-#ifndef TEST_HAS_NO_EXCEPTIONS
-    try
-#endif
     {
+        size_t idx = 0;
         assert(std::isnan(std::stold(L"NAN", &idx)));
         assert(idx == 3);
     }
 #ifndef TEST_HAS_NO_EXCEPTIONS
-    catch (const std::out_of_range&)
-    {
-        assert(false);
-    }
-    idx = 0;
-    try
-    {
-        std::stold("", &idx);
-        assert(false);
-    }
-    catch (const std::invalid_argument&)
-    {
-        assert(idx == 0);
-    }
-    try
-    {
-        std::stold(L"", &idx);
-        assert(false);
-    }
-    catch (const std::invalid_argument&)
     {
-        assert(idx == 0);
-    }
-    try
-    {
-        std::stold("  - 8", &idx);
-        assert(false);
-    }
-    catch (const std::invalid_argument&)
-    {
-        assert(idx == 0);
-    }
-    try
-    {
-        std::stold(L"  - 8", &idx);
-        assert(false);
-    }
-    catch (const std::invalid_argument&)
-    {
-        assert(idx == 0);
-    }
-    try
-    {
-        std::stold("a1", &idx);
-        assert(false);
-    }
-    catch (const std::invalid_argument&)
-    {
-        assert(idx == 0);
-    }
-    try
-    {
-        std::stold(L"a1", &idx);
-        assert(false);
-    }
-    catch (const std::invalid_argument&)
-    {
-        assert(idx == 0);
-    }
-#endif
+        size_t idx = 0;
+        try {
+            std::stold(L"", &idx);
+            assert(false);
+        } catch (const std::invalid_argument&) {
+            assert(idx == 0);
+        }
+    }
+    {
+        size_t idx = 0;
+        try {
+            std::stold(L"  - 8", &idx);
+            assert(false);
+        } catch (const std::invalid_argument&) {
+            assert(idx == 0);
+        }
+    }
+    {
+        size_t idx = 0;
+        try {
+            std::stold(L"a1", &idx);
+            assert(false);
+        } catch (const std::invalid_argument&) {
+            assert(idx == 0);
+        }
+    }
+    {
+        size_t idx = 0;
+        try {
+            assert(std::stold(L"1.e6000", &idx) == INFINITY);
+            assert(false);
+        } catch (const std::out_of_range&) {
+            assert(idx == 0);
+        }
+    }
+#endif // TEST_HAS_NO_EXCEPTIONS
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
 
   return 0;
 }

diff  --git a/libcxx/test/std/strings/string.conversions/stoll.pass.cpp b/libcxx/test/std/strings/string.conversions/stoll.pass.cpp
index bccf845cc5428..a6d53e54e2beb 100644
--- a/libcxx/test/std/strings/string.conversions/stoll.pass.cpp
+++ b/libcxx/test/std/strings/string.conversions/stoll.pass.cpp
@@ -20,96 +20,104 @@
 int main(int, char**)
 {
     assert(std::stoll("0") == 0);
-    assert(std::stoll(L"0") == 0);
     assert(std::stoll("-0") == 0);
-    assert(std::stoll(L"-0") == 0);
     assert(std::stoll("-10") == -10);
-    assert(std::stoll(L"-10") == -10);
     assert(std::stoll(" 10") == 10);
-    assert(std::stoll(L" 10") == 10);
-    size_t idx = 0;
-    assert(std::stoll("10g", &idx, 16) == 16);
-    assert(idx == 2);
-    idx = 0;
-    assert(std::stoll(L"10g", &idx, 16) == 16);
-    assert(idx == 2);
-#ifndef TEST_HAS_NO_EXCEPTIONS
-    idx = 0;
-    try
-    {
-        std::stoll("", &idx);
-        assert(false);
-    }
-    catch (const std::invalid_argument&)
-    {
-        assert(idx == 0);
-    }
-    try
-    {
-        std::stoll(L"", &idx);
-        assert(false);
-    }
-    catch (const std::invalid_argument&)
-    {
-        assert(idx == 0);
-    }
-    try
-    {
-        std::stoll("  - 8", &idx);
-        assert(false);
-    }
-    catch (const std::invalid_argument&)
-    {
-        assert(idx == 0);
-    }
-    try
-    {
-        std::stoll(L"  - 8", &idx);
-        assert(false);
-    }
-    catch (const std::invalid_argument&)
     {
-        assert(idx == 0);
+        size_t idx = 0;
+        assert(std::stoll("10g", &idx, 16) == 16);
+        assert(idx == 2);
     }
-    try
-    {
-        std::stoll("a1", &idx);
-        assert(false);
-    }
-    catch (const std::invalid_argument&)
-    {
-        assert(idx == 0);
-    }
-    try
-    {
-        std::stoll(L"a1", &idx);
-        assert(false);
-    }
-    catch (const std::invalid_argument&)
-    {
-        assert(idx == 0);
-    }
-    try
-    {
-        // LWG#2009 and PR14919
-        std::stoll("99999999999999999999999999", &idx);
-        assert(false);
-    }
-    catch (const std::out_of_range&)
+#ifndef TEST_HAS_NO_EXCEPTIONS
     {
-        assert(idx == 0);
-    }
-    try
+        size_t idx = 0;
+        try {
+            std::stoll("", &idx);
+            assert(false);
+        } catch (const std::invalid_argument&) {
+            assert(idx == 0);
+        }
+    }
+    {
+        size_t idx = 0;
+        try {
+            std::stoll("  - 8", &idx);
+            assert(false);
+        } catch (const std::invalid_argument&) {
+            assert(idx == 0);
+        }
+    }
+    {
+        size_t idx = 0;
+        try {
+            std::stoll("a1", &idx);
+            assert(false);
+        } catch (const std::invalid_argument&) {
+            assert(idx == 0);
+        }
+    }
+    {
+        size_t idx = 0;
+        try {
+            // LWG#2009 and PR14919
+            std::stoll("99999999999999999999999999", &idx);
+            assert(false);
+        } catch (const std::out_of_range&) {
+            assert(idx == 0);
+        }
+    }
+#endif // TEST_HAS_NO_EXCEPTIONS
+
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
+    assert(std::stoll(L"0") == 0);
+    assert(std::stoll(L"-0") == 0);
+    assert(std::stoll(L"-10") == -10);
+    assert(std::stoll(L" 10") == 10);
     {
-        // LWG#2009 and PR14919
-        std::stoll(L"99999999999999999999999999", &idx);
-        assert(false);
+        size_t idx = 0;
+        assert(std::stoll(L"10g", &idx, 16) == 16);
+        assert(idx == 2);
     }
-    catch (const std::out_of_range&)
+#ifndef TEST_HAS_NO_EXCEPTIONS
     {
-        assert(idx == 0);
-    }
-#endif
+        size_t idx = 0;
+        try {
+            std::stoll(L"", &idx);
+            assert(false);
+        } catch (const std::invalid_argument&) {
+            assert(idx == 0);
+        }
+    }
+    {
+        size_t idx = 0;
+        try {
+            std::stoll(L"  - 8", &idx);
+            assert(false);
+        } catch (const std::invalid_argument&) {
+            assert(idx == 0);
+        }
+    }
+    {
+        size_t idx = 0;
+        try {
+            std::stoll(L"a1", &idx);
+            assert(false);
+        } catch (const std::invalid_argument&) {
+            assert(idx == 0);
+        }
+    }
+    {
+        size_t idx = 0;
+        try {
+            // LWG#2009 and PR14919
+            std::stoll(L"99999999999999999999999999", &idx);
+            assert(false);
+        } catch (const std::out_of_range&) {
+            assert(idx == 0);
+        }
+    }
+#endif // TEST_HAS_NO_EXCEPTIONS
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
 
   return 0;
 }

diff  --git a/libcxx/test/std/strings/string.conversions/stoul.pass.cpp b/libcxx/test/std/strings/string.conversions/stoul.pass.cpp
index c620925d85d49..37e7f9d49a8de 100644
--- a/libcxx/test/std/strings/string.conversions/stoul.pass.cpp
+++ b/libcxx/test/std/strings/string.conversions/stoul.pass.cpp
@@ -20,94 +20,102 @@
 int main(int, char**)
 {
     assert(std::stoul("0") == 0);
-    assert(std::stoul(L"0") == 0);
     assert(std::stoul("-0") == 0);
-    assert(std::stoul(L"-0") == 0);
     assert(std::stoul(" 10") == 10);
-    assert(std::stoul(L" 10") == 10);
-    size_t idx = 0;
-    assert(std::stoul("10g", &idx, 16) == 16);
-    assert(idx == 2);
-    idx = 0;
-    assert(std::stoul(L"10g", &idx, 16) == 16);
-    assert(idx == 2);
-#ifndef TEST_HAS_NO_EXCEPTIONS
-    idx = 0;
-    try
-    {
-        std::stoul("", &idx);
-        assert(false);
-    }
-    catch (const std::invalid_argument&)
-    {
-        assert(idx == 0);
-    }
-    try
-    {
-        std::stoul(L"", &idx);
-        assert(false);
-    }
-    catch (const std::invalid_argument&)
-    {
-        assert(idx == 0);
-    }
-    try
-    {
-        std::stoul("  - 8", &idx);
-        assert(false);
-    }
-    catch (const std::invalid_argument&)
-    {
-        assert(idx == 0);
-    }
-    try
-    {
-        std::stoul(L"  - 8", &idx);
-        assert(false);
-    }
-    catch (const std::invalid_argument&)
     {
-        assert(idx == 0);
+        size_t idx = 0;
+        assert(std::stoul("10g", &idx, 16) == 16);
+        assert(idx == 2);
     }
-    try
-    {
-        std::stoul("a1", &idx);
-        assert(false);
-    }
-    catch (const std::invalid_argument&)
-    {
-        assert(idx == 0);
-    }
-    try
-    {
-        std::stoul(L"a1", &idx);
-        assert(false);
-    }
-    catch (const std::invalid_argument&)
-    {
-        assert(idx == 0);
-    }
-    try
-    {
-        // LWG#2009 and PR14919
-        std::stoul("9999999999999999999999999999999999999999999999999", &idx);
-        assert(false);
-    }
-    catch (const std::out_of_range&)
+#ifndef TEST_HAS_NO_EXCEPTIONS
     {
-        assert(idx == 0);
-    }
-    try
+        size_t idx = 0;
+        try {
+            std::stoul("", &idx);
+            assert(false);
+        } catch (const std::invalid_argument&) {
+            assert(idx == 0);
+        }
+    }
+    {
+        size_t idx = 0;
+        try {
+            std::stoul("  - 8", &idx);
+            assert(false);
+        } catch (const std::invalid_argument&) {
+            assert(idx == 0);
+        }
+    }
+    {
+        size_t idx = 0;
+        try {
+            std::stoul("a1", &idx);
+            assert(false);
+        } catch (const std::invalid_argument&) {
+            assert(idx == 0);
+        }
+    }
+    {
+        size_t idx = 0;
+        try {
+            // LWG#2009 and PR14919
+            std::stoul("9999999999999999999999999999999999999999999999999", &idx);
+            assert(false);
+        } catch (const std::out_of_range&) {
+            assert(idx == 0);
+        }
+    }
+#endif // TEST_HAS_NO_EXCEPTIONS
+
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
+    assert(std::stoul(L"0") == 0);
+    assert(std::stoul(L"-0") == 0);
+    assert(std::stoul(L" 10") == 10);
     {
-        // LWG#2009 and PR14919
-        std::stoul(L"9999999999999999999999999999999999999999999999999", &idx);
-        assert(false);
+        size_t idx = 0;
+        assert(std::stoul(L"10g", &idx, 16) == 16);
+        assert(idx == 2);
     }
-    catch (const std::out_of_range&)
+#ifndef TEST_HAS_NO_EXCEPTIONS
     {
-        assert(idx == 0);
-    }
-#endif
+        size_t idx = 0;
+        try {
+            std::stoul(L"", &idx);
+            assert(false);
+        } catch (const std::invalid_argument&) {
+            assert(idx == 0);
+        }
+    }
+    {
+        size_t idx = 0;
+        try {
+            std::stoul(L"  - 8", &idx);
+            assert(false);
+        } catch (const std::invalid_argument&) {
+            assert(idx == 0);
+        }
+    }
+    {
+        size_t idx = 0;
+        try {
+            std::stoul(L"a1", &idx);
+            assert(false);
+        } catch (const std::invalid_argument&) {
+            assert(idx == 0);
+        }
+    }
+    {
+        size_t idx = 0;
+        try {
+            // LWG#2009 and PR14919
+            std::stoul(L"9999999999999999999999999999999999999999999999999", &idx);
+            assert(false);
+        } catch (const std::out_of_range&) {
+            assert(idx == 0);
+        }
+    }
+#endif // TEST_HAS_NO_EXCEPTIONS
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
 
   return 0;
 }

diff  --git a/libcxx/test/std/strings/string.conversions/stoull.pass.cpp b/libcxx/test/std/strings/string.conversions/stoull.pass.cpp
index 803065cf34af6..dcfc5832e2027 100644
--- a/libcxx/test/std/strings/string.conversions/stoull.pass.cpp
+++ b/libcxx/test/std/strings/string.conversions/stoull.pass.cpp
@@ -20,95 +20,102 @@
 int main(int, char**)
 {
     assert(std::stoull("0") == 0);
-    assert(std::stoull(L"0") == 0);
     assert(std::stoull("-0") == 0);
-    assert(std::stoull(L"-0") == 0);
     assert(std::stoull(" 10") == 10);
-    assert(std::stoull(L" 10") == 10);
-    size_t idx = 0;
-    assert(std::stoull("10g", &idx, 16) == 16);
-    assert(idx == 2);
-    idx = 0;
-    assert(std::stoull(L"10g", &idx, 16) == 16);
-    assert(idx == 2);
-#ifndef TEST_HAS_NO_EXCEPTIONS
-    idx = 0;
-    try
-    {
-        std::stoull("", &idx);
-        assert(false);
-    }
-    catch (const std::invalid_argument&)
-    {
-        assert(idx == 0);
-    }
-    idx = 0;
-    try
-    {
-        std::stoull(L"", &idx);
-        assert(false);
-    }
-    catch (const std::invalid_argument&)
-    {
-        assert(idx == 0);
-    }
-    try
-    {
-        std::stoull("  - 8", &idx);
-        assert(false);
-    }
-    catch (const std::invalid_argument&)
-    {
-        assert(idx == 0);
-    }
-    try
-    {
-        std::stoull(L"  - 8", &idx);
-        assert(false);
-    }
-    catch (const std::invalid_argument&)
     {
-        assert(idx == 0);
+        size_t idx = 0;
+        assert(std::stoull("10g", &idx, 16) == 16);
+        assert(idx == 2);
     }
-    try
-    {
-        std::stoull("a1", &idx);
-        assert(false);
-    }
-    catch (const std::invalid_argument&)
-    {
-        assert(idx == 0);
-    }
-    try
-    {
-        std::stoull(L"a1", &idx);
-        assert(false);
-    }
-    catch (const std::invalid_argument&)
-    {
-        assert(idx == 0);
-    }
-    try
-    {
-        // LWG#2009 and PR14919
-        std::stoull("9999999999999999999999999999999999999999999999999", &idx);
-        assert(false);
-    }
-    catch (const std::out_of_range&)
+#ifndef TEST_HAS_NO_EXCEPTIONS
     {
-        assert(idx == 0);
-    }
-    try
+        size_t idx = 0;
+        try {
+            std::stoull("", &idx);
+            assert(false);
+        } catch (const std::invalid_argument&) {
+            assert(idx == 0);
+        }
+    }
+    {
+        size_t idx = 0;
+        try {
+            std::stoull("  - 8", &idx);
+            assert(false);
+        } catch (const std::invalid_argument&) {
+            assert(idx == 0);
+        }
+    }
+    {
+        size_t idx = 0;
+        try {
+            std::stoull("a1", &idx);
+            assert(false);
+        } catch (const std::invalid_argument&) {
+            assert(idx == 0);
+        }
+    }
+    {
+        size_t idx = 0;
+        try {
+            // LWG#2009 and PR14919
+            std::stoull("9999999999999999999999999999999999999999999999999", &idx);
+            assert(false);
+        } catch (const std::out_of_range&) {
+            assert(idx == 0);
+        }
+    }
+#endif // TEST_HAS_NO_EXCEPTIONS
+
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
+    assert(std::stoull(L"0") == 0);
+    assert(std::stoull(L"-0") == 0);
+    assert(std::stoull(L" 10") == 10);
     {
-        // LWG#2009 and PR14919
-        std::stoull(L"9999999999999999999999999999999999999999999999999", &idx);
-        assert(false);
+        size_t idx = 0;
+        assert(std::stoull(L"10g", &idx, 16) == 16);
+        assert(idx == 2);
     }
-    catch (const std::out_of_range&)
+#ifndef TEST_HAS_NO_EXCEPTIONS
     {
-        assert(idx == 0);
-    }
-#endif
+        size_t idx = 0;
+        try {
+            std::stoull(L"", &idx);
+            assert(false);
+        } catch (const std::invalid_argument&) {
+            assert(idx == 0);
+        }
+    }
+    {
+        size_t idx = 0;
+        try {
+            std::stoull(L"  - 8", &idx);
+            assert(false);
+        } catch (const std::invalid_argument&) {
+            assert(idx == 0);
+        }
+    }
+    {
+        size_t idx = 0;
+        try {
+            std::stoull(L"a1", &idx);
+            assert(false);
+        } catch (const std::invalid_argument&) {
+            assert(idx == 0);
+        }
+    }
+    {
+        size_t idx = 0;
+        try {
+            // LWG#2009 and PR14919
+            std::stoull(L"9999999999999999999999999999999999999999999999999", &idx);
+            assert(false);
+        } catch (const std::out_of_range&) {
+            assert(idx == 0);
+        }
+    }
+#endif // TEST_HAS_NO_EXCEPTIONS
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
 
   return 0;
 }

diff  --git a/libcxx/test/std/strings/string.conversions/to_wstring.pass.cpp b/libcxx/test/std/strings/string.conversions/to_wstring.pass.cpp
index f3b4712f341b2..7909cc860859a 100644
--- a/libcxx/test/std/strings/string.conversions/to_wstring.pass.cpp
+++ b/libcxx/test/std/strings/string.conversions/to_wstring.pass.cpp
@@ -6,6 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+// XFAIL: libcpp-has-no-wide-characters
+
 // <string>
 
 // wstring to_wstring(int val);

diff  --git a/libcxx/test/std/strings/string.view/string.view.capacity/capacity.pass.cpp b/libcxx/test/std/strings/string.view/string.view.capacity/capacity.pass.cpp
index 741e2c1f5b5d0..2283ccab6d7c5 100644
--- a/libcxx/test/std/strings/string.view/string.view.capacity/capacity.pass.cpp
+++ b/libcxx/test/std/strings/string.view/string.view.capacity/capacity.pass.cpp
@@ -68,17 +68,21 @@ int main(int, char**) {
 #endif
     test1<std::u16string_view> ();
     test1<std::u32string_view> ();
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     test1<std::wstring_view> ();
+#endif
 
     test2 ( "ABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDE", 105 );
     test2 ( "ABCDE", 5 );
     test2 ( "a", 1 );
     test2 ( "", 0 );
 
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     test2 ( L"ABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDE", 105 );
     test2 ( L"ABCDE", 5 );
     test2 ( L"a", 1 );
     test2 ( L"", 0 );
+#endif
 
 #if defined(__cpp_lib_char8_t) && __cpp_lib_char8_t >= 201811L
     test2 ( u8"ABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDE", 105 );

diff  --git a/libcxx/test/std/strings/string.view/string.view.cons/assign.pass.cpp b/libcxx/test/std/strings/string.view/string.view.cons/assign.pass.cpp
index 5ca2f45a0ee61..c80c8e5604da4 100644
--- a/libcxx/test/std/strings/string.view/string.view.cons/assign.pass.cpp
+++ b/libcxx/test/std/strings/string.view/string.view.cons/assign.pass.cpp
@@ -35,23 +35,27 @@ int main(int, char**) {
     assert( test<std::u8string_view>  (u8"1234"));
 #endif
 #if TEST_STD_VER >= 11
-#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
+#   ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
     assert( test<std::u16string_view> ( u"1234"));
     assert( test<std::u32string_view> ( U"1234"));
+#   endif
 #endif
-#endif
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     assert( test<std::wstring_view>   ( L"1234"));
+#endif
 
 #if TEST_STD_VER > 11
     static_assert( test<std::string_view>    ({  "abc", 3}), "");
-#if defined(__cpp_lib_char8_t) && __cpp_lib_char8_t >= 201811L
+#   if defined(__cpp_lib_char8_t) && __cpp_lib_char8_t >= 201811L
     static_assert( test<std::u8string_view>  ({u8"abc", 3}), "");
-#endif
-#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
+#   endif
+#   ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
     static_assert( test<std::u16string_view> ({ u"abc", 3}), "");
     static_assert( test<std::u32string_view> ({ U"abc", 3}), "");
-#endif
+#   endif
+#   ifndef TEST_HAS_NO_WIDE_CHARACTERS
     static_assert( test<std::wstring_view>   ({ L"abc", 3}), "");
+#   endif
 #endif
 
   return 0;

diff  --git a/libcxx/test/std/strings/string.view/string.view.cons/deduct.pass.cpp b/libcxx/test/std/strings/string.view/string.view.cons/deduct.pass.cpp
index f838fda8e2621..e0ff5f6c0cd53 100644
--- a/libcxx/test/std/strings/string.view/string.view.cons/deduct.pass.cpp
+++ b/libcxx/test/std/strings/string.view/string.view.cons/deduct.pass.cpp
@@ -31,7 +31,9 @@ constexpr void test() {
 
 constexpr void test() {
   test<char, char*>();
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
   test<wchar_t, wchar_t*>();
+#endif
   test<char8_t, char8_t*>();
   test<char16_t, char16_t*>();
   test<char32_t, char32_t*>();

diff  --git a/libcxx/test/std/strings/string.view/string.view.cons/default.pass.cpp b/libcxx/test/std/strings/string.view/string.view.cons/default.pass.cpp
index ad4621752757d..3134210fc7ede 100644
--- a/libcxx/test/std/strings/string.view/string.view.cons/default.pass.cpp
+++ b/libcxx/test/std/strings/string.view/string.view.cons/default.pass.cpp
@@ -41,8 +41,9 @@ int main(int, char**) {
     test<std::u8string_view> ();
 #endif
     test<std::u32string_view> ();
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     test<std::wstring_view> ();
-
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/strings/string.view/string.view.cons/from_iterator_sentinel.pass.cpp b/libcxx/test/std/strings/string.view/string.view.cons/from_iterator_sentinel.pass.cpp
index a65ba2763e33a..e7a9e0a836db1 100644
--- a/libcxx/test/std/strings/string.view/string.view.cons/from_iterator_sentinel.pass.cpp
+++ b/libcxx/test/std/strings/string.view/string.view.cons/from_iterator_sentinel.pass.cpp
@@ -32,7 +32,9 @@ constexpr void test() {
 
 constexpr bool test() {
   test<char, char*>();
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
   test<wchar_t, wchar_t*>();
+#endif
   test<char8_t, char8_t*>();
   test<char16_t, char16_t*>();
   test<char32_t, char32_t*>();

diff  --git a/libcxx/test/std/strings/string.view/string.view.cons/from_string.pass.cpp b/libcxx/test/std/strings/string.view/string.view.cons/from_string.pass.cpp
index 99d3ecb3a4701..15f28ab4383f8 100644
--- a/libcxx/test/std/strings/string.view/string.view.cons/from_string.pass.cpp
+++ b/libcxx/test/std/strings/string.view/string.view.cons/from_string.pass.cpp
@@ -36,9 +36,11 @@ int main(int, char**) {
     test ( std::string("") );
     test ( std::string() );
 
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     test ( std::wstring(L"QBCDE") );
     test ( std::wstring(L"") );
     test ( std::wstring() );
+#endif
 
 #if defined(__cpp_lib_char8_t) && __cpp_lib_char8_t >= 201811L
     test ( std::u8string{u8"QBCDE"} );

diff  --git a/libcxx/test/std/strings/string.view/string.view.cons/implicit_deduction_guides.pass.cpp b/libcxx/test/std/strings/string.view/string.view.cons/implicit_deduction_guides.pass.cpp
index 8e1ff27840526..35c10da4bb86e 100644
--- a/libcxx/test/std/strings/string.view/string.view.cons/implicit_deduction_guides.pass.cpp
+++ b/libcxx/test/std/strings/string.view/string.view.cons/implicit_deduction_guides.pass.cpp
@@ -36,29 +36,35 @@ int main(int, char**)
     ASSERT_SAME_TYPE(decltype(s), std::string_view);
     assert(s == "abc");
 
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     using WSV = std::basic_string_view<wchar_t, constexpr_char_traits<wchar_t>>;
     const WSV win(L"abcdef");
     std::basic_string_view w(win);
     ASSERT_SAME_TYPE(decltype(w), WSV);
     assert(w == L"abcdef");
+#endif
   }
   { // Testing (3)
     std::basic_string_view s("abc", 2);
     ASSERT_SAME_TYPE(decltype(s), std::string_view);
     assert(s == "ab");
 
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     std::basic_string_view w(L"abcdef", 4);
     ASSERT_SAME_TYPE(decltype(w), std::wstring_view);
     assert(w == L"abcd");
+#endif
   }
   { // Testing (4)
     std::basic_string_view s("abc");
     ASSERT_SAME_TYPE(decltype(s), std::string_view);
     assert(s == "abc");
 
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     std::basic_string_view w(L"abcdef");
     ASSERT_SAME_TYPE(decltype(w), std::wstring_view);
     assert(w == L"abcdef");
+#endif
   }
 
   return 0;

diff  --git a/libcxx/test/std/strings/string.view/string.view.hash/enabled_hashes.pass.cpp b/libcxx/test/std/strings/string.view/string.view.hash/enabled_hashes.pass.cpp
index ae87bd8dcd3f5..59ca4704b092d 100644
--- a/libcxx/test/std/strings/string.view/string.view.hash/enabled_hashes.pass.cpp
+++ b/libcxx/test/std/strings/string.view/string.view.hash/enabled_hashes.pass.cpp
@@ -23,7 +23,9 @@ int main(int, char**) {
   test_library_hash_specializations_available();
   {
     test_hash_enabled_for_type<std::string_view>();
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     test_hash_enabled_for_type<std::wstring_view>();
+#endif
 #if defined(__cpp_lib_char8_t) && __cpp_lib_char8_t >= 201811L
     test_hash_enabled_for_type<std::u8string_view>();
 #endif

diff  --git a/libcxx/test/std/strings/string.view/string.view.hash/string_view.pass.cpp b/libcxx/test/std/strings/string.view/string.view.hash/string_view.pass.cpp
index c0742ec9edad5..93a69cc257d05 100644
--- a/libcxx/test/std/strings/string.view/string.view.hash/string_view.pass.cpp
+++ b/libcxx/test/std/strings/string.view/string.view.hash/string_view.pass.cpp
@@ -65,7 +65,9 @@ int main(int, char**)
     test<std::u16string_view>();
     test<std::u32string_view>();
 #endif
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     test<std::wstring_view>();
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/strings/string.view/string.view.io/stream_insert.pass.cpp b/libcxx/test/std/strings/string.view/string.view.io/stream_insert.pass.cpp
index 2c172d07727e3..fb7dffeef368a 100644
--- a/libcxx/test/std/strings/string.view/string.view.io/stream_insert.pass.cpp
+++ b/libcxx/test/std/strings/string.view/string.view.io/stream_insert.pass.cpp
@@ -21,14 +21,11 @@
 
 #include "test_macros.h"
 
-using std::string_view;
-using std::wstring_view;
-
 int main(int, char**)
 {
     {
         std::ostringstream out;
-        string_view sv("some text");
+        std::string_view sv("some text");
         out << sv;
         assert(out.good());
         assert(sv == out.str());
@@ -36,15 +33,16 @@ int main(int, char**)
     {
         std::ostringstream out;
         std::string s("some text");
-        string_view sv(s);
+        std::string_view sv(s);
         out.width(12);
         out << sv;
         assert(out.good());
         assert("   " + s == out.str());
     }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     {
         std::wostringstream out;
-        wstring_view sv(L"some text");
+        std::wstring_view sv(L"some text");
         out << sv;
         assert(out.good());
         assert(sv == out.str());
@@ -52,12 +50,13 @@ int main(int, char**)
     {
         std::wostringstream out;
         std::wstring s(L"some text");
-        wstring_view sv(s);
+        std::wstring_view sv(s);
         out.width(12);
         out << sv;
         assert(out.good());
         assert(L"   " + s == out.str());
     }
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/strings/string.view/string.view.iterators/begin.pass.cpp b/libcxx/test/std/strings/string.view/string.view.iterators/begin.pass.cpp
index ba700c8abbc16..2a610c3dfa919 100644
--- a/libcxx/test/std/strings/string.view/string.view.iterators/begin.pass.cpp
+++ b/libcxx/test/std/strings/string.view/string.view.iterators/begin.pass.cpp
@@ -47,14 +47,11 @@ int main(int, char**)
 #endif
     typedef std::u16string_view u16string_view;
     typedef std::u32string_view u32string_view;
-    typedef std::wstring_view   wstring_view;
 
     test(string_view   ());
     test(u16string_view());
     test(u32string_view());
-    test(wstring_view  ());
     test(string_view   ( "123"));
-    test(wstring_view  (L"123"));
 #if defined(__cpp_lib_char8_t) && __cpp_lib_char8_t >= 201811L
     test(u8string_view{u8"123"});
 #endif
@@ -63,6 +60,12 @@ int main(int, char**)
     test(u32string_view{U"123"});
 #endif
 
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
+    typedef std::wstring_view   wstring_view;
+    test(wstring_view  ());
+    test(wstring_view  (L"123"));
+#endif
+
 #if TEST_STD_VER > 11
     {
     constexpr string_view       sv { "123", 3 };
@@ -71,7 +74,6 @@ int main(int, char**)
 #endif
     constexpr u16string_view u16sv {u"123", 3 };
     constexpr u32string_view u32sv {U"123", 3 };
-    constexpr wstring_view     wsv {L"123", 3 };
 
     static_assert (    *sv.begin() ==    sv[0], "" );
 #if defined(__cpp_lib_char8_t) && __cpp_lib_char8_t >= 201811L
@@ -79,7 +81,6 @@ int main(int, char**)
 #endif
     static_assert ( *u16sv.begin() == u16sv[0], "" );
     static_assert ( *u32sv.begin() == u32sv[0], "" );
-    static_assert (   *wsv.begin() ==   wsv[0], "" );
 
     static_assert (    *sv.cbegin() ==    sv[0], "" );
 #if defined(__cpp_lib_char8_t) && __cpp_lib_char8_t >= 201811L
@@ -87,9 +88,16 @@ int main(int, char**)
 #endif
     static_assert ( *u16sv.cbegin() == u16sv[0], "" );
     static_assert ( *u32sv.cbegin() == u32sv[0], "" );
-    static_assert (   *wsv.cbegin() ==   wsv[0], "" );
-    }
+
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
+        {
+            constexpr wstring_view     wsv {L"123", 3 };
+            static_assert (   *wsv.begin() ==   wsv[0], "" );
+            static_assert (   *wsv.cbegin() ==   wsv[0], "" );
+        }
 #endif
+    }
+#endif // TEST_STD_VER > 11
 
   return 0;
 }

diff  --git a/libcxx/test/std/strings/string.view/string.view.iterators/end.pass.cpp b/libcxx/test/std/strings/string.view/string.view.iterators/end.pass.cpp
index 59c29e2dbdd9f..5a52ac50e790a 100644
--- a/libcxx/test/std/strings/string.view/string.view.iterators/end.pass.cpp
+++ b/libcxx/test/std/strings/string.view/string.view.iterators/end.pass.cpp
@@ -56,14 +56,11 @@ int main(int, char**)
 #endif
     typedef std::u16string_view u16string_view;
     typedef std::u32string_view u32string_view;
-    typedef std::wstring_view   wstring_view;
 
     test(string_view   ());
     test(u16string_view());
     test(u32string_view());
-    test(wstring_view  ());
     test(string_view   ( "123"));
-    test(wstring_view  (L"123"));
 #if defined(__cpp_lib_char8_t) && __cpp_lib_char8_t >= 201811L
     test(u8string_view{u8"123"});
 #endif
@@ -72,6 +69,12 @@ int main(int, char**)
     test(u32string_view{U"123"});
 #endif
 
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
+    typedef std::wstring_view   wstring_view;
+    test(wstring_view  ());
+    test(wstring_view  (L"123"));
+#endif
+
 #if TEST_STD_VER > 11
     {
     constexpr string_view       sv { "123", 3 };
@@ -80,7 +83,6 @@ int main(int, char**)
 #endif
     constexpr u16string_view u16sv {u"123", 3 };
     constexpr u32string_view u32sv {U"123", 3 };
-    constexpr wstring_view     wsv {L"123", 3 };
 
     static_assert (    sv.begin() !=    sv.end(), "" );
 #if defined(__cpp_lib_char8_t) && __cpp_lib_char8_t >= 201811L
@@ -88,7 +90,6 @@ int main(int, char**)
 #endif
     static_assert ( u16sv.begin() != u16sv.end(), "" );
     static_assert ( u32sv.begin() != u32sv.end(), "" );
-    static_assert (   wsv.begin() !=   wsv.end(), "" );
 
     static_assert (    sv.begin() !=    sv.cend(), "" );
 #if defined(__cpp_lib_char8_t) && __cpp_lib_char8_t >= 201811L
@@ -96,9 +97,16 @@ int main(int, char**)
 #endif
     static_assert ( u16sv.begin() != u16sv.cend(), "" );
     static_assert ( u32sv.begin() != u32sv.cend(), "" );
-    static_assert (   wsv.begin() !=   wsv.cend(), "" );
-    }
+
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
+        {
+            constexpr wstring_view     wsv {L"123", 3 };
+            static_assert (   wsv.begin() !=   wsv.end(), "" );
+            static_assert (   wsv.begin() !=   wsv.cend(), "" );
+        }
 #endif
+    }
+#endif // TEST_STD_VER > 11
 
   return 0;
 }

diff  --git a/libcxx/test/std/strings/string.view/string.view.iterators/rbegin.pass.cpp b/libcxx/test/std/strings/string.view/string.view.iterators/rbegin.pass.cpp
index a57d7b454a3de..0f3c1103eed56 100644
--- a/libcxx/test/std/strings/string.view/string.view.iterators/rbegin.pass.cpp
+++ b/libcxx/test/std/strings/string.view/string.view.iterators/rbegin.pass.cpp
@@ -48,14 +48,11 @@ int main(int, char**)
 #endif
     typedef std::u16string_view u16string_view;
     typedef std::u32string_view u32string_view;
-    typedef std::wstring_view   wstring_view;
 
     test(string_view   ());
     test(u16string_view());
     test(u32string_view());
-    test(wstring_view  ());
     test(string_view   ( "123"));
-    test(wstring_view  (L"123"));
 #if defined(__cpp_lib_char8_t) && __cpp_lib_char8_t >= 201811L
     test(u8string_view{u8"123"});
 #endif
@@ -64,6 +61,12 @@ int main(int, char**)
     test(u32string_view{U"123"});
 #endif
 
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
+    typedef std::wstring_view   wstring_view;
+    test(wstring_view  ());
+    test(wstring_view  (L"123"));
+#endif
+
 #if TEST_STD_VER > 14
     {
     constexpr string_view       sv { "123", 3 };
@@ -72,7 +75,6 @@ int main(int, char**)
 #endif
     constexpr u16string_view u16sv {u"123", 3 };
     constexpr u32string_view u32sv {U"123", 3 };
-    constexpr wstring_view     wsv {L"123", 3 };
 
     static_assert (    *sv.rbegin() ==    sv[2], "" );
 #if defined(__cpp_lib_char8_t) && __cpp_lib_char8_t >= 201811L
@@ -80,7 +82,6 @@ int main(int, char**)
 #endif
     static_assert ( *u16sv.rbegin() == u16sv[2], "" );
     static_assert ( *u32sv.rbegin() == u32sv[2], "" );
-    static_assert (   *wsv.rbegin() ==   wsv[2], "" );
 
     static_assert (    *sv.crbegin() ==    sv[2], "" );
 #if defined(__cpp_lib_char8_t) && __cpp_lib_char8_t >= 201811L
@@ -88,9 +89,16 @@ int main(int, char**)
 #endif
     static_assert ( *u16sv.crbegin() == u16sv[2], "" );
     static_assert ( *u32sv.crbegin() == u32sv[2], "" );
-    static_assert (   *wsv.crbegin() ==   wsv[2], "" );
-    }
+
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
+        {
+            constexpr wstring_view     wsv {L"123", 3 };
+            static_assert (   *wsv.rbegin() ==   wsv[2], "" );
+            static_assert (   *wsv.crbegin() ==   wsv[2], "" );
+        }
 #endif
+    }
+#endif // TEST_STD_VER > 14
 
   return 0;
 }

diff  --git a/libcxx/test/std/strings/string.view/string.view.iterators/rend.pass.cpp b/libcxx/test/std/strings/string.view/string.view.iterators/rend.pass.cpp
index e0db02c22f69f..1eb781df3e1a1 100644
--- a/libcxx/test/std/strings/string.view/string.view.iterators/rend.pass.cpp
+++ b/libcxx/test/std/strings/string.view/string.view.iterators/rend.pass.cpp
@@ -56,14 +56,11 @@ int main(int, char**)
 #endif
     typedef std::u16string_view u16string_view;
     typedef std::u32string_view u32string_view;
-    typedef std::wstring_view   wstring_view;
 
     test(string_view   ());
     test(u16string_view());
     test(u32string_view());
-    test(wstring_view  ());
     test(string_view   ( "123"));
-    test(wstring_view  (L"123"));
 #if defined(__cpp_lib_char8_t) && __cpp_lib_char8_t >= 201811L
     test(u8string_view{u8"123"});
 #endif
@@ -72,6 +69,12 @@ int main(int, char**)
     test(u32string_view{U"123"});
 #endif
 
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
+    typedef std::wstring_view   wstring_view;
+    test(wstring_view  ());
+    test(wstring_view  (L"123"));
+#endif
+
 #if TEST_STD_VER > 14
     {
     constexpr string_view       sv { "123", 3 };
@@ -80,7 +83,6 @@ int main(int, char**)
 #endif
     constexpr u16string_view u16sv {u"123", 3 };
     constexpr u32string_view u32sv {U"123", 3 };
-    constexpr wstring_view     wsv {L"123", 3 };
 
     static_assert (    *--sv.rend() ==    sv[0], "" );
 #if defined(__cpp_lib_char8_t) && __cpp_lib_char8_t >= 201811L
@@ -88,7 +90,6 @@ int main(int, char**)
 #endif
     static_assert ( *--u16sv.rend() == u16sv[0], "" );
     static_assert ( *--u32sv.rend() == u32sv[0], "" );
-    static_assert (   *--wsv.rend() ==   wsv[0], "" );
 
     static_assert (    *--sv.crend() ==    sv[0], "" );
 #if defined(__cpp_lib_char8_t) && __cpp_lib_char8_t >= 201811L
@@ -96,9 +97,16 @@ int main(int, char**)
 #endif
     static_assert ( *--u16sv.crend() == u16sv[0], "" );
     static_assert ( *--u32sv.crend() == u32sv[0], "" );
-    static_assert (   *--wsv.crend() ==   wsv[0], "" );
-    }
+
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
+        {
+            constexpr wstring_view     wsv {L"123", 3 };
+            static_assert (   *--wsv.rend() ==   wsv[0], "" );
+            static_assert (   *--wsv.crend() ==   wsv[0], "" );
+        }
 #endif
+    }
+#endif // TEST_STD_VER > 14
 
   return 0;
 }

diff  --git a/libcxx/test/std/strings/string.view/string.view.modifiers/remove_prefix.pass.cpp b/libcxx/test/std/strings/string.view/string.view.modifiers/remove_prefix.pass.cpp
index 0e3313072c035..cb65cdf88c741 100644
--- a/libcxx/test/std/strings/string.view/string.view.modifiers/remove_prefix.pass.cpp
+++ b/libcxx/test/std/strings/string.view/string.view.modifiers/remove_prefix.pass.cpp
@@ -50,9 +50,11 @@ int main(int, char**) {
     test ( "a", 1 );
     test ( "", 0 );
 
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     test ( L"ABCDE", 5 );
     test ( L"a", 1 );
     test ( L"", 0 );
+#endif
 
 #if TEST_STD_VER >= 11
     test ( u"ABCDE", 5 );

diff  --git a/libcxx/test/std/strings/string.view/string.view.modifiers/remove_suffix.pass.cpp b/libcxx/test/std/strings/string.view/string.view.modifiers/remove_suffix.pass.cpp
index cab1254dda906..341ea667012ec 100644
--- a/libcxx/test/std/strings/string.view/string.view.modifiers/remove_suffix.pass.cpp
+++ b/libcxx/test/std/strings/string.view/string.view.modifiers/remove_suffix.pass.cpp
@@ -51,9 +51,11 @@ int main(int, char**) {
     test ( "a", 1 );
     test ( "", 0 );
 
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     test ( L"ABCDE", 5 );
     test ( L"a", 1 );
     test ( L"", 0 );
+#endif
 
 #if TEST_STD_VER >= 11
     test ( u"ABCDE", 5 );

diff  --git a/libcxx/test/std/strings/string.view/string.view.modifiers/swap.pass.cpp b/libcxx/test/std/strings/string.view/string.view.modifiers/swap.pass.cpp
index 0f0ae48c5e0bc..21dfa573edae6 100644
--- a/libcxx/test/std/strings/string.view/string.view.modifiers/swap.pass.cpp
+++ b/libcxx/test/std/strings/string.view/string.view.modifiers/swap.pass.cpp
@@ -50,9 +50,11 @@ int main(int, char**) {
     test ( "a", 1 );
     test ( "", 0 );
 
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     test ( L"ABCDE", 5 );
     test ( L"a", 1 );
     test ( L"", 0 );
+#endif
 
 #if TEST_STD_VER >= 11
     test ( u"ABCDE", 5 );

diff  --git a/libcxx/test/std/strings/string.view/string.view.nonmem/quoted.pass.cpp b/libcxx/test/std/strings/string.view/string.view.nonmem/quoted.pass.cpp
index 3ad9ae22a95da..3e7f85ec04a5f 100644
--- a/libcxx/test/std/strings/string.view/string.view.nonmem/quoted.pass.cpp
+++ b/libcxx/test/std/strings/string.view/string.view.nonmem/quoted.pass.cpp
@@ -22,12 +22,13 @@
 
 bool is_skipws ( const std::istream *is ) {
     return ( is->flags() & std::ios_base::skipws ) != 0;
-    }
-
+}
 
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
 bool is_skipws ( const std::wistream *is ) {
     return ( is->flags() & std::ios_base::skipws ) != 0;
-    }
+}
+#endif
 
 void round_trip ( const char *p ) {
     std::stringstream ss;
@@ -92,7 +93,7 @@ std::string unquote ( const char *p, char delim='"', char escape='\\' ) {
     return s;
 }
 
-
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
 void round_trip ( const wchar_t *p ) {
     std::wstringstream ss;
     bool skippingws = is_skipws ( &ss );
@@ -159,6 +160,7 @@ std::wstring unquote ( const wchar_t *p, wchar_t delim='"', wchar_t escape='\\'
     ss >> std::quoted(s, delim, escape);
     return s;
 }
+#endif // TEST_HAS_NO_WIDE_CHARACTERS
 
 int main(int, char**)
 {
@@ -167,10 +169,12 @@ int main(int, char**)
     round_trip_d  (  "", 'q' );
     round_trip_e  (  "", 'q' );
 
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     round_trip    ( L"" );
     round_trip_ws ( L"" );
     round_trip_d  ( L"", 'q' );
     round_trip_e  ( L"", 'q' );
+#endif
 
     round_trip    (  "Hi" );
     round_trip_ws (  "Hi" );
@@ -179,34 +183,42 @@ int main(int, char**)
     assert ( quote ( "Hi", '!' ) == "!Hi!" );
     assert ( quote ( "Hi!", '!' ) == R"(!Hi\!!)" );
 
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     round_trip    ( L"Hi" );
     round_trip_ws ( L"Hi" );
     round_trip_d  ( L"Hi", '!' );
     round_trip_e  ( L"Hi", '!' );
     assert ( quote ( L"Hi", '!' )  == L"!Hi!" );
     assert ( quote ( L"Hi!", '!' ) == LR"(!Hi\!!)" );
+#endif
 
     round_trip    (  "Hi Mom" );
     round_trip_ws (  "Hi Mom" );
+
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     round_trip    ( L"Hi Mom" );
     round_trip_ws ( L"Hi Mom" );
+#endif
 
     assert ( quote (  "" )  ==  "\"\"" );
-    assert ( quote ( L"" )  == L"\"\"" );
     assert ( quote (  "a" ) ==  "\"a\"" );
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
+    assert ( quote ( L"" )  == L"\"\"" );
     assert ( quote ( L"a" ) == L"\"a\"" );
+#endif
 
-//  missing end quote - must not hang
+    // missing end quote - must not hang
     assert ( unquote (  "\"abc" ) ==  "abc" );
-    assert ( unquote ( L"\"abc" ) == L"abc" );
-
     assert ( unquote (  "abc" ) == "abc" ); // no delimiter
-    assert ( unquote ( L"abc" ) == L"abc" ); // no delimiter
     assert ( unquote (  "abc def" ) ==  "abc" ); // no delimiter
-    assert ( unquote ( L"abc def" ) == L"abc" ); // no delimiter
-
     assert ( unquote (  "" ) ==  "" ); // nothing there
+
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
+    assert ( unquote ( L"\"abc" ) == L"abc" );
+    assert ( unquote ( L"abc" ) == L"abc" ); // no delimiter
+    assert ( unquote ( L"abc def" ) == L"abc" ); // no delimiter
     assert ( unquote ( L"" ) == L"" ); // nothing there
+#endif
 
     return 0;
 }

diff  --git a/libcxx/test/std/strings/string.view/string_view.literals/literal.pass.cpp b/libcxx/test/std/strings/string.view/string_view.literals/literal.pass.cpp
index 4b209f37c3f84..5c345071b271f 100644
--- a/libcxx/test/std/strings/string.view/string_view.literals/literal.pass.cpp
+++ b/libcxx/test/std/strings/string.view/string_view.literals/literal.pass.cpp
@@ -27,43 +27,57 @@ int main(int, char**) {
 
         ASSERT_SAME_TYPE(decltype(  "Hi"sv), std::string_view);
         ASSERT_SAME_TYPE(decltype(u8"Hi"sv), u8string_view);
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
         ASSERT_SAME_TYPE(decltype( L"Hi"sv), std::wstring_view);
+#endif
         ASSERT_SAME_TYPE(decltype( u"Hi"sv), std::u16string_view);
         ASSERT_SAME_TYPE(decltype( U"Hi"sv), std::u32string_view);
 
         std::string_view foo;
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
         std::wstring_view Lfoo;
+#endif
         u8string_view u8foo;
         std::u16string_view ufoo;
         std::u32string_view Ufoo;
 
         foo  =    ""sv;     assert(  foo.size() == 0);
         u8foo = u8""sv;     assert(u8foo.size() == 0);
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
         Lfoo  =  L""sv;     assert( Lfoo.size() == 0);
+#endif
         ufoo  =  u""sv;     assert( ufoo.size() == 0);
         Ufoo  =  U""sv;     assert( Ufoo.size() == 0);
 
         foo   =   " "sv;    assert(  foo.size() == 1);
         u8foo = u8" "sv;    assert(u8foo.size() == 1);
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
         Lfoo  =  L" "sv;    assert( Lfoo.size() == 1);
+#endif
         ufoo  =  u" "sv;    assert( ufoo.size() == 1);
         Ufoo  =  U" "sv;    assert( Ufoo.size() == 1);
 
         foo   =   "ABC"sv;  assert(  foo ==   "ABC");   assert(  foo == std::string_view   (  "ABC"));
         u8foo = u8"ABC"sv;  assert(u8foo == u8"ABC");   assert(u8foo == u8string_view      (u8"ABC"));
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
         Lfoo  =  L"ABC"sv;  assert( Lfoo ==  L"ABC");   assert( Lfoo == std::wstring_view  ( L"ABC"));
+#endif
         ufoo  =  u"ABC"sv;  assert( ufoo ==  u"ABC");   assert( ufoo == std::u16string_view( u"ABC"));
         Ufoo  =  U"ABC"sv;  assert( Ufoo ==  U"ABC");   assert( Ufoo == std::u32string_view( U"ABC"));
 
         static_assert(  "ABC"sv.size() == 3, "");
         static_assert(u8"ABC"sv.size() == 3, "");
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
         static_assert( L"ABC"sv.size() == 3, "");
+#endif
         static_assert( u"ABC"sv.size() == 3, "");
         static_assert( U"ABC"sv.size() == 3, "");
 
         ASSERT_NOEXCEPT(  "ABC"sv);
         ASSERT_NOEXCEPT(u8"ABC"sv);
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
         ASSERT_NOEXCEPT( L"ABC"sv);
+#endif
         ASSERT_NOEXCEPT( u"ABC"sv);
         ASSERT_NOEXCEPT( U"ABC"sv);
     }

diff  --git a/libcxx/test/std/strings/string.view/trivially_copyable.compile.pass.cpp b/libcxx/test/std/strings/string.view/trivially_copyable.compile.pass.cpp
index 934ddbd2a9d69..6a22864b23f10 100644
--- a/libcxx/test/std/strings/string.view/trivially_copyable.compile.pass.cpp
+++ b/libcxx/test/std/strings/string.view/trivially_copyable.compile.pass.cpp
@@ -13,8 +13,12 @@
 #include <string_view>
 #include <type_traits>
 
+#include "test_macros.h"
+
 static_assert(std::is_trivially_copyable<std::basic_string_view<char> >::value, "");
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
 static_assert(std::is_trivially_copyable<std::basic_string_view<wchar_t> >::value, "");
+#endif
 #ifndef _LIBCPP_HAS_NO_CHAR8_T
 static_assert(std::is_trivially_copyable<std::basic_string_view<char8_t> >::value, "");
 #endif

diff  --git a/libcxx/test/std/utilities/format/format.arguments/format.arg.store/class.pass.cpp b/libcxx/test/std/utilities/format/format.arguments/format.arg.store/class.pass.cpp
index 49b8d8850f27c..fe7a42de005bf 100644
--- a/libcxx/test/std/utilities/format/format.arguments/format.arg.store/class.pass.cpp
+++ b/libcxx/test/std/utilities/format/format.arguments/format.arg.store/class.pass.cpp
@@ -72,7 +72,9 @@ void test() {
 
 void test() {
   test<char>();
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
   test<wchar_t>();
+#endif
 }
 
 int main(int, char**) {

diff  --git a/libcxx/test/std/utilities/format/format.arguments/format.arg.store/make_format_args.sh.cpp b/libcxx/test/std/utilities/format/format.arguments/format.arg.store/make_format_args.sh.cpp
index 009bf72e4cc98..af174ea1c1363 100644
--- a/libcxx/test/std/utilities/format/format.arguments/format.arg.store/make_format_args.sh.cpp
+++ b/libcxx/test/std/utilities/format/format.arguments/format.arg.store/make_format_args.sh.cpp
@@ -8,6 +8,7 @@
 // UNSUPPORTED: c++03, c++11, c++14, c++17
 // UNSUPPORTED: libcpp-no-concepts
 // UNSUPPORTED: libcpp-has-no-incomplete-format
+// UNSUPPORTED: libcpp-has-no-wide-characters
 
 // Validate it works regardless of the signedness of `char`.
 // RUN: %{cxx} %{flags} %{compile_flags} -fsigned-char -fsyntax-only %s

diff  --git a/libcxx/test/std/utilities/format/format.arguments/format.arg.store/make_wformat_args.pass.cpp b/libcxx/test/std/utilities/format/format.arguments/format.arg.store/make_wformat_args.pass.cpp
index d654deaf0d8dd..9b3a567f914ba 100644
--- a/libcxx/test/std/utilities/format/format.arguments/format.arg.store/make_wformat_args.pass.cpp
+++ b/libcxx/test/std/utilities/format/format.arguments/format.arg.store/make_wformat_args.pass.cpp
@@ -8,6 +8,7 @@
 // UNSUPPORTED: c++03, c++11, c++14, c++17
 // UNSUPPORTED: libcpp-no-concepts
 // UNSUPPORTED: libcpp-has-no-incomplete-format
+// XFAIL: libcpp-has-no-wide-characters
 // TODO FMT Evaluate gcc-11 status
 // UNSUPPORTED: gcc-11
 

diff  --git a/libcxx/test/std/utilities/format/format.arguments/format.args/ctor.pass.cpp b/libcxx/test/std/utilities/format/format.arguments/format.args/ctor.pass.cpp
index 26a40571bd3b1..2a73d951cc952 100644
--- a/libcxx/test/std/utilities/format/format.arguments/format.args/ctor.pass.cpp
+++ b/libcxx/test/std/utilities/format/format.arguments/format.args/ctor.pass.cpp
@@ -57,7 +57,9 @@ void test() {
 
 void test() {
   test<char>();
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
   test<wchar_t>();
+#endif
 }
 
 int main(int, char**) {

diff  --git a/libcxx/test/std/utilities/format/format.arguments/format.args/types.compile.pass.cpp b/libcxx/test/std/utilities/format/format.arguments/format.args/types.compile.pass.cpp
index 356475ccf06fd..cac83f7898065 100644
--- a/libcxx/test/std/utilities/format/format.arguments/format.args/types.compile.pass.cpp
+++ b/libcxx/test/std/utilities/format/format.arguments/format.args/types.compile.pass.cpp
@@ -25,19 +25,23 @@
 
 static_assert(std::is_same_v<std::format_args,
                              std::basic_format_args<std::format_context>>);
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
 static_assert(std::is_same_v<std::wformat_args,
                              std::basic_format_args<std::wformat_context>>);
+#endif
 
 static_assert(std::is_same_v<
               std::format_args_t<std::back_insert_iterator<std::string>, char>,
               std::basic_format_args<std::basic_format_context<
                   std::back_insert_iterator<std::string>, char>>>);
 
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
 static_assert(
     std::is_same_v<
         std::format_args_t<std::back_insert_iterator<std::wstring>, wchar_t>,
         std::basic_format_args<std::basic_format_context<
             std::back_insert_iterator<std::wstring>, wchar_t>>>);
+#endif
 
 static_assert(
     std::is_same_v<

diff  --git a/libcxx/test/std/utilities/format/format.formatter/format.context/format.context/advance_to.pass.cpp b/libcxx/test/std/utilities/format/format.formatter/format.context/format.context/advance_to.pass.cpp
index eea6800da09f3..849b0e0c20913 100644
--- a/libcxx/test/std/utilities/format/format.formatter/format.context/format.context/advance_to.pass.cpp
+++ b/libcxx/test/std/utilities/format/format.formatter/format.context/format.context/advance_to.pass.cpp
@@ -47,9 +47,11 @@ void test() {
       std::make_format_args<std::basic_format_context<
           std::back_insert_iterator<std::basic_string<char>>, char>>()));
 
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
   test(std::basic_format_args(
       std::make_format_args<std::basic_format_context<
           std::back_insert_iterator<std::basic_string<wchar_t>>, wchar_t>>()));
+#endif
 #ifndef _LIBCPP_HAS_NO_CHAR8_T
   test(std::basic_format_args(
       std::make_format_args<std::basic_format_context<

diff  --git a/libcxx/test/std/utilities/format/format.formatter/format.context/format.context/arg.pass.cpp b/libcxx/test/std/utilities/format/format.formatter/format.context/format.context/arg.pass.cpp
index 5157fe7907016..e345878b478a1 100644
--- a/libcxx/test/std/utilities/format/format.formatter/format.context/format.context/arg.pass.cpp
+++ b/libcxx/test/std/utilities/format/format.formatter/format.context/format.context/arg.pass.cpp
@@ -46,7 +46,9 @@ void test() {
 
 int main(int, char**) {
   test<std::back_insert_iterator<std::basic_string<char>>, char>();
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
   test<std::back_insert_iterator<std::basic_string<wchar_t>>, wchar_t>();
+#endif
 #ifndef _LIBCPP_HAS_NO_CHAR8_T
   test<std::back_insert_iterator<std::basic_string<char8_t>>, char8_t>();
 #endif

diff  --git a/libcxx/test/std/utilities/format/format.formatter/format.context/format.context/ctor.pass.cpp b/libcxx/test/std/utilities/format/format.formatter/format.context/format.context/ctor.pass.cpp
index 909b61fa075d5..6ea2ee8031612 100644
--- a/libcxx/test/std/utilities/format/format.formatter/format.context/format.context/ctor.pass.cpp
+++ b/libcxx/test/std/utilities/format/format.formatter/format.context/format.context/ctor.pass.cpp
@@ -122,7 +122,9 @@ void test() {
 
 void test() {
   test<std::back_insert_iterator<std::basic_string<char>>, char>();
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
   test<std::back_insert_iterator<std::basic_string<wchar_t>>, wchar_t>();
+#endif
 #ifndef _LIBCPP_HAS_NO_CHAR8_T
   test<std::back_insert_iterator<std::basic_string<char8_t>>, char8_t>();
 #endif

diff  --git a/libcxx/test/std/utilities/format/format.formatter/format.context/format.context/locale.pass.cpp b/libcxx/test/std/utilities/format/format.formatter/format.context/format.context/locale.pass.cpp
index 0fe789ea9cce6..982416f23fc4a 100644
--- a/libcxx/test/std/utilities/format/format.formatter/format.context/format.context/locale.pass.cpp
+++ b/libcxx/test/std/utilities/format/format.formatter/format.context/format.context/locale.pass.cpp
@@ -78,7 +78,9 @@ void test() {
 
 void test() {
   test<std::back_insert_iterator<std::basic_string<char>>, char>();
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
   test<std::back_insert_iterator<std::basic_string<wchar_t>>, wchar_t>();
+#endif
 #ifndef _LIBCPP_HAS_NO_CHAR8_T
   test<std::back_insert_iterator<std::basic_string<char8_t>>, char8_t>();
 #endif

diff  --git a/libcxx/test/std/utilities/format/format.formatter/format.context/format.context/out.pass.cpp b/libcxx/test/std/utilities/format/format.formatter/format.context/format.context/out.pass.cpp
index af4d61fc1a35a..9c56f0581807b 100644
--- a/libcxx/test/std/utilities/format/format.formatter/format.context/format.context/out.pass.cpp
+++ b/libcxx/test/std/utilities/format/format.formatter/format.context/format.context/out.pass.cpp
@@ -43,9 +43,11 @@ void test() {
   test(std::basic_format_args(
       std::make_format_args<std::basic_format_context<
           std::back_insert_iterator<std::basic_string<char>>, char>>()));
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
   test(std::basic_format_args(
       std::make_format_args<std::basic_format_context<
           std::back_insert_iterator<std::basic_string<wchar_t>>, wchar_t>>()));
+#endif
 #ifndef _LIBCPP_HAS_NO_CHAR8_T
   test(std::basic_format_args(
       std::make_format_args<std::basic_format_context<

diff  --git a/libcxx/test/std/utilities/format/format.formatter/format.context/format.formatter.spec/formatter.bool.pass.cpp b/libcxx/test/std/utilities/format/format.formatter/format.context/format.formatter.spec/formatter.bool.pass.cpp
index 41b6f1246945f..162c23dc36999 100644
--- a/libcxx/test/std/utilities/format/format.formatter/format.context/format.formatter.spec/formatter.bool.pass.cpp
+++ b/libcxx/test/std/utilities/format/format.formatter/format.context/format.formatter.spec/formatter.bool.pass.cpp
@@ -73,7 +73,9 @@ void test_boolean() {
 
 int main(int, char**) {
   test_boolean<char>();
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
   test_boolean<wchar_t>();
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/utilities/format/format.formatter/format.context/format.formatter.spec/formatter.c_string.pass.cpp b/libcxx/test/std/utilities/format/format.formatter/format.context/format.formatter.spec/formatter.c_string.pass.cpp
index ab729141ef543..5e0af39a149e8 100644
--- a/libcxx/test/std/utilities/format/format.formatter/format.context/format.formatter.spec/formatter.c_string.pass.cpp
+++ b/libcxx/test/std/utilities/format/format.formatter/format.context/format.formatter.spec/formatter.c_string.pass.cpp
@@ -100,8 +100,10 @@ void test_char_pointer() {
 int main(int, char**) {
   test_char_pointer<char*>();
   test_char_pointer<const char*>();
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
   test_char_pointer<wchar_t*>();
   test_char_pointer<const wchar_t*>();
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/utilities/format/format.formatter/format.context/format.formatter.spec/formatter.char.pass.cpp b/libcxx/test/std/utilities/format/format.formatter/format.context/format.formatter.spec/formatter.char.pass.cpp
index f0ec2dd2350fc..65bca30220d26 100644
--- a/libcxx/test/std/utilities/format/format.formatter/format.context/format.formatter.spec/formatter.char.pass.cpp
+++ b/libcxx/test/std/utilities/format/format.formatter/format.context/format.formatter.spec/formatter.char.pass.cpp
@@ -76,8 +76,10 @@ void test_char_type() {
 
 int main(int, char**) {
   test_char_type<char, char>();
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
   test_char_type<char, wchar_t>();
   test_char_type<wchar_t, wchar_t>();
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/utilities/format/format.formatter/format.context/format.formatter.spec/formatter.const_char_array.pass.cpp b/libcxx/test/std/utilities/format/format.formatter/format.context/format.formatter.spec/formatter.const_char_array.pass.cpp
index b2228043b5ed6..386af8449e653 100644
--- a/libcxx/test/std/utilities/format/format.formatter/format.context/format.formatter.spec/formatter.const_char_array.pass.cpp
+++ b/libcxx/test/std/utilities/format/format.formatter/format.context/format.formatter.spec/formatter.const_char_array.pass.cpp
@@ -114,7 +114,9 @@ void test_array() {
 
 int main(int, char**) {
   test_array<char>();
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
   test_array<wchar_t>();
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/utilities/format/format.formatter/format.context/format.formatter.spec/formatter.floating_point.pass.cpp b/libcxx/test/std/utilities/format/format.formatter/format.context/format.formatter.spec/formatter.floating_point.pass.cpp
index 30708a1ef3719..1ba1189b512c5 100644
--- a/libcxx/test/std/utilities/format/format.formatter/format.context/format.formatter.spec/formatter.floating_point.pass.cpp
+++ b/libcxx/test/std/utilities/format/format.formatter/format.context/format.formatter.spec/formatter.floating_point.pass.cpp
@@ -113,7 +113,9 @@ void test_all_float_types() {
 
 int main(int, char**) {
   test_all_float_types<char>();
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
   test_all_float_types<wchar_t>();
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/utilities/format/format.formatter/format.context/format.formatter.spec/formatter.signed_integral.pass.cpp b/libcxx/test/std/utilities/format/format.formatter/format.context/format.formatter.spec/formatter.signed_integral.pass.cpp
index 526531ff46ae1..8f2d5af2dab91 100644
--- a/libcxx/test/std/utilities/format/format.formatter/format.context/format.formatter.spec/formatter.signed_integral.pass.cpp
+++ b/libcxx/test/std/utilities/format/format.formatter/format.context/format.formatter.spec/formatter.signed_integral.pass.cpp
@@ -115,7 +115,9 @@ void test_all_signed_integral_types() {
 
 int main(int, char**) {
   test_all_signed_integral_types<char>();
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
   test_all_signed_integral_types<wchar_t>();
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/utilities/format/format.formatter/format.context/format.formatter.spec/formatter.string.pass.cpp b/libcxx/test/std/utilities/format/format.formatter/format.context/format.formatter.spec/formatter.string.pass.cpp
index 6a6de7e64cb0e..df72c8976e714 100644
--- a/libcxx/test/std/utilities/format/format.formatter/format.context/format.formatter.spec/formatter.string.pass.cpp
+++ b/libcxx/test/std/utilities/format/format.formatter/format.context/format.formatter.spec/formatter.string.pass.cpp
@@ -118,7 +118,9 @@ void test_all_string_types() {
 
 int main(int, char**) {
   test_all_string_types<char>();
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
   test_all_string_types<wchar_t>();
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/utilities/format/format.formatter/format.context/format.formatter.spec/formatter.unsigned_integral.pass.cpp b/libcxx/test/std/utilities/format/format.formatter/format.context/format.formatter.spec/formatter.unsigned_integral.pass.cpp
index f2321126a0cf2..22e330c9daa81 100644
--- a/libcxx/test/std/utilities/format/format.formatter/format.context/format.formatter.spec/formatter.unsigned_integral.pass.cpp
+++ b/libcxx/test/std/utilities/format/format.formatter/format.context/format.formatter.spec/formatter.unsigned_integral.pass.cpp
@@ -103,7 +103,9 @@ void test_all_unsigned_integral_types() {
 
 int main(int, char**) {
   test_all_unsigned_integral_types<char>();
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
   test_all_unsigned_integral_types<wchar_t>();
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/utilities/format/format.formatter/format.context/types.compile.pass.cpp b/libcxx/test/std/utilities/format/format.formatter/format.context/types.compile.pass.cpp
index eb8d1b7eb5a04..13eb467095b63 100644
--- a/libcxx/test/std/utilities/format/format.formatter/format.context/types.compile.pass.cpp
+++ b/libcxx/test/std/utilities/format/format.formatter/format.context/types.compile.pass.cpp
@@ -99,7 +99,9 @@ constexpr void test() {
 
 constexpr void test() {
   test<std::back_insert_iterator<std::basic_string<char>>, char>();
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
   test<std::back_insert_iterator<std::basic_string<wchar_t>>, wchar_t>();
+#endif
   test<std::back_insert_iterator<std::basic_string<char8_t>>, char8_t>();
   test<std::back_insert_iterator<std::basic_string<char16_t>>, char16_t>();
   test<std::back_insert_iterator<std::basic_string<char32_t>>, char32_t>();
@@ -109,11 +111,13 @@ static_assert(std::is_same_v<
               std::format_context,
               std::basic_format_context<
                   std::back_insert_iterator<std::basic_string<char>>, char>>);
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
 static_assert(
     std::is_same_v<
         std::wformat_context,
         std::basic_format_context<
             std::back_insert_iterator<std::basic_string<wchar_t>>, wchar_t>>);
+#endif
 
 // Required for MSVC internal test runner compatibility.
 int main(int, char**) { return 0; }

diff  --git a/libcxx/test/std/utilities/format/format.formatter/format.parse.ctx/types.compile.pass.cpp b/libcxx/test/std/utilities/format/format.formatter/format.parse.ctx/types.compile.pass.cpp
index 7e1a6b6c84661..56e2d06cf2ceb 100644
--- a/libcxx/test/std/utilities/format/format.formatter/format.parse.ctx/types.compile.pass.cpp
+++ b/libcxx/test/std/utilities/format/format.formatter/format.parse.ctx/types.compile.pass.cpp
@@ -47,7 +47,9 @@ constexpr void test() {
 
 constexpr void test() {
   test<char>();
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
   test<wchar_t>();
+#endif
 #ifndef _LIBCPP_HAS_NO_CHAR8_T
   test<char8_t>();
 #endif
@@ -59,8 +61,10 @@ constexpr void test() {
 
 static_assert(std::is_same_v<std::format_parse_context,
                              std::basic_format_parse_context<char> >);
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
 static_assert(std::is_same_v<std::wformat_parse_context,
                              std::basic_format_parse_context<wchar_t> >);
+#endif
 
 // Required for MSVC internal test runner compatibility.
 int main(int, char**) { return 0; }

diff  --git a/libcxx/test/std/utilities/format/format.functions/format.locale.pass.cpp b/libcxx/test/std/utilities/format/format.functions/format.locale.pass.cpp
index 1fb6c3b3df6d2..4da2f2ec6ee7f 100644
--- a/libcxx/test/std/utilities/format/format.functions/format.locale.pass.cpp
+++ b/libcxx/test/std/utilities/format/format.functions/format.locale.pass.cpp
@@ -66,10 +66,12 @@ auto test_exception = []<class CharT, class... Args>(
 };
 
 int main(int, char**) {
-  format_tests_char_to_wchar_t(test);
-
   format_tests<char>(test, test_exception);
+
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
+  format_tests_char_to_wchar_t(test);
   format_tests<wchar_t>(test, test_exception);
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/utilities/format/format.functions/format.pass.cpp b/libcxx/test/std/utilities/format/format.functions/format.pass.cpp
index 392a412680caa..b6dffd864742e 100644
--- a/libcxx/test/std/utilities/format/format.functions/format.pass.cpp
+++ b/libcxx/test/std/utilities/format/format.functions/format.pass.cpp
@@ -75,10 +75,12 @@ auto test_exception = []<class CharT, class... Args>(
 };
 
 int main(int, char**) {
-  format_tests_char_to_wchar_t(test);
-
   format_tests<char>(test, test_exception);
+
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
+  format_tests_char_to_wchar_t(test);
   format_tests<wchar_t>(test, test_exception);
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/utilities/format/format.functions/format_tests.h b/libcxx/test/std/utilities/format/format.functions/format_tests.h
index 3da2edfbf066b..a2d71a9881dbc 100644
--- a/libcxx/test/std/utilities/format/format.functions/format_tests.h
+++ b/libcxx/test/std/utilities/format/format.functions/format_tests.h
@@ -1100,10 +1100,12 @@ void format_tests(TestFunction check, ExceptionTest check_exception) {
 #endif
 }
 
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
 template <class TestFunction>
 void format_tests_char_to_wchar_t(TestFunction check) {
   using CharT = wchar_t;
   check(STR("hello 09azA"), STR("hello {}{}{}{}{}"), '0', '9', 'a', 'z', 'A');
 }
+#endif
 
 #endif

diff  --git a/libcxx/test/std/utilities/format/format.functions/format_to.locale.pass.cpp b/libcxx/test/std/utilities/format/format.functions/format_to.locale.pass.cpp
index 461f541c73750..98356fdd8bd66 100644
--- a/libcxx/test/std/utilities/format/format.functions/format_to.locale.pass.cpp
+++ b/libcxx/test/std/utilities/format/format.functions/format_to.locale.pass.cpp
@@ -81,10 +81,12 @@ auto test_exception = []<class CharT, class... Args>(
 };
 
 int main(int, char**) {
-  format_tests_char_to_wchar_t(test);
-
   format_tests<char>(test, test_exception);
+
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
+  format_tests_char_to_wchar_t(test);
   format_tests<wchar_t>(test, test_exception);
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/utilities/format/format.functions/format_to.pass.cpp b/libcxx/test/std/utilities/format/format.functions/format_to.pass.cpp
index fc988beaca97e..d8d24f92d60cc 100644
--- a/libcxx/test/std/utilities/format/format.functions/format_to.pass.cpp
+++ b/libcxx/test/std/utilities/format/format.functions/format_to.pass.cpp
@@ -82,10 +82,12 @@ auto test_exception = []<class CharT, class... Args>(
 };
 
 int main(int, char**) {
-  format_tests_char_to_wchar_t(test);
-
   format_tests<char>(test, test_exception);
+
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
+  format_tests_char_to_wchar_t(test);
   format_tests<wchar_t>(test, test_exception);
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/utilities/format/format.functions/format_to_n.locale.pass.cpp b/libcxx/test/std/utilities/format/format.functions/format_to_n.locale.pass.cpp
index 40c502aba48ca..206450b53c466 100644
--- a/libcxx/test/std/utilities/format/format.functions/format_to_n.locale.pass.cpp
+++ b/libcxx/test/std/utilities/format/format.functions/format_to_n.locale.pass.cpp
@@ -119,10 +119,12 @@ auto test_exception = []<class CharT, class... Args>(
 };
 
 int main(int, char**) {
-  format_tests_char_to_wchar_t(test);
-
   format_tests<char>(test, test_exception);
+
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
+  format_tests_char_to_wchar_t(test);
   format_tests<wchar_t>(test, test_exception);
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/utilities/format/format.functions/format_to_n.pass.cpp b/libcxx/test/std/utilities/format/format.functions/format_to_n.pass.cpp
index 98b7c0cbd1fab..6f69af4d99df9 100644
--- a/libcxx/test/std/utilities/format/format.functions/format_to_n.pass.cpp
+++ b/libcxx/test/std/utilities/format/format.functions/format_to_n.pass.cpp
@@ -115,10 +115,12 @@ auto test_exception = []<class CharT, class... Args>(
 };
 
 int main(int, char**) {
-  format_tests_char_to_wchar_t(test);
-
   format_tests<char>(test, test_exception);
+
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
+  format_tests_char_to_wchar_t(test);
   format_tests<wchar_t>(test, test_exception);
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/utilities/format/format.functions/formatted_size.locale.pass.cpp b/libcxx/test/std/utilities/format/format.functions/formatted_size.locale.pass.cpp
index 26f6ef90cb676..b31170b62c596 100644
--- a/libcxx/test/std/utilities/format/format.functions/formatted_size.locale.pass.cpp
+++ b/libcxx/test/std/utilities/format/format.functions/formatted_size.locale.pass.cpp
@@ -54,10 +54,12 @@ auto test_exception = []<class CharT, class... Args>(
 };
 
 int main(int, char**) {
-  format_tests_char_to_wchar_t(test);
-
   format_tests<char>(test, test_exception);
+
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
+  format_tests_char_to_wchar_t(test);
   format_tests<wchar_t>(test, test_exception);
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/utilities/format/format.functions/formatted_size.pass.cpp b/libcxx/test/std/utilities/format/format.functions/formatted_size.pass.cpp
index 3ba377656934d..befb4ce626109 100644
--- a/libcxx/test/std/utilities/format/format.functions/formatted_size.pass.cpp
+++ b/libcxx/test/std/utilities/format/format.functions/formatted_size.pass.cpp
@@ -51,10 +51,12 @@ auto test_exception = []<class CharT, class... Args>(
 };
 
 int main(int, char**) {
-  format_tests_char_to_wchar_t(test);
-
   format_tests<char>(test, test_exception);
+
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
+  format_tests_char_to_wchar_t(test);
   format_tests<wchar_t>(test, test_exception);
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/utilities/format/format.functions/locale-specific_form.pass.cpp b/libcxx/test/std/utilities/format/format.functions/locale-specific_form.pass.cpp
index eda372310ac8d..2d660c6350d95 100644
--- a/libcxx/test/std/utilities/format/format.functions/locale-specific_form.pass.cpp
+++ b/libcxx/test/std/utilities/format/format.functions/locale-specific_form.pass.cpp
@@ -105,6 +105,7 @@ struct numpunct<char> : std::numpunct<char> {
   char do_thousands_sep() const override { return '_'; }
 };
 
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
 template <>
 struct numpunct<wchar_t> : std::numpunct<wchar_t> {
   string_type do_truename() const override { return L"yes"; }
@@ -113,6 +114,7 @@ struct numpunct<wchar_t> : std::numpunct<wchar_t> {
   std::string do_grouping() const override { return "\1\2\3\2\1"; };
   wchar_t do_thousands_sep() const override { return L'_'; }
 };
+#endif
 
 template <class CharT, class... Args>
 void test(std::basic_string<CharT> expected, std::basic_string<CharT> fmt,
@@ -237,12 +239,14 @@ struct numpunct_unicode<char> : std::numpunct<char> {
   string_type do_falsename() const override { return "ungültig"; }
 };
 
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
 template <>
 struct numpunct_unicode<wchar_t> : std::numpunct<wchar_t> {
   string_type do_truename() const override { return L"gültig"; }
   string_type do_falsename() const override { return L"ungültig"; }
 };
 #endif
+#endif // _LIBCPP_HAS_NO_UNICODE
 
 template <class CharT>
 void test_bool() {
@@ -613,7 +617,9 @@ void test() {
 
 int main(int, char**) {
   test<char>();
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
   test<wchar_t>();
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/utilities/format/format.functions/vformat.locale.pass.cpp b/libcxx/test/std/utilities/format/format.functions/vformat.locale.pass.cpp
index 5a0fcaba6c94c..08e067e9f2d61 100644
--- a/libcxx/test/std/utilities/format/format.functions/vformat.locale.pass.cpp
+++ b/libcxx/test/std/utilities/format/format.functions/vformat.locale.pass.cpp
@@ -58,10 +58,12 @@ auto test_exception = []<class CharT, class... Args>(
 };
 
 int main(int, char**) {
-  format_tests_char_to_wchar_t(test);
-
   format_tests<char>(test, test_exception);
+
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
+  format_tests_char_to_wchar_t(test);
   format_tests<wchar_t>(test, test_exception);
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/utilities/format/format.functions/vformat.pass.cpp b/libcxx/test/std/utilities/format/format.functions/vformat.pass.cpp
index b1e7025bbcd15..c4df0a84f445d 100644
--- a/libcxx/test/std/utilities/format/format.functions/vformat.pass.cpp
+++ b/libcxx/test/std/utilities/format/format.functions/vformat.pass.cpp
@@ -55,10 +55,12 @@ auto test_exception = []<class CharT, class... Args>(
 };
 
 int main(int, char**) {
-  format_tests_char_to_wchar_t(test);
-
   format_tests<char>(test, test_exception);
+
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
+  format_tests_char_to_wchar_t(test);
   format_tests<wchar_t>(test, test_exception);
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/utilities/format/format.functions/vformat_to.locale.pass.cpp b/libcxx/test/std/utilities/format/format.functions/vformat_to.locale.pass.cpp
index a006a2b686c08..5a57adf8a4a3b 100644
--- a/libcxx/test/std/utilities/format/format.functions/vformat_to.locale.pass.cpp
+++ b/libcxx/test/std/utilities/format/format.functions/vformat_to.locale.pass.cpp
@@ -97,10 +97,12 @@ auto test_exception = []<class CharT, class... Args>(
 };
 
 int main(int, char**) {
-  format_tests_char_to_wchar_t(test);
-
   format_tests<char>(test, test_exception);
+
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
+  format_tests_char_to_wchar_t(test);
   format_tests<wchar_t>(test, test_exception);
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/utilities/format/format.functions/vformat_to.pass.cpp b/libcxx/test/std/utilities/format/format.functions/vformat_to.pass.cpp
index 1c243e68d493e..1deca0d722cd5 100644
--- a/libcxx/test/std/utilities/format/format.functions/vformat_to.pass.cpp
+++ b/libcxx/test/std/utilities/format/format.functions/vformat_to.pass.cpp
@@ -100,10 +100,12 @@ auto test_exception = []<class CharT, class... Args>(
 };
 
 int main(int, char**) {
-  format_tests_char_to_wchar_t(test);
-
   format_tests<char>(test, test_exception);
+
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
+  format_tests_char_to_wchar_t(test);
   format_tests<wchar_t>(test, test_exception);
+#endif
 
   return 0;
 }

diff  --git a/libcxx/test/std/utilities/function.objects/unord.hash/integral.pass.cpp b/libcxx/test/std/utilities/function.objects/unord.hash/integral.pass.cpp
index 031aa30f2b05f..4168b169935af 100644
--- a/libcxx/test/std/utilities/function.objects/unord.hash/integral.pass.cpp
+++ b/libcxx/test/std/utilities/function.objects/unord.hash/integral.pass.cpp
@@ -58,7 +58,9 @@ int main(int, char**)
     test<unsigned char>();
     test<char16_t>();
     test<char32_t>();
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
     test<wchar_t>();
+#endif
     test<short>();
     test<unsigned short>();
     test<int>();

diff  --git a/libcxx/test/std/utilities/template.bitset/bitset.members/to_string.pass.cpp b/libcxx/test/std/utilities/template.bitset/bitset.members/to_string.pass.cpp
index 0f364ec40defd..2ad9c2d787933 100644
--- a/libcxx/test/std/utilities/template.bitset/bitset.members/to_string.pass.cpp
+++ b/libcxx/test/std/utilities/template.bitset/bitset.members/to_string.pass.cpp
@@ -47,6 +47,7 @@ void test_to_string() {
     std::vector<std::bitset<N> > const cases = get_test_cases<N>();
     for (std::size_t c = 0; c != cases.size(); ++c) {
         std::bitset<N> const v = cases[c];
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
         {
             std::wstring s = v.template to_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >();
             check_equal(s, v, L'0', L'1');
@@ -55,6 +56,7 @@ void test_to_string() {
             std::wstring s = v.template to_string<wchar_t, std::char_traits<wchar_t> >();
             check_equal(s, v, L'0', L'1');
         }
+#endif
         {
             std::string s = v.template to_string<char>();
             check_equal(s, v, '0', '1');
@@ -63,6 +65,7 @@ void test_to_string() {
             std::string s = v.to_string();
             check_equal(s, v, '0', '1');
         }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
         {
             std::wstring s = v.template to_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >('0');
             check_equal(s, v, L'0', L'1');
@@ -71,6 +74,7 @@ void test_to_string() {
             std::wstring s = v.template to_string<wchar_t, std::char_traits<wchar_t> >('0');
             check_equal(s, v, L'0', L'1');
         }
+#endif
         {
             std::string s = v.template to_string<char>('0');
             check_equal(s, v, '0', '1');
@@ -79,6 +83,7 @@ void test_to_string() {
             std::string s = v.to_string('0');
             check_equal(s, v, '0', '1');
         }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
         {
             std::wstring s = v.template to_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >('0', '1');
             check_equal(s, v, L'0', L'1');
@@ -87,6 +92,7 @@ void test_to_string() {
             std::wstring s = v.template to_string<wchar_t, std::char_traits<wchar_t> >('0', '1');
             check_equal(s, v, L'0', L'1');
         }
+#endif
         {
             std::string s = v.template to_string<char>('0', '1');
             check_equal(s, v, '0', '1');

diff  --git a/libcxx/test/std/utilities/template.bitset/includes.pass.cpp b/libcxx/test/std/utilities/template.bitset/includes.pass.cpp
index 43d9e08b66ac3..b58dac5bf7a65 100644
--- a/libcxx/test/std/utilities/template.bitset/includes.pass.cpp
+++ b/libcxx/test/std/utilities/template.bitset/includes.pass.cpp
@@ -21,7 +21,6 @@ int main(int, char**)
   }
   { // test for <iosfwd>
     test_typedef<std::ios>();
-    test_typedef<std::wios>();
     test_typedef<std::istream>();
     test_typedef<std::ostream>();
     test_typedef<std::iostream>();

diff  --git a/libcxx/test/std/utilities/utility/utility.intcmp/intcmp.fail.cpp b/libcxx/test/std/utilities/utility/utility.intcmp/intcmp.fail.cpp
index b5d68c805705f..66e35adc40726 100644
--- a/libcxx/test/std/utilities/utility/utility.intcmp/intcmp.fail.cpp
+++ b/libcxx/test/std/utilities/utility/utility.intcmp/intcmp.fail.cpp
@@ -51,83 +51,85 @@ struct EmptyT {};
 
 template <class T>
 constexpr void test() {
-  std::cmp_equal(T(), T()); // expected-error11{{no matching function for call to 'cmp_equal'}}
-  std::cmp_equal(T(), int()); // expected-error11{{no matching function for call to 'cmp_equal'}}
-  std::cmp_equal(int(), T()); // expected-error11{{no matching function for call to 'cmp_equal'}}
-  std::cmp_not_equal(T(), T()); // expected-error11{{no matching function for call to 'cmp_not_equal'}}
-  std::cmp_not_equal(T(), int()); // expected-error11{{no matching function for call to 'cmp_not_equal'}}
-  std::cmp_not_equal(int(), T()); // expected-error11{{no matching function for call to 'cmp_not_equal'}}
-  std::cmp_less(T(), T()); // expected-error11{{no matching function for call to 'cmp_less'}}
-  std::cmp_less(T(), int()); // expected-error11{{no matching function for call to 'cmp_less'}}
-  std::cmp_less(int(), T()); // expected-error11{{no matching function for call to 'cmp_less'}}
-  std::cmp_less_equal(T(), T()); // expected-error11{{no matching function for call to 'cmp_less_equal'}}
-  std::cmp_less_equal(T(), int()); // expected-error11{{no matching function for call to 'cmp_less_equal'}}
-  std::cmp_less_equal(int(), T()); // expected-error11{{no matching function for call to 'cmp_less_equal'}}
-  std::cmp_greater(T(), T()); // expected-error11{{no matching function for call to 'cmp_greater'}}
-  std::cmp_greater(T(), int()); // expected-error11{{no matching function for call to 'cmp_greater'}}
-  std::cmp_greater(int(), T()); // expected-error11{{no matching function for call to 'cmp_greater'}}
-  std::cmp_greater_equal(T(), T()); // expected-error11{{no matching function for call to 'cmp_greater_equal'}}
-  std::cmp_greater_equal(T(), int()); // expected-error11{{no matching function for call to 'cmp_greater_equal'}}
-  std::cmp_greater_equal(int(), T()); // expected-error11{{no matching function for call to 'cmp_greater_equal'}}
-  std::in_range<T>(int()); // expected-error11{{no matching function for call to 'in_range'}}
-  std::in_range<int>(T()); // expected-error11{{no matching function for call to 'in_range'}}
+  std::cmp_equal(T(), T()); // expected-error 10-11 {{no matching function for call to 'cmp_equal'}}
+  std::cmp_equal(T(), int()); // expected-error 10-11 {{no matching function for call to 'cmp_equal'}}
+  std::cmp_equal(int(), T()); // expected-error 10-11 {{no matching function for call to 'cmp_equal'}}
+  std::cmp_not_equal(T(), T()); // expected-error 10-11 {{no matching function for call to 'cmp_not_equal'}}
+  std::cmp_not_equal(T(), int()); // expected-error 10-11 {{no matching function for call to 'cmp_not_equal'}}
+  std::cmp_not_equal(int(), T()); // expected-error 10-11 {{no matching function for call to 'cmp_not_equal'}}
+  std::cmp_less(T(), T()); // expected-error 10-11 {{no matching function for call to 'cmp_less'}}
+  std::cmp_less(T(), int()); // expected-error 10-11 {{no matching function for call to 'cmp_less'}}
+  std::cmp_less(int(), T()); // expected-error 10-11 {{no matching function for call to 'cmp_less'}}
+  std::cmp_less_equal(T(), T()); // expected-error 10-11 {{no matching function for call to 'cmp_less_equal'}}
+  std::cmp_less_equal(T(), int()); // expected-error 10-11 {{no matching function for call to 'cmp_less_equal'}}
+  std::cmp_less_equal(int(), T()); // expected-error 10-11 {{no matching function for call to 'cmp_less_equal'}}
+  std::cmp_greater(T(), T()); // expected-error 10-11 {{no matching function for call to 'cmp_greater'}}
+  std::cmp_greater(T(), int()); // expected-error 10-11 {{no matching function for call to 'cmp_greater'}}
+  std::cmp_greater(int(), T()); // expected-error 10-11 {{no matching function for call to 'cmp_greater'}}
+  std::cmp_greater_equal(T(), T()); // expected-error 10-11 {{no matching function for call to 'cmp_greater_equal'}}
+  std::cmp_greater_equal(T(), int()); // expected-error 10-11 {{no matching function for call to 'cmp_greater_equal'}}
+  std::cmp_greater_equal(int(), T()); // expected-error 10-11 {{no matching function for call to 'cmp_greater_equal'}}
+  std::in_range<T>(int()); // expected-error 10-11 {{no matching function for call to 'in_range'}}
+  std::in_range<int>(T()); // expected-error 10-11 {{no matching function for call to 'in_range'}}
 }
 #ifndef _LIBCPP_HAS_NO_CHAR8_T
 template <class T>
 constexpr void test_char8t() {
-  std::cmp_equal(T(), T()); // expected-error1{{no matching function for call to 'cmp_equal'}}
-  std::cmp_equal(T(), int()); // expected-error1{{no matching function for call to 'cmp_equal'}}
-  std::cmp_equal(int(), T()); // expected-error1{{no matching function for call to 'cmp_equal'}}
-  std::cmp_not_equal(T(), T()); // expected-error1{{no matching function for call to 'cmp_not_equal'}}
-  std::cmp_not_equal(T(), int()); // expected-error1{{no matching function for call to 'cmp_not_equal'}}
-  std::cmp_not_equal(int(), T()); // expected-error1{{no matching function for call to 'cmp_not_equal'}}
-  std::cmp_less(T(), T()); // expected-error1{{no matching function for call to 'cmp_less'}}
-  std::cmp_less(T(), int()); // expected-error1{{no matching function for call to 'cmp_less'}}
-  std::cmp_less(int(), T()); // expected-error1{{no matching function for call to 'cmp_less'}}
-  std::cmp_less_equal(T(), T()); // expected-error1{{no matching function for call to 'cmp_less_equal'}}
-  std::cmp_less_equal(T(), int()); // expected-error1{{no matching function for call to 'cmp_less_equal'}}
-  std::cmp_less_equal(int(), T()); // expected-error1{{no matching function for call to 'cmp_less_equal'}}
-  std::cmp_greater(T(), T()); // expected-error1{{no matching function for call to 'cmp_greater'}}
-  std::cmp_greater(T(), int()); // expected-error1{{no matching function for call to 'cmp_greater'}}
-  std::cmp_greater(int(), T()); // expected-error1{{no matching function for call to 'cmp_greater'}}
-  std::cmp_greater_equal(T(), T()); // expected-error1{{no matching function for call to 'cmp_greater_equal'}}
-  std::cmp_greater_equal(T(), int()); // expected-error1{{no matching function for call to 'cmp_greater_equal'}}
-  std::cmp_greater_equal(int(), T()); // expected-error1{{no matching function for call to 'cmp_greater_equal'}}
-  std::in_range<T>(int()); // expected-error1{{no matching function for call to 'in_range'}}
-  std::in_range<int>(T()); // expected-error1{{no matching function for call to 'in_range'}}
+  std::cmp_equal(T(), T()); // expected-error 1 {{no matching function for call to 'cmp_equal'}}
+  std::cmp_equal(T(), int()); // expected-error 1 {{no matching function for call to 'cmp_equal'}}
+  std::cmp_equal(int(), T()); // expected-error 1 {{no matching function for call to 'cmp_equal'}}
+  std::cmp_not_equal(T(), T()); // expected-error 1 {{no matching function for call to 'cmp_not_equal'}}
+  std::cmp_not_equal(T(), int()); // expected-error 1 {{no matching function for call to 'cmp_not_equal'}}
+  std::cmp_not_equal(int(), T()); // expected-error 1 {{no matching function for call to 'cmp_not_equal'}}
+  std::cmp_less(T(), T()); // expected-error 1 {{no matching function for call to 'cmp_less'}}
+  std::cmp_less(T(), int()); // expected-error 1 {{no matching function for call to 'cmp_less'}}
+  std::cmp_less(int(), T()); // expected-error 1 {{no matching function for call to 'cmp_less'}}
+  std::cmp_less_equal(T(), T()); // expected-error 1 {{no matching function for call to 'cmp_less_equal'}}
+  std::cmp_less_equal(T(), int()); // expected-error 1 {{no matching function for call to 'cmp_less_equal'}}
+  std::cmp_less_equal(int(), T()); // expected-error 1 {{no matching function for call to 'cmp_less_equal'}}
+  std::cmp_greater(T(), T()); // expected-error 1 {{no matching function for call to 'cmp_greater'}}
+  std::cmp_greater(T(), int()); // expected-error 1 {{no matching function for call to 'cmp_greater'}}
+  std::cmp_greater(int(), T()); // expected-error 1 {{no matching function for call to 'cmp_greater'}}
+  std::cmp_greater_equal(T(), T()); // expected-error 1 {{no matching function for call to 'cmp_greater_equal'}}
+  std::cmp_greater_equal(T(), int()); // expected-error 1 {{no matching function for call to 'cmp_greater_equal'}}
+  std::cmp_greater_equal(int(), T()); // expected-error 1 {{no matching function for call to 'cmp_greater_equal'}}
+  std::in_range<T>(int()); // expected-error 1 {{no matching function for call to 'in_range'}}
+  std::in_range<int>(T()); // expected-error 1 {{no matching function for call to 'in_range'}}
 }
 #endif // _LIBCPP_HAS_NO_CHAR8_T
 
 #ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
 template <class T>
 constexpr void test_uchars() {
-  std::cmp_equal(T(), T()); // expected-error2{{no matching function for call to 'cmp_equal'}}
-  std::cmp_equal(T(), int()); // expected-error2{{no matching function for call to 'cmp_equal'}}
-  std::cmp_equal(int(), T()); // expected-error2{{no matching function for call to 'cmp_equal'}}
-  std::cmp_not_equal(T(), T()); // expected-error2{{no matching function for call to 'cmp_not_equal'}}
-  std::cmp_not_equal(T(), int()); // expected-error2{{no matching function for call to 'cmp_not_equal'}}
-  std::cmp_not_equal(int(), T()); // expected-error2{{no matching function for call to 'cmp_not_equal'}}
-  std::cmp_less(T(), T()); // expected-error2{{no matching function for call to 'cmp_less'}}
-  std::cmp_less(T(), int()); // expected-error2{{no matching function for call to 'cmp_less'}}
-  std::cmp_less(int(), T()); // expected-error2{{no matching function for call to 'cmp_less'}}
-  std::cmp_less_equal(T(), T()); // expected-error2{{no matching function for call to 'cmp_less_equal'}}
-  std::cmp_less_equal(T(), int()); // expected-error2{{no matching function for call to 'cmp_less_equal'}}
-  std::cmp_less_equal(int(), T()); // expected-error2{{no matching function for call to 'cmp_less_equal'}}
-  std::cmp_greater(T(), T()); // expected-error2{{no matching function for call to 'cmp_greater'}}
-  std::cmp_greater(T(), int()); // expected-error2{{no matching function for call to 'cmp_greater'}}
-  std::cmp_greater(int(), T()); // expected-error2{{no matching function for call to 'cmp_greater'}}
-  std::cmp_greater_equal(T(), T()); // expected-error2{{no matching function for call to 'cmp_greater_equal'}}
-  std::cmp_greater_equal(T(), int()); // expected-error2{{no matching function for call to 'cmp_greater_equal'}}
-  std::cmp_greater_equal(int(), T()); // expected-error2{{no matching function for call to 'cmp_greater_equal'}}
-  std::in_range<T>(int()); // expected-error2{{no matching function for call to 'in_range'}}
-  std::in_range<int>(T()); // expected-error2{{no matching function for call to 'in_range'}}
+  std::cmp_equal(T(), T()); // expected-error 2 {{no matching function for call to 'cmp_equal'}}
+  std::cmp_equal(T(), int()); // expected-error 2 {{no matching function for call to 'cmp_equal'}}
+  std::cmp_equal(int(), T()); // expected-error 2 {{no matching function for call to 'cmp_equal'}}
+  std::cmp_not_equal(T(), T()); // expected-error 2 {{no matching function for call to 'cmp_not_equal'}}
+  std::cmp_not_equal(T(), int()); // expected-error 2 {{no matching function for call to 'cmp_not_equal'}}
+  std::cmp_not_equal(int(), T()); // expected-error 2 {{no matching function for call to 'cmp_not_equal'}}
+  std::cmp_less(T(), T()); // expected-error 2 {{no matching function for call to 'cmp_less'}}
+  std::cmp_less(T(), int()); // expected-error 2 {{no matching function for call to 'cmp_less'}}
+  std::cmp_less(int(), T()); // expected-error 2 {{no matching function for call to 'cmp_less'}}
+  std::cmp_less_equal(T(), T()); // expected-error 2 {{no matching function for call to 'cmp_less_equal'}}
+  std::cmp_less_equal(T(), int()); // expected-error 2 {{no matching function for call to 'cmp_less_equal'}}
+  std::cmp_less_equal(int(), T()); // expected-error 2 {{no matching function for call to 'cmp_less_equal'}}
+  std::cmp_greater(T(), T()); // expected-error 2 {{no matching function for call to 'cmp_greater'}}
+  std::cmp_greater(T(), int()); // expected-error 2 {{no matching function for call to 'cmp_greater'}}
+  std::cmp_greater(int(), T()); // expected-error 2 {{no matching function for call to 'cmp_greater'}}
+  std::cmp_greater_equal(T(), T()); // expected-error 2 {{no matching function for call to 'cmp_greater_equal'}}
+  std::cmp_greater_equal(T(), int()); // expected-error 2 {{no matching function for call to 'cmp_greater_equal'}}
+  std::cmp_greater_equal(int(), T()); // expected-error 2 {{no matching function for call to 'cmp_greater_equal'}}
+  std::in_range<T>(int()); // expected-error 2 {{no matching function for call to 'in_range'}}
+  std::in_range<int>(T()); // expected-error 2 {{no matching function for call to 'in_range'}}
 }
 #endif // _LIBCPP_HAS_NO_UNICODE_CHARS
 
 int main() {
   test<bool>();
   test<char>();
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
   test<wchar_t>();
+#endif
   test<float>();
   test<double>();
   test<long double>();

diff  --git a/libcxx/test/support/make_string.h b/libcxx/test/support/make_string.h
index 1ff3dc4e5211d..d417d7e1b4df9 100644
--- a/libcxx/test/support/make_string.h
+++ b/libcxx/test/support/make_string.h
@@ -24,16 +24,24 @@
 #define CHAR8_ONLY(x)
 #endif
 
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
+# define IF_WIDE_CHARACTERS(...) __VA_ARGS__
+#else
+# define IF_WIDE_CHARACTERS(...) /* nothing */
+#endif
+
 #define MKSTR(Str)                                                             \
   {                                                                            \
-    Str, TEST_CONCAT(L, Str),                                                  \
+    Str, IF_WIDE_CHARACTERS(TEST_CONCAT(L, Str),)                              \
         CHAR8_ONLY(TEST_CONCAT(u8, Str)) TEST_CONCAT(u, Str),                  \
         TEST_CONCAT(U, Str)                                                    \
   }
 
 struct MultiStringType {
   const char* s;
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
   const wchar_t* w;
+#endif
 #if TEST_STD_VER > 17 && defined(__cpp_char8_t)
   const char8_t* u8;
 #endif
@@ -41,7 +49,9 @@ struct MultiStringType {
   const char32_t* u32;
 
   constexpr operator const char*() const { return s; }
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
   constexpr operator const wchar_t*() const { return w; }
+#endif
 #if TEST_STD_VER > 17 && defined(__cpp_char8_t)
   constexpr operator const char8_t*() const { return u8; }
 #endif

diff  --git a/libcxx/test/support/poisoned_hash_helper.h b/libcxx/test/support/poisoned_hash_helper.h
index fbd35caae5a6b..bb4b70ba86e5e 100644
--- a/libcxx/test/support/poisoned_hash_helper.h
+++ b/libcxx/test/support/poisoned_hash_helper.h
@@ -57,7 +57,9 @@ using LibraryHashTypes = TypeList<
       char,
       signed char,
       unsigned char,
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
       wchar_t,
+#endif
 #ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
       char16_t,
       char32_t,

diff  --git a/libcxx/test/support/test.support/make_string_header.pass.cpp b/libcxx/test/support/test.support/make_string_header.pass.cpp
index c35cc5237037e..63c9149e839d4 100644
--- a/libcxx/test/support/test.support/make_string_header.pass.cpp
+++ b/libcxx/test/support/test.support/make_string_header.pass.cpp
@@ -23,11 +23,13 @@ int main(int, char**) {
     ==   " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMN"
              "OPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~");
 
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
   assert(MAKE_STRING(wchar_t,
          " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMN"
              "OPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~")
     ==  L" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMN"
              "OPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~");
+#endif
 #ifndef _LIBCPP_HAS_NO_CHAR8_T
   assert(MAKE_STRING(char8_t,
          " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMN"

diff  --git a/libcxx/test/support/test_macros.h b/libcxx/test/support/test_macros.h
index feb6e8a26b4f7..53fb990e248c8 100644
--- a/libcxx/test/support/test_macros.h
+++ b/libcxx/test/support/test_macros.h
@@ -348,6 +348,11 @@ inline void DoNotOptimize(Tp const& value) {
 #define TEST_WIN_NO_FILESYSTEM_PERMS_NONE
 #endif
 
+// Support for carving out parts of the test suite, like removing wide characters, etc.
+#if defined(_LIBCPP_HAS_NO_WIDE_CHARACTERS)
+#   define TEST_HAS_NO_WIDE_CHARACTERS
+#endif
+
 #if defined(__GNUC__)
 #pragma GCC diagnostic pop
 #endif

diff  --git a/libcxx/utils/ci/buildkite-pipeline.yml b/libcxx/utils/ci/buildkite-pipeline.yml
index 08b4d3cc079fe..67b552541089f 100644
--- a/libcxx/utils/ci/buildkite-pipeline.yml
+++ b/libcxx/utils/ci/buildkite-pipeline.yml
@@ -465,6 +465,19 @@ steps:
           limit: 2
     timeout_in_minutes: 120
 
+  - label: "No wide characters"
+    command: "libcxx/utils/ci/run-buildbot generic-no-wide-characters"
+    artifact_paths:
+      - "**/test-results.xml"
+    agents:
+      queue: "libcxx-builders"
+      os: "linux"
+    retry:
+      automatic:
+        - exit_status: -1  # Agent was lost
+          limit: 2
+    timeout_in_minutes: 120
+
   # Other non-testing CI jobs
   - label: "Benchmarks"
     command: "libcxx/utils/ci/run-buildbot benchmarks"

diff  --git a/libcxx/utils/ci/run-buildbot b/libcxx/utils/ci/run-buildbot
index a3e6b781ce23e..1a90a52b7e1c3 100755
--- a/libcxx/utils/ci/run-buildbot
+++ b/libcxx/utils/ci/run-buildbot
@@ -364,6 +364,12 @@ generic-no-unicode)
                    -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in"
     check-runtimes
 ;;
+generic-no-wide-characters)
+    clean
+    generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-wide-characters.cmake" \
+                   -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in"
+    check-runtimes
+;;
 x86_64-apple-system)
     clean
     generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Apple.cmake" \

diff  --git a/libcxx/utils/generate_header_tests.py b/libcxx/utils/generate_header_tests.py
index e08191400c580..19e7278320a8b 100755
--- a/libcxx/utils/generate_header_tests.py
+++ b/libcxx/utils/generate_header_tests.py
@@ -50,6 +50,11 @@ def get_libcxx_paths():
     "streambuf": ["ifndef _LIBCPP_HAS_NO_LOCALIZATION"],
     "strstream": ["ifndef _LIBCPP_HAS_NO_LOCALIZATION"],
 
+    "wctype.h": ["ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS"],
+    "cwctype": ["ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS"],
+    "cwchar": ["ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS"],
+    "wchar.h": ["ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS"],
+
     "experimental/coroutine": ["if defined(__cpp_coroutines)"],
     "experimental/regex": ["ifndef _LIBCPP_HAS_NO_LOCALIZATION"],
 }

diff  --git a/libcxx/utils/libcxx/test/features.py b/libcxx/utils/libcxx/test/features.py
index 1204304899120..fe2aa14af70b2 100644
--- a/libcxx/utils/libcxx/test/features.py
+++ b/libcxx/utils/libcxx/test/features.py
@@ -100,6 +100,7 @@
   '_LIBCPP_HAS_NO_FILESYSTEM_LIBRARY': 'libcpp-has-no-filesystem-library',
   '_LIBCPP_HAS_NO_RANDOM_DEVICE': 'libcpp-has-no-random-device',
   '_LIBCPP_HAS_NO_LOCALIZATION': 'libcpp-has-no-localization',
+  '_LIBCPP_HAS_NO_WIDE_CHARACTERS': 'libcpp-has-no-wide-characters',
   '_LIBCPP_HAS_NO_INCOMPLETE_FORMAT': 'libcpp-has-no-incomplete-format',
   '_LIBCPP_HAS_NO_INCOMPLETE_RANGES': 'libcpp-has-no-incomplete-ranges',
   '_LIBCPP_HAS_NO_UNICODE': 'libcpp-has-no-unicode',


        


More information about the libcxx-commits mailing list