xref: /minix3/external/bsd/llvm/dist/clang/test/Index/complete-ivar-access.m (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc@interface Other {
2*f4a2713aSLionel Sambuc@private
3*f4a2713aSLionel Sambuc  int other_private;
4*f4a2713aSLionel Sambuc@protected
5*f4a2713aSLionel Sambuc  int other_protected;
6*f4a2713aSLionel Sambuc@public
7*f4a2713aSLionel Sambuc  int other_public;
8*f4a2713aSLionel Sambuc}
9*f4a2713aSLionel Sambuc@end
10*f4a2713aSLionel Sambuc
11*f4a2713aSLionel Sambuc@interface Super {
12*f4a2713aSLionel Sambuc@private
13*f4a2713aSLionel Sambuc  int super_private;
14*f4a2713aSLionel Sambuc@protected
15*f4a2713aSLionel Sambuc  int super_protected;
16*f4a2713aSLionel Sambuc@public
17*f4a2713aSLionel Sambuc  int super_public;
18*f4a2713aSLionel Sambuc}
19*f4a2713aSLionel Sambuc@end
20*f4a2713aSLionel Sambuc
21*f4a2713aSLionel Sambuc@interface Super () {
22*f4a2713aSLionel Sambuc@private
23*f4a2713aSLionel Sambuc  int super_ext_private;
24*f4a2713aSLionel Sambuc@protected
25*f4a2713aSLionel Sambuc  int super_ext_protected;
26*f4a2713aSLionel Sambuc@public
27*f4a2713aSLionel Sambuc  int super_ext_public;
28*f4a2713aSLionel Sambuc}
29*f4a2713aSLionel Sambuc@end
30*f4a2713aSLionel Sambuc
31*f4a2713aSLionel Sambuc@interface Sub : Super {
32*f4a2713aSLionel Sambuc@private
33*f4a2713aSLionel Sambuc  int sub_private;
34*f4a2713aSLionel Sambuc@protected
35*f4a2713aSLionel Sambuc  int sub_protected;
36*f4a2713aSLionel Sambuc@public
37*f4a2713aSLionel Sambuc  int sub_public;
38*f4a2713aSLionel Sambuc}
39*f4a2713aSLionel Sambuc@end
40*f4a2713aSLionel Sambuc
41*f4a2713aSLionel Sambuc@implementation Sub
42*f4a2713aSLionel Sambuc- (void)method:(Sub *)sub with:(Other *)other {
43*f4a2713aSLionel Sambuc  sub->super_protected = 1;
44*f4a2713aSLionel Sambuc  other->other_public = 1;
45*f4a2713aSLionel Sambuc}
46*f4a2713aSLionel Sambuc
47*f4a2713aSLionel Sambucvoid f(Sub *sub, Other *other) {
48*f4a2713aSLionel Sambuc  sub->super_protected = 1;
49*f4a2713aSLionel Sambuc  other->other_public = 1;
50*f4a2713aSLionel Sambuc}
51*f4a2713aSLionel Sambuc@end
52*f4a2713aSLionel Sambuc
53*f4a2713aSLionel Sambuc// RUN: c-index-test -code-completion-at=%s:43:8 -fobjc-nonfragile-abi %s | FileCheck -check-prefix=CHECK-SUB %s
54*f4a2713aSLionel Sambuc// RUN: c-index-test -code-completion-at=%s:48:8 -fobjc-nonfragile-abi %s | FileCheck -check-prefix=CHECK-SUB %s
55*f4a2713aSLionel Sambuc// CHECK-SUB: ObjCIvarDecl:{ResultType int}{TypedText sub_private} (35)
56*f4a2713aSLionel Sambuc// CHECK-SUB: ObjCIvarDecl:{ResultType int}{TypedText sub_protected} (35)
57*f4a2713aSLionel Sambuc// CHECK-SUB: ObjCIvarDecl:{ResultType int}{TypedText sub_public} (35)
58*f4a2713aSLionel Sambuc// CHECK-SUB: ObjCIvarDecl:{ResultType int}{TypedText super_ext_private} (35) (inaccessible)
59*f4a2713aSLionel Sambuc// CHECK-SUB: ObjCIvarDecl:{ResultType int}{TypedText super_ext_protected} (35)
60*f4a2713aSLionel Sambuc// CHECK-SUB: ObjCIvarDecl:{ResultType int}{TypedText super_ext_public} (35)
61*f4a2713aSLionel Sambuc// CHECK-SUB: ObjCIvarDecl:{ResultType int}{TypedText super_private} (37) (inaccessible)
62*f4a2713aSLionel Sambuc// CHECK-SUB: ObjCIvarDecl:{ResultType int}{TypedText super_protected} (37)
63*f4a2713aSLionel Sambuc// CHECK-SUB: ObjCIvarDecl:{ResultType int}{TypedText super_public} (37)
64*f4a2713aSLionel Sambuc
65*f4a2713aSLionel Sambuc// RUN: c-index-test -code-completion-at=%s:44:10 -fobjc-nonfragile-abi %s | FileCheck -check-prefix=CHECK-OTHER %s
66*f4a2713aSLionel Sambuc// RUN: c-index-test -code-completion-at=%s:49:10 -fobjc-nonfragile-abi %s | FileCheck -check-prefix=CHECK-OTHER %s
67*f4a2713aSLionel Sambuc// CHECK-OTHER: ObjCIvarDecl:{ResultType int}{TypedText other_private} (35) (inaccessible)
68*f4a2713aSLionel Sambuc// CHECK-OTHER: ObjCIvarDecl:{ResultType int}{TypedText other_protected} (35) (inaccessible)
69*f4a2713aSLionel Sambuc// CHECK-OTHER: ObjCIvarDecl:{ResultType int}{TypedText other_public} (35)
70