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 ctype<char>;
13 
14 // const char* tolower(char* low, const char* high) const;
15 
16 #include <locale>
17 #include <string>
18 #include <cassert>
19 
main()20 int main()
21 {
22     std::locale l = std::locale::classic();
23     {
24         typedef std::ctype<char> F;
25         const F& f = std::use_facet<F>(l);
26         std::string in(" A\x07.a1");
27 
28         assert(f.tolower(&in[0], in.data() + in.size()) == in.data() + in.size());
29         assert(in[0] == ' ');
30         assert(in[1] == 'a');
31         assert(in[2] == '\x07');
32         assert(in[3] == '.');
33         assert(in[4] == 'a');
34         assert(in[5] == '1');
35     }
36 }
37