Douglas Gregor | 9630eb6 | 2009-11-17 16:44:22 +0000 | [diff] [blame] | 1 | // Note: the run lines follow their respective tests, since line/column |
| 2 | // matter in this test. |
Douglas Gregor | aaa107a | 2010-08-23 23:51:41 +0000 | [diff] [blame] | 3 | #define nil (void*)0 |
Douglas Gregor | 9630eb6 | 2009-11-17 16:44:22 +0000 | [diff] [blame] | 4 | @protocol FooTestProtocol |
| 5 | + protocolClassMethod; |
| 6 | - protocolInstanceMethod : (int)value; |
| 7 | @end |
| 8 | @interface Foo <FooTestProtocol> { |
| 9 | void *isa; |
| 10 | } |
| 11 | + (int)classMethod1:a withKeyword:(int)b; |
| 12 | + (void)classMethod2; |
| 13 | + new; |
| 14 | - instanceMethod1; |
| 15 | @end |
| 16 | |
| 17 | @interface Foo (FooTestCategory) |
| 18 | + categoryClassMethod; |
| 19 | - categoryInstanceMethod; |
| 20 | @end |
| 21 | |
| 22 | void func() { |
| 23 | Foo *obj = [Foo new]; |
| 24 | [obj xx]; |
| 25 | } |
Douglas Gregor | 24a069f | 2009-11-17 17:59:40 +0000 | [diff] [blame] | 26 | |
| 27 | @interface MyClass { } |
| 28 | + (int)MyClassMethod:(id)obj; |
| 29 | - (int)MyInstMethod:(id)x second:(id)y; |
| 30 | @end |
| 31 | |
| 32 | @interface MySubClass : MyClass { } |
| 33 | + (int)MySubClassMethod; |
| 34 | - (int)MySubInstMethod; |
| 35 | @end |
| 36 | |
| 37 | @implementation MyClass |
| 38 | + (int)MyClassMethod:(id)obj { |
| 39 | return 0; |
| 40 | } |
| 41 | |
| 42 | + (int)MyPrivateMethod { |
| 43 | return 1; |
| 44 | } |
| 45 | |
| 46 | - (int)MyInstMethod:(id)x second:(id)y { |
| 47 | return 2; |
| 48 | } |
| 49 | |
| 50 | - (int)MyPrivateInstMethod { |
| 51 | return 3; |
| 52 | } |
| 53 | @end |
Douglas Gregor | 8e254cf | 2010-05-27 23:06:34 +0000 | [diff] [blame] | 54 | MyClass *getMyClass(); |
Douglas Gregor | 24a069f | 2009-11-17 17:59:40 +0000 | [diff] [blame] | 55 | @implementation MySubClass |
| 56 | + (int)MySubClassMethod { |
| 57 | return 2; |
| 58 | } |
| 59 | |
| 60 | + (int)MySubPrivateMethod { |
| 61 | return [super MyPrivateMethod]; |
| 62 | } |
| 63 | |
| 64 | - (int)MySubInstMethod:(id)obj { |
| 65 | return [super MyInstMethod: obj second:obj]; |
| 66 | } |
| 67 | |
| 68 | - (int)MyInstMethod:(id)x second:(id)y { |
| 69 | return 3; |
| 70 | } |
| 71 | @end |
| 72 | |
| 73 | void test_super_var(MySubClass *super) { |
| 74 | [super MyInstMethod: super second:super]; |
| 75 | } |
| 76 | |
Douglas Gregor | f74a419 | 2009-11-18 00:06:18 +0000 | [diff] [blame] | 77 | @protocol FooTestProtocol2 |
| 78 | - (int)secondProtocolInstanceMethod; |
| 79 | @end |
| 80 | |
| 81 | void test_qual_id(id<FooTestProtocol,FooTestProtocol2> ptr) { |
| 82 | [ptr protocolInstanceMethod:1]; |
| 83 | } |
| 84 | |
Douglas Gregor | d3c6854 | 2009-11-19 01:08:35 +0000 | [diff] [blame] | 85 | @interface Overload |
| 86 | - (int)Method:(int)i; |
| 87 | - (int)Method; |
| 88 | - (int)Method:(float)f Arg1:(int)i1 Arg2:(int)i2; |
| 89 | - (int)Method:(float)f Arg1:(int)i1 OtherArg:(id)obj; |
| 90 | - (int)Method:(float)f SomeArg:(int)i1 OtherArg:(id)obj; |
| 91 | - (int)OtherMethod:(float)f Arg1:(int)i1 Arg2:(int)i2; |
| 92 | @end |
| 93 | |
| 94 | void test_overload(Overload *ovl) { |
| 95 | [ovl Method:1 Arg1:1 OtherArg:ovl]; |
| 96 | } |
| 97 | |
Douglas Gregor | 2a17af0 | 2009-12-23 00:21:46 +0000 | [diff] [blame] | 98 | @interface Ellipsis |
Douglas Gregor | aaa107a | 2010-08-23 23:51:41 +0000 | [diff] [blame] | 99 | - (int)Method:(int)i, ...; |
| 100 | - (int)SentinelMethod:(int)i, ... __attribute__((sentinel(0,1))); |
Douglas Gregor | 2a17af0 | 2009-12-23 00:21:46 +0000 | [diff] [blame] | 101 | @end |
Douglas Gregor | 2a17af0 | 2009-12-23 00:21:46 +0000 | [diff] [blame] | 102 | void f(Ellipsis *e) { |
| 103 | [e Method:1, 2, 3]; |
| 104 | } |
| 105 | |
Douglas Gregor | 85372b9 | 2010-04-06 15:27:03 +0000 | [diff] [blame] | 106 | @interface Overload2 |
| 107 | + (int)Method:(int)i; |
| 108 | + (int)Method; |
| 109 | + (int)Method:(float)f Arg1:(int)i1 Arg2:(int)i2; |
| 110 | + (int)Method:(float)f Arg1:(int)i1 OtherArg:(id)obj; |
| 111 | + (int)Method:(float)f SomeArg:(int)i1 OtherArg:(id)obj; |
| 112 | + (int)OtherMethod:(float)f Arg1:(int)i1 Arg2:(int)i2; |
| 113 | @end |
| 114 | |
| 115 | void test_overload2(void) { |
| 116 | [Overload2 Method:1 Arg1:1 OtherArg:ovl]; |
| 117 | } |
| 118 | |
Douglas Gregor | 13438f9 | 2010-04-06 16:40:00 +0000 | [diff] [blame] | 119 | void msg_id(id x) { |
| 120 | [x Method:1 Arg1:1 OtherArg:ovl]; |
| 121 | [[x blarg] Method:1 Arg1:1 OtherArg:ovl]; |
| 122 | [id Method:1 Arg1:1 OtherArg:ovl]; |
| 123 | } |
| 124 | |
Douglas Gregor | 408be5a | 2010-08-25 01:08:01 +0000 | [diff] [blame] | 125 | @interface A |
| 126 | - (void)method1; |
| 127 | @end |
| 128 | |
| 129 | @interface B : A |
| 130 | - (void)method2; |
| 131 | @end |
| 132 | |
| 133 | void test_ranking(B *b) { |
| 134 | [b method1]; |
Douglas Gregor | 78edf51 | 2010-09-15 16:23:04 +0000 | [diff] [blame] | 135 | b method1]; |
| 136 | } |
| 137 | |
Douglas Gregor | 77328d1 | 2010-09-15 23:19:31 +0000 | [diff] [blame] | 138 | void test_overload3(Overload *ovl) { |
Douglas Gregor | 78edf51 | 2010-09-15 16:23:04 +0000 | [diff] [blame] | 139 | ovl Method:1 Arg1:1 OtherArg:ovl]; |
Douglas Gregor | c7b6d88 | 2010-09-16 15:14:18 +0000 | [diff] [blame] | 140 | Overload2 Method:1 Arg1:1 OtherArg:ovl]; |
| 141 | (Overload2 Method:1 Arg1:1 OtherArg:ovl]); |
Douglas Gregor | 408be5a | 2010-08-25 01:08:01 +0000 | [diff] [blame] | 142 | } |
| 143 | |
Douglas Gregor | d36adf5 | 2010-09-16 16:06:31 +0000 | [diff] [blame] | 144 | @interface C : B |
| 145 | - (void)method2; |
| 146 | - (void)method3; |
| 147 | @end |
| 148 | |
| 149 | void test_redundancy(C *c) { |
| 150 | [c method2]; |
| 151 | }; |
| 152 | |
Douglas Gregor | da89264 | 2010-11-08 21:12:30 +0000 | [diff] [blame] | 153 | @protocol P |
| 154 | - (Class)class; |
| 155 | @end |
| 156 | |
| 157 | @interface A () <P> |
| 158 | @end |
| 159 | |
| 160 | @interface A () |
| 161 | + (void)class_method3; |
| 162 | @end |
| 163 | |
| 164 | @interface A (Cat) |
| 165 | + (void)class_method4; |
| 166 | @end |
| 167 | |
| 168 | @implementation A |
| 169 | - (void)method5:(A*)a { |
| 170 | [[self class] class_method4]; |
| 171 | } |
| 172 | @end |
| 173 | |
Douglas Gregor | 97d7ff0 | 2011-02-15 19:17:31 +0000 | [diff] [blame] | 174 | void test_missing_open_more() { |
| 175 | A *a = A class_method3]; |
| 176 | } |
| 177 | |
Douglas Gregor | 3e64d56 | 2011-04-14 20:33:34 +0000 | [diff] [blame] | 178 | void test_block_invoke(A *(^block1)(int), |
| 179 | int (^block2)(int), |
| 180 | id (^block3)(int)) { |
| 181 | [block1(5) init]; |
| 182 | } |
| 183 | |
Douglas Gregor | 6fa14dd | 2011-07-30 07:55:26 +0000 | [diff] [blame] | 184 | @interface DO |
| 185 | - (void)method:(in bycopy A*)ain result:(out byref A**)aout; |
| 186 | @end |
| 187 | |
| 188 | void test_DO(DO *d, A* a) { |
| 189 | [d method:a aout:&a]; |
| 190 | } |
| 191 | |
Douglas Gregor | 9630eb6 | 2009-11-17 16:44:22 +0000 | [diff] [blame] | 192 | // RUN: c-index-test -code-completion-at=%s:23:19 %s | FileCheck -check-prefix=CHECK-CC1 %s |
| 193 | // CHECK-CC1: {TypedText categoryClassMethod} |
Douglas Gregor | c7b7b7a | 2010-10-18 21:05:04 +0000 | [diff] [blame] | 194 | // CHECK-CC1: {TypedText classMethod1:}{Placeholder (id)}{HorizontalSpace }{TypedText withKeyword:}{Placeholder (int)} |
Douglas Gregor | 9630eb6 | 2009-11-17 16:44:22 +0000 | [diff] [blame] | 195 | // CHECK-CC1: {TypedText classMethod2} |
| 196 | // CHECK-CC1: {TypedText new} |
| 197 | // CHECK-CC1: {TypedText protocolClassMethod} |
Douglas Gregor | e081a61 | 2011-07-21 01:05:26 +0000 | [diff] [blame] | 198 | // CHECK-CC1: Completion contexts: |
| 199 | // CHECK-CC1-NEXT: Objective-C class method |
| 200 | // CHECK-CC1-NEXT: Container Kind: ObjCInterfaceDecl |
| 201 | // CHECK-CC1-NEXT: Container is complete |
| 202 | // CHECK-CC1-NEXT: Container USR: c:objc(cs)Foo |
Douglas Gregor | 9630eb6 | 2009-11-17 16:44:22 +0000 | [diff] [blame] | 203 | // RUN: c-index-test -code-completion-at=%s:24:8 %s | FileCheck -check-prefix=CHECK-CC2 %s |
| 204 | // CHECK-CC2: {TypedText categoryInstanceMethod} |
| 205 | // CHECK-CC2: {TypedText instanceMethod1} |
Douglas Gregor | aba4808 | 2010-08-29 19:47:46 +0000 | [diff] [blame] | 206 | // CHECK-CC2: {TypedText protocolInstanceMethod:}{Placeholder (int)} |
Douglas Gregor | e081a61 | 2011-07-21 01:05:26 +0000 | [diff] [blame] | 207 | // CHECK-CC2: Completion contexts: |
| 208 | // CHECK-CC2-NEXT: Objective-C instance method |
| 209 | // CHECK-CC2-NEXT: Container Kind: ObjCInterfaceDecl |
| 210 | // CHECK-CC2-NEXT: Container is complete |
| 211 | // CHECK-CC2-NEXT: Container USR: c:objc(cs)Foo |
Douglas Gregor | 24a069f | 2009-11-17 17:59:40 +0000 | [diff] [blame] | 212 | // RUN: c-index-test -code-completion-at=%s:61:16 %s | FileCheck -check-prefix=CHECK-CC3 %s |
Douglas Gregor | aba4808 | 2010-08-29 19:47:46 +0000 | [diff] [blame] | 213 | // CHECK-CC3: ObjCClassMethodDecl:{ResultType int}{TypedText MyClassMethod:}{Placeholder (id)} |
Douglas Gregor | ff5ce6e | 2009-12-18 18:53:37 +0000 | [diff] [blame] | 214 | // CHECK-CC3: ObjCClassMethodDecl:{ResultType int}{TypedText MyPrivateMethod} |
Douglas Gregor | 24a069f | 2009-11-17 17:59:40 +0000 | [diff] [blame] | 215 | // RUN: c-index-test -code-completion-at=%s:65:16 %s | FileCheck -check-prefix=CHECK-CC4 %s |
Douglas Gregor | c7b7b7a | 2010-10-18 21:05:04 +0000 | [diff] [blame] | 216 | // CHECK-CC4: ObjCInstanceMethodDecl:{ResultType int}{TypedText MyInstMethod:}{Placeholder (id)}{HorizontalSpace }{TypedText second:}{Placeholder (id)} |
Douglas Gregor | ff5ce6e | 2009-12-18 18:53:37 +0000 | [diff] [blame] | 217 | // CHECK-CC4: ObjCInstanceMethodDecl:{ResultType int}{TypedText MyPrivateInstMethod} |
Douglas Gregor | 24a069f | 2009-11-17 17:59:40 +0000 | [diff] [blame] | 218 | // RUN: c-index-test -code-completion-at=%s:74:9 %s | FileCheck -check-prefix=CHECK-CC5 %s |
Douglas Gregor | c7b7b7a | 2010-10-18 21:05:04 +0000 | [diff] [blame] | 219 | // CHECK-CC5: ObjCInstanceMethodDecl:{ResultType int}{TypedText MyInstMethod:}{Placeholder (id)}{HorizontalSpace }{TypedText second:}{Placeholder (id)} |
Douglas Gregor | ff5ce6e | 2009-12-18 18:53:37 +0000 | [diff] [blame] | 220 | // CHECK-CC5: ObjCInstanceMethodDecl:{ResultType int}{TypedText MySubInstMethod} |
Douglas Gregor | f74a419 | 2009-11-18 00:06:18 +0000 | [diff] [blame] | 221 | // RUN: c-index-test -code-completion-at=%s:82:8 %s | FileCheck -check-prefix=CHECK-CC6 %s |
Douglas Gregor | aba4808 | 2010-08-29 19:47:46 +0000 | [diff] [blame] | 222 | // CHECK-CC6: ObjCInstanceMethodDecl:{ResultType id}{TypedText protocolInstanceMethod:}{Placeholder (int)} |
Douglas Gregor | ff5ce6e | 2009-12-18 18:53:37 +0000 | [diff] [blame] | 223 | // CHECK-CC6: ObjCInstanceMethodDecl:{ResultType int}{TypedText secondProtocolInstanceMethod} |
Douglas Gregor | d3c6854 | 2009-11-19 01:08:35 +0000 | [diff] [blame] | 224 | // RUN: c-index-test -code-completion-at=%s:95:8 %s | FileCheck -check-prefix=CHECK-CC7 %s |
Douglas Gregor | ff5ce6e | 2009-12-18 18:53:37 +0000 | [diff] [blame] | 225 | // CHECK-CC7: ObjCInstanceMethodDecl:{ResultType int}{TypedText Method} |
Douglas Gregor | aba4808 | 2010-08-29 19:47:46 +0000 | [diff] [blame] | 226 | // CHECK-CC7: ObjCInstanceMethodDecl:{ResultType int}{TypedText Method:}{Placeholder (int)} |
Douglas Gregor | c7b7b7a | 2010-10-18 21:05:04 +0000 | [diff] [blame] | 227 | // CHECK-CC7: ObjCInstanceMethodDecl:{ResultType int}{TypedText Method:}{Placeholder (float)}{HorizontalSpace }{TypedText Arg1:}{Placeholder (int)}{HorizontalSpace }{TypedText Arg2:}{Placeholder (int)} |
| 228 | // CHECK-CC7: ObjCInstanceMethodDecl:{ResultType int}{TypedText Method:}{Placeholder (float)}{HorizontalSpace }{TypedText Arg1:}{Placeholder (int)}{HorizontalSpace }{TypedText OtherArg:}{Placeholder (id)} |
| 229 | // CHECK-CC7: ObjCInstanceMethodDecl:{ResultType int}{TypedText Method:}{Placeholder (float)}{HorizontalSpace }{TypedText SomeArg:}{Placeholder (int)}{HorizontalSpace }{TypedText OtherArg:}{Placeholder (id)} |
| 230 | // CHECK-CC7: ObjCInstanceMethodDecl:{ResultType int}{TypedText OtherMethod:}{Placeholder (float)}{HorizontalSpace }{TypedText Arg1:}{Placeholder (int)}{HorizontalSpace }{TypedText Arg2:}{Placeholder (int)} |
Douglas Gregor | d3c6854 | 2009-11-19 01:08:35 +0000 | [diff] [blame] | 231 | // RUN: c-index-test -code-completion-at=%s:95:17 %s | FileCheck -check-prefix=CHECK-CC8 %s |
Douglas Gregor | c7b7b7a | 2010-10-18 21:05:04 +0000 | [diff] [blame] | 232 | // CHECK-CC8: ObjCInstanceMethodDecl:{ResultType int}{Informative Method:}{TypedText Arg1:}{Placeholder (int)}{HorizontalSpace }{TypedText Arg2:}{Placeholder (int)} |
| 233 | // CHECK-CC8: ObjCInstanceMethodDecl:{ResultType int}{Informative Method:}{TypedText Arg1:}{Placeholder (int)}{HorizontalSpace }{TypedText OtherArg:}{Placeholder (id)} |
| 234 | // CHECK-CC8: ObjCInstanceMethodDecl:{ResultType int}{Informative Method:}{TypedText SomeArg:}{Placeholder (int)}{HorizontalSpace }{TypedText OtherArg:}{Placeholder (id)} |
Douglas Gregor | cf54426 | 2010-11-17 21:36:08 +0000 | [diff] [blame] | 235 | // CHECK-CC8-NOT: ObjCInstanceMethodDecl:{ResultType int}{Informative Method:}{TypedText } |
Douglas Gregor | d3c6854 | 2009-11-19 01:08:35 +0000 | [diff] [blame] | 236 | // RUN: c-index-test -code-completion-at=%s:95:24 %s | FileCheck -check-prefix=CHECK-CC9 %s |
Douglas Gregor | aba4808 | 2010-08-29 19:47:46 +0000 | [diff] [blame] | 237 | // CHECK-CC9: ObjCInstanceMethodDecl:{ResultType int}{Informative Method:}{Informative Arg1:}{TypedText Arg2:}{Placeholder (int)} |
| 238 | // CHECK-CC9: ObjCInstanceMethodDecl:{ResultType int}{Informative Method:}{Informative Arg1:}{TypedText OtherArg:}{Placeholder (id)} |
Douglas Gregor | 0a47d69 | 2011-07-26 15:24:30 +0000 | [diff] [blame] | 239 | // CHECK-CC9: Objective-C selector: Method:Arg1: |
Douglas Gregor | 2a7925c | 2009-12-07 09:54:55 +0000 | [diff] [blame] | 240 | // RUN: c-index-test -code-completion-at=%s:61:11 %s | FileCheck -check-prefix=CHECK-CCA %s |
Douglas Gregor | 2a7925c | 2009-12-07 09:54:55 +0000 | [diff] [blame] | 241 | // CHECK-CCA: TypedefDecl:{TypedText Class} |
Douglas Gregor | 8e254cf | 2010-05-27 23:06:34 +0000 | [diff] [blame] | 242 | // CHECK-CCA-NEXT: ObjCInterfaceDecl:{TypedText Foo} |
| 243 | // CHECK-CCA-NOT: FunctionDecl:{ResultType void}{TypedText func}{LeftParen (}{RightParen )} |
| 244 | // CHECK-CCA:FunctionDecl:{ResultType MyClass *}{TypedText getMyClass}{LeftParen (}{RightParen )} |
Douglas Gregor | 2a7925c | 2009-12-07 09:54:55 +0000 | [diff] [blame] | 245 | // CHECK-CCA: TypedefDecl:{TypedText id} |
| 246 | // CHECK-CCA: ObjCInterfaceDecl:{TypedText MyClass} |
| 247 | // CHECK-CCA: ObjCInterfaceDecl:{TypedText MySubClass} |
Douglas Gregor | ab0b4f1 | 2010-01-13 23:24:38 +0000 | [diff] [blame] | 248 | // CHECK-CCA: {ResultType Class}{TypedText self} |
Douglas Gregor | 2a7925c | 2009-12-07 09:54:55 +0000 | [diff] [blame] | 249 | // CHECK-CCA: {TypedText super} |
Douglas Gregor | 2a17af0 | 2009-12-23 00:21:46 +0000 | [diff] [blame] | 250 | // RUN: c-index-test -code-completion-at=%s:103:6 %s | FileCheck -check-prefix=CHECK-CCB %s |
Douglas Gregor | e17794f | 2010-08-31 05:13:43 +0000 | [diff] [blame] | 251 | // CHECK-CCB: ObjCInstanceMethodDecl:{ResultType int}{TypedText Method:}{Placeholder (int), ...} |
| 252 | // CHECK-CCB: ObjCInstanceMethodDecl:{ResultType int}{TypedText SentinelMethod:}{Placeholder (int), ...}{Text , nil} |
Douglas Gregor | 85372b9 | 2010-04-06 15:27:03 +0000 | [diff] [blame] | 253 | // RUN: c-index-test -code-completion-at=%s:116:14 %s | FileCheck -check-prefix=CHECK-CCC %s |
| 254 | // CHECK-CCC: ObjCClassMethodDecl:{ResultType int}{TypedText Method} |
Douglas Gregor | aba4808 | 2010-08-29 19:47:46 +0000 | [diff] [blame] | 255 | // CHECK-CCC: ObjCClassMethodDecl:{ResultType int}{TypedText Method:}{Placeholder (int)} |
Douglas Gregor | c7b7b7a | 2010-10-18 21:05:04 +0000 | [diff] [blame] | 256 | // CHECK-CCC: ObjCClassMethodDecl:{ResultType int}{TypedText Method:}{Placeholder (float)}{HorizontalSpace }{TypedText Arg1:}{Placeholder (int)}{HorizontalSpace }{TypedText Arg2:}{Placeholder (int)} |
| 257 | // CHECK-CCC: ObjCClassMethodDecl:{ResultType int}{TypedText Method:}{Placeholder (float)}{HorizontalSpace }{TypedText Arg1:}{Placeholder (int)}{HorizontalSpace }{TypedText OtherArg:}{Placeholder (id)} |
| 258 | // CHECK-CCC: ObjCClassMethodDecl:{ResultType int}{TypedText Method:}{Placeholder (float)}{HorizontalSpace }{TypedText SomeArg:}{Placeholder (int)}{HorizontalSpace }{TypedText OtherArg:}{Placeholder (id)} |
| 259 | // CHECK-CCC: ObjCClassMethodDecl:{ResultType int}{TypedText OtherMethod:}{Placeholder (float)}{HorizontalSpace }{TypedText Arg1:}{Placeholder (int)}{HorizontalSpace }{TypedText Arg2:}{Placeholder (int)} |
Douglas Gregor | 85372b9 | 2010-04-06 15:27:03 +0000 | [diff] [blame] | 260 | // RUN: c-index-test -code-completion-at=%s:116:23 %s | FileCheck -check-prefix=CHECK-CCD %s |
Douglas Gregor | c7b7b7a | 2010-10-18 21:05:04 +0000 | [diff] [blame] | 261 | // CHECK-CCD: ObjCClassMethodDecl:{ResultType int}{Informative Method:}{TypedText Arg1:}{Placeholder (int)}{HorizontalSpace }{TypedText Arg2:}{Placeholder (int)} |
| 262 | // CHECK-CCD: ObjCClassMethodDecl:{ResultType int}{Informative Method:}{TypedText Arg1:}{Placeholder (int)}{HorizontalSpace }{TypedText OtherArg:}{Placeholder (id)} |
| 263 | // CHECK-CCD: ObjCClassMethodDecl:{ResultType int}{Informative Method:}{TypedText SomeArg:}{Placeholder (int)}{HorizontalSpace }{TypedText OtherArg:}{Placeholder (id)} |
Douglas Gregor | cf54426 | 2010-11-17 21:36:08 +0000 | [diff] [blame] | 264 | // CHECK-CCD-NOT: ObjCClassMethodDecl:{ResultType int}{Informative Method:}{TypedText } |
Douglas Gregor | 0a47d69 | 2011-07-26 15:24:30 +0000 | [diff] [blame] | 265 | // CHECK-CCD: Objective-C selector: Method: |
Douglas Gregor | 85372b9 | 2010-04-06 15:27:03 +0000 | [diff] [blame] | 266 | // RUN: c-index-test -code-completion-at=%s:116:30 %s | FileCheck -check-prefix=CHECK-CCE %s |
Douglas Gregor | aba4808 | 2010-08-29 19:47:46 +0000 | [diff] [blame] | 267 | // CHECK-CCE: ObjCClassMethodDecl:{ResultType int}{Informative Method:}{Informative Arg1:}{TypedText Arg2:}{Placeholder (int)} |
| 268 | // CHECK-CCE: ObjCClassMethodDecl:{ResultType int}{Informative Method:}{Informative Arg1:}{TypedText OtherArg:}{Placeholder (id)} |
Douglas Gregor | 85372b9 | 2010-04-06 15:27:03 +0000 | [diff] [blame] | 269 | // RUN: c-index-test -code-completion-at=%s:61:11 %s | FileCheck -check-prefix=CHECK-CCF %s |
Douglas Gregor | 85372b9 | 2010-04-06 15:27:03 +0000 | [diff] [blame] | 270 | // CHECK-CCF: TypedefDecl:{TypedText Class} |
| 271 | // CHECK-CCF: ObjCInterfaceDecl:{TypedText Foo} |
Douglas Gregor | 8e254cf | 2010-05-27 23:06:34 +0000 | [diff] [blame] | 272 | // CHECK-CCF-NOT: FunctionDecl:{ResultType void}{TypedText func}{LeftParen (}{RightParen )} |
Douglas Gregor | 85372b9 | 2010-04-06 15:27:03 +0000 | [diff] [blame] | 273 | // CHECK-CCF: TypedefDecl:{TypedText id} |
| 274 | // CHECK-CCF: ObjCInterfaceDecl:{TypedText MyClass} |
| 275 | // CHECK-CCF: ObjCInterfaceDecl:{TypedText MySubClass} |
Douglas Gregor | 85372b9 | 2010-04-06 15:27:03 +0000 | [diff] [blame] | 276 | // CHECK-CCF: {ResultType Class}{TypedText self} |
| 277 | // CHECK-CCF: {TypedText super} |
Douglas Gregor | 13438f9 | 2010-04-06 16:40:00 +0000 | [diff] [blame] | 278 | // RUN: c-index-test -code-completion-at=%s:120:6 %s | FileCheck -check-prefix=CHECK-CCG %s |
Douglas Gregor | 9214819 | 2010-08-26 00:30:24 +0000 | [diff] [blame] | 279 | // CHECK-CCG: ObjCInstanceMethodDecl:{ResultType id}{TypedText categoryInstanceMethod} |
| 280 | // CHECK-CCG: ObjCInstanceMethodDecl:{ResultType id}{TypedText instanceMethod1} |
| 281 | // CHECK-CCG: ObjCInstanceMethodDecl:{ResultType int}{TypedText Method} |
Douglas Gregor | c7b7b7a | 2010-10-18 21:05:04 +0000 | [diff] [blame] | 282 | // CHECK-CCG: ObjCInstanceMethodDecl:{ResultType int}{TypedText MyInstMethod:}{Placeholder (id)}{HorizontalSpace }{TypedText second:}{Placeholder (id)} |
Douglas Gregor | 9214819 | 2010-08-26 00:30:24 +0000 | [diff] [blame] | 283 | // CHECK-CCG: ObjCInstanceMethodDecl:{ResultType int}{TypedText MyPrivateInstMethod} |
| 284 | // CHECK-CCG: ObjCInstanceMethodDecl:{ResultType int}{TypedText MySubInstMethod} |
Douglas Gregor | aba4808 | 2010-08-29 19:47:46 +0000 | [diff] [blame] | 285 | // CHECK-CCG: ObjCInstanceMethodDecl:{ResultType id}{TypedText protocolInstanceMethod:}{Placeholder (int)} |
Douglas Gregor | 9214819 | 2010-08-26 00:30:24 +0000 | [diff] [blame] | 286 | // CHECK-CCG: ObjCInstanceMethodDecl:{ResultType int}{TypedText secondProtocolInstanceMethod} |
Douglas Gregor | 13438f9 | 2010-04-06 16:40:00 +0000 | [diff] [blame] | 287 | // RUN: c-index-test -code-completion-at=%s:121:14 %s | FileCheck -check-prefix=CHECK-CCG %s |
| 288 | // RUN: c-index-test -code-completion-at=%s:122:7 %s | FileCheck -check-prefix=CHECK-CCH %s |
| 289 | // CHECK-CCH: ObjCClassMethodDecl:{ResultType id}{TypedText categoryClassMethod} |
Douglas Gregor | c7b7b7a | 2010-10-18 21:05:04 +0000 | [diff] [blame] | 290 | // CHECK-CCH: ObjCClassMethodDecl:{ResultType int}{TypedText classMethod1:}{Placeholder (id)}{HorizontalSpace }{TypedText withKeyword:}{Placeholder (int)} |
Douglas Gregor | 13438f9 | 2010-04-06 16:40:00 +0000 | [diff] [blame] | 291 | // CHECK-CCH: ObjCClassMethodDecl:{ResultType void}{TypedText classMethod2} |
| 292 | // CHECK-CCH: ObjCClassMethodDecl:{ResultType int}{TypedText Method} |
Douglas Gregor | aba4808 | 2010-08-29 19:47:46 +0000 | [diff] [blame] | 293 | // CHECK-CCH: ObjCClassMethodDecl:{ResultType int}{TypedText Method:}{Placeholder (int)} |
| 294 | // CHECK-CCH: ObjCClassMethodDecl:{ResultType int}{TypedText MyClassMethod:}{Placeholder (id)} |
Douglas Gregor | 13438f9 | 2010-04-06 16:40:00 +0000 | [diff] [blame] | 295 | // CHECK-CCH: ObjCClassMethodDecl:{ResultType int}{TypedText MyPrivateMethod} |
| 296 | // CHECK-CCH: ObjCClassMethodDecl:{ResultType int}{TypedText MySubClassMethod} |
| 297 | // CHECK-CCH: ObjCClassMethodDecl:{ResultType int}{TypedText MySubPrivateMethod} |
| 298 | // CHECK-CCH: ObjCClassMethodDecl:{ResultType id}{TypedText new} |
Douglas Gregor | c7b7b7a | 2010-10-18 21:05:04 +0000 | [diff] [blame] | 299 | // CHECK-CCH: ObjCClassMethodDecl:{ResultType int}{TypedText OtherMethod:}{Placeholder (float)}{HorizontalSpace }{TypedText Arg1:}{Placeholder (int)}{HorizontalSpace }{TypedText Arg2:}{Placeholder (int)} |
Douglas Gregor | 13438f9 | 2010-04-06 16:40:00 +0000 | [diff] [blame] | 300 | // CHECK-CCH: ObjCClassMethodDecl:{ResultType id}{TypedText protocolClassMethod} |
Douglas Gregor | 408be5a | 2010-08-25 01:08:01 +0000 | [diff] [blame] | 301 | // RUN: c-index-test -code-completion-at=%s:134:6 %s | FileCheck -check-prefix=CHECK-CCI %s |
Douglas Gregor | 8ec904c | 2010-10-19 00:03:23 +0000 | [diff] [blame] | 302 | // CHECK-CCI: ObjCInstanceMethodDecl:{ResultType void}{TypedText method1} (37) |
| 303 | // CHECK-CCI: ObjCInstanceMethodDecl:{ResultType void}{TypedText method2} (35) |
Douglas Gregor | 78edf51 | 2010-09-15 16:23:04 +0000 | [diff] [blame] | 304 | |
Douglas Gregor | d36adf5 | 2010-09-16 16:06:31 +0000 | [diff] [blame] | 305 | // RUN: c-index-test -code-completion-at=%s:150:5 %s | FileCheck -check-prefix=CHECK-REDUNDANT %s |
Douglas Gregor | 8ec904c | 2010-10-19 00:03:23 +0000 | [diff] [blame] | 306 | // CHECK-REDUNDANT: ObjCInstanceMethodDecl:{ResultType void}{TypedText method2} (35) |
Douglas Gregor | d36adf5 | 2010-09-16 16:06:31 +0000 | [diff] [blame] | 307 | // CHECK-REDUNDANT-NOT: ObjCInstanceMethodDecl:{ResultType void}{TypedText method2} |
Douglas Gregor | 8ec904c | 2010-10-19 00:03:23 +0000 | [diff] [blame] | 308 | // CHECK-REDUNDANT: ObjCInstanceMethodDecl:{ResultType void}{TypedText method3} (35) |
Douglas Gregor | d36adf5 | 2010-09-16 16:06:31 +0000 | [diff] [blame] | 309 | |
Douglas Gregor | da89264 | 2010-11-08 21:12:30 +0000 | [diff] [blame] | 310 | // RUN: c-index-test -code-completion-at=%s:170:16 %s | FileCheck -check-prefix=CHECK-CLASS-RESULT %s |
| 311 | // CHECK-CLASS-RESULT: ObjCClassMethodDecl:{ResultType void}{TypedText class_method3} (35) |
| 312 | // CHECK-CLASS-RESULT: ObjCClassMethodDecl:{ResultType void}{TypedText class_method4} (35) |
| 313 | |
Douglas Gregor | 3e64d56 | 2011-04-14 20:33:34 +0000 | [diff] [blame] | 314 | // RUN: c-index-test -code-completion-at=%s:181:4 %s | FileCheck -check-prefix=CHECK-BLOCK-RECEIVER %s |
| 315 | // CHECK-BLOCK-RECEIVER: ObjCInterfaceDecl:{TypedText A} (50) |
| 316 | // CHECK-BLOCK-RECEIVER: ObjCInterfaceDecl:{TypedText B} (50) |
| 317 | // CHECK-BLOCK-RECEIVER: ParmDecl:{ResultType A *(^)(int)}{TypedText block1} (34) |
| 318 | // CHECK-BLOCK-RECEIVER-NEXT: ParmDecl:{ResultType id (^)(int)}{TypedText block3} (34) |
| 319 | |
Douglas Gregor | 78edf51 | 2010-09-15 16:23:04 +0000 | [diff] [blame] | 320 | // Test code completion with a missing opening bracket: |
| 321 | // RUN: c-index-test -code-completion-at=%s:135:5 %s | FileCheck -check-prefix=CHECK-CCI %s |
| 322 | // RUN: c-index-test -code-completion-at=%s:139:7 %s | FileCheck -check-prefix=CHECK-CC7 %s |
| 323 | // RUN: c-index-test -code-completion-at=%s:139:16 %s | FileCheck -check-prefix=CHECK-CC8 %s |
| 324 | // RUN: c-index-test -code-completion-at=%s:139:23 %s | FileCheck -check-prefix=CHECK-CC9 %s |
Douglas Gregor | c7b6d88 | 2010-09-16 15:14:18 +0000 | [diff] [blame] | 325 | |
| 326 | // RUN: c-index-test -code-completion-at=%s:140:14 %s | FileCheck -check-prefix=CHECK-CCC %s |
| 327 | // RUN: c-index-test -code-completion-at=%s:140:23 %s | FileCheck -check-prefix=CHECK-CCD %s |
| 328 | // RUN: c-index-test -code-completion-at=%s:140:30 %s | FileCheck -check-prefix=CHECK-CCE %s |
| 329 | // RUN: c-index-test -code-completion-at=%s:141:14 %s | FileCheck -check-prefix=CHECK-CCC %s |
| 330 | // RUN: c-index-test -code-completion-at=%s:141:23 %s | FileCheck -check-prefix=CHECK-CCD %s |
| 331 | // RUN: c-index-test -code-completion-at=%s:141:30 %s | FileCheck -check-prefix=CHECK-CCE %s |
Douglas Gregor | da89264 | 2010-11-08 21:12:30 +0000 | [diff] [blame] | 332 | |
Douglas Gregor | 97d7ff0 | 2011-02-15 19:17:31 +0000 | [diff] [blame] | 333 | // RUN: c-index-test -code-completion-at=%s:175:12 %s | FileCheck -check-prefix=CHECK-CLASS-RESULT %s |
Douglas Gregor | 6fa14dd | 2011-07-30 07:55:26 +0000 | [diff] [blame] | 334 | |
| 335 | // RUN: c-index-test -code-completion-at=%s:189:6 %s | FileCheck -check-prefix=CHECK-DISTRIB-OBJECTS %s |
Douglas Gregor | 6ef9209 | 2011-11-09 02:13:45 +0000 | [diff] [blame] | 336 | // CHECK-DISTRIB-OBJECTS: ObjCInstanceMethodDecl:{ResultType void}{TypedText method:}{Placeholder (in bycopy A *)}{HorizontalSpace }{TypedText result:}{Placeholder (out byref A **)} (35) |