Skip to content

Commit 4afe2b1

Browse files
committed
[libc++] Enable additional tests when Clang modules are enabled
Disabling tests when Clang modules are enabled is not great because we are moving more and more tests towards using Clang modules by default. Instead, disable Clang modules on a per-test basis.
1 parent 244b230 commit 4afe2b1

23 files changed

+47
-28
lines changed

libcxx/test/extensions/libcxx/depr/depr.c.headers/extern_c.pass.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
// When building with modules, including headers inside extern "C" is an anti-pattern
1010
// that we don't want to support and can't support with LSV enabled.
11-
// UNSUPPORTED: clang-modules-build
11+
// ADDITIONAL_COMPILE_FLAGS: -fno-modules
1212

1313
// Sometimes C++'s <foo.h> headers get included within extern "C" contexts. This
1414
// is ill-formed (no diagnostic required), per [using.headers]p3, but we permit

libcxx/test/extensions/libcxx/depr/depr.c.headers/include_as_c.sh.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
//===----------------------------------------------------------------------===//
88

99
// We're building as C, so this test doesn't work when building with modules.
10-
// UNSUPPORTED: clang-modules-build
10+
// ADDITIONAL_COMPILE_FLAGS: -fno-modules
1111

1212
// GCC complains about unrecognized arguments because we're compiling the
1313
// file as C, but we're passing C++ flags on the command-line.

libcxx/test/extensions/libcxx/depr/depr.c.headers/stdint_h.xopen_source.compile.pass.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
//===----------------------------------------------------------------------===//
88

99
// This test breaks when enabling LSV.
10-
// UNSUPPORTED: clang-modules-build
10+
// ADDITIONAL_COMPILE_FLAGS: -fno-modules
1111

1212
// Test that limits macros are available when <stdint.h> is included
1313
// with or without macro _XOPEN_SOURCE=700.

libcxx/test/extensions/posix/xopen_source.gen.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# Some parts of the code like <fstream> use non-standard functions in their implementation,
1616
# and these functions are not provided when _XOPEN_SOURCE is set to older values. This
1717
# breaks when building with modules even when we don't use the offending headers directly.
18-
# UNSUPPORTED: clang-modules-build
18+
# ADDITIONAL_COMPILE_FLAGS: -fno-modules
1919

2020
# The AIX localization support uses some functions as part of their headers that require a
2121
# recent value of _XOPEN_SOURCE.

libcxx/test/libcxx-03/assertions/customize_verbose_abort.compile-time.pass.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
//===----------------------------------------------------------------------===//
88

99
// This compile-time customization requires cross-file macros, which doesn't work with modules.
10-
// UNSUPPORTED: clang-modules-build
10+
// ADDITIONAL_COMPILE_FLAGS: -fno-modules
1111

1212
// Make sure that we can customize the verbose termination function at compile-time by
1313
// defining _LIBCPP_VERBOSE_ABORT ourselves. Note that this does not have any

libcxx/test/libcxx-03/assertions/modes/hardening_mode_incorrect_value.sh.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@
99
// This test verifies that setting the hardening mode to a value that's not part of the predefined constants triggers
1010
// a compile-time error.
1111

12-
// Modules build produces a different error ("Could not build module 'std'").
13-
// UNSUPPORTED: clang-modules-build
1412
// REQUIRES: verify-support
1513

14+
// TODO: Investigate
15+
// ADDITIONAL_COMPILE_FLAGS: -fno-modules
16+
1617
// Note that GCC doesn't support `-Wno-macro-redefined`.
1718
// RUN: %{verify} -U_LIBCPP_HARDENING_MODE -D_LIBCPP_HARDENING_MODE=42
1819
// Make sure that common cases of misuse produce readable errors. We deliberately disallow setting the hardening mode as

libcxx/test/libcxx-03/transitive_includes.gen.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
7878
// When built with modules, this test doesn't work because --trace-includes doesn't
7979
// report the stack of includes correctly.
80-
// UNSUPPORTED: clang-modules-build
80+
// ADDITIONAL_COMPILE_FLAGS: -fno-modules
8181
8282
// This test uses --trace-includes, which is not supported by GCC.
8383
// UNSUPPORTED: gcc

libcxx/test/libcxx-03/utilities/utility/pairs/pairs.pair/abi.non_trivial_copy_move.pass.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
// The test suite needs to define the ABI macros on the command line when
1010
// modules are enabled.
11-
// UNSUPPORTED: clang-modules-build
11+
// ADDITIONAL_COMPILE_FLAGS: -fno-modules
1212

1313
// <utility>
1414

libcxx/test/libcxx/algorithms/alg.modifying.operations/copy_move_nontrivial.pass.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,13 @@
77
//===----------------------------------------------------------------------===//
88

99
// UNSUPPORTED: c++03, c++11, c++14, c++17
10-
// In the modules build, adding another overload of `memmove` doesn't work.
11-
// UNSUPPORTED: clang-modules-build
10+
1211
// GCC complains about "ambiguating" `__builtin_memmove`.
1312
// UNSUPPORTED: gcc
1413

14+
// In the modules build, adding another overload of `memmove` doesn't work.
15+
// ADDITIONAL_COMPILE_FLAGS: -fno-modules
16+
1517
// <algorithm>
1618

1719
#include <cassert>

libcxx/test/libcxx/algorithms/alg.modifying.operations/copy_move_trivial.pass.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,13 @@
77
//===----------------------------------------------------------------------===//
88

99
// UNSUPPORTED: c++03, c++11, c++14, c++17
10-
// In the modules build, adding another overload of `memmove` doesn't work.
11-
// UNSUPPORTED: clang-modules-build
10+
1211
// GCC complains about "ambiguating" `__builtin_memmove`.
1312
// UNSUPPORTED: gcc
1413

14+
// In the modules build, adding another overload of `memmove` doesn't work.
15+
// ADDITIONAL_COMPILE_FLAGS: -fno-modules
16+
1517
// <algorithm>
1618

1719
// These tests check that `std::copy` and `std::move` (including their variations like `copy_n`) forward to

0 commit comments

Comments
 (0)