Skip to content

Commit f619783

Browse files
committed
[libcxx] [test] Link against msvcprt as C++ ABI library in tests
This matches what we link the library itself against (set in CMakeLists.txt). When testing a static library version of libc++, this is needed for essentially every test due to libc++ object files requiring it. Also with libc++ built as a DLL, some tests directly call functions that are provided by msvcprt (such as std::set_new_handler), thus this fixes a number of tests in that configuration too. Differential Revision: https://reviews.llvm.org/D99263
1 parent c0645f1 commit f619783

File tree

10 files changed

+3
-27
lines changed

10 files changed

+3
-27
lines changed

libcxx/test/std/language.support/support.dynamic/alloc.errors/set.new.handler/set_new_handler.pass.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88

99
// test set_new_handler
1010

11-
// XFAIL: LIBCXX-WINDOWS-FIXME
12-
1311
#include <new>
1412
#include <cassert>
1513

libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_align_val_t.pass.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,6 @@
2222
// XFAIL: with_system_cxx_lib=macosx10.10
2323
// XFAIL: with_system_cxx_lib=macosx10.9
2424

25-
// On Windows libc++ doesn't provide its own definitions for new/delete
26-
// but instead depends on the ones in VCRuntime. However VCRuntime does not
27-
// yet provide aligned new/delete definitions so this test fails to link.
28-
// XFAIL: LIBCXX-WINDOWS-FIXME
29-
3025
// test operator new
3126

3227
#include <new>

libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_align_val_t_nothrow.pass.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,6 @@
2222
// XFAIL: with_system_cxx_lib=macosx10.10
2323
// XFAIL: with_system_cxx_lib=macosx10.9
2424

25-
// On Windows libc++ doesn't provide its own definitions for new/delete
26-
// but instead depends on the ones in VCRuntime. However VCRuntime does not
27-
// yet provide aligned new/delete definitions so this test fails to compile/link.
28-
// XFAIL: LIBCXX-WINDOWS-FIXME
29-
3025
// test operator new (nothrow)
3126

3227
#include <new>

libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_array.pass.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
// test operator new[]
1010
// NOTE: asan and msan will not call the new handler.
1111
// UNSUPPORTED: sanitizer-new-delete
12-
// XFAIL: LIBCXX-WINDOWS-FIXME
1312

1413

1514
#include <new>

libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_array_nothrow.pass.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
// test operator new [] (nothrow)
1010
// NOTE: asan and msan will not call the new handler.
1111
// UNSUPPORTED: sanitizer-new-delete
12-
// XFAIL: LIBCXX-WINDOWS-FIXME
1312

1413

1514
#include <new>

libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/new.pass.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
// asan and msan will not call the new handler.
1212
// UNSUPPORTED: sanitizer-new-delete
13-
// XFAIL: LIBCXX-WINDOWS-FIXME
1413

1514
#include <new>
1615
#include <cstddef>

libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_align_val_t.pass.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,6 @@
2222
// asan and msan will not call the new handler.
2323
// UNSUPPORTED: sanitizer-new-delete
2424

25-
// On Windows libc++ doesn't provide its own definitions for new/delete
26-
// but instead depends on the ones in VCRuntime. However VCRuntime does not
27-
// yet provide aligned new/delete definitions so this test fails to compile/link.
28-
// XFAIL: LIBCXX-WINDOWS-FIXME
29-
3025
// test operator new
3126

3227
#include <new>

libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_align_val_t_nothrow.pass.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,6 @@
2222
// asan and msan will not call the new handler.
2323
// UNSUPPORTED: sanitizer-new-delete
2424

25-
// On Windows libc++ doesn't provide its own definitions for new/delete
26-
// but instead depends on the ones in VCRuntime. However VCRuntime does not
27-
// yet provide aligned new/delete definitions so this test fails to compile/link.
28-
// XFAIL: LIBCXX-WINDOWS-FIXME
29-
3025
// test operator new (nothrow)
3126

3227
#include <new>

libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_nothrow.pass.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
// asan and msan will not call the new handler.
1212
// UNSUPPORTED: sanitizer-new-delete
13-
// XFAIL: LIBCXX-WINDOWS-FIXME
1413

1514
#include <new>
1615
#include <cstddef>

libcxx/utils/libcxx/test/config.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,8 +456,10 @@ def configure_link_flags_abi_library(self):
456456
self.cxx.link_flags += ['-lcxxrt']
457457
elif cxx_abi == 'vcruntime':
458458
debug_suffix = 'd' if self.debug_build else ''
459+
# This matches the set of libraries linked in the toplevel
460+
# libcxx CMakeLists.txt if building targeting msvc.
459461
self.cxx.link_flags += ['-l%s%s' % (lib, debug_suffix) for lib in
460-
['vcruntime', 'ucrt', 'msvcrt']]
462+
['vcruntime', 'ucrt', 'msvcrt', 'msvcprt']]
461463
elif cxx_abi == 'none' or cxx_abi == 'default':
462464
if self.target_info.is_windows():
463465
debug_suffix = 'd' if self.debug_build else ''

0 commit comments

Comments
 (0)