xref: /minix3/external/bsd/llvm/dist/clang/test/Index/complete-declarators.m (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc// This test is line- and column-sensitive, so test commands are at the bottom.
2*f4a2713aSLionel Sambuc@protocol P
3*f4a2713aSLionel Sambuc- (int)method:(id)param1;
4*f4a2713aSLionel Sambuc@end
5*f4a2713aSLionel Sambuc
6*f4a2713aSLionel Sambuc@interface A <P>
7*f4a2713aSLionel Sambuc- (int)method:(id)param1;
8*f4a2713aSLionel Sambuc
9*f4a2713aSLionel Sambuc@property int prop1;
10*f4a2713aSLionel Sambuc@end
11*f4a2713aSLionel Sambuc
12*f4a2713aSLionel Sambuc@implementation A
13*f4a2713aSLionel Sambuc- (int)method:(id)param1 {
14*f4a2713aSLionel Sambuc  int q2;
15*f4a2713aSLionel Sambuc  for(id q in param1) {
16*f4a2713aSLionel Sambuc    int y;
17*f4a2713aSLionel Sambuc  }
18*f4a2713aSLionel Sambuc  id q;
19*f4a2713aSLionel Sambuc  for(q in param1) {
20*f4a2713aSLionel Sambuc    int y;
21*f4a2713aSLionel Sambuc  }
22*f4a2713aSLionel Sambuc
23*f4a2713aSLionel Sambuc  static P *p = 0;
24*f4a2713aSLionel Sambuc}
25*f4a2713aSLionel Sambuc- (boid)method2 {}
26*f4a2713aSLionel Sambuc@end
27*f4a2713aSLionel Sambuc
28*f4a2713aSLionel Sambuc// RUN: c-index-test -code-completion-at=%s:7:4 %s | FileCheck -check-prefix=CHECK-CC0 %s
29*f4a2713aSLionel Sambuc// CHECK-CC0: NotImplemented:{TypedText IBAction}{RightParen )}{Placeholder selector}{Colon :}{LeftParen (}{Text id}{RightParen )}{Text sender} (40)
30*f4a2713aSLionel Sambuc// CHECK-CC0: macro definition:{TypedText IBAction} (70)
31*f4a2713aSLionel Sambuc// CHECK-CC0: macro definition:{TypedText IBOutlet} (70)
32*f4a2713aSLionel Sambuc// CHECK-CC0: macro definition:{TypedText IBOutletCollection}{LeftParen (}{Placeholder ClassName}{RightParen )} (70)
33*f4a2713aSLionel Sambuc// CHECK-CC0: TypedefDecl:{TypedText id} (50)
34*f4a2713aSLionel Sambuc// CHECK-CC0: NotImplemented:{TypedText in} (40)
35*f4a2713aSLionel Sambuc// CHECK-CC0: NotImplemented:{TypedText inout} (40)
36*f4a2713aSLionel Sambuc// CHECK-CC0: NotImplemented:{TypedText instancetype} (40)
37*f4a2713aSLionel Sambuc// CHECK-CC0: NotImplemented:{TypedText int} (50)
38*f4a2713aSLionel Sambuc// CHECK-CC0: NotImplemented:{TypedText long} (50)
39*f4a2713aSLionel Sambuc// RUN: c-index-test -code-completion-at=%s:7:19 %s | FileCheck -check-prefix=CHECK-CC1 %s
40*f4a2713aSLionel Sambuc// CHECK-CC1-NOT: NotImplemented:{TypedText extern} (40)
41*f4a2713aSLionel Sambuc// CHECK-CC1: NotImplemented:{TypedText param1} (40)
42*f4a2713aSLionel Sambuc// RUN: c-index-test -code-completion-at=%s:9:15 %s | FileCheck -check-prefix=CHECK-CC2 %s
43*f4a2713aSLionel Sambuc// RUN: c-index-test -code-completion-at=%s:15:10 %s | FileCheck -check-prefix=CHECK-CC2 %s
44*f4a2713aSLionel Sambuc// RUN: c-index-test -code-completion-at=%s:16:9 %s | FileCheck -check-prefix=CHECK-CC2 %s
45*f4a2713aSLionel Sambuc// CHECK-CC2: NotImplemented:{TypedText const} (40)
46*f4a2713aSLionel Sambuc// CHECK-CC2-NOT: int
47*f4a2713aSLionel Sambuc// CHECK-CC2: NotImplemented:{TypedText restrict} (40)
48*f4a2713aSLionel Sambuc// CHECK-CC2: NotImplemented:{TypedText volatile} (40)
49*f4a2713aSLionel Sambuc// RUN: c-index-test -code-completion-at=%s:15:15 %s | FileCheck -check-prefix=CHECK-CC3 %s
50*f4a2713aSLionel Sambuc// CHECK-CC3: ParmDecl:{ResultType id}{TypedText param1} (34)
51*f4a2713aSLionel Sambuc// CHECK-CC3-NOT: VarDecl:{ResultType int}{TypedText q2}
52*f4a2713aSLionel Sambuc// CHECK-CC3-NOT: VarDecl:{ResultType id}{TypedText q}
53*f4a2713aSLionel Sambuc// CHECK-CC3: NotImplemented:{ResultType A *}{TypedText self} (34)
54*f4a2713aSLionel Sambuc// CHECK-CC3: NotImplemented:{ResultType size_t}{TypedText sizeof}{LeftParen (}{Placeholder expression-or-type}{RightParen )} (40)
55*f4a2713aSLionel Sambuc// RUN: c-index-test -code-completion-at=%s:15:15 %s | FileCheck -check-prefix=CHECK-CC4 %s
56*f4a2713aSLionel Sambuc// CHECK-CC4: ParmDecl:{ResultType id}{TypedText param1} (34)
57*f4a2713aSLionel Sambuc// CHECK-CC4-NOT: VarDecl:{ResultType int}{TypedText q2}
58*f4a2713aSLionel Sambuc// CHECK-CC4: NotImplemented:{ResultType A *}{TypedText self} (34)
59*f4a2713aSLionel Sambuc// CHECK-CC4: NotImplemented:{ResultType size_t}{TypedText sizeof}{LeftParen (}{Placeholder expression-or-type}{RightParen )} (40)
60*f4a2713aSLionel Sambuc// RUN: c-index-test -code-completion-at=%s:23:10 %s | FileCheck -check-prefix=CHECK-CC5 %s
61*f4a2713aSLionel Sambuc// CHECK-CC5: NotImplemented:{TypedText _Bool} (50)
62*f4a2713aSLionel Sambuc// CHECK-CC5: NotImplemented:{TypedText _Complex} (50)
63*f4a2713aSLionel Sambuc// CHECK-CC5: NotImplemented:{TypedText _Imaginary} (50)
64*f4a2713aSLionel Sambuc// CHECK-CC5: ObjCInterfaceDecl:{TypedText A} (50)
65*f4a2713aSLionel Sambuc// CHECK-CC5: NotImplemented:{TypedText char} (50)
66*f4a2713aSLionel Sambuc// CHECK-CC5: TypedefDecl:{TypedText Class} (50)
67*f4a2713aSLionel Sambuc// CHECK-CC5: NotImplemented:{TypedText const} (50)
68*f4a2713aSLionel Sambuc// CHECK-CC5: NotImplemented:{TypedText double} (50)
69*f4a2713aSLionel Sambuc// CHECK-CC5: NotImplemented:{TypedText enum} (50)
70*f4a2713aSLionel Sambuc// CHECK-CC5: NotImplemented:{TypedText float} (50)
71*f4a2713aSLionel Sambuc// CHECK-CC5: TypedefDecl:{TypedText id} (50)
72*f4a2713aSLionel Sambuc// CHECK-CC5: NotImplemented:{TypedText int} (50)
73*f4a2713aSLionel Sambuc// CHECK-CC5: NotImplemented:{TypedText long} (50)
74*f4a2713aSLionel Sambuc// CHECK-CC5: NotImplemented:{TypedText restrict} (50)
75*f4a2713aSLionel Sambuc// CHECK-CC5: TypedefDecl:{TypedText SEL} (50)
76*f4a2713aSLionel Sambuc// CHECK-CC5: NotImplemented:{TypedText short} (50)
77*f4a2713aSLionel Sambuc// CHECK-CC5: NotImplemented:{TypedText signed} (50)
78*f4a2713aSLionel Sambuc// CHECK-CC5: NotImplemented:{TypedText struct} (50)
79*f4a2713aSLionel Sambuc// CHECK-CC5: NotImplemented:{TypedText typeof}{HorizontalSpace  }{Placeholder expression} (40)
80*f4a2713aSLionel Sambuc// CHECK-CC5: NotImplemented:{TypedText typeof}{LeftParen (}{Placeholder type}{RightParen )} (40)
81*f4a2713aSLionel Sambuc// CHECK-CC5: NotImplemented:{TypedText union} (50)
82*f4a2713aSLionel Sambuc// CHECK-CC5: NotImplemented:{TypedText unsigned} (50)
83*f4a2713aSLionel Sambuc// CHECK-CC5: NotImplemented:{TypedText void} (50)
84*f4a2713aSLionel Sambuc// CHECK-CC5: NotImplemented:{TypedText volatile} (50)
85*f4a2713aSLionel Sambuc
86*f4a2713aSLionel Sambuc// Check that there are no duplicate entries if we code-complete after an @implementation
87*f4a2713aSLionel Sambuc// RUN: c-index-test -code-completion-at=%s:27:1 %s | FileCheck -check-prefix=CHECK-CC6 %s
88*f4a2713aSLionel Sambuc// CHECK-CC6: ObjCInterfaceDecl:{TypedText A}
89*f4a2713aSLionel Sambuc// CHECK-CC6-NOT: ObjCInterfaceDecl:{TypedText A}
90