summaryrefslogtreecommitdiffstats
path: root/test/Index/complete-declarators.m
diff options
context:
space:
mode:
Diffstat (limited to 'test/Index/complete-declarators.m')
-rw-r--r--test/Index/complete-declarators.m45
1 files changed, 45 insertions, 0 deletions
diff --git a/test/Index/complete-declarators.m b/test/Index/complete-declarators.m
new file mode 100644
index 0000000..3a69282
--- /dev/null
+++ b/test/Index/complete-declarators.m
@@ -0,0 +1,45 @@
+// This test is line- and column-sensitive, so test commands are at the bottom.
+@protocol P
+- (int)method:(id)param1;
+@end
+
+@interface A <P>
+- (int)method:(id)param1;
+
+@property int prop1;
+@end
+
+@implementation A
+- (int)method:(id)param1 {
+ int q2;
+ for(id q in param1) {
+ int y;
+ }
+ id q;
+ for(q in param1) {
+ int y;
+ }
+}
+@end
+
+// RUN: c-index-test -code-completion-at=%s:7:19 %s | FileCheck -check-prefix=CHECK-CC1 %s
+// CHECK-CC1-NOT: NotImplemented:{TypedText extern} (30)
+// CHECK-CC1: NotImplemented:{TypedText param1} (30)
+// RUN: c-index-test -code-completion-at=%s:9:15 %s | FileCheck -check-prefix=CHECK-CC2 %s
+// RUN: c-index-test -code-completion-at=%s:15:10 %s | FileCheck -check-prefix=CHECK-CC2 %s
+// RUN: c-index-test -code-completion-at=%s:16:9 %s | FileCheck -check-prefix=CHECK-CC2 %s
+// CHECK-CC2: NotImplemented:{TypedText const} (30)
+// CHECK-CC2-NOT: int
+// CHECK-CC2: NotImplemented:{TypedText restrict} (30)
+// CHECK-CC2: NotImplemented:{TypedText volatile} (30)
+// RUN: c-index-test -code-completion-at=%s:15:15 %s | FileCheck -check-prefix=CHECK-CC3 %s
+// CHECK-CC3: ParmDecl:{ResultType id}{TypedText param1} (8)
+// CHECK-CC3-NOT: VarDecl:{ResultType int}{TypedText q2} (8)
+// CHECK-CC3-NOT: VarDecl:{ResultType id}{TypedText q} (8)
+// CHECK-CC3: NotImplemented:{ResultType A *}{TypedText self} (8)
+// CHECK-CC3: NotImplemented:{TypedText sizeof}{LeftParen (}{Placeholder expression-or-type}{RightParen )} (30)
+// RUN: c-index-test -code-completion-at=%s:15:15 %s | FileCheck -check-prefix=CHECK-CC4 %s
+// CHECK-CC4: ParmDecl:{ResultType id}{TypedText param1} (8)
+// CHECK-CC4-NOT: VarDecl:{ResultType int}{TypedText q2} (8)
+// CHECK-CC4: NotImplemented:{ResultType A *}{TypedText self} (8)
+// CHECK-CC4: NotImplemented:{TypedText sizeof}{LeftParen (}{Placeholder expression-or-type}{RightParen )} (30)
OpenPOWER on IntegriCloud