1 // Copyright (C) 2020-2025 Free Software Foundation, Inc.
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)
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"
27 test_utf8_utf32_codecvts ()
29 #if __SIZEOF_WCHAR_T__ == 4
30 codecvt_utf8
<wchar_t> cvt
;
31 test_utf8_utf32_cvt (cvt
);
36 test_utf8_utf16_codecvts ()
38 #if __SIZEOF_WCHAR_T__ >= 2
39 codecvt_utf8_utf16
<wchar_t> cvt
;
40 test_utf8_utf16_cvt (cvt
);
45 test_utf8_ucs2_codecvts ()
47 #if __SIZEOF_WCHAR_T__ == 2
48 codecvt_utf8
<wchar_t> cvt
;
49 test_utf8_ucs2_cvt (cvt
);
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
);
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
);
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 ();