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 codecvt<wchar_t, char, mbstate_t>
12 
13 // result unshift(stateT& state,
14 //                externT* to, externT* to_end, externT*& to_next) const;
15 
16 // This is pretty much just an "are you breathing" test
17 
18 #include <locale>
19 #include <string>
20 #include <vector>
21 #include <cassert>
22 
23 #include "test_macros.h"
24 
25 typedef std::codecvt<wchar_t, char, std::mbstate_t> F;
26 
main(int,char **)27 int main(int, char**)
28 {
29     std::locale l = std::locale::classic();
30     std::vector<F::extern_type> to(3);
31     const F& f = std::use_facet<F>(l);
32     std::mbstate_t mbs = {};
33     F::extern_type* to_next = 0;
34     assert(f.unshift(mbs, to.data(), to.data() + to.size(), to_next) == F::ok);
35     assert(to_next == to.data());
36 
37   return 0;
38 }
39