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 | // UNSUPPORTED: no-localization |
11 | |
12 | // "support/make_string.h" |
13 | |
14 | #include "make_string.h" |
15 | #include <cassert> |
16 | |
17 | #include "test_macros.h" |
18 | |
19 | int main(int, char**) { |
20 | // clang-format off |
21 | assert(MAKE_STRING(char, |
22 | " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMN" |
23 | "OPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~" ) |
24 | == " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMN" |
25 | "OPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~" ); |
26 | |
27 | #ifndef TEST_HAS_NO_WIDE_CHARACTERS |
28 | assert(MAKE_STRING(wchar_t, |
29 | " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMN" |
30 | "OPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~" ) |
31 | == L" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMN" |
32 | "OPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~" ); |
33 | #endif |
34 | #if _LIBCPP_HAS_CHAR8_T |
35 | assert(MAKE_STRING(char8_t, |
36 | " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMN" |
37 | "OPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~" ) |
38 | == u8" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMN" |
39 | "OPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~" ); |
40 | #endif |
41 | assert(MAKE_STRING(char16_t, |
42 | " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMN" |
43 | "OPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~" ) |
44 | == u" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMN" |
45 | "OPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~" ); |
46 | |
47 | assert(MAKE_STRING(char32_t, |
48 | " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMN" |
49 | "OPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~" ) |
50 | == U" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMN" |
51 | "OPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~" ); |
52 | |
53 | // clang-format on |
54 | return 0; |
55 | } |
56 | |