[libc++] Remove ad-hoc modules tests that are now unnecessary
authorLouis Dionne <ldionne.2@gmail.com>
Tue, 22 Jun 2021 20:54:27 +0000 (16:54 -0400)
committerLouis Dionne <ldionne.2@gmail.com>
Wed, 23 Jun 2021 13:42:56 +0000 (09:42 -0400)
Since we now have modules-enabled CI, it is now redundant to have ad-hoc
tests that check arbitrary things about our modules support. Instead,
the whole test suite should pass with modules enabled, period.

This patch also removes the module cache path workaround: one would
expect that modules work properly without that workaround. If that
isn't the case and we do run into flaky test failures, we can re-enable
the workaround temporarily (but that would be very vexing and we should
fix Clang ASAP if that's the case).

Differential Revision: https://reviews.llvm.org/D104746

libcxx/test/libcxx/modules/cinttypes_exports.compile.pass.cpp [deleted file]
libcxx/test/libcxx/modules/clocale_exports.compile.pass.cpp [deleted file]
libcxx/test/libcxx/modules/cstdint_exports.compile.pass.cpp [deleted file]
libcxx/test/libcxx/modules/inttypes_h_exports.compile.pass.cpp [deleted file]
libcxx/test/libcxx/modules/stdint_h_exports.compile.pass.cpp [deleted file]
libcxx/test/libcxx/modules/stds_include.sh.cpp [deleted file]
libcxx/utils/libcxx/test/features.py

diff --git a/libcxx/test/libcxx/modules/cinttypes_exports.compile.pass.cpp b/libcxx/test/libcxx/modules/cinttypes_exports.compile.pass.cpp
deleted file mode 100644 (file)
index aa3ae7f..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// This test fails on Windows because the underlying libc headers on Windows
-// are not modular
-// XFAIL: LIBCXX-WINDOWS-FIXME
-
-// Some headers are not available when these features are disabled, but they
-// still get built as part of the 'std' module, which breaks the build.
-// UNSUPPORTED: libcpp-has-no-threads
-// UNSUPPORTED: libcpp-has-no-localization
-// UNSUPPORTED: libcpp-has-no-filesystem-library
-
-// REQUIRES: modules-support
-// ADDITIONAL_COMPILE_FLAGS: -fmodules
-
-// Test that <cinttypes> re-exports <cstdint>
-
-#include <cinttypes>
-
-int main(int, char**) {
-  int8_t x; (void)x;
-  std::int8_t y; (void)y;
-
-  return 0;
-}
diff --git a/libcxx/test/libcxx/modules/clocale_exports.compile.pass.cpp b/libcxx/test/libcxx/modules/clocale_exports.compile.pass.cpp
deleted file mode 100644 (file)
index 92c50e2..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// This test fails on Windows because the underlying libc headers on Windows
-// are not modular
-// XFAIL: LIBCXX-WINDOWS-FIXME
-
-// Some headers are not available when these features are disabled, but they
-// still get built as part of the 'std' module, which breaks the build.
-// UNSUPPORTED: libcpp-has-no-threads
-// UNSUPPORTED: libcpp-has-no-localization
-// UNSUPPORTED: libcpp-has-no-filesystem-library
-
-// UNSUPPORTED: c++03
-
-// REQUIRES: modules-support
-// ADDITIONAL_COMPILE_FLAGS: -fmodules
-
-#include <clocale>
-
-int main(int, char**) {
-  std::lconv l; (void)l;
-  using T = decltype(std::setlocale(0, ""));
-  using U = decltype(std::localeconv());
-
-  return 0;
-}
diff --git a/libcxx/test/libcxx/modules/cstdint_exports.compile.pass.cpp b/libcxx/test/libcxx/modules/cstdint_exports.compile.pass.cpp
deleted file mode 100644 (file)
index b83e4da..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// This test fails on Windows because the underlying libc headers on Windows
-// are not modular
-// XFAIL: LIBCXX-WINDOWS-FIXME
-
-// Some headers are not available when these features are disabled, but they
-// still get built as part of the 'std' module, which breaks the build.
-// UNSUPPORTED: libcpp-has-no-threads
-// UNSUPPORTED: libcpp-has-no-localization
-// UNSUPPORTED: libcpp-has-no-filesystem-library
-
-// Test that <cstdint> re-exports <stdint.h>
-
-// REQUIRES: modules-support
-// ADDITIONAL_COMPILE_FLAGS: -fmodules
-
-#include <cstdint>
-
-int main(int, char**) {
-  int8_t x; (void)x;
-  std::int8_t y; (void)y;
-
-  return 0;
-}
diff --git a/libcxx/test/libcxx/modules/inttypes_h_exports.compile.pass.cpp b/libcxx/test/libcxx/modules/inttypes_h_exports.compile.pass.cpp
deleted file mode 100644 (file)
index ffc6a62..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// This test fails on Windows because the underlying libc headers on Windows
-// are not modular
-// XFAIL: LIBCXX-WINDOWS-FIXME
-
-// Some headers are not available when these features are disabled, but they
-// still get built as part of the 'std' module, which breaks the build.
-// UNSUPPORTED: libcpp-has-no-threads
-// UNSUPPORTED: libcpp-has-no-localization
-// UNSUPPORTED: libcpp-has-no-filesystem-library
-
-// Test that intypes.h re-exports stdint.h
-
-// REQUIRES: modules-support
-// ADDITIONAL_COMPILE_FLAGS: -fmodules
-
-#include <inttypes.h>
-
-int main(int, char**) {
-  int8_t x; (void)x;
-
-  return 0;
-}
diff --git a/libcxx/test/libcxx/modules/stdint_h_exports.compile.pass.cpp b/libcxx/test/libcxx/modules/stdint_h_exports.compile.pass.cpp
deleted file mode 100644 (file)
index ad59b3c..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// Some headers are not available when these features are disabled, but they
-// still get built as part of the 'std' module, which breaks the build.
-// UNSUPPORTED: libcpp-has-no-threads
-// UNSUPPORTED: libcpp-has-no-localization
-// UNSUPPORTED: libcpp-has-no-filesystem-library
-
-// Test that int8_t and the like are exported from stdint.h, not inttypes.h
-
-// REQUIRES: modules-support
-// ADDITIONAL_COMPILE_FLAGS: -fmodules
-
-// XFAIL: LIBCXX-WINDOWS-FIXME
-
-#include <stdint.h>
-
-int main(int, char**) {
-  int8_t x; (void)x;
-
-  return 0;
-}
diff --git a/libcxx/test/libcxx/modules/stds_include.sh.cpp b/libcxx/test/libcxx/modules/stds_include.sh.cpp
deleted file mode 100644 (file)
index 715ab44..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// Test that we can include libc++ headers when building with modules
-// enabled in various Standard modes. This is a common source of breakage
-// since the 'std' module will include all headers, so if something in a
-// header fails under a standard mode, importing anything will fail.
-
-// This test fails on Windows because the underlying libc headers on Windows
-// are not modular
-// XFAIL: LIBCXX-WINDOWS-FIXME
-
-// Some headers are not available when these features are disabled, but they
-// still get built as part of the 'std' module, which breaks the build.
-// UNSUPPORTED: libcpp-has-no-threads
-// UNSUPPORTED: libcpp-has-no-localization
-// UNSUPPORTED: libcpp-has-no-filesystem-library
-
-// REQUIRES: modules-support
-
-// NOTE: The -std=XXX flag is present in %{flags}, so we overwrite it by passing it after %{flags}.
-// FIXME: Remove the `-DINVALIDATE_CACHE_FOO` macros. Their purpose is to workaround a bug in older Clang versions
-//        the same modules caches were reused across standard dialects.
-// RUN: %{cxx} %{flags} %{compile_flags} -fmodules -fcxx-modules -fsyntax-only -std=c++03 -DINVALIDATE_CACHE_CXX03 %s
-// RUN: %{cxx} %{flags} %{compile_flags} -fmodules -fcxx-modules -fsyntax-only -std=c++11 -DINVALIDATE_CACHE_CXX11 %s
-// RUN: %{cxx} %{flags} %{compile_flags} -fmodules -fcxx-modules -fsyntax-only -std=c++14 -DINVALIDATE_CACHE_CXX14 %s
-// RUN: %{cxx} %{flags} %{compile_flags} -fmodules -fcxx-modules -fsyntax-only -std=c++17 -DINVALIDATE_CACHE_CXX17 %s
-// RUN: %{cxx} %{flags} %{compile_flags} -fmodules -fcxx-modules -fsyntax-only -std=c++2a -DINVALIDATE_CACHE_CXX20 %s
-
-#include <vector>
-
-int main(int, char**) {
-  return 0;
-}
index 85955cd..43c9e4a 100644 (file)
@@ -43,15 +43,6 @@ DEFAULT_FEATURES = [
                                                                  sys.platform.lower().strip() == 'darwin'), # TODO: this doesn't handle cross-compiling to Apple platforms.
   Feature(name='objective-c++',                 when=lambda cfg: hasCompileFlag(cfg, '-xobjective-c++ -fobjc-arc')),
 
-  # Note: We use a custom modules cache path to make sure that we don't reuse
-  #       the default one, which can be shared across builds. This is important
-  #       because we define macros in headers files, and a change in these macros
-  #       doesn't seem to invalidate modules cache entries, which means we could
-  #       build against now-invalid cached headers from a previous build.
-  Feature(name='modules-support',
-          when=lambda cfg: hasCompileFlag(cfg, '-fmodules'),
-          actions=lambda cfg: [AddCompileFlag('-fmodules-cache-path=%t/ModuleCache')]),
-
   Feature(name='non-lockfree-atomics',
           when=lambda cfg: sourceBuilds(cfg, """
             #include <atomic>