[PowerPC][NFC] Cleanup PPCCTRLoopsVerify pass
[llvm-project.git] / libcxx / test / std / localization / locale.stdcvt / codecvt_utf8_utf16_max_length.pass.cpp
blob6459b2eaabbc4fdfc75f16715e53858cb491aba8
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 // template <class Elem, unsigned long Maxcode = 0x10ffff,
12 // codecvt_mode Mode = (codecvt_mode)0>
13 // class codecvt_utf8_utf16
14 // : public codecvt<Elem, char, mbstate_t>
15 // {
16 // // unspecified
17 // };
19 // int max_length() const throw();
21 #include <codecvt>
22 #include <cassert>
24 #include "test_macros.h"
26 int main(int, char**)
29 typedef std::codecvt_utf8_utf16<wchar_t> C;
30 C c;
31 int r = c.max_length();
32 assert(r == 4);
35 typedef std::codecvt_utf8_utf16<wchar_t, 0xFFFFFFFF, std::consume_header> C;
36 C c;
37 int r = c.max_length();
38 assert(r == 7);
41 typedef std::codecvt_utf8_utf16<char16_t> C;
42 C c;
43 int r = c.max_length();
44 assert(r == 4);
47 typedef std::codecvt_utf8_utf16<char16_t, 0xFFFFFFFF, std::consume_header> C;
48 C c;
49 int r = c.max_length();
50 assert(r == 7);
53 typedef std::codecvt_utf8_utf16<char32_t> C;
54 C c;
55 int r = c.max_length();
56 assert(r == 4);
59 typedef std::codecvt_utf8_utf16<char32_t, 0xFFFFFFFF, std::consume_header> C;
60 C c;
61 int r = c.max_length();
62 assert(r == 7);
65 return 0;