summaryrefslogtreecommitdiffstats
path: root/test/CodeGenObjC/autorelease.m
diff options
context:
space:
mode:
Diffstat (limited to 'test/CodeGenObjC/autorelease.m')
-rw-r--r--test/CodeGenObjC/autorelease.m30
1 files changed, 30 insertions, 0 deletions
diff --git a/test/CodeGenObjC/autorelease.m b/test/CodeGenObjC/autorelease.m
new file mode 100644
index 0000000..7bf40f1
--- /dev/null
+++ b/test/CodeGenObjC/autorelease.m
@@ -0,0 +1,30 @@
+// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -fobjc-arc -fobjc-nonfragile-abi -fobjc-runtime-has-arc -o - %s | FileCheck %s
+// RUN: %clang_cc1 -triple x86_64-apple-darwin11 -emit-llvm -fobjc-nonfragile-abi -fobjc-runtime-has-arc -o - %s | FileCheck %s
+// rdar://8881826
+// rdar://9412038
+
+@interface I
+{
+ id ivar;
+}
+- (id) Meth;
++ (id) MyAlloc;;
+@end
+
+@implementation I
+- (id) Meth {
+ @autoreleasepool {
+ id p = [I MyAlloc];
+ if (!p)
+ return ivar;
+ }
+ return 0;
+}
++ (id) MyAlloc {
+ return 0;
+}
+@end
+
+// CHECK: call i8* @objc_autoreleasePoolPush
+// CHECK: [[T:%.*]] = load i8** [[A:%.*]]
+// CHECK: call void @objc_autoreleasePoolPop
OpenPOWER on IntegriCloud