From 6503e97e0f2d8032e9daeb4c8cfef00c409bd9f3 Mon Sep 17 00:00:00 2001 From: Akira Hatanaka <ahatanaka@apple.com> Date: Tue, 13 Dec 2016 23:32:22 +0000 Subject: [PATCH] [CodeGen][ObjC] Emit objc_unsafeClaimAutoreleasedReturnValue for fragile runtime too. Follow-up to r258962. rdar://problem/29269006 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289615 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/Basic/ObjCRuntime.h | 1 + test/CodeGenObjC/arc-unsafeclaim.m | 3 +++ 2 files changed, 4 insertions(+) diff --git a/include/clang/Basic/ObjCRuntime.h b/include/clang/Basic/ObjCRuntime.h index 6975b6c9bb9..78fc8998824 100644 --- a/include/clang/Basic/ObjCRuntime.h +++ b/include/clang/Basic/ObjCRuntime.h @@ -312,6 +312,7 @@ public: bool hasARCUnsafeClaimAutoreleasedReturnValue() const { switch (getKind()) { case MacOSX: + case FragileMacOSX: return getVersion() >= VersionTuple(10, 11); case iOS: return getVersion() >= VersionTuple(9); diff --git a/test/CodeGenObjC/arc-unsafeclaim.m b/test/CodeGenObjC/arc-unsafeclaim.m index cda00b0a2f5..fd8215c2039 100644 --- a/test/CodeGenObjC/arc-unsafeclaim.m +++ b/test/CodeGenObjC/arc-unsafeclaim.m @@ -1,6 +1,9 @@ // Make sure it works on x86-64. // RUN: %clang_cc1 -triple x86_64-apple-darwin11 -fobjc-runtime=macosx-10.11 -fobjc-arc -emit-llvm -o - %s | FileCheck %s -check-prefix=CHECK -check-prefix=CHECK-UNOPTIMIZED +// Make sure it works on x86-32. +// RUN: %clang_cc1 -triple i386-apple-darwin11 -fobjc-runtime=macosx-fragile-10.11 -fobjc-arc -emit-llvm -o - %s | FileCheck %s -check-prefix=CHECK -check-prefix=CHECK-UNOPTIMIZED -check-prefix=CHECK-MARKED + // Make sure it works on ARM. // RUN: %clang_cc1 -triple arm64-apple-ios9 -fobjc-runtime=ios-9.0 -fobjc-arc -emit-llvm -o - %s | FileCheck %s -check-prefix=CHECK -check-prefix=CHECK-UNOPTIMIZED -check-prefix=CHECK-MARKED // RUN: %clang_cc1 -triple arm64-apple-ios9 -fobjc-runtime=ios-9.0 -fobjc-arc -O -disable-llvm-optzns -emit-llvm -o - %s | FileCheck %s -check-prefix=CHECK -check-prefix=CHECK-OPTIMIZED -- GitLab