[PATCH] D56445: [Sema] Teach Clang that aligned allocation is not supported with macosx10.13
hans added a comment. This (I think) caused a bunch of libc++ tests to start failing during testing of the newly created 8.0 branch on my machine, see https://bugs.llvm.org/show_bug.cgi?id=40354 Repository: rL LLVM CHANGES SINCE LAST ACTION https://reviews.llvm.org/D56445/new/ https://reviews.llvm.org/D56445 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D56445: [Sema] Teach Clang that aligned allocation is not supported with macosx10.13
This revision was automatically updated to reflect the committed changes. Closed by commit rL350649: [Sema] Teach Clang that aligned allocation is not supported with macosx10.13 (authored by ldionne, committed by ). Herald added a subscriber: llvm-commits. Changed prior to commit: https://reviews.llvm.org/D56445?vs=180688=180715#toc Repository: rL LLVM CHANGES SINCE LAST ACTION https://reviews.llvm.org/D56445/new/ https://reviews.llvm.org/D56445 Files: cfe/trunk/include/clang/Basic/AlignedAllocation.h cfe/trunk/test/Driver/unavailable_aligned_allocation.cpp cfe/trunk/test/SemaCXX/unavailable_aligned_allocation.cpp libcxx/trunk/test/libcxx/language.support/support.dynamic/libcpp_deallocate.sh.cpp libcxx/trunk/test/libcxx/memory/aligned_allocation_macro.pass.cpp Index: libcxx/trunk/test/libcxx/memory/aligned_allocation_macro.pass.cpp === --- libcxx/trunk/test/libcxx/memory/aligned_allocation_macro.pass.cpp +++ libcxx/trunk/test/libcxx/memory/aligned_allocation_macro.pass.cpp @@ -9,14 +9,17 @@ // UNSUPPORTED: c++98, c++03, c++11, c++14 -// Aligned allocation functions are not provided prior to macosx10.13, but -// AppleClang <= 10 does not know about this restriction and always enables them. -// XFAIL: !(apple-clang-9 || apple-clang-10) && availability=macosx10.12 -// XFAIL: !(apple-clang-9 || apple-clang-10) && availability=macosx10.11 -// XFAIL: !(apple-clang-9 || apple-clang-10) && availability=macosx10.10 -// XFAIL: !(apple-clang-9 || apple-clang-10) && availability=macosx10.9 -// XFAIL: !(apple-clang-9 || apple-clang-10) && availability=macosx10.8 -// XFAIL: !(apple-clang-9 || apple-clang-10) && availability=macosx10.7 +// AppleClang <= 10 enables aligned allocation regardless of the deployment +// target, so this test would fail. +// UNSUPPORTED: apple-clang-9, apple-clang-10 + +// XFAIL: availability=macosx10.13 +// XFAIL: availability=macosx10.12 +// XFAIL: availability=macosx10.11 +// XFAIL: availability=macosx10.10 +// XFAIL: availability=macosx10.9 +// XFAIL: availability=macosx10.8 +// XFAIL: availability=macosx10.7 #include Index: libcxx/trunk/test/libcxx/language.support/support.dynamic/libcpp_deallocate.sh.cpp === --- libcxx/trunk/test/libcxx/language.support/support.dynamic/libcpp_deallocate.sh.cpp +++ libcxx/trunk/test/libcxx/language.support/support.dynamic/libcpp_deallocate.sh.cpp @@ -14,9 +14,15 @@ // definitions, which does not yet provide aligned allocation // XFAIL: LIBCXX-WINDOWS-FIXME -// Clang 10 (and older) will trigger an availability error when the deployment +// AppleClang 10 (and older) will trigger an availability error when the deployment // target does not support aligned allocation, even if we pass `-faligned-allocation`. +// XFAIL: apple-clang-10 && availability=macosx10.13 // XFAIL: apple-clang-10 && availability=macosx10.12 +// XFAIL: apple-clang-10 && availability=macosx10.11 +// XFAIL: apple-clang-10 && availability=macosx10.10 +// XFAIL: apple-clang-10 && availability=macosx10.9 +// XFAIL: apple-clang-10 && availability=macosx10.8 +// XFAIL: apple-clang-10 && availability=macosx10.7 // The dylibs shipped before macosx10.14 do not contain the aligned allocation // functions, so trying to force using those with -faligned-allocation results Index: cfe/trunk/include/clang/Basic/AlignedAllocation.h === --- cfe/trunk/include/clang/Basic/AlignedAllocation.h +++ cfe/trunk/include/clang/Basic/AlignedAllocation.h @@ -27,8 +27,8 @@ default: break; case llvm::Triple::Darwin: - case llvm::Triple::MacOSX: // Earliest supporting version is 10.13. -return llvm::VersionTuple(10U, 13U); + case llvm::Triple::MacOSX: // Earliest supporting version is 10.14. +return llvm::VersionTuple(10U, 14U); case llvm::Triple::IOS: case llvm::Triple::TvOS: // Earliest supporting version is 11.0.0. return llvm::VersionTuple(11U); Index: cfe/trunk/test/Driver/unavailable_aligned_allocation.cpp === --- cfe/trunk/test/Driver/unavailable_aligned_allocation.cpp +++ cfe/trunk/test/Driver/unavailable_aligned_allocation.cpp @@ -1,4 +1,4 @@ -// RUN: %clang -target x86_64-apple-macosx10.12 -c -### %s 2>&1 \ +// RUN: %clang -target x86_64-apple-macosx10.13 -c -### %s 2>&1 \ // RUN: | FileCheck %s -check-prefix=UNAVAILABLE // // RUN: %clang -target arm64-apple-ios10 -c -### %s 2>&1 \ @@ -24,7 +24,7 @@ // // UNAVAILABLE: "-faligned-alloc-unavailable" -// RUN: %clang -target x86_64-apple-macosx10.13 -c -### %s 2>&1 \ +// RUN: %clang -target x86_64-apple-macosx10.14 -c -### %s 2>&1 \ // RUN: | FileCheck %s -check-prefix=AVAILABLE // // RUN: %clang -target arm64-apple-ios11 -c -### %s 2>&1 \ @@ -54,10 +54,10 @@ // Check that passing -faligned-allocation or
[PATCH] D56445: [Sema] Teach Clang that aligned allocation is not supported with macosx10.13
ahatanak accepted this revision. ahatanak added a comment. This revision is now accepted and ready to land. LGTM. We should probably check that alignedAllocMinVersion returns the correct versions for other OSes too, but this patch is fine. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D56445/new/ https://reviews.llvm.org/D56445 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D56445: [Sema] Teach Clang that aligned allocation is not supported with macosx10.13
ldionne created this revision. ldionne added a reviewer: ahatanak. Herald added subscribers: cfe-commits, dexonsmith, jkorous, christof. r306722 added diagnostics when aligned allocation is used with deployment targets that do not support it, but the first macosx supporting aligned allocation was incorrectly set to 10.13. In reality, the dylib shipped with macosx10.13 does not support aligned allocation, but the dylib shipped with macosx10.14 does. Repository: rC Clang https://reviews.llvm.org/D56445 Files: clang/include/clang/Basic/AlignedAllocation.h clang/test/Driver/unavailable_aligned_allocation.cpp clang/test/SemaCXX/unavailable_aligned_allocation.cpp libcxx/test/libcxx/language.support/support.dynamic/libcpp_deallocate.sh.cpp libcxx/test/libcxx/memory/aligned_allocation_macro.pass.cpp Index: libcxx/test/libcxx/memory/aligned_allocation_macro.pass.cpp === --- libcxx/test/libcxx/memory/aligned_allocation_macro.pass.cpp +++ libcxx/test/libcxx/memory/aligned_allocation_macro.pass.cpp @@ -9,8 +9,9 @@ // UNSUPPORTED: c++98, c++03, c++11, c++14 -// Aligned allocation functions are not provided prior to macosx10.13, but +// Aligned allocation functions are not provided prior to macosx10.14, but // AppleClang <= 10 does not know about this restriction and always enables them. +// XFAIL: !(apple-clang-9 || apple-clang-10) && availability=macosx10.13 // XFAIL: !(apple-clang-9 || apple-clang-10) && availability=macosx10.12 // XFAIL: !(apple-clang-9 || apple-clang-10) && availability=macosx10.11 // XFAIL: !(apple-clang-9 || apple-clang-10) && availability=macosx10.10 Index: libcxx/test/libcxx/language.support/support.dynamic/libcpp_deallocate.sh.cpp === --- libcxx/test/libcxx/language.support/support.dynamic/libcpp_deallocate.sh.cpp +++ libcxx/test/libcxx/language.support/support.dynamic/libcpp_deallocate.sh.cpp @@ -14,9 +14,15 @@ // definitions, which does not yet provide aligned allocation // XFAIL: LIBCXX-WINDOWS-FIXME -// Clang 10 (and older) will trigger an availability error when the deployment +// AppleClang 10 (and older) will trigger an availability error when the deployment // target does not support aligned allocation, even if we pass `-faligned-allocation`. +// XFAIL: apple-clang-10 && availability=macosx10.13 // XFAIL: apple-clang-10 && availability=macosx10.12 +// XFAIL: apple-clang-10 && availability=macosx10.11 +// XFAIL: apple-clang-10 && availability=macosx10.10 +// XFAIL: apple-clang-10 && availability=macosx10.9 +// XFAIL: apple-clang-10 && availability=macosx10.8 +// XFAIL: apple-clang-10 && availability=macosx10.7 // The dylibs shipped before macosx10.14 do not contain the aligned allocation // functions, so trying to force using those with -faligned-allocation results Index: clang/test/SemaCXX/unavailable_aligned_allocation.cpp === --- clang/test/SemaCXX/unavailable_aligned_allocation.cpp +++ clang/test/SemaCXX/unavailable_aligned_allocation.cpp @@ -1,6 +1,6 @@ -// RUN: %clang_cc1 -triple x86_64-apple-macosx10.12.0 -fexceptions -faligned-alloc-unavailable -std=c++1z -verify %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 %s +// RUN: %clang_cc1 -triple x86_64-apple-macosx10.13.0 -fexceptions -faligned-alloc-unavailable -std=c++1z -verify %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 %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 @@ -117,8 +117,8 @@ // 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}}} #else -// 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}}} +// expected-error@-16 {{aligned allocation function of type 'void *(unsigned long, enum std::align_val_t)' is only available on macOS 10.14