| 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 | // UNSUPPORTED: c++03 |
| 10 | |
| 11 | // Apple platforms don't provide <uchar.h> yet, so these tests fail. |
| 12 | // XFAIL: target={{.+}}-apple-{{.+}} |
| 13 | |
| 14 | // mbrtoc16 not defined. |
| 15 | // XFAIL: LIBCXX-PICOLIBC-FIXME |
| 16 | |
| 17 | // <cuchar> |
| 18 | |
| 19 | #include <cuchar> |
| 20 | |
| 21 | #include "test_macros.h" |
| 22 | |
| 23 | // __STDC_UTF_16__ may or may not be defined by the C standard library |
| 24 | // __STDC_UTF_32__ may or may not be defined by the C standard library |
| 25 | |
| 26 | #if !defined(TEST_HAS_NO_C8RTOMB_MBRTOC8) |
| 27 | ASSERT_SAME_TYPE(std::size_t, decltype(std::mbrtoc8((char8_t*)0, (const char*)0, (size_t)0, (mbstate_t*)0))); |
| 28 | ASSERT_SAME_TYPE(std::size_t, decltype(std::c8rtomb((char*)0, (char8_t)0, (mbstate_t*)0))); |
| 29 | #endif |
| 30 | |
| 31 | ASSERT_SAME_TYPE(std::size_t, decltype(std::mbrtoc16(pc16: (char16_t*)0, s: (const char*)0, n: (size_t)0, p: (mbstate_t*)0))); |
| 32 | ASSERT_SAME_TYPE(std::size_t, decltype(std::c16rtomb(s: (char*)0, c16: (char16_t)0, ps: (mbstate_t*)0))); |
| 33 | |
| 34 | ASSERT_SAME_TYPE(std::size_t, decltype(std::mbrtoc32(pc32: (char32_t*)0, s: (const char*)0, n: (size_t)0, p: (mbstate_t*)0))); |
| 35 | ASSERT_SAME_TYPE(std::size_t, decltype(std::c16rtomb(s: (char*)0, c16: (char32_t)0, ps: (mbstate_t*)0))); |
| 36 | |