Douglas Gregor | 03d8aec | 2010-08-27 15:10:57 +0000 | [diff] [blame] | 1 | // Note: the run lines follow their respective tests, since line/column |
| 2 | // matter in this test. |
| 3 | |
| 4 | typedef 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 Gregor | 78edf51 | 2010-09-15 16:23:04 +0000 | [diff] [blame] | 25 | super selector:condition first:a second:b]; |
Douglas Gregor | 03d8aec | 2010-08-27 15:10:57 +0000 | [diff] [blame] | 26 | } |
| 27 | @end |
| 28 | |
Douglas Gregor | 78bcd91 | 2011-02-16 00:51:18 +0000 | [diff] [blame] | 29 | @interface A (Cat) |
| 30 | - (void)multiply:(int)x by:(int)y; |
| 31 | @end |
| 32 | |
| 33 | @interface C : A |
| 34 | @end |
| 35 | |
| 36 | @implementation C |
| 37 | - (void)multiply:(int)a by:(int)b { |
| 38 | [super multiply:a by:b]; |
| 39 | } |
| 40 | @end |
| 41 | |
Douglas Gregor | 03d8aec | 2010-08-27 15:10:57 +0000 | [diff] [blame] | 42 | // Check "super" completion as a message receiver. |
| 43 | // RUN: c-index-test -code-completion-at=%s:20:4 %s | FileCheck -check-prefix=CHECK-ADD-RECEIVER %s |
Douglas Gregor | 8ec904c | 2010-10-19 00:03:23 +0000 | [diff] [blame] | 44 | // CHECK-ADD-RECEIVER: ObjCInstanceMethodDecl:{ResultType void}{TypedText super}{HorizontalSpace }{Text add:}{Placeholder a}{HorizontalSpace }{Text to:}{Placeholder b} (20) |
Douglas Gregor | 03d8aec | 2010-08-27 15:10:57 +0000 | [diff] [blame] | 45 | |
| 46 | // RUN: c-index-test -code-completion-at=%s:24:4 %s | FileCheck -check-prefix=CHECK-SELECT-RECEIVER %s |
Douglas Gregor | 8ec904c | 2010-10-19 00:03:23 +0000 | [diff] [blame] | 47 | // 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 Gregor | 03d8aec | 2010-08-27 15:10:57 +0000 | [diff] [blame] | 48 | |
| 49 | // Check "super" completion at the first identifier |
| 50 | // RUN: c-index-test -code-completion-at=%s:20:10 %s | FileCheck -check-prefix=CHECK-ADD-ADD %s |
Douglas Gregor | 8ec904c | 2010-10-19 00:03:23 +0000 | [diff] [blame] | 51 | // CHECK-ADD-ADD: ObjCInstanceMethodDecl:{ResultType void}{TypedText add:}{Placeholder a}{HorizontalSpace }{Text to:}{Placeholder b} (20) |
Douglas Gregor | 03d8aec | 2010-08-27 15:10:57 +0000 | [diff] [blame] | 52 | // CHECK-ADD-ADD-NOT: add |
Douglas Gregor | 8ec904c | 2010-10-19 00:03:23 +0000 | [diff] [blame] | 53 | // CHECK-ADD-ADD: ObjCInstanceMethodDecl:{ResultType void}{TypedText last} (35) |
Douglas Gregor | 03d8aec | 2010-08-27 15:10:57 +0000 | [diff] [blame] | 54 | |
| 55 | // RUN: c-index-test -code-completion-at=%s:24:10 %s | FileCheck -check-prefix=CHECK-SELECTOR-SELECTOR %s |
Douglas Gregor | 5824b80 | 2013-01-30 06:58:39 +0000 | [diff] [blame] | 56 | // CHECK-SELECTOR-SELECTOR: ObjCInstanceMethodDecl:{ResultType void}{TypedText last} (35) |
Douglas Gregor | 8ec904c | 2010-10-19 00:03:23 +0000 | [diff] [blame] | 57 | // CHECK-SELECTOR-SELECTOR: ObjCClassMethodDecl:{ResultType void}{TypedText select:}{Placeholder condition}{HorizontalSpace }{Text first:}{Placeholder a}{HorizontalSpace }{Text second:}{Placeholder b} (20) |
Douglas Gregor | 03d8aec | 2010-08-27 15:10:57 +0000 | [diff] [blame] | 58 | |
| 59 | // Check "super" completion at the second identifier |
| 60 | // RUN: c-index-test -code-completion-at=%s:20:16 %s | FileCheck -check-prefix=CHECK-ADD-TO %s |
Douglas Gregor | 8ec904c | 2010-10-19 00:03:23 +0000 | [diff] [blame] | 61 | // CHECK-ADD-TO: ObjCInstanceMethodDecl:{ResultType void}{Informative add:}{TypedText to:}{Placeholder b} (20) |
Douglas Gregor | 03d8aec | 2010-08-27 15:10:57 +0000 | [diff] [blame] | 62 | |
| 63 | // RUN: c-index-test -code-completion-at=%s:24:28 %s | FileCheck -check-prefix=CHECK-SELECTOR-FIRST %s |
Douglas Gregor | 8ec904c | 2010-10-19 00:03:23 +0000 | [diff] [blame] | 64 | // CHECK-SELECTOR-FIRST: ObjCClassMethodDecl:{ResultType void}{Informative select:}{TypedText first:}{Placeholder a}{HorizontalSpace }{Text second:}{Placeholder b} (20) |
Douglas Gregor | 03d8aec | 2010-08-27 15:10:57 +0000 | [diff] [blame] | 65 | |
| 66 | // Check "super" completion at the third identifier |
| 67 | // RUN: c-index-test -code-completion-at=%s:24:37 %s | FileCheck -check-prefix=CHECK-SELECTOR-SECOND %s |
Douglas Gregor | 8ec904c | 2010-10-19 00:03:23 +0000 | [diff] [blame] | 68 | // CHECK-SELECTOR-SECOND: ObjCClassMethodDecl:{ResultType void}{Informative select:}{Informative first:}{TypedText second:}{Placeholder b} (20) |
Douglas Gregor | 78edf51 | 2010-09-15 16:23:04 +0000 | [diff] [blame] | 69 | |
| 70 | // Check "super" completion with missing '['. |
| 71 | // RUN: c-index-test -code-completion-at=%s:25:10 %s | FileCheck -check-prefix=CHECK-SELECTOR-SELECTOR %s |
| 72 | // RUN: c-index-test -code-completion-at=%s:25:28 %s | FileCheck -check-prefix=CHECK-SELECTOR-FIRST %s |
| 73 | // RUN: c-index-test -code-completion-at=%s:25:37 %s | FileCheck -check-prefix=CHECK-SELECTOR-SECOND %s |
Douglas Gregor | 78bcd91 | 2011-02-16 00:51:18 +0000 | [diff] [blame] | 74 | |
| 75 | // Check "super" completion for a method declared in a category. |
| 76 | // RUN: c-index-test -code-completion-at=%s:38:10 %s | FileCheck -check-prefix=CHECK-IN-CATEGORY %s |
| 77 | // CHECK-IN-CATEGORY: ObjCInstanceMethodDecl:{ResultType void}{TypedText add:}{Placeholder (int)}{HorizontalSpace }{TypedText to:}{Placeholder (int)} (35) |
| 78 | // CHECK-IN-CATEGORY: ObjCInstanceMethodDecl:{ResultType void}{TypedText last} (35) |
| 79 | // CHECK-IN-CATEGORY: ObjCInstanceMethodDecl:{ResultType void}{TypedText multiply:}{Placeholder a}{HorizontalSpace }{Text by:}{Placeholder b} (20) |
| 80 | |