summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenObjC/objc-alloc-init.m
diff options
context:
space:
mode:
authorErik Pilkington <erik.pilkington@gmail.com>2019-05-15 20:15:01 +0000
committerErik Pilkington <erik.pilkington@gmail.com>2019-05-15 20:15:01 +0000
commitf6c645f9fd93190be479fff697cff9a45c208bbf (patch)
tree5ec7aa7b4b0999d408986831df2702f9e31d9cba /clang/test/CodeGenObjC/objc-alloc-init.m
parent11b515ac0af15e0646bde5a7bf2b0f8867bfbff6 (diff)
downloadbcm5719-llvm-f6c645f9fd93190be479fff697cff9a45c208bbf.tar.gz
bcm5719-llvm-f6c645f9fd93190be479fff697cff9a45c208bbf.zip
[CodeGenObjC] invoke objc_autorelease, objc_retain when necessary
Any of these methods can be overridden, so we need to invoke these functions. Differential revision: https://reviews.llvm.org/D61957 llvm-svn: 360802
Diffstat (limited to 'clang/test/CodeGenObjC/objc-alloc-init.m')
-rw-r--r--clang/test/CodeGenObjC/objc-alloc-init.m15
1 files changed, 11 insertions, 4 deletions
diff --git a/clang/test/CodeGenObjC/objc-alloc-init.m b/clang/test/CodeGenObjC/objc-alloc-init.m
index a55a9835c8a..08a383d59f6 100644
--- a/clang/test/CodeGenObjC/objc-alloc-init.m
+++ b/clang/test/CodeGenObjC/objc-alloc-init.m
@@ -1,7 +1,7 @@
-// RUN: %clang_cc1 %s -fobjc-runtime=macosx-10.14.4 -emit-llvm -O0 -o - | FileCheck %s --check-prefix=OPTIMIZED --check-prefix=EITHER
-// RUN: %clang_cc1 %s -fobjc-runtime=macosx-10.14.3 -emit-llvm -O0 -o - | FileCheck %s --check-prefix=NOT_OPTIMIZED --check-prefix=EITHER
-// RUN: %clang_cc1 %s -fobjc-runtime=ios-12.2 -emit-llvm -O0 -o - | FileCheck %s --check-prefix=OPTIMIZED --check-prefix=EITHER
-// RUN: %clang_cc1 %s -fobjc-runtime=ios-12.1 -emit-llvm -O0 -o - | FileCheck %s --check-prefix=NOT_OPTIMIZED --check-prefix=EITHER
+// RUN: %clang_cc1 %s -fobjc-exceptions -fexceptions -fobjc-runtime=macosx-10.14.4 -emit-llvm -O0 -o - | FileCheck %s --check-prefix=OPTIMIZED --check-prefix=EITHER
+// RUN: %clang_cc1 %s -fobjc-exceptions -fexceptions -fobjc-runtime=macosx-10.14.3 -emit-llvm -O0 -o - | FileCheck %s --check-prefix=NOT_OPTIMIZED --check-prefix=EITHER
+// RUN: %clang_cc1 %s -fobjc-exceptions -fexceptions -fobjc-runtime=ios-12.2 -emit-llvm -O0 -o - | FileCheck %s --check-prefix=OPTIMIZED --check-prefix=EITHER
+// RUN: %clang_cc1 %s -fobjc-exceptions -fexceptions -fobjc-runtime=ios-12.1 -emit-llvm -O0 -o - | FileCheck %s --check-prefix=NOT_OPTIMIZED --check-prefix=EITHER
@interface X
+(X *)alloc;
@@ -12,6 +12,13 @@ void f() {
[[X alloc] init];
// OPTIMIZED: call i8* @objc_alloc_init(
// NOT_OPTIMIZED: call i8* @objc_alloc(
+
+ @try {
+ [[X alloc] init];
+ } @catch (X *x) {
+ }
+ // OPTIMIZED: invoke i8* @objc_alloc_init(
+ // NOT_OPTIMIZED: invoke i8* @objc_alloc(
}
@interface Y : X
OpenPOWER on IntegriCloud