[PowerPC][NFC] Cleanup PPCCTRLoopsVerify pass
[llvm-project.git] / libcxx / test / std / localization / locale.stdcvt / codecvt_utf8_unshift.pass.cpp
blob6aa021a8d16407c1832a4ac6ccb78a59aa93103e
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
14 // : public codecvt<Elem, char, mbstate_t>
15 // {
16 // // unspecified
17 // };
19 // result
20 // unshift(stateT& state,
21 // externT* to, externT* to_end, externT*& to_next) const;
23 #include <codecvt>
24 #include <cassert>
26 #include "test_macros.h"
28 int main(int, char**)
31 typedef std::codecvt_utf8<wchar_t> C;
32 C c;
33 char n[4] = {0};
34 std::mbstate_t m;
35 char* np = nullptr;
36 std::codecvt_base::result r = c.unshift(m, n, n+4, np);
37 assert(r == std::codecvt_base::noconv);
40 typedef std::codecvt_utf8<char16_t> C;
41 C c;
42 char n[4] = {0};
43 std::mbstate_t m;
44 char* np = nullptr;
45 std::codecvt_base::result r = c.unshift(m, n, n+4, np);
46 assert(r == std::codecvt_base::noconv);
49 typedef std::codecvt_utf8<char32_t> C;
50 C c;
51 char n[4] = {0};
52 std::mbstate_t m;
53 char* np = nullptr;
54 std::codecvt_base::result r = c.unshift(m, n, n+4, np);
55 assert(r == std::codecvt_base::noconv);
58 return 0;