summaryrefslogtreecommitdiff
path: root/test/CodeGenObjC/autorelease.m
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2011-07-17 15:40:56 +0000
committerDimitry Andric <dim@FreeBSD.org>2011-07-17 15:40:56 +0000
commit180abc3db9ae3b4fc63cd65b15697e6ffcc8a657 (patch)
tree2097d084eb235c0b12c0bff3445f4ec7bbaa8a12 /test/CodeGenObjC/autorelease.m
parent29cafa66ad3878dbb9f82615f19fa0bded2e443c (diff)
Notes
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 0000000000000..7bf40f11ffd15
--- /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