• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 can include each header in a TU while using modules.
10# This is important notably because the LLDB data formatters use
11# libc++ headers with modules enabled.
12
13# RUN: %{python} %s %{libcxx}/utils
14
15import sys
16sys.path.append(sys.argv[1])
17from libcxx.test.header_information import lit_header_restrictions, public_headers
18
19for header in public_headers:
20  BLOCKLIT = '' # block Lit from interpreting a RUN/XFAIL/etc inside the generation script
21  print(f"""\
22//--- {header}.compile.pass.cpp
23// RUN{BLOCKLIT}: %{{cxx}} %s %{{flags}} %{{compile_flags}} -fmodules -fcxx-modules -fmodules-cache-path=%t -fsyntax-only
24
25// UNSUPPORTED{BLOCKLIT}: use_module_std
26
27// GCC doesn't support -fcxx-modules
28// UNSUPPORTED{BLOCKLIT}: gcc
29
30// The Windows headers don't appear to be compatible with modules
31// UNSUPPORTED{BLOCKLIT}: windows
32// UNSUPPORTED{BLOCKLIT}: buildhost=windows
33
34// The Android headers don't appear to be compatible with modules yet
35// XFAIL{BLOCKLIT}: LIBCXX-ANDROID-FIXME
36
37// TODO: Investigate this failure
38// UNSUPPORTED{BLOCKLIT}: LIBCXX-FREEBSD-FIXME
39
40{lit_header_restrictions.get(header, '')}
41
42#include <{header}>
43""")
44