summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenObjC/arc.m
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2011-09-13 18:49:24 +0000
committerJohn McCall <rjmccall@apple.com>2011-09-13 18:49:24 +0000
commit94312285b7c9ebd95337fff60df7dfa1c0d14f9a (patch)
treeb616610d0caf9caa1ab3124d898980e93857cfa6 /clang/test/CodeGenObjC/arc.m
parent8db67df6630b9f3e84a33c7bd7bd82f03dbae823 (diff)
downloadbcm5719-llvm-94312285b7c9ebd95337fff60df7dfa1c0d14f9a.tar.gz
bcm5719-llvm-94312285b7c9ebd95337fff60df7dfa1c0d14f9a.zip
A strong property of block type has "copy" setter semantics, not "retain".
This is consistent with the behavior of assigning into a __strong l-value, and it's also necessary for ensuring that the ivar doesn't end up a dangling reference. We decided not to change the behavior of "retain" properties, but just to make them warnings/errors when of block type. llvm-svn: 139619
Diffstat (limited to 'clang/test/CodeGenObjC/arc.m')
-rw-r--r--clang/test/CodeGenObjC/arc.m20
1 files changed, 20 insertions, 0 deletions
diff --git a/clang/test/CodeGenObjC/arc.m b/clang/test/CodeGenObjC/arc.m
index 7982fd6ebc7..ebbc3473166 100644
--- a/clang/test/CodeGenObjC/arc.m
+++ b/clang/test/CodeGenObjC/arc.m
@@ -1892,3 +1892,23 @@ void test64b(void) {
// CHECK-NEXT: call void @objc_release(i8* [[T5]])
// CHECK-NEXT: ret void
}
+
+// rdar://problem/9979150
+@interface Test65
+@property (strong) void(^ablock)(void);
+@property (nonatomic, strong) void(^nblock)(void);
+@end
+@implementation Test65
+@synthesize ablock, nblock;
+// CHECK: define internal void ()* @"\01-[Test65 ablock]"(
+// CHECK: call i8* @objc_getProperty(i8* {{%.*}}, i8* {{%.*}}, i64 {{%.*}}, i1 zeroext true)
+
+// CHECK: define internal void @"\01-[Test65 setAblock:]"(
+// CHECK: call void @objc_setProperty(i8* {{%.*}}, i8* {{%.*}}, i64 {{%.*}}, i8* {{%.*}}, i1 zeroext true, i1 zeroext true)
+
+// CHECK: define internal void ()* @"\01-[Test65 nblock]"(
+// CHECK: call i8* @objc_getProperty(i8* {{%.*}}, i8* {{%.*}}, i64 {{%.*}}, i1 zeroext false)
+
+// CHECK: define internal void @"\01-[Test65 setNblock:]"(
+// CHECK: call void @objc_setProperty(i8* {{%.*}}, i8* {{%.*}}, i64 {{%.*}}, i8* {{%.*}}, i1 zeroext false, i1 zeroext true)
+@end
OpenPOWER on IntegriCloud