blob: c7d273ac1ef799d885c716dc46f56635e7a673fc [file] [log] [blame]
Douglas Gregorc3425b12015-07-07 06:20:19 +00001@protocol NSObject
2@end
3
4@interface NSObject
5@end
6
7@interface Test<T : id, U : NSObject *> : NSObject
8{
9@public
10 U myVar;
11}
12-(U)getit:(T)val;
13-(void)apply:(void(^)(T, U))block;
Douglas Gregor9b7b3e92015-07-07 06:20:27 +000014-(void)apply2:(void(^_Nonnull)(T, U))block;
Douglas Gregorc3425b12015-07-07 06:20:19 +000015
16@property (strong) T prop;
17@end
18
19@interface MyClsA : NSObject
20@end
21@interface MyClsB : NSObject
22@end
23
24void test1(Test<MyClsA*, MyClsB*> *obj) {
25 [obj ];
26 obj.;
27 obj->;
28}
29
30void test2(Test *obj) {
31 [obj ];
32 obj.;
33 obj->;
34}
35
Douglas Gregor9b7b3e92015-07-07 06:20:27 +000036@implementation Test
37-(id)getit:(id)val {}
38@end
39
Douglas Gregor4c850f32015-07-07 06:20:22 +000040// RUN: c-index-test -code-completion-at=%s:25:8 %s | FileCheck -check-prefix=CHECK-CC0 %s
41// CHECK-CC0: ObjCInstanceMethodDecl:{ResultType void}{TypedText apply2:}{Placeholder ^(MyClsA *, MyClsB *)block} (35)
Douglas Gregorc3425b12015-07-07 06:20:19 +000042// CHECK-CC0: ObjCInstanceMethodDecl:{ResultType void}{TypedText apply:}{Placeholder ^(MyClsA *, MyClsB *)block} (35)
43// CHECK-CC0: ObjCInstanceMethodDecl:{ResultType MyClsB *}{TypedText getit:}{Placeholder (MyClsA *)} (35)
44
Douglas Gregor4c850f32015-07-07 06:20:22 +000045// RUN: c-index-test -code-completion-at=%s:26:7 %s | FileCheck -check-prefix=CHECK-CC1 %s
Douglas Gregorc3425b12015-07-07 06:20:19 +000046// CHECK-CC1: ObjCPropertyDecl:{ResultType MyClsA *}{TypedText prop} (35)
47
Douglas Gregor4c850f32015-07-07 06:20:22 +000048// RUN: c-index-test -code-completion-at=%s:27:8 %s | FileCheck -check-prefix=CHECK-CC2 %s
Douglas Gregorc3425b12015-07-07 06:20:19 +000049// CHECK-CC2: ObjCIvarDecl:{ResultType MyClsB *}{TypedText myVar} (35)
50
Douglas Gregor4c850f32015-07-07 06:20:22 +000051// RUN: c-index-test -code-completion-at=%s:31:8 %s | FileCheck -check-prefix=CHECK-CC3 %s
52// CHECK-CC3: ObjCInstanceMethodDecl:{ResultType void}{TypedText apply2:}{Placeholder ^(id, NSObject *)block} (35)
Douglas Gregorc3425b12015-07-07 06:20:19 +000053// CHECK-CC3: ObjCInstanceMethodDecl:{ResultType void}{TypedText apply:}{Placeholder ^(id, NSObject *)block} (35)
54// CHECK-CC3: ObjCInstanceMethodDecl:{ResultType __kindof NSObject *}{TypedText getit:}{Placeholder (id)} (35)
55
Douglas Gregor4c850f32015-07-07 06:20:22 +000056// RUN: c-index-test -code-completion-at=%s:32:7 %s | FileCheck -check-prefix=CHECK-CC4 %s
Douglas Gregorc3425b12015-07-07 06:20:19 +000057// CHECK-CC4: ObjCPropertyDecl:{ResultType id}{TypedText prop} (35)
58
Douglas Gregor4c850f32015-07-07 06:20:22 +000059// RUN: c-index-test -code-completion-at=%s:33:8 %s | FileCheck -check-prefix=CHECK-CC5 %s
Douglas Gregorc3425b12015-07-07 06:20:19 +000060// CHECK-CC5: ObjCIvarDecl:{ResultType __kindof NSObject *}{TypedText myVar} (35)
Douglas Gregor9b7b3e92015-07-07 06:20:27 +000061
62// RUN: c-index-test -code-completion-at=%s:37:2 %s | FileCheck -check-prefix=CHECK-CC6 %s
63// CHECK-CC6: ObjCInstanceMethodDecl:{LeftParen (}{Text void}{RightParen )}{TypedText apply2}{TypedText :}{LeftParen (}{Text void (^ _Nonnull)(id, NSObject *)}{RightParen )}{Text block} (40)
64// CHECK-CC6: ObjCInstanceMethodDecl:{LeftParen (}{Text void}{RightParen )}{TypedText apply}{TypedText :}{LeftParen (}{Text void (^)(id, NSObject *)}{RightParen )}{Text block} (40)
65// CHECK-CC6: ObjCInstanceMethodDecl:{LeftParen (}{Text NSObject *}{RightParen )}{TypedText getit}{TypedText :}{LeftParen (}{Text id}{RightParen )}{Text val} (40)
66// CHECK-CC6: ObjCInstanceMethodDecl:{LeftParen (}{Text id}{RightParen )}{TypedText prop} (40)