70 lines · plain
1@interface Other {2@private3 int other_private;4@protected5 int other_protected;6@public7 int other_public;8}9@end10 11@interface Super {12@private13 int super_private;14@protected15 int super_protected;16@public17 int super_public;18}19@end20 21@interface Super () {22@private23 int super_ext_private;24@protected25 int super_ext_protected;26@public27 int super_ext_public;28}29@end30 31@interface Sub : Super {32@private33 int sub_private;34@protected35 int sub_protected;36@public37 int sub_public;38}39@end40 41@implementation Sub42- (void)method:(Sub *)sub with:(Other *)other {43 sub->super_protected = 1;44 other->other_public = 1;45}46 47void f(Sub *sub, Other *other) {48 sub->super_protected = 1;49 other->other_public = 1;50}51@end52 53// RUN: c-index-test -code-completion-at=%s:43:8 -fobjc-nonfragile-abi %s | FileCheck -check-prefix=CHECK-SUB %s54// RUN: c-index-test -code-completion-at=%s:48:8 -fobjc-nonfragile-abi %s | FileCheck -check-prefix=CHECK-SUB %s55// CHECK-SUB: ObjCIvarDecl:{ResultType int}{TypedText sub_private} (35)56// CHECK-SUB: ObjCIvarDecl:{ResultType int}{TypedText sub_protected} (35)57// CHECK-SUB: ObjCIvarDecl:{ResultType int}{TypedText sub_public} (35)58// CHECK-SUB: ObjCIvarDecl:{ResultType int}{TypedText super_ext_private} (35) (inaccessible)59// CHECK-SUB: ObjCIvarDecl:{ResultType int}{TypedText super_ext_protected} (35)60// CHECK-SUB: ObjCIvarDecl:{ResultType int}{TypedText super_ext_public} (35)61// CHECK-SUB: ObjCIvarDecl:{ResultType int}{TypedText super_private} (37) (inaccessible)62// CHECK-SUB: ObjCIvarDecl:{ResultType int}{TypedText super_protected} (37)63// CHECK-SUB: ObjCIvarDecl:{ResultType int}{TypedText super_public} (37)64 65// RUN: c-index-test -code-completion-at=%s:44:10 -fobjc-nonfragile-abi %s | FileCheck -check-prefix=CHECK-OTHER %s66// RUN: c-index-test -code-completion-at=%s:49:10 -fobjc-nonfragile-abi %s | FileCheck -check-prefix=CHECK-OTHER %s67// CHECK-OTHER: ObjCIvarDecl:{ResultType int}{TypedText other_private} (35) (inaccessible)68// CHECK-OTHER: ObjCIvarDecl:{ResultType int}{TypedText other_protected} (35) (inaccessible)69// CHECK-OTHER: ObjCIvarDecl:{ResultType int}{TypedText other_public} (35)70