c++: Fix ICE with #embed/RAW_DATA_CST after list conversion [PR118671]
[gcc.git] / libstdc++-v3 / testsuite / 22_locale / codecvt / codecvt_unicode_wchar_t.cc
blob84bd72098332a6fb449fdc02c75504ec01cc0d29
1 // Copyright (C) 2020-2025 Free Software Foundation, Inc.
2 //
3 // This file is part of the GNU ISO C++ Library. This library is free
4 // software; you can redistribute it and/or modify it under the
5 // terms of the GNU General Public License as published by the
6 // Free Software Foundation; either version 3, or (at your option)
7 // any later version.
9 // This library is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
14 // You should have received a copy of the GNU General Public License along
15 // with this library; see the file COPYING3. If not see
16 // <http://www.gnu.org/licenses/>.
18 // { dg-do run { target c++11 } }
20 #include "codecvt_unicode.h"
22 #include <codecvt>
24 using namespace std;
26 void
27 test_utf8_utf32_codecvts ()
29 #if __SIZEOF_WCHAR_T__ == 4
30 codecvt_utf8<wchar_t> cvt;
31 test_utf8_utf32_cvt (cvt);
32 #endif
35 void
36 test_utf8_utf16_codecvts ()
38 #if __SIZEOF_WCHAR_T__ >= 2
39 codecvt_utf8_utf16<wchar_t> cvt;
40 test_utf8_utf16_cvt (cvt);
41 #endif
44 void
45 test_utf8_ucs2_codecvts ()
47 #if __SIZEOF_WCHAR_T__ == 2
48 codecvt_utf8<wchar_t> cvt;
49 test_utf8_ucs2_cvt (cvt);
50 #endif
53 void
54 test_utf16_utf32_codecvts ()
56 #if __SIZEOF_WCHAR_T__ == 4
57 codecvt_utf16<wchar_t> cvt3;
58 test_utf16_utf32_cvt (cvt3, utf16_big_endian);
60 codecvt_utf16<wchar_t, 0x10FFFF, codecvt_mode::little_endian> cvt4;
61 test_utf16_utf32_cvt (cvt4, utf16_little_endian);
62 #endif
65 void
66 test_utf16_ucs2_codecvts ()
68 #if __SIZEOF_WCHAR_T__ == 2
69 codecvt_utf16<wchar_t> cvt3;
70 test_utf16_ucs2_cvt (cvt3, utf16_big_endian);
72 codecvt_utf16<wchar_t, 0x10FFFF, codecvt_mode::little_endian> cvt4;
73 test_utf16_ucs2_cvt (cvt4, utf16_little_endian);
74 #endif
77 int
78 main ()
80 test_utf8_utf32_codecvts ();
81 test_utf8_utf16_codecvts ();
82 test_utf8_ucs2_codecvts ();
83 test_utf16_utf32_codecvts ();
84 test_utf16_ucs2_codecvts ();