1/* Note: the RUN lines are near the end of the file, since line/column
2   matter for this test. */
3
4@class Int1, Int2, Int3, Int4;
5
6@interface Int3
7{
8}
9@end
10
11@interface Int2 : Int3
12{
13}
14@end
15
16@implementation Int2
17@end
18
19@implementation Int3
20@end
21
22// RUN: c-index-test -code-completion-at=%s:6:12 %s | FileCheck -check-prefix=CHECK-CC1 %s
23// CHECK-CC1: ObjCInterfaceDecl:{TypedText Int1}
24// CHECK-CC1: ObjCInterfaceDecl:{TypedText Int2}
25// CHECK-CC1: ObjCInterfaceDecl:{TypedText Int3}
26// CHECK-CC1: ObjCInterfaceDecl:{TypedText Int4}
27// RUN: c-index-test -code-completion-at=%s:11:12 %s | FileCheck -check-prefix=CHECK-CC2 %s
28// CHECK-CC2: ObjCInterfaceDecl:{TypedText Int1}
29// CHECK-CC2-NEXT: ObjCInterfaceDecl:{TypedText Int2}
30// CHECK-CC2-NEXT: ObjCInterfaceDecl:{TypedText Int3}
31// CHECK-CC2-NEXT: ObjCInterfaceDecl:{TypedText Int4}
32// RUN: c-index-test -code-completion-at=%s:11:19 %s | FileCheck -check-prefix=CHECK-CC3 %s
33// CHECK-CC3: ObjCInterfaceDecl:{TypedText Int1}
34// CHECK-CC3-NEXT: ObjCInterfaceDecl:{TypedText Int3}
35// CHECK-CC3-NEXT: ObjCInterfaceDecl:{TypedText Int4}
36// RUN: c-index-test -code-completion-at=%s:16:17 %s | FileCheck -check-prefix=CHECK-CC4 %s
37// CHECK-CC4: ObjCInterfaceDecl:{TypedText Int1}
38// CHECK-CC4-NEXT: ObjCInterfaceDecl:{TypedText Int2}
39// CHECK-CC4-NEXT: ObjCInterfaceDecl:{TypedText Int3}
40// CHECK-CC4-NEXT: ObjCInterfaceDecl:{TypedText Int4}
41// RUN: c-index-test -code-completion-at=%s:19:17 %s | FileCheck -check-prefix=CHECK-CC5 %s
42// CHECK-CC5: ObjCInterfaceDecl:{TypedText Int1}
43// CHECK-CC5-NEXT: ObjCInterfaceDecl:{TypedText Int3}
44// CHECK-CC5-NEXT: ObjCInterfaceDecl:{TypedText Int4}
45
46
47// RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_CACHING=1 c-index-test -code-completion-at=%s:11:12 %s | FileCheck -check-prefix=CHECK-CC2 %s
48
49
50void useClasses() {
51  int i = 0;
52  [Int3 message:1];
53}
54
55// RUN: c-index-test -code-completion-at=%s:51:11 %s | FileCheck -check-prefix=CHECK-USE %s
56// RUN: c-index-test -code-completion-at=%s:52:17 %s | FileCheck -check-prefix=CHECK-USE %s
57// CHECK-USE: ObjCInterfaceDecl:{TypedText Int2} (50)
58// CHECK-USE: ObjCInterfaceDecl:{TypedText Int3} (50)
59// CHECK-USE-NOT: Int1
60// CHECK-USE-NOT: Int4
61
62// Caching should work too:
63// RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_CACHING=1 c-index-test -code-completion-at=%s:51:11 %s | FileCheck -check-prefix=CHECK-USE %s
64