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 // WARNING: This test was generated by generate_feature_test_macro_components.py
10 // and should not be edited manually.
11 //
12 // clang-format off
13 
14 // UNSUPPORTED: no-localization
15 
16 // <ostream>
17 
18 // Test the feature test macros defined by <ostream>
19 
20 /*  Constant             Value
21     __cpp_lib_char8_t    201907L [C++20]
22     __cpp_lib_print      202207L [C++23]
23 */
24 
25 #include <ostream>
26 #include "test_macros.h"
27 
28 #if TEST_STD_VER < 14
29 
30 # ifdef __cpp_lib_char8_t
31 #   error "__cpp_lib_char8_t should not be defined before c++20"
32 # endif
33 
34 # ifdef __cpp_lib_print
35 #   error "__cpp_lib_print should not be defined before c++23"
36 # endif
37 
38 #elif TEST_STD_VER == 14
39 
40 # ifdef __cpp_lib_char8_t
41 #   error "__cpp_lib_char8_t should not be defined before c++20"
42 # endif
43 
44 # ifdef __cpp_lib_print
45 #   error "__cpp_lib_print should not be defined before c++23"
46 # endif
47 
48 #elif TEST_STD_VER == 17
49 
50 # ifdef __cpp_lib_char8_t
51 #   error "__cpp_lib_char8_t should not be defined before c++20"
52 # endif
53 
54 # ifdef __cpp_lib_print
55 #   error "__cpp_lib_print should not be defined before c++23"
56 # endif
57 
58 #elif TEST_STD_VER == 20
59 
60 # if defined(__cpp_char8_t)
61 #   ifndef __cpp_lib_char8_t
62 #     error "__cpp_lib_char8_t should be defined in c++20"
63 #   endif
64 #   if __cpp_lib_char8_t != 201907L
65 #     error "__cpp_lib_char8_t should have the value 201907L in c++20"
66 #   endif
67 # else
68 #   ifdef __cpp_lib_char8_t
69 #     error "__cpp_lib_char8_t should not be defined when the requirement 'defined(__cpp_char8_t)' is not met!"
70 #   endif
71 # endif
72 
73 # ifdef __cpp_lib_print
74 #   error "__cpp_lib_print should not be defined before c++23"
75 # endif
76 
77 #elif TEST_STD_VER == 23
78 
79 # if defined(__cpp_char8_t)
80 #   ifndef __cpp_lib_char8_t
81 #     error "__cpp_lib_char8_t should be defined in c++23"
82 #   endif
83 #   if __cpp_lib_char8_t != 201907L
84 #     error "__cpp_lib_char8_t should have the value 201907L in c++23"
85 #   endif
86 # else
87 #   ifdef __cpp_lib_char8_t
88 #     error "__cpp_lib_char8_t should not be defined when the requirement 'defined(__cpp_char8_t)' is not met!"
89 #   endif
90 # endif
91 
92 # ifndef __cpp_lib_print
93 #   error "__cpp_lib_print should be defined in c++23"
94 # endif
95 # if __cpp_lib_print != 202207L
96 #   error "__cpp_lib_print should have the value 202207L in c++23"
97 # endif
98 
99 #elif TEST_STD_VER > 23
100 
101 # if defined(__cpp_char8_t)
102 #   ifndef __cpp_lib_char8_t
103 #     error "__cpp_lib_char8_t should be defined in c++26"
104 #   endif
105 #   if __cpp_lib_char8_t != 201907L
106 #     error "__cpp_lib_char8_t should have the value 201907L in c++26"
107 #   endif
108 # else
109 #   ifdef __cpp_lib_char8_t
110 #     error "__cpp_lib_char8_t should not be defined when the requirement 'defined(__cpp_char8_t)' is not met!"
111 #   endif
112 # endif
113 
114 # ifndef __cpp_lib_print
115 #   error "__cpp_lib_print should be defined in c++26"
116 # endif
117 # if __cpp_lib_print != 202207L
118 #   error "__cpp_lib_print should have the value 202207L in c++26"
119 # endif
120 
121 #endif // TEST_STD_VER > 23
122 
123