• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 // <codecvt>
10 
11 // template <class Elem, unsigned long Maxcode = 0x10ffff,
12 //           codecvt_mode Mode = (codecvt_mode)0>
13 // class codecvt_utf8
14 //     : public codecvt<Elem, char, mbstate_t>
15 // {
16 //     // unspecified
17 // };
18 
19 // Not a portable test
20 
21 #include <codecvt>
22 #include <cstdlib>
23 #include <cassert>
24 
25 #include "count_new.h"
26 
27 #include "test_macros.h"
28 
main(int,char **)29 int main(int, char**)
30 {
31     globalMemCounter.reset();
32     assert(globalMemCounter.checkOutstandingNewEq(0));
33     {
34         typedef std::codecvt_utf8<wchar_t> C;
35         C c;
36         assert(globalMemCounter.checkOutstandingNewEq(0));
37     }
38     {
39         typedef std::codecvt_utf8<wchar_t> C;
40         std::locale loc(std::locale::classic(), new C);
41         assert(globalMemCounter.checkOutstandingNewNotEq(0));
42     }
43     assert(globalMemCounter.checkOutstandingNewEq(0));
44 
45   return 0;
46 }
47