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 | // UNSUPPORTED: no-filesystem |
13 | |
14 | // <filesystem> |
15 | |
16 | // Test the feature test macros defined by <filesystem> |
17 | |
18 | // clang-format off |
19 | |
20 | #include <filesystem> |
21 | #include "test_macros.h" |
22 | |
23 | #if TEST_STD_VER < 14 |
24 | |
25 | # ifdef __cpp_lib_char8_t |
26 | # error "__cpp_lib_char8_t should not be defined before c++20" |
27 | # endif |
28 | |
29 | # ifdef __cpp_lib_filesystem |
30 | # error "__cpp_lib_filesystem should not be defined before c++17" |
31 | # endif |
32 | |
33 | # ifdef __cpp_lib_format_path |
34 | # error "__cpp_lib_format_path should not be defined before c++26" |
35 | # endif |
36 | |
37 | #elif TEST_STD_VER == 14 |
38 | |
39 | # ifdef __cpp_lib_char8_t |
40 | # error "__cpp_lib_char8_t should not be defined before c++20" |
41 | # endif |
42 | |
43 | # ifdef __cpp_lib_filesystem |
44 | # error "__cpp_lib_filesystem should not be defined before c++17" |
45 | # endif |
46 | |
47 | # ifdef __cpp_lib_format_path |
48 | # error "__cpp_lib_format_path should not be defined before c++26" |
49 | # endif |
50 | |
51 | #elif TEST_STD_VER == 17 |
52 | |
53 | # ifdef __cpp_lib_char8_t |
54 | # error "__cpp_lib_char8_t should not be defined before c++20" |
55 | # endif |
56 | |
57 | # if !defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_FILESYSTEM && _LIBCPP_AVAILABILITY_HAS_FILESYSTEM_LIBRARY) |
58 | # ifndef __cpp_lib_filesystem |
59 | # error "__cpp_lib_filesystem should be defined in c++17" |
60 | # endif |
61 | # if __cpp_lib_filesystem != 201703L |
62 | # error "__cpp_lib_filesystem should have the value 201703L in c++17" |
63 | # endif |
64 | # else |
65 | # ifdef __cpp_lib_filesystem |
66 | # error "__cpp_lib_filesystem should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_FILESYSTEM && _LIBCPP_AVAILABILITY_HAS_FILESYSTEM_LIBRARY)' is not met!" |
67 | # endif |
68 | # endif |
69 | |
70 | # ifdef __cpp_lib_format_path |
71 | # error "__cpp_lib_format_path should not be defined before c++26" |
72 | # endif |
73 | |
74 | #elif TEST_STD_VER == 20 |
75 | |
76 | # if defined(__cpp_char8_t) |
77 | # ifndef __cpp_lib_char8_t |
78 | # error "__cpp_lib_char8_t should be defined in c++20" |
79 | # endif |
80 | # if __cpp_lib_char8_t != 201907L |
81 | # error "__cpp_lib_char8_t should have the value 201907L in c++20" |
82 | # endif |
83 | # else |
84 | # ifdef __cpp_lib_char8_t |
85 | # error "__cpp_lib_char8_t should not be defined when the requirement 'defined(__cpp_char8_t)' is not met!" |
86 | # endif |
87 | # endif |
88 | |
89 | # if !defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_FILESYSTEM && _LIBCPP_AVAILABILITY_HAS_FILESYSTEM_LIBRARY) |
90 | # ifndef __cpp_lib_filesystem |
91 | # error "__cpp_lib_filesystem should be defined in c++20" |
92 | # endif |
93 | # if __cpp_lib_filesystem != 201703L |
94 | # error "__cpp_lib_filesystem should have the value 201703L in c++20" |
95 | # endif |
96 | # else |
97 | # ifdef __cpp_lib_filesystem |
98 | # error "__cpp_lib_filesystem should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_FILESYSTEM && _LIBCPP_AVAILABILITY_HAS_FILESYSTEM_LIBRARY)' is not met!" |
99 | # endif |
100 | # endif |
101 | |
102 | # ifdef __cpp_lib_format_path |
103 | # error "__cpp_lib_format_path should not be defined before c++26" |
104 | # endif |
105 | |
106 | #elif TEST_STD_VER == 23 |
107 | |
108 | # if defined(__cpp_char8_t) |
109 | # ifndef __cpp_lib_char8_t |
110 | # error "__cpp_lib_char8_t should be defined in c++23" |
111 | # endif |
112 | # if __cpp_lib_char8_t != 201907L |
113 | # error "__cpp_lib_char8_t should have the value 201907L in c++23" |
114 | # endif |
115 | # else |
116 | # ifdef __cpp_lib_char8_t |
117 | # error "__cpp_lib_char8_t should not be defined when the requirement 'defined(__cpp_char8_t)' is not met!" |
118 | # endif |
119 | # endif |
120 | |
121 | # if !defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_FILESYSTEM && _LIBCPP_AVAILABILITY_HAS_FILESYSTEM_LIBRARY) |
122 | # ifndef __cpp_lib_filesystem |
123 | # error "__cpp_lib_filesystem should be defined in c++23" |
124 | # endif |
125 | # if __cpp_lib_filesystem != 201703L |
126 | # error "__cpp_lib_filesystem should have the value 201703L in c++23" |
127 | # endif |
128 | # else |
129 | # ifdef __cpp_lib_filesystem |
130 | # error "__cpp_lib_filesystem should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_FILESYSTEM && _LIBCPP_AVAILABILITY_HAS_FILESYSTEM_LIBRARY)' is not met!" |
131 | # endif |
132 | # endif |
133 | |
134 | # ifdef __cpp_lib_format_path |
135 | # error "__cpp_lib_format_path should not be defined before c++26" |
136 | # endif |
137 | |
138 | #elif TEST_STD_VER > 23 |
139 | |
140 | # if defined(__cpp_char8_t) |
141 | # ifndef __cpp_lib_char8_t |
142 | # error "__cpp_lib_char8_t should be defined in c++26" |
143 | # endif |
144 | # if __cpp_lib_char8_t != 201907L |
145 | # error "__cpp_lib_char8_t should have the value 201907L in c++26" |
146 | # endif |
147 | # else |
148 | # ifdef __cpp_lib_char8_t |
149 | # error "__cpp_lib_char8_t should not be defined when the requirement 'defined(__cpp_char8_t)' is not met!" |
150 | # endif |
151 | # endif |
152 | |
153 | # if !defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_FILESYSTEM && _LIBCPP_AVAILABILITY_HAS_FILESYSTEM_LIBRARY) |
154 | # ifndef __cpp_lib_filesystem |
155 | # error "__cpp_lib_filesystem should be defined in c++26" |
156 | # endif |
157 | # if __cpp_lib_filesystem != 201703L |
158 | # error "__cpp_lib_filesystem should have the value 201703L in c++26" |
159 | # endif |
160 | # else |
161 | # ifdef __cpp_lib_filesystem |
162 | # error "__cpp_lib_filesystem should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_FILESYSTEM && _LIBCPP_AVAILABILITY_HAS_FILESYSTEM_LIBRARY)' is not met!" |
163 | # endif |
164 | # endif |
165 | |
166 | # if !defined(_LIBCPP_VERSION) |
167 | # ifndef __cpp_lib_format_path |
168 | # error "__cpp_lib_format_path should be defined in c++26" |
169 | # endif |
170 | # if __cpp_lib_format_path != 202403L |
171 | # error "__cpp_lib_format_path should have the value 202403L in c++26" |
172 | # endif |
173 | # else |
174 | # ifdef __cpp_lib_format_path |
175 | # error "__cpp_lib_format_path should not be defined because it is unimplemented in libc++!" |
176 | # endif |
177 | # endif |
178 | |
179 | #endif // TEST_STD_VER > 23 |
180 | |
181 | // clang-format on |
182 | |
183 | |