Daniel Dunbar | 8fbe78f | 2009-12-15 20:14:24 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-nonfragile-abi -fblocks -emit-pch -x objective-c %s -o %t.ast |
Ted Kremenek | ef3339b | 2009-11-17 18:09:14 +0000 | [diff] [blame] | 2 | // RUN: c-index-test -test-load-tu %t.ast all | FileCheck %s |
Douglas Gregor | 46d6614 | 2010-01-16 17:14:40 +0000 | [diff] [blame] | 3 | |
Steve Naroff | a7753c4 | 2009-09-24 20:03:06 +0000 | [diff] [blame] | 4 | @interface Foo |
| 5 | { |
| 6 | } |
| 7 | |
| 8 | - foo; |
| 9 | + fooC; |
| 10 | |
| 11 | @end |
| 12 | |
| 13 | @interface Bar : Foo |
| 14 | { |
| 15 | } |
| 16 | |
| 17 | @end |
| 18 | |
| 19 | @interface Foo (FooCat) |
| 20 | - (int) catMethodWithFloat:(float) fArg; |
| 21 | - (float) floatMethod; |
| 22 | @end |
| 23 | |
| 24 | @protocol Proto |
| 25 | - pMethod; |
| 26 | @end |
| 27 | |
| 28 | @protocol SubP <Proto> |
| 29 | - spMethod; |
| 30 | @end |
| 31 | |
| 32 | @interface Baz : Bar <SubP> |
| 33 | { |
| 34 | int _anIVar; |
| 35 | } |
| 36 | |
| 37 | - (Foo *) bazMethod; |
| 38 | |
| 39 | @end |
| 40 | |
| 41 | enum { |
| 42 | someEnum |
| 43 | }; |
| 44 | |
Steve Naroff | a7753c4 | 2009-09-24 20:03:06 +0000 | [diff] [blame] | 45 | int main (int argc, const char * argv[]) { |
| 46 | Baz * bee; |
| 47 | id a = [bee foo]; |
| 48 | id <SubP> c = [Foo fooC]; |
| 49 | id <Proto> d; |
| 50 | d = c; |
| 51 | [d pMethod]; |
| 52 | [bee catMethodWithFloat:[bee floatMethod]]; |
| 53 | main(someEnum, (const char **)bee); |
| 54 | } |
| 55 | |
Douglas Gregor | ad27e8b | 2010-01-19 01:20:04 +0000 | [diff] [blame^] | 56 | // CHECK: c-index-api-loadTU-test.m:4:12: ObjCInterfaceDecl=Foo:4:12 [Extent=4:1:11:4] |
Ted Kremenek | 473c7a7 | 2010-01-18 20:23:29 +0000 | [diff] [blame] | 57 | // CHECK: c-index-api-loadTU-test.m:8:1: ObjCInstanceMethodDecl=foo:8:1 [Extent=8:1:8:6] |
| 58 | // CHECK: c-index-api-loadTU-test.m:9:1: ObjCClassMethodDecl=fooC:9:1 [Extent=9:1:9:7] |
Douglas Gregor | ad27e8b | 2010-01-19 01:20:04 +0000 | [diff] [blame^] | 59 | // CHECK: c-index-api-loadTU-test.m:13:12: ObjCInterfaceDecl=Bar:13:12 [Extent=13:1:17:4] |
| 60 | // CHECK: c-index-api-loadTU-test.m:13:18: ObjCSuperClassRef=Foo:4:12 [Extent=13:18:13:20] |
Ted Kremenek | 473c7a7 | 2010-01-18 20:23:29 +0000 | [diff] [blame] | 61 | // CHECK: c-index-api-loadTU-test.m:19:12: ObjCCategoryDecl=FooCat:19:12 [Extent=19:1:22:4] |
Douglas Gregor | ad27e8b | 2010-01-19 01:20:04 +0000 | [diff] [blame^] | 62 | // CHECK: c-index-api-loadTU-test.m:19:12: ObjCClassRef=Foo:4:12 [Extent=19:12:19:14] |
Ted Kremenek | 473c7a7 | 2010-01-18 20:23:29 +0000 | [diff] [blame] | 63 | // CHECK: c-index-api-loadTU-test.m:20:1: ObjCInstanceMethodDecl=catMethodWithFloat::20:1 [Extent=20:1:20:40] |
| 64 | // CHECK: c-index-api-loadTU-test.m:21:1: ObjCInstanceMethodDecl=floatMethod:21:1 [Extent=21:1:21:22] |
| 65 | // CHECK: c-index-api-loadTU-test.m:24:1: ObjCProtocolDecl=Proto:24:1 [Extent=24:1:26:4] |
| 66 | // CHECK: c-index-api-loadTU-test.m:25:1: ObjCInstanceMethodDecl=pMethod:25:1 [Extent=25:1:25:10] |
| 67 | // CHECK: c-index-api-loadTU-test.m:28:1: ObjCProtocolDecl=SubP:28:1 [Extent=28:1:30:4] |
Douglas Gregor | 33c34ac | 2010-01-19 00:34:46 +0000 | [diff] [blame] | 68 | // CHECK: c-index-api-loadTU-test.m:28:17: ObjCProtocolRef=Proto:24:1 [Extent=28:17:28:21] |
Ted Kremenek | 473c7a7 | 2010-01-18 20:23:29 +0000 | [diff] [blame] | 69 | // CHECK: c-index-api-loadTU-test.m:29:1: ObjCInstanceMethodDecl=spMethod:29:1 [Extent=29:1:29:11] |
Douglas Gregor | ad27e8b | 2010-01-19 01:20:04 +0000 | [diff] [blame^] | 70 | // CHECK: c-index-api-loadTU-test.m:32:12: ObjCInterfaceDecl=Baz:32:12 [Extent=32:1:39:4] |
| 71 | // CHECK: c-index-api-loadTU-test.m:32:18: ObjCSuperClassRef=Bar:13:12 [Extent=32:18:32:20] |
Douglas Gregor | 33c34ac | 2010-01-19 00:34:46 +0000 | [diff] [blame] | 72 | // CHECK: c-index-api-loadTU-test.m:32:23: ObjCProtocolRef=SubP:28:1 [Extent=32:23:32:26] |
Ted Kremenek | 473c7a7 | 2010-01-18 20:23:29 +0000 | [diff] [blame] | 73 | // CHECK: c-index-api-loadTU-test.m:34:9: ObjCIvarDecl=_anIVar:34:9 [Extent=34:9:34:15] |
| 74 | // CHECK: c-index-api-loadTU-test.m:37:1: ObjCInstanceMethodDecl=bazMethod:37:1 [Extent=37:1:37:20] |
| 75 | // CHECK: c-index-api-loadTU-test.m:41:1: EnumDecl=:41:1 [Extent=41:1:43:1] |
| 76 | // CHECK: c-index-api-loadTU-test.m:42:3: EnumConstantDecl=someEnum:42:3 [Extent=42:3:42:10] |
| 77 | // CHECK: c-index-api-loadTU-test.m:45:5: FunctionDefn=main:45:5 [Extent=45:5:54:1] |
| 78 | // CHECK: c-index-api-loadTU-test.m:45:15: ParmDecl=argc:45:15 [Extent=45:15:45:18] |
| 79 | // CHECK: c-index-api-loadTU-test.m:45:34: ParmDecl=argv:45:34 [Extent=45:34:45:37] |
| 80 | // CHECK: c-index-api-loadTU-test.m:46:8: VarDecl=bee:46:8 [Extent=46:8:46:10] |
| 81 | // CHECK: c-index-api-loadTU-test.m:47:5: VarDecl=a:47:5 [Extent=47:5:47:17] |
| 82 | // CHECK: c-index-api-loadTU-test.m:48:12: VarDecl=c:48:12 [Extent=48:12:48:25] |
| 83 | // CHECK: c-index-api-loadTU-test.m:49:13: VarDecl=d:49:13 [Extent=49:13:49:13] |
Ted Kremenek | a44d99c | 2010-01-05 23:18:49 +0000 | [diff] [blame] | 84 | |
Ted Kremenek | c7c6431 | 2010-01-07 01:20:12 +0000 | [diff] [blame] | 85 | |