Revert "[libc] Use best-fit binary trie to make malloc logarithmic" (#117065)
[llvm-project.git] / libcxx / test / std / localization / locale.stdcvt / codecvt_utf8_encoding.pass.cpp
blob25f308170a79b9c89556421a55fba4ae69c1e50b
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 //===----------------------------------------------------------------------===//
9 // <codecvt>
11 // ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS -D_LIBCPP_ENABLE_CXX26_REMOVED_CODECVT
13 // template <class Elem, unsigned long Maxcode = 0x10ffff,
14 // codecvt_mode Mode = (codecvt_mode)0>
15 // class codecvt_utf8
16 // : public codecvt<Elem, char, mbstate_t>
17 // {
18 // // unspecified
19 // };
21 // int encoding() const throw();
23 #include <codecvt>
24 #include <cassert>
26 #include "test_macros.h"
28 int main(int, char**)
30 #ifndef TEST_HAS_NO_WIDE_CHARACTERS
32 typedef std::codecvt_utf8<wchar_t> C;
33 C c;
34 int r = c.encoding();
35 assert(r == 0);
37 #endif
39 typedef std::codecvt_utf8<char16_t> C;
40 C c;
41 int r = c.encoding();
42 assert(r == 0);
45 typedef std::codecvt_utf8<char32_t> C;
46 C c;
47 int r = c.encoding();
48 assert(r == 0);
51 return 0;