1 //===----------------------------------------------------------------------===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 
10 // <locale>
11 
12 // template <class charT> class ctype;
13 
14 // const charT* tolower(charT* low, const charT* high) const;
15 
16 #include <locale>
17 #include <string>
18 #include <cassert>
19 
20 int main()
21 {
22     std::locale l = std::locale::classic();
23     {
24         typedef std::ctype<wchar_t> F;
25         const F& f = std::use_facet<F>(l);
26         std::wstring in(L" A\x07.a1");
27 
28         assert(f.tolower(&in[0], in.data() + in.size()) == in.data() + in.size());
29         assert(in[0] == L' ');
30         assert(in[1] == L'a');
31         assert(in[2] == L'\x07');
32         assert(in[3] == L'.');
33         assert(in[4] == L'a');
34         assert(in[5] == L'1');
35     }
36 }
37