aboutsummaryrefslogtreecommitdiff
path: root/test/SemaObjC/no-ivar-access-control.m
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2012-03-07 00:58:41 +0000
committerFariborz Jahanian <fjahanian@apple.com>2012-03-07 00:58:41 +0000
commit458a7fbe7349c7906fa4ca96c09e6ceb02aa8ea7 (patch)
tree28f1a5aa5473bf134eee0d6f39ab0e1ed53c8f0c /test/SemaObjC/no-ivar-access-control.m
parentfddfbdbf143864c15ddfbda53e7c4851426bfefa (diff)
objective-c lldb support: don't perform ivar access control check
when debugging. // rdar://10997647 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152187 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaObjC/no-ivar-access-control.m')
-rw-r--r--test/SemaObjC/no-ivar-access-control.m70
1 files changed, 70 insertions, 0 deletions
diff --git a/test/SemaObjC/no-ivar-access-control.m b/test/SemaObjC/no-ivar-access-control.m
new file mode 100644
index 0000000000..cf720992d4
--- /dev/null
+++ b/test/SemaObjC/no-ivar-access-control.m
@@ -0,0 +1,70 @@
+// RUN: %clang_cc1 -fsyntax-only -fdebugger-support -verify %s
+// RUN: %clang_cc1 -x objective-c++ -fdebugger-support -fsyntax-only -verify %s
+// rdar://10997647
+
+@interface I
+{
+@private
+int ivar;
+}
+@end
+
+@implementation I
+- (int) meth {
+ return self->ivar;
+}
+int foo1(I* p) {
+ return p->ivar;
+}
+@end
+
+int foo(I* p) {
+ return p->ivar;
+}
+
+@interface B
+@end
+
+@implementation B
+- (int) meth : (I*) arg {
+ return arg->ivar;
+}
+@end
+
+
+@interface I1 {
+ int protected_ivar;
+}
+@property int PROP_INMAIN;
+@end
+
+@interface I1() {
+ int private_ivar;
+}
+@property int PROP_INCLASSEXT;
+@end
+
+@implementation I1
+@synthesize PROP_INMAIN, PROP_INCLASSEXT;
+
+- (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;
+ PROP_INCLASSEXT = 2;
+ return private_ivar;
+}
+@end
+