ivars craeted for explicit @synthesize and those
created for auto-synthesis are @private.
Fixes: // rdar://8769582



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121913 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/SemaObjC/synthesized-ivar.m b/test/SemaObjC/synthesized-ivar.m
index 01e51ef..6d7e4e7 100644
--- a/test/SemaObjC/synthesized-ivar.m
+++ b/test/SemaObjC/synthesized-ivar.m
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -fobjc-nonfragile-abi -verify %s
+// RUN: %clang_cc1 -fsyntax-only -fobjc-nonfragile-abi2 -verify %s
 @interface I
 {
 }
@@ -13,4 +13,41 @@
 @end
 
 // rdar://7823675
-int f0(I *a) { return a->IP; } // expected-error {{instance variable 'IP' is protected}}
+int f0(I *a) { return a->IP; } // expected-error {{instance variable 'IP' is private}}
+
+// rdar://8769582
+
+@interface I1 {
+ int protected_ivar;
+}
+@property int PROP_INMAIN;
+@end
+
+@interface I1() {
+ int private_ivar;
+}
+@property int PROP_INCLASSEXT;
+@end
+
+@implementation I1
+- (int) Meth {
+   PROP_INMAIN = 1;
+   PROP_INCLASSEXT = 2;
+   protected_ivar = 1;	// OK
+   return private_ivar; // OK
+}
+@end
+
+
+@interface DER : I1
+@end
+
+@implementation DER
+- (int) Meth {
+   protected_ivar = 1;	// OK
+   PROP_INMAIN = 1; // expected-error {{instance variable 'PROP_INMAIN' is private}}
+   PROP_INCLASSEXT = 2; // expected-error {{instance variable 'PROP_INCLASSEXT' is private}}
+   return private_ivar; // expected-error {{instance variable 'private_ivar' is private}}
+}
+@end
+