[clang] Correct the macOS version that supports aligned allocation

After checking the libc++abi.dylib shipped in macOS 10.13, I can confirm
that it contains the align_val_t variants of operator new and operator
delete. However, the libc++abi.dylib shipped on macOS 10.12 does not.

Differential Revision: https://reviews.llvm.org/D129198
This commit is contained in:
Louis Dionne 2022-07-05 18:53:33 -04:00
parent 8366e21ef1
commit 4722b5d133
11 changed files with 34 additions and 34 deletions

View File

@ -26,8 +26,8 @@ inline llvm::VersionTuple alignedAllocMinVersion(llvm::Triple::OSType OS) {
default:
break;
case llvm::Triple::Darwin:
case llvm::Triple::MacOSX: // Earliest supporting version is 10.14.
return llvm::VersionTuple(10U, 14U);
case llvm::Triple::MacOSX: // Earliest supporting version is 10.13.
return llvm::VersionTuple(10U, 13U);
case llvm::Triple::IOS:
case llvm::Triple::TvOS: // Earliest supporting version is 11.0.0.
return llvm::VersionTuple(11U);

View File

@ -1,4 +1,4 @@
// RUN: %clang -target x86_64-apple-macosx10.13 -c -### %s 2>&1 \
// RUN: %clang -target x86_64-apple-macosx10.12 -c -### %s 2>&1 \
// RUN: | FileCheck %s -check-prefix=UNAVAILABLE
//
// RUN: %clang -target arm64-apple-ios10 -c -### %s 2>&1 \
@ -27,7 +27,7 @@
// UNAVAILABLE: "-faligned-alloc-unavailable"
// RUN: %clang -target x86_64-apple-macosx10.14 -c -### %s 2>&1 \
// RUN: %clang -target x86_64-apple-macosx10.13 -c -### %s 2>&1 \
// RUN: | FileCheck %s -check-prefix=AVAILABLE
//
// RUN: %clang -target arm64-apple-ios11 -c -### %s 2>&1 \
@ -57,10 +57,10 @@
// Check that passing -faligned-allocation or -fno-aligned-allocation stops the
// driver from passing -faligned-alloc-unavailable to cc1.
//
// RUN: %clang -target x86_64-apple-macosx10.13 -faligned-allocation -c -### %s 2>&1 \
// RUN: %clang -target x86_64-apple-macosx10.12 -faligned-allocation -c -### %s 2>&1 \
// RUN: | FileCheck %s -check-prefix=AVAILABLE
//
// RUN: %clang -target x86_64-apple-macosx10.13 -fno-aligned-allocation -c -### %s 2>&1 \
// RUN: %clang -target x86_64-apple-macosx10.12 -fno-aligned-allocation -c -### %s 2>&1 \
// RUN: | FileCheck %s -check-prefix=AVAILABLE
//
// RUN: %clang -target s390x-none-zos -faligned-allocation -c -### %s 2>&1 \

View File

@ -1,6 +1,6 @@
// RUN: %clang_cc1 -triple x86_64-apple-macosx10.13.0 -fexceptions -faligned-alloc-unavailable -std=c++1z -verify -DMACOS %s
// RUN: %clang_cc1 -triple x86_64-apple-macosx10.13.0 -fexceptions -std=c++1z -verify -DNO_ERRORS %s
// RUN: %clang_cc1 -triple x86_64-apple-macosx10.13.0 -fexceptions -faligned-allocation -faligned-alloc-unavailable -std=c++14 -verify -DMACOS %s
// RUN: %clang_cc1 -triple x86_64-apple-macosx10.12.0 -fexceptions -faligned-alloc-unavailable -std=c++1z -verify -DMACOS %s
// RUN: %clang_cc1 -triple x86_64-apple-macosx10.12.0 -fexceptions -std=c++1z -verify -DNO_ERRORS %s
// RUN: %clang_cc1 -triple x86_64-apple-macosx10.12.0 -fexceptions -faligned-allocation -faligned-alloc-unavailable -std=c++14 -verify -DMACOS %s
// RUN: %clang_cc1 -triple arm64-apple-ios10.0.0 -fexceptions -faligned-alloc-unavailable -std=c++1z -verify -DIOS %s
// RUN: %clang_cc1 -triple arm64-apple-ios10.0.0 -fexceptions -std=c++1z -verify -DNO_ERRORS %s
// RUN: %clang_cc1 -triple arm64-apple-tvos10.0.0 -fexceptions -faligned-alloc-unavailable -std=c++1z -verify -DTVOS %s
@ -120,8 +120,8 @@ void testOveralignedCheckOS() {
// expected-error@-13 {{aligned allocation function of type 'void *(unsigned long, enum std::align_val_t)' is only available on watchOS 4 or newer}}}
// expected-error@-14 {{aligned deallocation function of type 'void (void *, enum std::align_val_t) noexcept' is only available on watchOS 4 or newer}}}
#elif defined(MACOS)
// expected-error@-16 {{aligned allocation function of type 'void *(unsigned long, enum std::align_val_t)' is only available on macOS 10.14 or newer}}}
// expected-error@-17 {{aligned deallocation function of type 'void (void *, enum std::align_val_t) noexcept' is only available on macOS 10.14 or newer}}}
// expected-error@-16 {{aligned allocation function of type 'void *(unsigned long, enum std::align_val_t)' is only available on macOS 10.13 or newer}}}
// expected-error@-17 {{aligned deallocation function of type 'void (void *, enum std::align_val_t) noexcept' is only available on macOS 10.13 or newer}}}
#elif defined(ZOS)
// expected-error@-19 {{aligned allocation function of type 'void *(unsigned long, enum std::align_val_t)' is not available on z/OS}}}
// expected-error@-20 {{aligned deallocation function of type 'void (void *, enum std::align_val_t) noexcept' is not available on z/OS}}}
@ -152,7 +152,7 @@ OveralignedS2::~OveralignedS2() {}
// expected-error@-12 {{aligned deallocation function of type 'void (void *, enum std::align_val_t) noexcept' is only available on watchOS 4 or newer}}}
// expected-note@-13 {{if you supply your own aligned allocation functions}}
#elif defined(MACOS)
// expected-error@-15 {{aligned deallocation function of type 'void (void *, enum std::align_val_t) noexcept' is only available on macOS 10.14 or newer}}}
// expected-error@-15 {{aligned deallocation function of type 'void (void *, enum std::align_val_t) noexcept' is only available on macOS 10.13 or newer}}}
// expected-note@-16 {{if you supply your own aligned allocation functions}}
#elif defined(ZOS)
// expected-error@-18 {{aligned deallocation function of type 'void (void *, enum std::align_val_t) noexcept' is not available on z/OS}}}

View File

@ -7,12 +7,12 @@
//===----------------------------------------------------------------------===//
// Make sure we get compile-time availability errors when trying to use aligned
// allocation/deallocation on deployment targets that don't support it (before macosx10.14).
// allocation/deallocation on deployment targets that don't support it (before macosx10.13).
// UNSUPPORTED: c++03, c++11, c++14
// Aligned allocation was not provided before macosx10.14.
// REQUIRES: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13}}
// Aligned allocation was not provided before macosx10.13.
// REQUIRES: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
#include <new>
#include <cstddef>

View File

@ -8,7 +8,7 @@
// UNSUPPORTED: c++03, c++11, c++14
// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13}}
// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
#include <new>

View File

@ -11,9 +11,9 @@
// asan and msan will not call the new handler.
// UNSUPPORTED: sanitizer-new-delete
// Aligned allocation was not provided before macosx10.14 and as a result we
// get availability errors when the deployment target is older than macosx10.14.
// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13}}
// Aligned allocation was not provided before macosx10.13 and as a result we
// get availability errors when the deployment target is older than macosx10.13.
// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
// Libcxx when built for z/OS doesn't contain the aligned allocation functions,
// nor does the dynamic library shipped with z/OS.

View File

@ -11,9 +11,9 @@
// asan and msan will not call the new handler.
// UNSUPPORTED: sanitizer-new-delete
// Aligned allocation was not provided before macosx10.14 and as a result we
// get availability errors when the deployment target is older than macosx10.14.
// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13}}
// Aligned allocation was not provided before macosx10.13 and as a result we
// get availability errors when the deployment target is older than macosx10.13.
// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
// Libcxx when built for z/OS doesn't contain the aligned allocation functions,
// nor does the dynamic library shipped with z/OS.

View File

@ -11,9 +11,9 @@
// XFAIL: LIBCXX-AIX-FIXME
// Aligned allocation was not provided before macosx10.14 and as a result we
// get availability errors when the deployment target is older than macosx10.14.
// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13}}
// Aligned allocation was not provided before macosx10.13 and as a result we
// get availability errors when the deployment target is older than macosx10.13.
// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
// Libcxx when built for z/OS doesn't contain the aligned allocation functions,
// nor does the dynamic library shipped with z/OS.

View File

@ -8,9 +8,9 @@
// UNSUPPORTED: c++03, c++11, c++14
// Aligned allocation was not provided before macosx10.14 and as a result we
// get availability errors when the deployment target is older than macosx10.14.
// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13}}
// Aligned allocation was not provided before macosx10.13 and as a result we
// get availability errors when the deployment target is older than macosx10.13.
// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
// asan and msan will not call the new handler.
// UNSUPPORTED: sanitizer-new-delete

View File

@ -8,9 +8,9 @@
// UNSUPPORTED: c++03, c++11, c++14
// Aligned allocation was not provided before macosx10.14 and as a result we
// get availability errors when the deployment target is older than macosx10.14.
// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13}}
// Aligned allocation was not provided before macosx10.13 and as a result we
// get availability errors when the deployment target is older than macosx10.13.
// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
// asan and msan will not call the new handler.
// UNSUPPORTED: sanitizer-new-delete

View File

@ -11,9 +11,9 @@
// XFAIL: LIBCXX-AIX-FIXME
// Aligned allocation was not provided before macosx10.14 and as a result we
// get availability errors when the deployment target is older than macosx10.14.
// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13}}
// Aligned allocation was not provided before macosx10.13 and as a result we
// get availability errors when the deployment target is older than macosx10.13.
// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
// Libcxx when built for z/OS doesn't contain the aligned allocation functions,
// nor does the dynamic library shipped with z/OS.