brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.1 KiB · 2866104 Raw
72 lines · python
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-exception6#7# ===----------------------------------------------------------------------===##8 9# Test that we can include each header in a TU while using modules.10# This is important notably because the LLDB data formatters use11# libc++ headers with modules enabled.12 13# Older macOS SDKs were not properly modularized, which causes issues with localization.14# This feature should instead be based on the SDK version.15# UNSUPPORTED: stdlib=system && target={{.+}}-apple-macosx13{{.*}}16 17# GCC doesn't support -fcxx-modules18# UNSUPPORTED: gcc19 20# The Windows headers don't appear to be compatible with modules21# UNSUPPORTED: windows22# UNSUPPORTED: buildhost=windows23 24# The Android headers don't appear to be compatible with modules yet25# UNSUPPORTED: LIBCXX-ANDROID-FIXME26 27# TODO: Investigate this failure28# UNSUPPORTED: LIBCXX-FREEBSD-FIXME29 30# TODO: Investigate why this doesn't work on Picolibc once the locale base API is refactored31# UNSUPPORTED: LIBCXX-PICOLIBC-FIXME32 33# TODO: Fix seemingly circular inclusion or <wchar.h> on AIX34# UNSUPPORTED: LIBCXX-AIX-FIXME35 36# UNSUPPORTED: FROZEN-CXX03-HEADERS-FIXME37 38# RUN: %{python} %s %{libcxx-dir}/utils39# END.40 41import sys42sys.path.append(sys.argv[1])43from libcxx.header_information import (44    lit_header_restrictions,45    lit_header_undeprecations,46    public_headers,47)48 49for header in public_headers:50    print(51        f"""\52//--- {header}.compile.pass.cpp53// RUN: %{{cxx}} %s %{{flags}} %{{compile_flags}} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only54 55{lit_header_restrictions.get(header, '')}56{lit_header_undeprecations.get(header, '')}57 58#include <{header}>59"""60    )61 62print(63    f"""\64//--- import_std.compile.pass.mm65// RUN: %{{cxx}} %s %{{flags}} %{{compile_flags}} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only66 67// REQUIRES: clang-modules-build68 69@import std;70"""71)72