1 //===----------------------------------------------------------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
12 // template <class charT> class ctype_byname;
14 // const charT* tolower(charT* low, const charT* high) const;
16 // XFAIL: with_system_lib=x86_64-apple-darwin11
17 // XFAIL: with_system_lib=x86_64-apple-darwin12
24 #include "platform_support.h" // locale name macros
29 std::locale l(LOCALE_en_US_UTF_8);
31 typedef std::ctype<char> F;
32 const F& f = std::use_facet<F>(l);
33 std::string in("\xDA A\x07.a1");
35 assert(f.tolower(&in[0], in.data() + in.size()) == in.data() + in.size());
36 assert(in[0] == '\xFA');
39 assert(in[3] == '\x07');
48 typedef std::ctype<char> F;
49 const F& f = std::use_facet<F>(l);
50 std::string in("\xDA A\x07.a1");
52 assert(f.tolower(&in[0], in.data() + in.size()) == in.data() + in.size());
53 assert(in[0] == '\xDA');
56 assert(in[3] == '\x07');
63 std::locale l(LOCALE_en_US_UTF_8);
65 typedef std::ctype<wchar_t> F;
66 const F& f = std::use_facet<F>(l);
67 std::wstring in(L"\xDA A\x07.a1");
69 assert(f.tolower(&in[0], in.data() + in.size()) == in.data() + in.size());
70 assert(in[0] == L'\xFA');
71 assert(in[1] == L' ');
72 assert(in[2] == L'a');
73 assert(in[3] == L'\x07');
74 assert(in[4] == L'.');
75 assert(in[5] == L'a');
76 assert(in[6] == L'1');
82 typedef std::ctype<wchar_t> F;
83 const F& f = std::use_facet<F>(l);
84 std::wstring in(L"\xDA A\x07.a1");
86 assert(f.tolower(&in[0], in.data() + in.size()) == in.data() + in.size());
87 assert(in[0] == L'\xDA');
88 assert(in[1] == L' ');
89 assert(in[2] == L'a');
90 assert(in[3] == L'\x07');
91 assert(in[4] == L'.');
92 assert(in[5] == L'a');
93 assert(in[6] == L'1');