blob: 7772a72119757737da0c9fd75c8c1d7a7495394c [file] [log] [blame]
Douglas Gregor03d8aec2010-08-27 15:10:57 +00001// Note: the run lines follow their respective tests, since line/column
2// matter in this test.
3
4typedef int Bool;
5
6@interface A
7- (void)add:(int)x to:(int)y;
8+ (void)select:(Bool)condition first:(int)x second:(int)y;
9- (void)last;
10+ (void)last;
11@end
12
13@interface B : A
14- (void)add:(int)x to:(int)y;
15+ (void)select:(Bool)condition first:(int)x second:(int)y;
16@end
17
18@implementation B
19- (void)add:(int)a to:(int)b {
20 [super add:a to:b];
21}
22
23+ (void)select:(Bool)condition first:(int)a second:(int)b {
24 [super selector:condition first:a second:b];
Douglas Gregor78edf512010-09-15 16:23:04 +000025 super selector:condition first:a second:b];
Douglas Gregor03d8aec2010-08-27 15:10:57 +000026}
27@end
28
29// Check "super" completion as a message receiver.
30// RUN: c-index-test -code-completion-at=%s:20:4 %s | FileCheck -check-prefix=CHECK-ADD-RECEIVER %s
Douglas Gregor8ec904c2010-10-19 00:03:23 +000031// CHECK-ADD-RECEIVER: ObjCInstanceMethodDecl:{ResultType void}{TypedText super}{HorizontalSpace }{Text add:}{Placeholder a}{HorizontalSpace }{Text to:}{Placeholder b} (20)
Douglas Gregor03d8aec2010-08-27 15:10:57 +000032
33// RUN: c-index-test -code-completion-at=%s:24:4 %s | FileCheck -check-prefix=CHECK-SELECT-RECEIVER %s
Douglas Gregor8ec904c2010-10-19 00:03:23 +000034// CHECK-SELECT-RECEIVER: ObjCClassMethodDecl:{ResultType void}{TypedText super}{HorizontalSpace }{Text select:}{Placeholder condition}{HorizontalSpace }{Text first:}{Placeholder a}{HorizontalSpace }{Text second:}{Placeholder b} (20)
Douglas Gregor03d8aec2010-08-27 15:10:57 +000035
36// Check "super" completion at the first identifier
37// RUN: c-index-test -code-completion-at=%s:20:10 %s | FileCheck -check-prefix=CHECK-ADD-ADD %s
Douglas Gregor8ec904c2010-10-19 00:03:23 +000038// CHECK-ADD-ADD: ObjCInstanceMethodDecl:{ResultType void}{TypedText add:}{Placeholder a}{HorizontalSpace }{Text to:}{Placeholder b} (20)
Douglas Gregor03d8aec2010-08-27 15:10:57 +000039// CHECK-ADD-ADD-NOT: add
Douglas Gregor8ec904c2010-10-19 00:03:23 +000040// CHECK-ADD-ADD: ObjCInstanceMethodDecl:{ResultType void}{TypedText last} (35)
Douglas Gregor03d8aec2010-08-27 15:10:57 +000041
42// RUN: c-index-test -code-completion-at=%s:24:10 %s | FileCheck -check-prefix=CHECK-SELECTOR-SELECTOR %s
43// CHECK-SELECTOR-SELECTOR-NOT: x
Douglas Gregor8ec904c2010-10-19 00:03:23 +000044// CHECK-SELECTOR-SELECTOR: ObjCClassMethodDecl:{ResultType void}{TypedText last} (35)
45// CHECK-SELECTOR-SELECTOR: ObjCClassMethodDecl:{ResultType void}{TypedText select:}{Placeholder condition}{HorizontalSpace }{Text first:}{Placeholder a}{HorizontalSpace }{Text second:}{Placeholder b} (20)
Douglas Gregor03d8aec2010-08-27 15:10:57 +000046
47// Check "super" completion at the second identifier
48// RUN: c-index-test -code-completion-at=%s:20:16 %s | FileCheck -check-prefix=CHECK-ADD-TO %s
Douglas Gregor8ec904c2010-10-19 00:03:23 +000049// CHECK-ADD-TO: ObjCInstanceMethodDecl:{ResultType void}{Informative add:}{TypedText to:}{Placeholder b} (20)
Douglas Gregor03d8aec2010-08-27 15:10:57 +000050
51// RUN: c-index-test -code-completion-at=%s:24:28 %s | FileCheck -check-prefix=CHECK-SELECTOR-FIRST %s
Douglas Gregor8ec904c2010-10-19 00:03:23 +000052// CHECK-SELECTOR-FIRST: ObjCClassMethodDecl:{ResultType void}{Informative select:}{TypedText first:}{Placeholder a}{HorizontalSpace }{Text second:}{Placeholder b} (20)
Douglas Gregor03d8aec2010-08-27 15:10:57 +000053
54// Check "super" completion at the third identifier
55// RUN: c-index-test -code-completion-at=%s:24:37 %s | FileCheck -check-prefix=CHECK-SELECTOR-SECOND %s
Douglas Gregor8ec904c2010-10-19 00:03:23 +000056// CHECK-SELECTOR-SECOND: ObjCClassMethodDecl:{ResultType void}{Informative select:}{Informative first:}{TypedText second:}{Placeholder b} (20)
Douglas Gregor78edf512010-09-15 16:23:04 +000057
58// Check "super" completion with missing '['.
59// RUN: c-index-test -code-completion-at=%s:25:10 %s | FileCheck -check-prefix=CHECK-SELECTOR-SELECTOR %s
60// RUN: c-index-test -code-completion-at=%s:25:28 %s | FileCheck -check-prefix=CHECK-SELECTOR-FIRST %s
61// RUN: c-index-test -code-completion-at=%s:25:37 %s | FileCheck -check-prefix=CHECK-SELECTOR-SECOND %s