1 //===----------------------------------------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 // <locale>
10 
11 // template <> class ctype<char>
12 
13 // const mask* table() const throw();
14 
15 #include <locale>
16 #include <cassert>
17 
18 #include "test_macros.h"
19 
main(int,char **)20 int main(int, char**)
21 {
22     typedef std::ctype<char> F;
23     {
24         std::locale l(std::locale::classic(), new std::ctype<char>);
25         const F& f = std::use_facet<F>(l);
26         assert(f.table() == f.classic_table());
27     }
28     {
29         std::ctype<char>::mask table[256];
30         std::locale l(std::locale::classic(), new std::ctype<char>(table));
31         const F& f = std::use_facet<F>(l);
32         assert(f.table() == table);
33     }
34 
35   return 0;
36 }
37