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