Index: libcxx/test/libcxx/experimental/memory/memory.resource.adaptor/memory.resource.adaptor.mem/db_deallocate.pass.cpp =================================================================== --- libcxx/test/libcxx/experimental/memory/memory.resource.adaptor/memory.resource.adaptor.mem/db_deallocate.pass.cpp +++ libcxx/test/libcxx/experimental/memory/memory.resource.adaptor/memory.resource.adaptor.mem/db_deallocate.pass.cpp @@ -14,8 +14,6 @@ // T* polymorphic_allocator::deallocate(T*, size_t size) -// XFAIL: LIBCXX-WINDOWS-FIXME - int AssertCount = 0; #define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : (void)::AssertCount++) @@ -38,13 +36,8 @@ ex::resource_adaptor r(Alloc{P}); ex::memory_resource & m1 = r; -#ifdef __STDCPP_DEFAULT_NEW_ALIGNMENT__ - std::size_t maxSize = std::numeric_limits::max() - - __STDCPP_DEFAULT_NEW_ALIGNMENT__; -#else std::size_t maxSize = std::numeric_limits::max() - alignof(std::max_align_t); -#endif m1.deallocate(nullptr, maxSize); assert(AssertCount == 0); Index: libcxx/test/libcxx/memory/trivial_abi/weak_ptr_ret.pass.cpp =================================================================== --- libcxx/test/libcxx/memory/trivial_abi/weak_ptr_ret.pass.cpp +++ libcxx/test/libcxx/memory/trivial_abi/weak_ptr_ret.pass.cpp @@ -15,8 +15,6 @@ // There were assertion failures in both parse and codegen, which are fixed in clang 11. // UNSUPPORTED: gcc, clang-4, clang-5, clang-6, clang-7, clang-8, clang-9, clang-10 -// XFAIL: LIBCXX-WINDOWS-FIXME - #include #include @@ -51,9 +49,10 @@ // // With trivial_abi, local_addr is the address of a local variable in // make_val, and hence different from &ret. -#if !defined(__i386__) && !defined(__arm__) +#if !defined(__i386__) && !defined(__arm__) && !defined(_WIN32) // On X86, structs are never returned in registers. // On ARM32, structs larger than 4 bytes cannot be returned in registers. + // On Windows, structs with a destructor are always returned indirectly. // Thus, weak_ptr will be passed indirectly even if it is trivial. assert((void*)&ret != local_addr); #endif Index: libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/delete_align_val_t_replace.pass.cpp =================================================================== --- libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/delete_align_val_t_replace.pass.cpp +++ libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/delete_align_val_t_replace.pass.cpp @@ -20,11 +20,6 @@ // UNSUPPORTED: clang-5, clang-6, clang-7 // XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13}} -// On Windows libc++ doesn't provide its own definitions for new/delete -// but instead depends on the ones in VCRuntime. However VCRuntime does not -// yet provide aligned new/delete definitions so this test fails to compile/link. -// XFAIL: LIBCXX-WINDOWS-FIXME - // Libcxx when built for z/OS doesn't contain the aligned allocation functions, // nor does the dynamic library shipped with z/OS. // UNSUPPORTED: target={{.+}}-zos{{.*}} @@ -48,13 +43,21 @@ aligned_delete_called = 0; } -void operator delete(void* p) TEST_NOEXCEPT +// Override aligned operator new, to make sure that the returned pointer +// is freeable with std::free(). (__libcpp_aligned_alloc and +// __libcpp_aligned_free may be using functions incompatible with std::free().) +void* operator new [] (std::size_t s, std::align_val_t) TEST_THROW_SPEC(std::bad_alloc) +{ + return std::malloc(s); +} + +void operator delete [] (void* p) TEST_NOEXCEPT { ++unsized_delete_called; std::free(p); } -void operator delete(void* p, const std::nothrow_t&) TEST_NOEXCEPT +void operator delete [] (void* p, const std::nothrow_t&) TEST_NOEXCEPT { ++unsized_delete_nothrow_called; std::free(p); Index: libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/delete_align_val_t_replace.pass.cpp =================================================================== --- libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/delete_align_val_t_replace.pass.cpp +++ libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/delete_align_val_t_replace.pass.cpp @@ -20,11 +20,6 @@ // UNSUPPORTED: clang-5, clang-6, clang-7 // XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13}} -// On Windows libc++ doesn't provide its own definitions for new/delete -// but instead depends on the ones in VCRuntime. However VCRuntime does not -// yet provide aligned new/delete definitions so this test fails to compile/link. -// XFAIL: LIBCXX-WINDOWS-FIXME - // Libcxx when built for z/OS doesn't contain the aligned allocation functions, // nor does the dynamic library shipped with z/OS. // UNSUPPORTED: target={{.+}}-zos{{.*}} @@ -48,6 +43,14 @@ aligned_delete_called = 0; } +// Override aligned operator new, to make sure that the returned pointer +// is freeable with std::free(). (__libcpp_aligned_alloc and +// __libcpp_aligned_free may be using functions incompatible with std::free().) +void* operator new (std::size_t s, std::align_val_t) TEST_THROW_SPEC(std::bad_alloc) +{ + return std::malloc(s); +} + void operator delete(void* p) TEST_NOEXCEPT { ++unsized_delete_called;