Skip to content

Commit 7667723

Browse files
authored
[libc++][hardening] Clean up some legacy debug mode tests: (#71016)
- reenable a few tests that still pass under the new debug mode; - delete a placeholder test; - delete a test that is no longer relevant.
1 parent 4b57d03 commit 7667723

File tree

8 files changed

+8
-138
lines changed

8 files changed

+8
-138
lines changed

libcxx/test/libcxx/algorithms/debug_less.inconsistent.pass.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212

1313
// Make sure __debug_less asserts when the comparator is not consistent.
1414

15-
// REQUIRES: has-unix-headers
16-
// UNSUPPORTED: !libcpp-has-legacy-debug-mode, c++03
15+
// REQUIRES: has-unix-headers, libcpp-hardening-mode=debug
16+
// UNSUPPORTED: c++03
1717

1818
#include <algorithm>
1919
#include <iterator>

libcxx/test/libcxx/algorithms/debug_less.pass.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212

1313
// __debug_less checks that a comparator actually provides a strict-weak ordering.
1414

15-
// REQUIRES: has-unix-headers
16-
// UNSUPPORTED: !libcpp-has-legacy-debug-mode, c++03
15+
// REQUIRES: has-unix-headers, libcpp-hardening-mode=debug
16+
// UNSUPPORTED: c++03
1717

1818
#include <algorithm>
1919
#include <cassert>

libcxx/test/libcxx/algorithms/debug_three_way_comp.inconsistent.pass.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212

1313
// Make sure __debug_three_way_comp asserts when the comparator is not consistent.
1414

15-
// UNSUPPORTED: !libcpp-has-legacy-debug-mode, c++03, c++11, c++14, c++17
15+
// REQUIRES: libcpp-hardening-mode=debug
16+
// UNSUPPORTED: c++03, c++11, c++14, c++17
1617

1718
#include <algorithm>
1819
#include <iterator>

libcxx/test/libcxx/debug/containers/associative_containers.pass.cpp

Lines changed: 0 additions & 60 deletions
This file was deleted.

libcxx/test/libcxx/debug/extern-templates.sh.cpp

Lines changed: 0 additions & 52 deletions
This file was deleted.

libcxx/test/libcxx/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/debug.deallocate.pass.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9-
// UNSUPPORTED: !libcpp-has-legacy-debug-mode, c++03, c++11, c++14
10-
// REQUIRES: has-unix-headers
9+
// UNSUPPORTED: c++03, c++11, c++14
10+
// REQUIRES: has-unix-headers, libcpp-hardening-mode=debug
1111

1212
// <memory_resource>
1313

libcxx/utils/data/ignore_format.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -708,7 +708,6 @@ libcxx/test/libcxx/containers/views/views.span/span.elem/assert.op_idx.pass.cpp
708708
libcxx/test/libcxx/containers/views/views.span/span.sub/assert.first.pass.cpp
709709
libcxx/test/libcxx/containers/views/views.span/span.sub/assert.last.pass.cpp
710710
libcxx/test/libcxx/containers/views/views.span/span.sub/assert.subspan.pass.cpp
711-
libcxx/test/libcxx/debug/containers/associative_containers.pass.cpp
712711
libcxx/test/libcxx/debug/containers.multithread.pass.cpp
713712
libcxx/test/libcxx/debug/containers/sequence_container_iterators.pass.cpp
714713
libcxx/test/libcxx/debug/containers/string.pass.cpp

libcxx/utils/libcxx/test/features.py

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -136,24 +136,6 @@ def _getAndroidDeviceApi(cfg):
136136
""",
137137
),
138138
),
139-
# Some tests rely on creating shared libraries which link in the C++ Standard Library. In some
140-
# cases, this doesn't work (e.g. if the library was built as a static archive and wasn't compiled
141-
# as position independent). This feature informs the test suite of whether it's possible to create
142-
# a shared library in a shell test by using the '-shared' compiler flag.
143-
#
144-
# Note: To implement this check properly, we need to make sure that we use something inside the
145-
# compiled library, not only in the headers. It should be safe to assume that all implementations
146-
# define `operator new` in the compiled library.
147-
Feature(
148-
name="cant-build-shared-library",
149-
when=lambda cfg: not sourceBuilds(
150-
cfg,
151-
"""
152-
void f() { new int(3); }
153-
""",
154-
["-shared"],
155-
),
156-
),
157139
# Check for a Windows UCRT bug (fixed in UCRT/Windows 10.0.20348.0):
158140
# https://developercommunity.visualstudio.com/t/utf-8-locales-break-ctype-functions-for-wchar-type/1653678
159141
Feature(

0 commit comments

Comments
 (0)