From 222e2a7620e6520ffaf4fc4e69d79c18da31542e Mon Sep 17 00:00:00 2001 From: "Zancanaro; Carlo" Date: Mon, 24 Sep 2012 09:58:17 +1000 Subject: Add the clang library to the repo (with some of my changes, too). --- clang/test/CodeGenObjC/autorelease.m | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 clang/test/CodeGenObjC/autorelease.m (limited to 'clang/test/CodeGenObjC/autorelease.m') 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 -- cgit v1.2.3