diff --git a/libcxx/test/std/input.output/filesystems/class.path/path.member/path.append.pass.cpp b/libcxx/test/std/input.output/filesystems/class.path/path.member/path.append.pass.cpp --- a/libcxx/test/std/input.output/filesystems/class.path/path.member/path.append.pass.cpp +++ b/libcxx/test/std/input.output/filesystems/class.path/path.member/path.append.pass.cpp @@ -11,8 +11,6 @@ // These tests require locale for non-char paths // UNSUPPORTED: libcpp-has-no-localization -// XFAIL: LIBCXX-WINDOWS-FIXME - // // class path @@ -197,6 +195,9 @@ // required. // On Windows, the append method is more complex and uses intermediate // path objects, which causes extra allocations. + // In DLL builds on Windows, the overridden operator new won't pick up + // allocations done within the DLL, so the RequireAllocationGuard below + // won't necessarily see allocations in the cases where they're expected. #ifdef _WIN32 bool DisableAllocations = false; #else @@ -208,6 +209,7 @@ { RequireAllocationGuard g; // requires 1 or more allocations occur by default if (DisableAllocations) g.requireExactly(0); + else TEST_ONLY_WIN32(g.requireAtLeast(0)); LHS /= RHS; } assert(PathEq(LHS, E)); @@ -219,6 +221,7 @@ { RequireAllocationGuard g; if (DisableAllocations) g.requireExactly(0); + else TEST_ONLY_WIN32(g.requireAtLeast(0)); LHS.append(RHS, REnd); } assert(PathEq(LHS, E)); diff --git a/libcxx/test/std/input.output/filesystems/class.path/path.member/path.assign/move.pass.cpp b/libcxx/test/std/input.output/filesystems/class.path/path.member/path.assign/move.pass.cpp --- a/libcxx/test/std/input.output/filesystems/class.path/path.member/path.assign/move.pass.cpp +++ b/libcxx/test/std/input.output/filesystems/class.path/path.member/path.assign/move.pass.cpp @@ -8,8 +8,6 @@ // UNSUPPORTED: c++03 -// XFAIL: LIBCXX-WINDOWS-FIXME - // // class path @@ -30,7 +28,9 @@ assert(globalMemCounter.checkOutstandingNewEq(0)); const std::string s("we really really really really really really really " "really really long string so that we allocate"); - assert(globalMemCounter.checkOutstandingNewEq(1)); + // On windows, the operator new from count_new.h can't override the default + // operator for calls within the libc++ DLL. + TEST_NOT_WIN32(assert(globalMemCounter.checkOutstandingNewEq(1))); const fs::path::string_type ps(s.begin(), s.end()); path p(s); { diff --git a/libcxx/test/std/input.output/filesystems/class.path/path.member/path.concat.pass.cpp b/libcxx/test/std/input.output/filesystems/class.path/path.member/path.concat.pass.cpp --- a/libcxx/test/std/input.output/filesystems/class.path/path.member/path.concat.pass.cpp +++ b/libcxx/test/std/input.output/filesystems/class.path/path.member/path.concat.pass.cpp @@ -11,8 +11,6 @@ // These tests require locale for non-char paths // UNSUPPORTED: libcpp-has-no-localization -// XFAIL: LIBCXX-WINDOWS-FIXME - // // class path @@ -142,6 +140,10 @@ // code_cvt conversions. // For the path native type, no allocations will be performed because no // conversion is required. + + // In DLL builds on Windows, the overridden operator new won't pick up + // allocations done within the DLL, so the RequireAllocationGuard below + // won't necessarily see allocations in the cases where they're expected. bool DisableAllocations = std::is_same::value; { path LHS(L); PathReserve(LHS, ReserveSize); @@ -149,6 +151,7 @@ { RequireAllocationGuard g; // requires 1 or more allocations occur by default if (DisableAllocations) g.requireExactly(0); + else TEST_ONLY_WIN32(g.requireAtLeast(0)); LHS += RHS; } assert(LHS == E); @@ -160,6 +163,7 @@ { RequireAllocationGuard g; if (DisableAllocations) g.requireExactly(0); + else TEST_ONLY_WIN32(g.requireAtLeast(0)); LHS.concat(RHS, REnd); } assert(LHS == E); diff --git a/libcxx/test/std/input.output/filesystems/class.path/path.member/path.construct/move.pass.cpp b/libcxx/test/std/input.output/filesystems/class.path/path.member/path.construct/move.pass.cpp --- a/libcxx/test/std/input.output/filesystems/class.path/path.member/path.construct/move.pass.cpp +++ b/libcxx/test/std/input.output/filesystems/class.path/path.member/path.construct/move.pass.cpp @@ -8,8 +8,6 @@ // UNSUPPORTED: c++03 -// XFAIL: LIBCXX-WINDOWS-FIXME - // // class path @@ -30,7 +28,9 @@ assert(globalMemCounter.checkOutstandingNewEq(0)); const std::string s("we really really really really really really really " "really really long string so that we allocate"); - assert(globalMemCounter.checkOutstandingNewEq(1)); + // On windows, the operator new from count_new.h can't override the default + // operator for calls within the libc++ DLL. + TEST_NOT_WIN32(assert(globalMemCounter.checkOutstandingNewEq(1))); const fs::path::string_type ps(s.begin(), s.end()); path p(s); { diff --git a/libcxx/test/support/test_macros.h b/libcxx/test/support/test_macros.h --- a/libcxx/test/support/test_macros.h +++ b/libcxx/test/support/test_macros.h @@ -374,8 +374,10 @@ #ifdef _WIN32 #define TEST_NOT_WIN32(...) ((void)0) +#define TEST_ONLY_WIN32(...) __VA_ARGS__ #else #define TEST_NOT_WIN32(...) __VA_ARGS__ +#define TEST_ONLY_WIN32(...) ((void)0) #endif #if defined(__GNUC__)