Skip to content

Commit 41617bc

Browse files
author
git apple-llvm automerger
committed
Merge commit '45307f1b0d27' from llvm.org/main into next
2 parents 73f619d + 45307f1 commit 41617bc

File tree

41 files changed

+93
-1257
lines changed

Some content is hidden

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

41 files changed

+93
-1257
lines changed

libcxx/docs/Contributing.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ sure you don't forget anything:
4848

4949
- Did you add it to ``include/module.modulemap.in``?
5050
- Did you add it to ``include/CMakeLists.txt``?
51-
- If it's a public header, did you update ``utils/generate_header_inclusion_tests.py``?
51+
- If it's a public header, did you update ``utils/libcxx/test/header_information.py``?
5252

5353
- Did you add the relevant feature test macro(s) for your feature? Did you update the ``generate_feature_test_macro_components.py`` script with it?
5454
- Did you run the ``libcxx-generate-files`` target and verify its output?
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
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 all headers include all the other headers they're supposed to, as
10+
# prescribed by the Standard.
11+
12+
# RUN: %{python} %s %{libcxx}/utils
13+
14+
import sys
15+
sys.path.append(sys.argv[1])
16+
from libcxx.test.header_information import header_restrictions, public_headers, mandatory_inclusions
17+
18+
for header in public_headers:
19+
test_condition_begin = '#if ' + header_restrictions[header] if header in header_restrictions else ''
20+
test_condition_end = '#endif' if header in header_restrictions else ''
21+
22+
header_guard = lambda h: f"_LIBCPP_{h.upper().replace('.', '_').replace('/', '_')}"
23+
24+
# <cassert> has no header guards
25+
if header == 'cassert':
26+
checks = ''
27+
else:
28+
checks = f'''
29+
#ifndef {header_guard(header)}
30+
# error <{header}> was expected to define a header guard {header_guard(header)}
31+
#endif
32+
'''
33+
for includee in mandatory_inclusions.get(header, []):
34+
checks += f'''
35+
#ifndef {header_guard(includee)}
36+
# error <{header}> was expected to include <{includee}>
37+
#endif
38+
'''
39+
40+
print(f"""\
41+
//--- {header}.compile.pass.cpp
42+
#include <__config>
43+
{test_condition_begin}
44+
#include <{header}>
45+
{checks}
46+
{test_condition_end}
47+
""")

libcxx/test/libcxx/inclusions/algorithm.inclusions.compile.pass.cpp

Lines changed: 0 additions & 26 deletions
This file was deleted.

libcxx/test/libcxx/inclusions/array.inclusions.compile.pass.cpp

Lines changed: 0 additions & 29 deletions
This file was deleted.

libcxx/test/libcxx/inclusions/bitset.inclusions.compile.pass.cpp

Lines changed: 0 additions & 29 deletions
This file was deleted.

libcxx/test/libcxx/inclusions/chrono.inclusions.compile.pass.cpp

Lines changed: 0 additions & 28 deletions
This file was deleted.

libcxx/test/libcxx/inclusions/cinttypes.inclusions.compile.pass.cpp

Lines changed: 0 additions & 26 deletions
This file was deleted.

libcxx/test/libcxx/inclusions/complex.h.inclusions.compile.pass.cpp

Lines changed: 0 additions & 26 deletions
This file was deleted.

libcxx/test/libcxx/inclusions/coroutine.inclusions.compile.pass.cpp

Lines changed: 0 additions & 28 deletions
This file was deleted.

libcxx/test/libcxx/inclusions/deque.inclusions.compile.pass.cpp

Lines changed: 0 additions & 29 deletions
This file was deleted.

libcxx/test/libcxx/inclusions/filesystem.inclusions.compile.pass.cpp

Lines changed: 0 additions & 29 deletions
This file was deleted.

libcxx/test/libcxx/inclusions/forward_list.inclusions.compile.pass.cpp

Lines changed: 0 additions & 29 deletions
This file was deleted.

libcxx/test/libcxx/inclusions/ios.inclusions.compile.pass.cpp

Lines changed: 0 additions & 28 deletions
This file was deleted.

0 commit comments

Comments
 (0)