Argyrios Kyrtzidis | aed123e | 2011-10-06 07:00:54 +0000 | [diff] [blame] | 1 | @class Foo; |
| 2 | |
| 3 | @interface Foo |
| 4 | -(id)setWithInt:(int)i andFloat:(float)f; |
| 5 | @end |
| 6 | |
| 7 | @implementation Foo |
| 8 | -(id)setWithInt:(int)i andFloat:(float)f { |
| 9 | return self; |
| 10 | } |
| 11 | @end |
| 12 | |
| 13 | void test(Foo *foo) { |
| 14 | [foo setWithInt:0 andFloat:0]; |
| 15 | [foo setWithInt: 2 andFloat: 3]; |
| 16 | } |
| 17 | |
| 18 | @protocol Prot1 |
| 19 | -(void)protMeth; |
| 20 | @end |
| 21 | |
| 22 | @protocol Prot2<Prot1> |
| 23 | @end |
| 24 | |
| 25 | @interface Base<Prot2> |
| 26 | @end |
| 27 | |
| 28 | @interface Sub : Base |
| 29 | -(void)protMeth; |
| 30 | @end |
| 31 | |
| 32 | @implementation Sub |
| 33 | -(void)protMeth {} |
| 34 | @end |
| 35 | |
| 36 | void test2(Sub *s, id<Prot1> p) { |
| 37 | [s protMeth]; |
| 38 | [p protMeth]; |
| 39 | } |
| 40 | |
| 41 | |
| 42 | // RUN: c-index-test \ |
| 43 | |
| 44 | // RUN: -file-refs-at=%s:7:18 \ |
| 45 | // CHECK: ObjCImplementationDecl=Foo:7:17 (Definition) |
Argyrios Kyrtzidis | c15707d | 2012-01-24 21:39:26 +0000 | [diff] [blame] | 46 | |
| 47 | // FIXME: There should not be 2 for the same range. |
| 48 | // CHECK-NEXT: ObjCInterfaceDecl=Foo:1:8 =[1:8 - 1:11] |
Argyrios Kyrtzidis | aed123e | 2011-10-06 07:00:54 +0000 | [diff] [blame] | 49 | // CHECK-NEXT: ObjCClassRef=Foo:3:12 =[1:8 - 1:11] |
Argyrios Kyrtzidis | c15707d | 2012-01-24 21:39:26 +0000 | [diff] [blame] | 50 | |
Argyrios Kyrtzidis | aed123e | 2011-10-06 07:00:54 +0000 | [diff] [blame] | 51 | // CHECK-NEXT: ObjCInterfaceDecl=Foo:3:12 =[3:12 - 3:15] |
| 52 | // CHECK-NEXT: ObjCImplementationDecl=Foo:7:17 (Definition) =[7:17 - 7:20] |
| 53 | // CHECK-NEXT: ObjCClassRef=Foo:3:12 =[13:11 - 13:14] |
| 54 | |
| 55 | // RUN: -file-refs-at=%s:4:10 \ |
Argyrios Kyrtzidis | ccc6f36 | 2012-03-23 03:33:19 +0000 | [diff] [blame] | 56 | // CHECK-NEXT: ObjCInstanceMethodDecl=setWithInt:andFloat::4:6 |
| 57 | // CHECK-NEXT: ObjCInstanceMethodDecl=setWithInt:andFloat::4:6 =[4:6 - 4:16] |
| 58 | // CHECK-NEXT: ObjCInstanceMethodDecl=setWithInt:andFloat::8:6 (Definition) =[8:6 - 8:16] |
| 59 | // CHECK-NEXT: ObjCMessageExpr=setWithInt:andFloat::4:6 =[14:8 - 14:18] |
| 60 | // CHECK-NEXT: ObjCMessageExpr=setWithInt:andFloat::4:6 =[15:8 - 15:18] |
Argyrios Kyrtzidis | aed123e | 2011-10-06 07:00:54 +0000 | [diff] [blame] | 61 | |
| 62 | // RUN: -file-refs-at=%s:15:27 \ |
Argyrios Kyrtzidis | ccc6f36 | 2012-03-23 03:33:19 +0000 | [diff] [blame] | 63 | // CHECK-NEXT: ObjCMessageExpr=setWithInt:andFloat::4:6 |
| 64 | // CHECK-NEXT: ObjCInstanceMethodDecl=setWithInt:andFloat::4:6 =[4:24 - 4:32] |
| 65 | // CHECK-NEXT: ObjCInstanceMethodDecl=setWithInt:andFloat::8:6 (Definition) =[8:24 - 8:32] |
| 66 | // CHECK-NEXT: ObjCMessageExpr=setWithInt:andFloat::4:6 =[14:21 - 14:29] |
| 67 | // CHECK-NEXT: ObjCMessageExpr=setWithInt:andFloat::4:6 =[15:22 - 15:30] |
Argyrios Kyrtzidis | aed123e | 2011-10-06 07:00:54 +0000 | [diff] [blame] | 68 | |
| 69 | // RUN: -file-refs-at=%s:18:13 \ |
| 70 | // CHECK-NEXT: ObjCProtocolDecl=Prot1:18:11 (Definition) |
| 71 | // CHECK-NEXT: ObjCProtocolDecl=Prot1:18:11 (Definition) =[18:11 - 18:16] |
| 72 | // CHECK-NEXT: ObjCProtocolRef=Prot1:18:11 =[22:17 - 22:22] |
| 73 | // CHECK-NEXT: ObjCProtocolRef=Prot1:18:11 =[36:23 - 36:28] |
| 74 | |
| 75 | // RUN: -file-refs-at=%s:38:10 \ |
Argyrios Kyrtzidis | ccc6f36 | 2012-03-23 03:33:19 +0000 | [diff] [blame] | 76 | // CHECK-NEXT: ObjCMessageExpr=protMeth:19:8 |
| 77 | // CHECK-NEXT: ObjCInstanceMethodDecl=protMeth:19:8 =[19:8 - 19:16] |
| 78 | // CHECK-NEXT: ObjCInstanceMethodDecl=protMeth:29:8 [Overrides @19:8] =[29:8 - 29:16] |
| 79 | // CHECK-NEXT: ObjCInstanceMethodDecl=protMeth:33:8 (Definition) [Overrides @19:8] =[33:8 - 33:16] |
| 80 | // CHECK-NEXT: ObjCMessageExpr=protMeth:29:8 =[37:6 - 37:14] |
| 81 | // CHECK-NEXT: ObjCMessageExpr=protMeth:19:8 =[38:6 - 38:14] |
Argyrios Kyrtzidis | aed123e | 2011-10-06 07:00:54 +0000 | [diff] [blame] | 82 | |
| 83 | // RUN: -file-refs-at=%s:33:12 \ |
Argyrios Kyrtzidis | ccc6f36 | 2012-03-23 03:33:19 +0000 | [diff] [blame] | 84 | // CHECK-NEXT: ObjCInstanceMethodDecl=protMeth:33:8 (Definition) [Overrides @19:8] |
| 85 | // CHECK-NEXT: ObjCInstanceMethodDecl=protMeth:19:8 =[19:8 - 19:16] |
| 86 | // CHECK-NEXT: ObjCInstanceMethodDecl=protMeth:29:8 [Overrides @19:8] =[29:8 - 29:16] |
| 87 | // CHECK-NEXT: ObjCInstanceMethodDecl=protMeth:33:8 (Definition) [Overrides @19:8] =[33:8 - 33:16] |
| 88 | // CHECK-NEXT: ObjCMessageExpr=protMeth:29:8 =[37:6 - 37:14] |
| 89 | // CHECK-NEXT: ObjCMessageExpr=protMeth:19:8 =[38:6 - 38:14] |
Argyrios Kyrtzidis | aed123e | 2011-10-06 07:00:54 +0000 | [diff] [blame] | 90 | |
| 91 | // RUN: %s | FileCheck %s |