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 // Test that we don't remove transitive includes of public C++ headers in the library accidentally.
10 // When we remove a transitive public include, clients tend to break because they don't always
11 // properly include what they use. Note that we don't check which system (C) headers are
12 // included transitively, because that is too unstable across platforms, and hence difficult
13 // to test for.
14 //
15 // This is not meant to block libc++ from removing unused transitive includes
16 // forever, however we do try to group removals for a couple of releases
17 // to avoid breaking users at every release.
18 
19 // This test doesn't support being run when some headers are not available, since we
20 // would need to add significant complexity to make that work.
21 // UNSUPPORTED: no-localization, no-threads, no-wide-characters, no-filesystem, libcpp-has-no-incomplete-format, libcpp-has-no-incomplete-ranges
22 
23 // This test only supports being run with the latest Standard, otherwise we'd
24 // have to support various versions of the test.
25 // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
26 
27 // When built with modules, this test doesn't work because --trace-includes doesn't
28 // report the stack of includes correctly.
29 // UNSUPPORTED: modules-build
30 
31 // This test uses --trace-includes, which is not supported by GCC.
32 // UNSUPPORTED: gcc
33 
34 // This test doesn't work on AIX or Windows, but it should. Needs investigation.
35 // XFAIL: buildhost=aix, buildhost=windows
36 
37 // This test is not supported when we remove the transitive includes provided for backwards
38 // compatibility. When we bulk-remove them, we'll adjust the includes that are expected by
39 // this test instead.
40 // XFAIL: transitive-includes-disabled
41 
42 // Prevent <ext/hash_map> from generating deprecated warnings for this test.
43 #if defined(__DEPRECATED)
44 #    undef __DEPRECATED
45 #endif
46 
47 /*
48 BEGIN-SCRIPT
49 
50 import re
51 
52 # To re-generate the list of expected headers, temporarily set this to True, re-generate
53 # the file and run this test.
54 regenerate_expected_results = False
55 
56 # Used because the sequence of tokens RUN : can't appear anywhere or it'll confuse Lit.
57 RUN = "RUN"
58 
59 if regenerate_expected_results:
60   print(f"// {RUN}: rm -rf %S/transitive_includes")
61   print(f"// {RUN}: mkdir %S/transitive_includes")
62 
63 for i, header in enumerate(public_headers):
64   if header.endswith('.h'): # Skip C compatibility headers
65     continue
66 
67   normalized_header = re.sub('/', '_', header)
68   trace_includes = "%{{cxx}} %s %{{flags}} %{{compile_flags}} --trace-includes -fsyntax-only -DTEST_{} 2>&1".format(i)
69   if regenerate_expected_results:
70     print(f"// {RUN}: {trace_includes} | %{{python}} %S/transitive_includes.sanitize.py > %S/transitive_includes/expected.{normalized_header}")
71   else:
72     print(f"// {RUN}: {trace_includes} | %{{python}} %S/transitive_includes.sanitize.py > %t.actual.{normalized_header}")
73     print(f"// {RUN}: diff %S/transitive_includes/expected.{normalized_header} %t.actual.{normalized_header}")
74 
75   print("#if defined(TEST_{})".format(i))
76   print("#include <{}>".format(header))
77   print("#endif")
78 
79 END-SCRIPT
80 */
81 
82 // DO NOT MANUALLY EDIT ANYTHING BETWEEN THE MARKERS BELOW
83 // GENERATED-MARKER
84 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_0 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.algorithm
85 // RUN: diff %S/transitive_includes/expected.algorithm %t.actual.algorithm
86 #if defined(TEST_0)
87 #include <algorithm>
88 #endif
89 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_1 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.any
90 // RUN: diff %S/transitive_includes/expected.any %t.actual.any
91 #if defined(TEST_1)
92 #include <any>
93 #endif
94 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_2 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.array
95 // RUN: diff %S/transitive_includes/expected.array %t.actual.array
96 #if defined(TEST_2)
97 #include <array>
98 #endif
99 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_3 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.atomic
100 // RUN: diff %S/transitive_includes/expected.atomic %t.actual.atomic
101 #if defined(TEST_3)
102 #include <atomic>
103 #endif
104 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_4 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.barrier
105 // RUN: diff %S/transitive_includes/expected.barrier %t.actual.barrier
106 #if defined(TEST_4)
107 #include <barrier>
108 #endif
109 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_5 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.bit
110 // RUN: diff %S/transitive_includes/expected.bit %t.actual.bit
111 #if defined(TEST_5)
112 #include <bit>
113 #endif
114 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_6 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.bitset
115 // RUN: diff %S/transitive_includes/expected.bitset %t.actual.bitset
116 #if defined(TEST_6)
117 #include <bitset>
118 #endif
119 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_7 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.cassert
120 // RUN: diff %S/transitive_includes/expected.cassert %t.actual.cassert
121 #if defined(TEST_7)
122 #include <cassert>
123 #endif
124 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_8 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.ccomplex
125 // RUN: diff %S/transitive_includes/expected.ccomplex %t.actual.ccomplex
126 #if defined(TEST_8)
127 #include <ccomplex>
128 #endif
129 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_9 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.cctype
130 // RUN: diff %S/transitive_includes/expected.cctype %t.actual.cctype
131 #if defined(TEST_9)
132 #include <cctype>
133 #endif
134 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_10 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.cerrno
135 // RUN: diff %S/transitive_includes/expected.cerrno %t.actual.cerrno
136 #if defined(TEST_10)
137 #include <cerrno>
138 #endif
139 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_11 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.cfenv
140 // RUN: diff %S/transitive_includes/expected.cfenv %t.actual.cfenv
141 #if defined(TEST_11)
142 #include <cfenv>
143 #endif
144 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_12 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.cfloat
145 // RUN: diff %S/transitive_includes/expected.cfloat %t.actual.cfloat
146 #if defined(TEST_12)
147 #include <cfloat>
148 #endif
149 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_13 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.charconv
150 // RUN: diff %S/transitive_includes/expected.charconv %t.actual.charconv
151 #if defined(TEST_13)
152 #include <charconv>
153 #endif
154 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_14 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.chrono
155 // RUN: diff %S/transitive_includes/expected.chrono %t.actual.chrono
156 #if defined(TEST_14)
157 #include <chrono>
158 #endif
159 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_15 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.cinttypes
160 // RUN: diff %S/transitive_includes/expected.cinttypes %t.actual.cinttypes
161 #if defined(TEST_15)
162 #include <cinttypes>
163 #endif
164 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_16 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.ciso646
165 // RUN: diff %S/transitive_includes/expected.ciso646 %t.actual.ciso646
166 #if defined(TEST_16)
167 #include <ciso646>
168 #endif
169 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_17 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.climits
170 // RUN: diff %S/transitive_includes/expected.climits %t.actual.climits
171 #if defined(TEST_17)
172 #include <climits>
173 #endif
174 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_18 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.clocale
175 // RUN: diff %S/transitive_includes/expected.clocale %t.actual.clocale
176 #if defined(TEST_18)
177 #include <clocale>
178 #endif
179 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_19 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.cmath
180 // RUN: diff %S/transitive_includes/expected.cmath %t.actual.cmath
181 #if defined(TEST_19)
182 #include <cmath>
183 #endif
184 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_20 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.codecvt
185 // RUN: diff %S/transitive_includes/expected.codecvt %t.actual.codecvt
186 #if defined(TEST_20)
187 #include <codecvt>
188 #endif
189 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_21 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.compare
190 // RUN: diff %S/transitive_includes/expected.compare %t.actual.compare
191 #if defined(TEST_21)
192 #include <compare>
193 #endif
194 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_22 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.complex
195 // RUN: diff %S/transitive_includes/expected.complex %t.actual.complex
196 #if defined(TEST_22)
197 #include <complex>
198 #endif
199 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_24 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.concepts
200 // RUN: diff %S/transitive_includes/expected.concepts %t.actual.concepts
201 #if defined(TEST_24)
202 #include <concepts>
203 #endif
204 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_25 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.condition_variable
205 // RUN: diff %S/transitive_includes/expected.condition_variable %t.actual.condition_variable
206 #if defined(TEST_25)
207 #include <condition_variable>
208 #endif
209 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_26 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.coroutine
210 // RUN: diff %S/transitive_includes/expected.coroutine %t.actual.coroutine
211 #if defined(TEST_26)
212 #include <coroutine>
213 #endif
214 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_27 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.csetjmp
215 // RUN: diff %S/transitive_includes/expected.csetjmp %t.actual.csetjmp
216 #if defined(TEST_27)
217 #include <csetjmp>
218 #endif
219 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_28 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.csignal
220 // RUN: diff %S/transitive_includes/expected.csignal %t.actual.csignal
221 #if defined(TEST_28)
222 #include <csignal>
223 #endif
224 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_29 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.cstdarg
225 // RUN: diff %S/transitive_includes/expected.cstdarg %t.actual.cstdarg
226 #if defined(TEST_29)
227 #include <cstdarg>
228 #endif
229 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_30 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.cstdbool
230 // RUN: diff %S/transitive_includes/expected.cstdbool %t.actual.cstdbool
231 #if defined(TEST_30)
232 #include <cstdbool>
233 #endif
234 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_31 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.cstddef
235 // RUN: diff %S/transitive_includes/expected.cstddef %t.actual.cstddef
236 #if defined(TEST_31)
237 #include <cstddef>
238 #endif
239 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_32 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.cstdint
240 // RUN: diff %S/transitive_includes/expected.cstdint %t.actual.cstdint
241 #if defined(TEST_32)
242 #include <cstdint>
243 #endif
244 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_33 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.cstdio
245 // RUN: diff %S/transitive_includes/expected.cstdio %t.actual.cstdio
246 #if defined(TEST_33)
247 #include <cstdio>
248 #endif
249 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_34 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.cstdlib
250 // RUN: diff %S/transitive_includes/expected.cstdlib %t.actual.cstdlib
251 #if defined(TEST_34)
252 #include <cstdlib>
253 #endif
254 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_35 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.cstring
255 // RUN: diff %S/transitive_includes/expected.cstring %t.actual.cstring
256 #if defined(TEST_35)
257 #include <cstring>
258 #endif
259 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_36 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.ctgmath
260 // RUN: diff %S/transitive_includes/expected.ctgmath %t.actual.ctgmath
261 #if defined(TEST_36)
262 #include <ctgmath>
263 #endif
264 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_37 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.ctime
265 // RUN: diff %S/transitive_includes/expected.ctime %t.actual.ctime
266 #if defined(TEST_37)
267 #include <ctime>
268 #endif
269 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_39 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.cuchar
270 // RUN: diff %S/transitive_includes/expected.cuchar %t.actual.cuchar
271 #if defined(TEST_39)
272 #include <cuchar>
273 #endif
274 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_40 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.cwchar
275 // RUN: diff %S/transitive_includes/expected.cwchar %t.actual.cwchar
276 #if defined(TEST_40)
277 #include <cwchar>
278 #endif
279 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_41 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.cwctype
280 // RUN: diff %S/transitive_includes/expected.cwctype %t.actual.cwctype
281 #if defined(TEST_41)
282 #include <cwctype>
283 #endif
284 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_42 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.deque
285 // RUN: diff %S/transitive_includes/expected.deque %t.actual.deque
286 #if defined(TEST_42)
287 #include <deque>
288 #endif
289 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_44 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.exception
290 // RUN: diff %S/transitive_includes/expected.exception %t.actual.exception
291 #if defined(TEST_44)
292 #include <exception>
293 #endif
294 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_45 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.execution
295 // RUN: diff %S/transitive_includes/expected.execution %t.actual.execution
296 #if defined(TEST_45)
297 #include <execution>
298 #endif
299 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_47 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.filesystem
300 // RUN: diff %S/transitive_includes/expected.filesystem %t.actual.filesystem
301 #if defined(TEST_47)
302 #include <filesystem>
303 #endif
304 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_49 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.format
305 // RUN: diff %S/transitive_includes/expected.format %t.actual.format
306 #if defined(TEST_49)
307 #include <format>
308 #endif
309 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_50 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.forward_list
310 // RUN: diff %S/transitive_includes/expected.forward_list %t.actual.forward_list
311 #if defined(TEST_50)
312 #include <forward_list>
313 #endif
314 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_51 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.fstream
315 // RUN: diff %S/transitive_includes/expected.fstream %t.actual.fstream
316 #if defined(TEST_51)
317 #include <fstream>
318 #endif
319 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_52 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.functional
320 // RUN: diff %S/transitive_includes/expected.functional %t.actual.functional
321 #if defined(TEST_52)
322 #include <functional>
323 #endif
324 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_53 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.future
325 // RUN: diff %S/transitive_includes/expected.future %t.actual.future
326 #if defined(TEST_53)
327 #include <future>
328 #endif
329 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_54 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.initializer_list
330 // RUN: diff %S/transitive_includes/expected.initializer_list %t.actual.initializer_list
331 #if defined(TEST_54)
332 #include <initializer_list>
333 #endif
334 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_56 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.iomanip
335 // RUN: diff %S/transitive_includes/expected.iomanip %t.actual.iomanip
336 #if defined(TEST_56)
337 #include <iomanip>
338 #endif
339 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_57 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.ios
340 // RUN: diff %S/transitive_includes/expected.ios %t.actual.ios
341 #if defined(TEST_57)
342 #include <ios>
343 #endif
344 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_58 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.iosfwd
345 // RUN: diff %S/transitive_includes/expected.iosfwd %t.actual.iosfwd
346 #if defined(TEST_58)
347 #include <iosfwd>
348 #endif
349 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_59 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.iostream
350 // RUN: diff %S/transitive_includes/expected.iostream %t.actual.iostream
351 #if defined(TEST_59)
352 #include <iostream>
353 #endif
354 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_60 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.istream
355 // RUN: diff %S/transitive_includes/expected.istream %t.actual.istream
356 #if defined(TEST_60)
357 #include <istream>
358 #endif
359 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_61 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.iterator
360 // RUN: diff %S/transitive_includes/expected.iterator %t.actual.iterator
361 #if defined(TEST_61)
362 #include <iterator>
363 #endif
364 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_62 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.latch
365 // RUN: diff %S/transitive_includes/expected.latch %t.actual.latch
366 #if defined(TEST_62)
367 #include <latch>
368 #endif
369 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_63 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.limits
370 // RUN: diff %S/transitive_includes/expected.limits %t.actual.limits
371 #if defined(TEST_63)
372 #include <limits>
373 #endif
374 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_65 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.list
375 // RUN: diff %S/transitive_includes/expected.list %t.actual.list
376 #if defined(TEST_65)
377 #include <list>
378 #endif
379 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_66 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.locale
380 // RUN: diff %S/transitive_includes/expected.locale %t.actual.locale
381 #if defined(TEST_66)
382 #include <locale>
383 #endif
384 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_68 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.map
385 // RUN: diff %S/transitive_includes/expected.map %t.actual.map
386 #if defined(TEST_68)
387 #include <map>
388 #endif
389 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_70 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.memory
390 // RUN: diff %S/transitive_includes/expected.memory %t.actual.memory
391 #if defined(TEST_70)
392 #include <memory>
393 #endif
394 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_71 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.mutex
395 // RUN: diff %S/transitive_includes/expected.mutex %t.actual.mutex
396 #if defined(TEST_71)
397 #include <mutex>
398 #endif
399 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_72 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.new
400 // RUN: diff %S/transitive_includes/expected.new %t.actual.new
401 #if defined(TEST_72)
402 #include <new>
403 #endif
404 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_73 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.numbers
405 // RUN: diff %S/transitive_includes/expected.numbers %t.actual.numbers
406 #if defined(TEST_73)
407 #include <numbers>
408 #endif
409 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_74 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.numeric
410 // RUN: diff %S/transitive_includes/expected.numeric %t.actual.numeric
411 #if defined(TEST_74)
412 #include <numeric>
413 #endif
414 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_75 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.optional
415 // RUN: diff %S/transitive_includes/expected.optional %t.actual.optional
416 #if defined(TEST_75)
417 #include <optional>
418 #endif
419 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_76 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.ostream
420 // RUN: diff %S/transitive_includes/expected.ostream %t.actual.ostream
421 #if defined(TEST_76)
422 #include <ostream>
423 #endif
424 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_77 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.queue
425 // RUN: diff %S/transitive_includes/expected.queue %t.actual.queue
426 #if defined(TEST_77)
427 #include <queue>
428 #endif
429 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_78 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.random
430 // RUN: diff %S/transitive_includes/expected.random %t.actual.random
431 #if defined(TEST_78)
432 #include <random>
433 #endif
434 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_79 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.ranges
435 // RUN: diff %S/transitive_includes/expected.ranges %t.actual.ranges
436 #if defined(TEST_79)
437 #include <ranges>
438 #endif
439 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_80 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.ratio
440 // RUN: diff %S/transitive_includes/expected.ratio %t.actual.ratio
441 #if defined(TEST_80)
442 #include <ratio>
443 #endif
444 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_81 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.regex
445 // RUN: diff %S/transitive_includes/expected.regex %t.actual.regex
446 #if defined(TEST_81)
447 #include <regex>
448 #endif
449 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_82 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.scoped_allocator
450 // RUN: diff %S/transitive_includes/expected.scoped_allocator %t.actual.scoped_allocator
451 #if defined(TEST_82)
452 #include <scoped_allocator>
453 #endif
454 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_83 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.semaphore
455 // RUN: diff %S/transitive_includes/expected.semaphore %t.actual.semaphore
456 #if defined(TEST_83)
457 #include <semaphore>
458 #endif
459 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_84 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.set
460 // RUN: diff %S/transitive_includes/expected.set %t.actual.set
461 #if defined(TEST_84)
462 #include <set>
463 #endif
464 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_86 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.shared_mutex
465 // RUN: diff %S/transitive_includes/expected.shared_mutex %t.actual.shared_mutex
466 #if defined(TEST_86)
467 #include <shared_mutex>
468 #endif
469 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_87 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.span
470 // RUN: diff %S/transitive_includes/expected.span %t.actual.span
471 #if defined(TEST_87)
472 #include <span>
473 #endif
474 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_88 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.sstream
475 // RUN: diff %S/transitive_includes/expected.sstream %t.actual.sstream
476 #if defined(TEST_88)
477 #include <sstream>
478 #endif
479 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_89 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.stack
480 // RUN: diff %S/transitive_includes/expected.stack %t.actual.stack
481 #if defined(TEST_89)
482 #include <stack>
483 #endif
484 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_93 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.stdexcept
485 // RUN: diff %S/transitive_includes/expected.stdexcept %t.actual.stdexcept
486 #if defined(TEST_93)
487 #include <stdexcept>
488 #endif
489 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_97 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.streambuf
490 // RUN: diff %S/transitive_includes/expected.streambuf %t.actual.streambuf
491 #if defined(TEST_97)
492 #include <streambuf>
493 #endif
494 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_98 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.string
495 // RUN: diff %S/transitive_includes/expected.string %t.actual.string
496 #if defined(TEST_98)
497 #include <string>
498 #endif
499 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_100 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.string_view
500 // RUN: diff %S/transitive_includes/expected.string_view %t.actual.string_view
501 #if defined(TEST_100)
502 #include <string_view>
503 #endif
504 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_101 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.strstream
505 // RUN: diff %S/transitive_includes/expected.strstream %t.actual.strstream
506 #if defined(TEST_101)
507 #include <strstream>
508 #endif
509 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_102 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.system_error
510 // RUN: diff %S/transitive_includes/expected.system_error %t.actual.system_error
511 #if defined(TEST_102)
512 #include <system_error>
513 #endif
514 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_104 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.thread
515 // RUN: diff %S/transitive_includes/expected.thread %t.actual.thread
516 #if defined(TEST_104)
517 #include <thread>
518 #endif
519 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_105 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.tuple
520 // RUN: diff %S/transitive_includes/expected.tuple %t.actual.tuple
521 #if defined(TEST_105)
522 #include <tuple>
523 #endif
524 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_106 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.type_traits
525 // RUN: diff %S/transitive_includes/expected.type_traits %t.actual.type_traits
526 #if defined(TEST_106)
527 #include <type_traits>
528 #endif
529 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_107 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.typeindex
530 // RUN: diff %S/transitive_includes/expected.typeindex %t.actual.typeindex
531 #if defined(TEST_107)
532 #include <typeindex>
533 #endif
534 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_108 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.typeinfo
535 // RUN: diff %S/transitive_includes/expected.typeinfo %t.actual.typeinfo
536 #if defined(TEST_108)
537 #include <typeinfo>
538 #endif
539 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_110 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.unordered_map
540 // RUN: diff %S/transitive_includes/expected.unordered_map %t.actual.unordered_map
541 #if defined(TEST_110)
542 #include <unordered_map>
543 #endif
544 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_111 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.unordered_set
545 // RUN: diff %S/transitive_includes/expected.unordered_set %t.actual.unordered_set
546 #if defined(TEST_111)
547 #include <unordered_set>
548 #endif
549 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_112 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.utility
550 // RUN: diff %S/transitive_includes/expected.utility %t.actual.utility
551 #if defined(TEST_112)
552 #include <utility>
553 #endif
554 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_113 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.valarray
555 // RUN: diff %S/transitive_includes/expected.valarray %t.actual.valarray
556 #if defined(TEST_113)
557 #include <valarray>
558 #endif
559 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_114 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.variant
560 // RUN: diff %S/transitive_includes/expected.variant %t.actual.variant
561 #if defined(TEST_114)
562 #include <variant>
563 #endif
564 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_115 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.vector
565 // RUN: diff %S/transitive_includes/expected.vector %t.actual.vector
566 #if defined(TEST_115)
567 #include <vector>
568 #endif
569 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_116 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.version
570 // RUN: diff %S/transitive_includes/expected.version %t.actual.version
571 #if defined(TEST_116)
572 #include <version>
573 #endif
574 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_119 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.experimental_algorithm
575 // RUN: diff %S/transitive_includes/expected.experimental_algorithm %t.actual.experimental_algorithm
576 #if defined(TEST_119)
577 #include <experimental/algorithm>
578 #endif
579 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_120 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.experimental_coroutine
580 // RUN: diff %S/transitive_includes/expected.experimental_coroutine %t.actual.experimental_coroutine
581 #if defined(TEST_120)
582 #include <experimental/coroutine>
583 #endif
584 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_121 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.experimental_deque
585 // RUN: diff %S/transitive_includes/expected.experimental_deque %t.actual.experimental_deque
586 #if defined(TEST_121)
587 #include <experimental/deque>
588 #endif
589 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_122 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.experimental_forward_list
590 // RUN: diff %S/transitive_includes/expected.experimental_forward_list %t.actual.experimental_forward_list
591 #if defined(TEST_122)
592 #include <experimental/forward_list>
593 #endif
594 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_123 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.experimental_functional
595 // RUN: diff %S/transitive_includes/expected.experimental_functional %t.actual.experimental_functional
596 #if defined(TEST_123)
597 #include <experimental/functional>
598 #endif
599 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_124 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.experimental_iterator
600 // RUN: diff %S/transitive_includes/expected.experimental_iterator %t.actual.experimental_iterator
601 #if defined(TEST_124)
602 #include <experimental/iterator>
603 #endif
604 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_125 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.experimental_list
605 // RUN: diff %S/transitive_includes/expected.experimental_list %t.actual.experimental_list
606 #if defined(TEST_125)
607 #include <experimental/list>
608 #endif
609 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_126 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.experimental_map
610 // RUN: diff %S/transitive_includes/expected.experimental_map %t.actual.experimental_map
611 #if defined(TEST_126)
612 #include <experimental/map>
613 #endif
614 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_127 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.experimental_memory_resource
615 // RUN: diff %S/transitive_includes/expected.experimental_memory_resource %t.actual.experimental_memory_resource
616 #if defined(TEST_127)
617 #include <experimental/memory_resource>
618 #endif
619 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_128 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.experimental_propagate_const
620 // RUN: diff %S/transitive_includes/expected.experimental_propagate_const %t.actual.experimental_propagate_const
621 #if defined(TEST_128)
622 #include <experimental/propagate_const>
623 #endif
624 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_129 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.experimental_regex
625 // RUN: diff %S/transitive_includes/expected.experimental_regex %t.actual.experimental_regex
626 #if defined(TEST_129)
627 #include <experimental/regex>
628 #endif
629 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_130 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.experimental_set
630 // RUN: diff %S/transitive_includes/expected.experimental_set %t.actual.experimental_set
631 #if defined(TEST_130)
632 #include <experimental/set>
633 #endif
634 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_131 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.experimental_simd
635 // RUN: diff %S/transitive_includes/expected.experimental_simd %t.actual.experimental_simd
636 #if defined(TEST_131)
637 #include <experimental/simd>
638 #endif
639 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_132 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.experimental_string
640 // RUN: diff %S/transitive_includes/expected.experimental_string %t.actual.experimental_string
641 #if defined(TEST_132)
642 #include <experimental/string>
643 #endif
644 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_133 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.experimental_type_traits
645 // RUN: diff %S/transitive_includes/expected.experimental_type_traits %t.actual.experimental_type_traits
646 #if defined(TEST_133)
647 #include <experimental/type_traits>
648 #endif
649 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_134 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.experimental_unordered_map
650 // RUN: diff %S/transitive_includes/expected.experimental_unordered_map %t.actual.experimental_unordered_map
651 #if defined(TEST_134)
652 #include <experimental/unordered_map>
653 #endif
654 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_135 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.experimental_unordered_set
655 // RUN: diff %S/transitive_includes/expected.experimental_unordered_set %t.actual.experimental_unordered_set
656 #if defined(TEST_135)
657 #include <experimental/unordered_set>
658 #endif
659 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_136 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.experimental_utility
660 // RUN: diff %S/transitive_includes/expected.experimental_utility %t.actual.experimental_utility
661 #if defined(TEST_136)
662 #include <experimental/utility>
663 #endif
664 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_137 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.experimental_vector
665 // RUN: diff %S/transitive_includes/expected.experimental_vector %t.actual.experimental_vector
666 #if defined(TEST_137)
667 #include <experimental/vector>
668 #endif
669 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_138 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.ext_hash_map
670 // RUN: diff %S/transitive_includes/expected.ext_hash_map %t.actual.ext_hash_map
671 #if defined(TEST_138)
672 #include <ext/hash_map>
673 #endif
674 // RUN: %{cxx} %s %{flags} %{compile_flags} --trace-includes -fsyntax-only -DTEST_139 2>&1 | %{python} %S/transitive_includes.sanitize.py > %t.actual.ext_hash_set
675 // RUN: diff %S/transitive_includes/expected.ext_hash_set %t.actual.ext_hash_set
676 #if defined(TEST_139)
677 #include <ext/hash_set>
678 #endif
679 // GENERATED-MARKER
680