[arcmt] Don't add __weak if there is already a GC __weak and make sure to clear
__weak from a readonly property.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145210 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/ARCMT/GC.m b/test/ARCMT/GC.m
index 35e9bcf..86e8b9b 100644
--- a/test/ARCMT/GC.m
+++ b/test/ARCMT/GC.m
@@ -58,6 +58,8 @@
 @interface I4Impl {
   I4Impl *pds2;
   I4Impl *pds3;
+  __weak I4Impl *pw3;
+  __weak I4Impl *pw4;
 }
 @property (assign) I4Impl *__weak pw1, *__weak pw2;
 @property (assign) I4Impl *__strong ps;
@@ -65,10 +67,12 @@
 @property (assign) I4Impl * pds2;
 @property (readwrite) I4Impl * pds3;
 @property (readonly) I4Impl * pds4;
+@property (readonly) __weak I4Impl *pw3;
+@property (assign) __weak I4Impl *pw4;
 @end
 
 @implementation I4Impl
-@synthesize pw1, pw2, ps, pds, pds2, pds3, pds4;
+@synthesize pw1, pw2, pw3, pw4, ps, pds, pds2, pds3, pds4;
 
 -(void)test1:(CFTypeRef *)cft {
   id x = NSMakeCollectable(cft);