| 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: no-wide-characters |
| 10 | |
| 11 | // towctrans and wctrans were added in Android API 26. |
| 12 | // TODO: Switch from UNSUPPORTED to XFAIL once the Android CI Docker sysroot is |
| 13 | // updated. |
| 14 | // UNSUPPORTED: LIBCXX-ANDROID-FIXME && target={{.+}}-android{{(eabi)?(21|22|23|24|25)}} |
| 15 | |
| 16 | // <wctype.h> |
| 17 | |
| 18 | #include <wctype.h> |
| 19 | |
| 20 | #include "test_macros.h" |
| 21 | |
| 22 | #ifndef WEOF |
| 23 | #error WEOF not defined |
| 24 | #endif |
| 25 | |
| 26 | #ifdef iswalnum |
| 27 | #error iswalnum defined |
| 28 | #endif |
| 29 | |
| 30 | #ifdef iswalpha |
| 31 | #error iswalpha defined |
| 32 | #endif |
| 33 | |
| 34 | #ifdef iswblank |
| 35 | #error iswblank defined |
| 36 | #endif |
| 37 | |
| 38 | #ifdef iswcntrl |
| 39 | #error iswcntrl defined |
| 40 | #endif |
| 41 | |
| 42 | #ifdef iswdigit |
| 43 | #error iswdigit defined |
| 44 | #endif |
| 45 | |
| 46 | #ifdef iswgraph |
| 47 | #error iswgraph defined |
| 48 | #endif |
| 49 | |
| 50 | #ifdef iswlower |
| 51 | #error iswlower defined |
| 52 | #endif |
| 53 | |
| 54 | #ifdef iswprint |
| 55 | #error iswprint defined |
| 56 | #endif |
| 57 | |
| 58 | #ifdef iswpunct |
| 59 | #error iswpunct defined |
| 60 | #endif |
| 61 | |
| 62 | #ifdef iswspace |
| 63 | #error iswspace defined |
| 64 | #endif |
| 65 | |
| 66 | #ifdef iswupper |
| 67 | #error iswupper defined |
| 68 | #endif |
| 69 | |
| 70 | #ifdef iswxdigit |
| 71 | #error iswxdigit defined |
| 72 | #endif |
| 73 | |
| 74 | #ifdef iswctype |
| 75 | #error iswctype defined |
| 76 | #endif |
| 77 | |
| 78 | #ifdef wctype |
| 79 | #error wctype defined |
| 80 | #endif |
| 81 | |
| 82 | #ifdef towlower |
| 83 | #error towlower defined |
| 84 | #endif |
| 85 | |
| 86 | #ifdef towupper |
| 87 | #error towupper defined |
| 88 | #endif |
| 89 | |
| 90 | #ifdef towctrans |
| 91 | #error towctrans defined |
| 92 | #endif |
| 93 | |
| 94 | #ifdef wctrans |
| 95 | #error wctrans defined |
| 96 | #endif |
| 97 | |
| 98 | wint_t w = 0; |
| 99 | wctrans_t wctr = 0; |
| 100 | wctype_t wct = 0; |
| 101 | ASSERT_SAME_TYPE(int, decltype(iswalnum(wc: w))); |
| 102 | ASSERT_SAME_TYPE(int, decltype(iswalpha(wc: w))); |
| 103 | ASSERT_SAME_TYPE(int, decltype(iswblank(wc: w))); |
| 104 | ASSERT_SAME_TYPE(int, decltype(iswcntrl(wc: w))); |
| 105 | ASSERT_SAME_TYPE(int, decltype(iswdigit(wc: w))); |
| 106 | ASSERT_SAME_TYPE(int, decltype(iswgraph(wc: w))); |
| 107 | ASSERT_SAME_TYPE(int, decltype(iswlower(wc: w))); |
| 108 | ASSERT_SAME_TYPE(int, decltype(iswprint(wc: w))); |
| 109 | ASSERT_SAME_TYPE(int, decltype(iswpunct(wc: w))); |
| 110 | ASSERT_SAME_TYPE(int, decltype(iswspace(wc: w))); |
| 111 | ASSERT_SAME_TYPE(int, decltype(iswupper(wc: w))); |
| 112 | ASSERT_SAME_TYPE(int, decltype(iswxdigit(wc: w))); |
| 113 | ASSERT_SAME_TYPE(int, decltype(iswctype(wc: w, desc: wct))); |
| 114 | ASSERT_SAME_TYPE(wctype_t, decltype(wctype(property: "" ))); |
| 115 | ASSERT_SAME_TYPE(wint_t, decltype(towlower(wc: w))); |
| 116 | ASSERT_SAME_TYPE(wint_t, decltype(towupper(wc: w))); |
| 117 | ASSERT_SAME_TYPE(wint_t, decltype(towctrans(wc: w, desc: wctr))); |
| 118 | ASSERT_SAME_TYPE(wctrans_t, decltype(wctrans(property: "" ))); |
| 119 | |