Files
TheRock/compiler/amd-llvm/libcxx/test/libcxx-03/lint/lint_headers.sh.py
T
derek.holloway 7502bf64a4
CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

64 lines
1.8 KiB
Python

# RUN: %{python} %s
# Verify that each run of consecutive #include directives
# in each libcxx/include/ header is maintained in alphabetical order.
import glob
import os
import re
def exclude_from_consideration(path):
return (
path.endswith(".txt")
or path.endswith(".modulemap.in")
or os.path.basename(path) == "__config"
or os.path.basename(path) == "__config_site.in"
or os.path.basename(path) == "libcxx.imp"
or os.path.basename(path).startswith("__pstl")
or not os.path.isfile(path) # TODO: Remove once PSTL integration is finished
)
def check_for_pragma_GCC_system_header(pretty_fname, lines):
if pretty_fname not in ["__undef_macros"]:
for line in lines:
if re.match("# *pragma GCC system_header\n", line):
return True
print(
"FAILED TO FIND # pragma GCC system_header in libcxx/include/%s"
% pretty_fname
)
return False
return True
if __name__ == "__main__":
libcxx_test_libcxx_lint = os.path.dirname(os.path.abspath(__file__))
libcxx_include = os.path.abspath(
os.path.join(libcxx_test_libcxx_lint, "../../../include")
)
assert os.path.isdir(libcxx_include)
def pretty(path):
return path[len(libcxx_include) + 1 :]
all_headers = [
p
for p in (
glob.glob(os.path.join(libcxx_include, "*"))
+ glob.glob(os.path.join(libcxx_include, "__*/*.h"))
)
if not exclude_from_consideration(p)
]
okay = True
for fname in all_headers:
pretty_fname = pretty(fname)
with open(fname, "r") as f:
lines = f.readlines()
okay = check_for_pragma_GCC_system_header(pretty_fname, lines) and okay
assert okay