summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clang/lib/AST/ASTContext.cpp2
-rw-r--r--clang/test/CodeGenObjC/arc-ivar-layout.m9
2 files changed, 11 insertions, 0 deletions
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp
index edc74603ff6..5aa4beeb292 100644
--- a/clang/lib/AST/ASTContext.cpp
+++ b/clang/lib/AST/ASTContext.cpp
@@ -5018,6 +5018,8 @@ void ASTContext::getObjCEncodingForPropertyDecl(const ObjCPropertyDecl *PD,
S += ",C";
if (PD->getPropertyAttributes() & ObjCPropertyDecl::OBJC_PR_retain)
S += ",&";
+ if (PD->getPropertyAttributes() & ObjCPropertyDecl::OBJC_PR_weak)
+ S += ",W";
} else {
switch (PD->getSetterKind()) {
case ObjCPropertyDecl::Assign: break;
diff --git a/clang/test/CodeGenObjC/arc-ivar-layout.m b/clang/test/CodeGenObjC/arc-ivar-layout.m
index 9128063652b..06e387c817e 100644
--- a/clang/test/CodeGenObjC/arc-ivar-layout.m
+++ b/clang/test/CodeGenObjC/arc-ivar-layout.m
@@ -54,3 +54,12 @@
@implementation UnsafePerson @end
// CHECK-LP64: L_OBJC_CLASS_NAME_20:
// CHECK-LP64-NEXT: .asciz "!"
+
+// rdar://16136439
+@interface rdar16136439
+ @property (nonatomic, readonly, weak) id first;
+@end
+
+@implementation rdar16136439 @end
+// CHECK-LP64: L_OBJC_PROP_NAME_ATTR_29:
+// CHECK-LP64-NEXT: .asciz "T@,R,W,N,V_first"
OpenPOWER on IntegriCloud