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 // This test uses new symbols that were not defined in the libc++ shipped on
11 // darwin11 and darwin12:
12 // XFAIL: with_system_lib=x86_64-apple-darwin11
13 // XFAIL: with_system_lib=x86_64-apple-darwin12
14 
15 // <locale>
16 
17 // typedef int category;
18 
19 #include <locale>
20 #include <type_traits>
21 #include <cassert>
22 
23 template <class _Tp>
test(const _Tp &)24 void test(const _Tp &) {}
25 
26 
main()27 int main()
28 {
29     static_assert((std::is_same<std::locale::category, int>::value), "");
30     assert(std::locale::none == 0);
31     assert(std::locale::collate);
32     assert(std::locale::ctype);
33     assert(std::locale::monetary);
34     assert(std::locale::numeric);
35     assert(std::locale::time);
36     assert(std::locale::messages);
37     assert((std::locale::collate
38           & std::locale::ctype
39           & std::locale::monetary
40           & std::locale::numeric
41           & std::locale::time
42           & std::locale::messages) == 0);
43     assert((std::locale::collate
44           | std::locale::ctype
45           | std::locale::monetary
46           | std::locale::numeric
47           | std::locale::time
48           | std::locale::messages)
49          == std::locale::all);
50 
51     test(std::locale::none);
52     test(std::locale::collate);
53     test(std::locale::ctype);
54     test(std::locale::monetary);
55     test(std::locale::numeric);
56     test(std::locale::time);
57     test(std::locale::messages);
58     test(std::locale::all);
59 }
60