aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2011-06-21 17:38:29 +0000
committerFariborz Jahanian <fjahanian@apple.com>2011-06-21 17:38:29 +0000
commitaf9751747b098d77052cb71f1e648f29cfbadcc1 (patch)
treeb0d391080be0a9d8962d361160daaffd6958ddbd /test
parent14d251cd62942bf7d56bb87a267ba2ca2f7fae3e (diff)
objc-arc: CodeGen part of unbridged cast of CF types.
// rdar://9474349 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133525 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/CodeGenObjC/arc-unbridged-cast.m27
1 files changed, 27 insertions, 0 deletions
diff --git a/test/CodeGenObjC/arc-unbridged-cast.m b/test/CodeGenObjC/arc-unbridged-cast.m
new file mode 100644
index 0000000000..5c560e94ab
--- /dev/null
+++ b/test/CodeGenObjC/arc-unbridged-cast.m
@@ -0,0 +1,27 @@
+// RUN: %clang_cc1 -triple x86_64-apple-darwin11 -emit-llvm -fobjc-nonfragile-abi -fobjc-arc -o - %s | FileCheck %s
+// rdar://9744349
+
+typedef const struct __CFString * CFStringRef;
+
+@interface I
+@property CFStringRef P;
+- (CFStringRef) CFMeth __attribute__((cf_returns_retained));
+- (CFStringRef) newSomething;
+- (CFStringRef) P __attribute__((cf_returns_retained));
+@end
+
+@implementation I
+@synthesize P;
+- (id) Meth {
+ I* p1 = (id)[p1 P];
+ id p2 = (id)[p1 CFMeth];
+ id p3 = (id)[p1 newSomething];
+ return (id) p1.P;
+}
+- (CFStringRef) CFMeth { return 0; }
+- (CFStringRef) newSomething { return 0; }
+- (CFStringRef) P { return 0; }
+- (void) setP : (CFStringRef)arg {}
+@end
+
+// CHECK-NOT: call i8* @objc_retainAutoreleasedReturnValue