summaryrefslogtreecommitdiff
path: root/clang/test/CodeGenObjC/autorelease.m
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/CodeGenObjC/autorelease.m')
-rw-r--r--clang/test/CodeGenObjC/autorelease.m30
1 files changed, 30 insertions, 0 deletions
diff --git a/clang/test/CodeGenObjC/autorelease.m b/clang/test/CodeGenObjC/autorelease.m
new file mode 100644
index 0000000..9260c3f
--- /dev/null
+++ b/clang/test/CodeGenObjC/autorelease.m
@@ -0,0 +1,30 @@
+// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -fobjc-arc -fobjc-runtime-has-arc -o - %s | FileCheck %s
+// RUN: %clang_cc1 -triple x86_64-apple-darwin11 -emit-llvm -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