Skip to content

Commit e13d520

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 da82709 commit e13d520

File tree

84 files changed

+17442
-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

+17442
-1
lines changed

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

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

0 commit comments

Comments
 (0)