Skip to content

Commit 4ef5a85

Browse files
committed
[libc++] Adds a FTM v2 data file generator.
This generator converts the existing data structure to the new JSON format. Next to adding the generator add the output of the tests in a new directory beneath the existing directory. This allows validating the output for the old and new tests. (These should be almost identical.) This infrastructure allows using the new code and developing additional features without changing the existing work-flow. Then at some point we can switch from the old to the new version without a lot of additional manual work or merge conflicts. The new files are generated by the normal libcxx-generate-files cmake target that is used to update the existing FTM macros. Note the new code have no tests; the validation of the output and testing in the CI shows it works. This code will be removed in the future.
1 parent 1afa959 commit 4ef5a85

File tree

84 files changed

+17550
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+17550
-1
lines changed

libcxx/test/std/language.support/support.limits/support.limits.general/v2/algorithm.version.compile.pass.cpp

Lines changed: 463 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
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
10+
// generate_feature_test_macro_components.py
11+
// and should not be edited manually.
12+
13+
// <any>
14+
15+
// Test the feature test macros defined by <any>
16+
17+
// clang-format off
18+
19+
#include <any>
20+
#include "test_macros.h"
21+
22+
#if TEST_STD_VER < 14
23+
24+
# ifdef __cpp_lib_any
25+
# error "__cpp_lib_any should not be defined before c++17"
26+
# endif
27+
28+
#elif TEST_STD_VER == 14
29+
30+
# ifdef __cpp_lib_any
31+
# error "__cpp_lib_any should not be defined before c++17"
32+
# endif
33+
34+
#elif TEST_STD_VER == 17
35+
36+
# ifndef __cpp_lib_any
37+
# error "__cpp_lib_any should be defined in c++17"
38+
# endif
39+
# if __cpp_lib_any != 201606L
40+
# error "__cpp_lib_any should have the value 201606L in c++17"
41+
# endif
42+
43+
#elif TEST_STD_VER == 20
44+
45+
# ifndef __cpp_lib_any
46+
# error "__cpp_lib_any should be defined in c++20"
47+
# endif
48+
# if __cpp_lib_any != 201606L
49+
# error "__cpp_lib_any should have the value 201606L in c++20"
50+
# endif
51+
52+
#elif TEST_STD_VER == 23
53+
54+
# ifndef __cpp_lib_any
55+
# error "__cpp_lib_any should be defined in c++23"
56+
# endif
57+
# if __cpp_lib_any != 201606L
58+
# error "__cpp_lib_any should have the value 201606L in c++23"
59+
# endif
60+
61+
#elif TEST_STD_VER > 23
62+
63+
# ifndef __cpp_lib_any
64+
# error "__cpp_lib_any should be defined in c++26"
65+
# endif
66+
# if __cpp_lib_any != 201606L
67+
# error "__cpp_lib_any should have the value 201606L in c++26"
68+
# endif
69+
70+
#endif // TEST_STD_VER > 23
71+
72+
// clang-format on
73+
Lines changed: 175 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,175 @@
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
10+
// generate_feature_test_macro_components.py
11+
// and should not be edited manually.
12+
13+
// <array>
14+
15+
// Test the feature test macros defined by <array>
16+
17+
// clang-format off
18+
19+
#include <array>
20+
#include "test_macros.h"
21+
22+
#if TEST_STD_VER < 14
23+
24+
# ifdef __cpp_lib_array_constexpr
25+
# error "__cpp_lib_array_constexpr should not be defined before c++17"
26+
# endif
27+
28+
# ifdef __cpp_lib_freestanding_array
29+
# error "__cpp_lib_freestanding_array should not be defined before c++26"
30+
# endif
31+
32+
# ifdef __cpp_lib_nonmember_container_access
33+
# error "__cpp_lib_nonmember_container_access should not be defined before c++17"
34+
# endif
35+
36+
# ifdef __cpp_lib_to_array
37+
# error "__cpp_lib_to_array should not be defined before c++20"
38+
# endif
39+
40+
#elif TEST_STD_VER == 14
41+
42+
# ifdef __cpp_lib_array_constexpr
43+
# error "__cpp_lib_array_constexpr should not be defined before c++17"
44+
# endif
45+
46+
# ifdef __cpp_lib_freestanding_array
47+
# error "__cpp_lib_freestanding_array should not be defined before c++26"
48+
# endif
49+
50+
# ifdef __cpp_lib_nonmember_container_access
51+
# error "__cpp_lib_nonmember_container_access should not be defined before c++17"
52+
# endif
53+
54+
# ifdef __cpp_lib_to_array
55+
# error "__cpp_lib_to_array should not be defined before c++20"
56+
# endif
57+
58+
#elif TEST_STD_VER == 17
59+
60+
# ifndef __cpp_lib_array_constexpr
61+
# error "__cpp_lib_array_constexpr should be defined in c++17"
62+
# endif
63+
# if __cpp_lib_array_constexpr != 201603L
64+
# error "__cpp_lib_array_constexpr should have the value 201603L in c++17"
65+
# endif
66+
67+
# ifdef __cpp_lib_freestanding_array
68+
# error "__cpp_lib_freestanding_array should not be defined before c++26"
69+
# endif
70+
71+
# ifndef __cpp_lib_nonmember_container_access
72+
# error "__cpp_lib_nonmember_container_access should be defined in c++17"
73+
# endif
74+
# if __cpp_lib_nonmember_container_access != 201411L
75+
# error "__cpp_lib_nonmember_container_access should have the value 201411L in c++17"
76+
# endif
77+
78+
# ifdef __cpp_lib_to_array
79+
# error "__cpp_lib_to_array should not be defined before c++20"
80+
# endif
81+
82+
#elif TEST_STD_VER == 20
83+
84+
# ifndef __cpp_lib_array_constexpr
85+
# error "__cpp_lib_array_constexpr should be defined in c++20"
86+
# endif
87+
# if __cpp_lib_array_constexpr != 201811L
88+
# error "__cpp_lib_array_constexpr should have the value 201811L in c++20"
89+
# endif
90+
91+
# ifdef __cpp_lib_freestanding_array
92+
# error "__cpp_lib_freestanding_array should not be defined before c++26"
93+
# endif
94+
95+
# ifndef __cpp_lib_nonmember_container_access
96+
# error "__cpp_lib_nonmember_container_access should be defined in c++20"
97+
# endif
98+
# if __cpp_lib_nonmember_container_access != 201411L
99+
# error "__cpp_lib_nonmember_container_access should have the value 201411L in c++20"
100+
# endif
101+
102+
# ifndef __cpp_lib_to_array
103+
# error "__cpp_lib_to_array should be defined in c++20"
104+
# endif
105+
# if __cpp_lib_to_array != 201907L
106+
# error "__cpp_lib_to_array should have the value 201907L in c++20"
107+
# endif
108+
109+
#elif TEST_STD_VER == 23
110+
111+
# ifndef __cpp_lib_array_constexpr
112+
# error "__cpp_lib_array_constexpr should be defined in c++23"
113+
# endif
114+
# if __cpp_lib_array_constexpr != 201811L
115+
# error "__cpp_lib_array_constexpr should have the value 201811L in c++23"
116+
# endif
117+
118+
# ifdef __cpp_lib_freestanding_array
119+
# error "__cpp_lib_freestanding_array should not be defined before c++26"
120+
# endif
121+
122+
# ifndef __cpp_lib_nonmember_container_access
123+
# error "__cpp_lib_nonmember_container_access should be defined in c++23"
124+
# endif
125+
# if __cpp_lib_nonmember_container_access != 201411L
126+
# error "__cpp_lib_nonmember_container_access should have the value 201411L in c++23"
127+
# endif
128+
129+
# ifndef __cpp_lib_to_array
130+
# error "__cpp_lib_to_array should be defined in c++23"
131+
# endif
132+
# if __cpp_lib_to_array != 201907L
133+
# error "__cpp_lib_to_array should have the value 201907L in c++23"
134+
# endif
135+
136+
#elif TEST_STD_VER > 23
137+
138+
# ifndef __cpp_lib_array_constexpr
139+
# error "__cpp_lib_array_constexpr should be defined in c++26"
140+
# endif
141+
# if __cpp_lib_array_constexpr != 201811L
142+
# error "__cpp_lib_array_constexpr should have the value 201811L in c++26"
143+
# endif
144+
145+
# if !defined(_LIBCPP_VERSION)
146+
# ifndef __cpp_lib_freestanding_array
147+
# error "__cpp_lib_freestanding_array should be defined in c++26"
148+
# endif
149+
# if __cpp_lib_freestanding_array != 202311L
150+
# error "__cpp_lib_freestanding_array should have the value 202311L in c++26"
151+
# endif
152+
# else
153+
# ifdef __cpp_lib_freestanding_array
154+
# error "__cpp_lib_freestanding_array should not be defined because it is unimplemented in libc++!"
155+
# endif
156+
# endif
157+
158+
# ifndef __cpp_lib_nonmember_container_access
159+
# error "__cpp_lib_nonmember_container_access should be defined in c++26"
160+
# endif
161+
# if __cpp_lib_nonmember_container_access != 201411L
162+
# error "__cpp_lib_nonmember_container_access should have the value 201411L in c++26"
163+
# endif
164+
165+
# ifndef __cpp_lib_to_array
166+
# error "__cpp_lib_to_array should be defined in c++26"
167+
# endif
168+
# if __cpp_lib_to_array != 201907L
169+
# error "__cpp_lib_to_array should have the value 201907L in c++26"
170+
# endif
171+
172+
#endif // TEST_STD_VER > 23
173+
174+
// clang-format on
175+

0 commit comments

Comments
 (0)