Daniel Dunbar | c22dd4d | 2009-09-26 07:06:36 +0000 | [diff] [blame] | 1 | // RUN: clang-cc -triple i386-apple-darwin9 -emit-pch %s -o %t.ast && |
Steve Naroff | ff9e18c | 2009-09-24 20:03:06 +0000 | [diff] [blame] | 2 | // RUN: c-index-test %t.ast all | FileCheck %s |
| 3 | |
| 4 | // CHECK: <invalid loc>:0:0: StructDecl=objc_selector [Context=c-index-api-test.m] |
| 5 | // CHECK: <invalid loc>:0:0: TypedefDecl=SEL [Context=c-index-api-test.m] |
| 6 | // CHECK: <invalid loc>:0:0: ObjCInterfaceDecl=Protocol [Context=c-index-api-test.m] |
| 7 | // CHECK: <invalid loc>:0:0: TypedefDecl=id [Context=c-index-api-test.m] |
| 8 | // CHECK: <invalid loc>:0:0: TypedefDecl=Class [Context=c-index-api-test.m] |
Douglas Gregor | d781a39 | 2009-09-25 06:44:41 +0000 | [diff] [blame] | 9 | // |
Steve Naroff | ff9e18c | 2009-09-24 20:03:06 +0000 | [diff] [blame] | 10 | |
| 11 | @interface Foo |
| 12 | { |
| 13 | } |
| 14 | |
| 15 | - foo; |
| 16 | + fooC; |
| 17 | |
| 18 | @end |
| 19 | |
| 20 | @interface Bar : Foo |
| 21 | { |
| 22 | } |
| 23 | |
| 24 | @end |
| 25 | |
| 26 | @interface Foo (FooCat) |
| 27 | - (int) catMethodWithFloat:(float) fArg; |
| 28 | - (float) floatMethod; |
| 29 | @end |
| 30 | |
| 31 | @protocol Proto |
| 32 | - pMethod; |
| 33 | @end |
| 34 | |
| 35 | @protocol SubP <Proto> |
| 36 | - spMethod; |
| 37 | @end |
| 38 | |
| 39 | @interface Baz : Bar <SubP> |
| 40 | { |
| 41 | int _anIVar; |
| 42 | } |
| 43 | |
| 44 | - (Foo *) bazMethod; |
| 45 | |
| 46 | @end |
| 47 | |
| 48 | enum { |
| 49 | someEnum |
| 50 | }; |
| 51 | |
| 52 | // CHECK: c-index-api-test.m:11:12: ObjCInterfaceDecl=Foo [Context=c-index-api-test.m] |
| 53 | // CHECK: c-index-api-test.m:15:1: ObjCInstanceMethodDecl=foo [Context=Foo] |
| 54 | // CHECK: c-index-api-test.m:16:1: ObjCClassMethodDecl=fooC [Context=Foo] |
| 55 | // CHECK: c-index-api-test.m:20:12: ObjCInterfaceDecl=Bar [Context=c-index-api-test.m] |
| 56 | // CHECK: c-index-api-test.m:20:18: ObjCSuperClassRef=Foo [Context=Bar] |
| 57 | // CHECK: c-index-api-test.m:26:1: ObjCCategoryDecl=FooCat [Context=c-index-api-test.m] |
| 58 | // CHECK: <invalid loc>:0:0: ObjCClassRef=Foo [Context=FooCat] |
| 59 | // CHECK: c-index-api-test.m:27:1: ObjCInstanceMethodDecl=catMethodWithFloat: [Context=FooCat] |
| 60 | // CHECK: c-index-api-test.m:28:1: ObjCInstanceMethodDecl=floatMethod [Context=FooCat] |
| 61 | // CHECK: c-index-api-test.m:31:1: ObjCProtocolDecl=Proto [Context=c-index-api-test.m] |
| 62 | // CHECK: c-index-api-test.m:32:1: ObjCInstanceMethodDecl=pMethod [Context=Proto] |
| 63 | // CHECK: c-index-api-test.m:35:1: ObjCProtocolDecl=SubP [Context=c-index-api-test.m] |
| 64 | // CHECK: c-index-api-test.m:31:1: ObjCProtocolRef=Proto [Context=SubP] |
| 65 | // CHECK: c-index-api-test.m:36:1: ObjCInstanceMethodDecl=spMethod [Context=SubP] |
| 66 | // CHECK: c-index-api-test.m:39:12: ObjCInterfaceDecl=Baz [Context=c-index-api-test.m] |
| 67 | // CHECK: c-index-api-test.m:39:18: ObjCSuperClassRef=Bar [Context=Baz] |
| 68 | // CHECK: c-index-api-test.m:35:1: ObjCProtocolRef=SubP [Context=Baz] |
| 69 | // CHECK: c-index-api-test.m:41:9: ObjCIvarDecl=_anIVar [Context=Baz] |
| 70 | // CHECK: c-index-api-test.m:44:1: ObjCInstanceMethodDecl=bazMethod [Context=Baz] |
| 71 | // CHECK: c-index-api-test.m:48:1: EnumDecl= [Context=c-index-api-test.m] |
| 72 | // CHECK: c-index-api-test.m:49:3: EnumConstantDecl=someEnum [Context=] |
| 73 | |
| 74 | int main (int argc, const char * argv[]) { |
| 75 | Baz * bee; |
| 76 | id a = [bee foo]; |
| 77 | id <SubP> c = [Foo fooC]; |
| 78 | id <Proto> d; |
| 79 | d = c; |
| 80 | [d pMethod]; |
| 81 | [bee catMethodWithFloat:[bee floatMethod]]; |
| 82 | main(someEnum, (const char **)bee); |
| 83 | } |
| 84 | |
| 85 | // CHECK: c-index-api-test.m:74:5: FunctionDefn=main [Context=c-index-api-test.m] |
| 86 | // CHECK: c-index-api-test.m:74:15: ParmDecl=argc [Context=main] |
| 87 | // CHECK: c-index-api-test.m:74:34: ParmDecl=argv [Context=main] |
| 88 | // CHECK: c-index-api-test.m:75:8: VarDecl=bee [Context=main] |
| 89 | // CHECK: c-index-api-test.m:76:5: VarDecl=a [Context=main] |
| 90 | // CHECK: c-index-api-test.m:77:12: VarDecl=c [Context=main] |
| 91 | // CHECK: c-index-api-test.m:78:13: VarDecl=d [Context=main] |
| 92 | // CHECK: c-index-api-test.m:75:8: VarDecl=bee [Context:bee] |
| 93 | // CHECK: c-index-api-test.m:75:9: VarDecl=bee [Context:bee] |
| 94 | // CHECK: c-index-api-test.m:75:10: VarDecl=bee [Context:bee] |
| 95 | // CHECK: c-index-api-test.m:76:5: VarDecl=a [Context:a] |
| 96 | // CHECK: c-index-api-test.m:76:6: VarDecl=a [Context:a] |
| 97 | // CHECK: c-index-api-test.m:76:7: VarDecl=a [Context:a] |
| 98 | // CHECK: c-index-api-test.m:76:8: VarDecl=a [Context:a] |
Steve Naroff | 7416524 | 2009-09-25 22:15:54 +0000 | [diff] [blame] | 99 | // CHECK: c-index-api-test.m:76:9: ObjCSelectorRef=foo:15:1 [Context:a] |
| 100 | // CHECK: c-index-api-test.m:76:10: VarRef=bee:75:8 [Context:a] |
| 101 | // CHECK: c-index-api-test.m:76:11: VarRef=bee:75:8 [Context:a] |
| 102 | // CHECK: c-index-api-test.m:76:12: VarRef=bee:75:8 [Context:a] |
| 103 | // CHECK: c-index-api-test.m:76:13: ObjCSelectorRef=foo:15:1 [Context:a] |
| 104 | // CHECK: c-index-api-test.m:76:14: ObjCSelectorRef=foo:15:1 [Context:a] |
| 105 | // CHECK: c-index-api-test.m:76:15: ObjCSelectorRef=foo:15:1 [Context:a] |
| 106 | // CHECK: c-index-api-test.m:76:16: ObjCSelectorRef=foo:15:1 [Context:a] |
| 107 | // CHECK: c-index-api-test.m:76:17: ObjCSelectorRef=foo:15:1 [Context:a] |
Steve Naroff | ff9e18c | 2009-09-24 20:03:06 +0000 | [diff] [blame] | 108 | // CHECK: c-index-api-test.m:77:12: VarDecl=c [Context:c] |
| 109 | // CHECK: c-index-api-test.m:77:13: VarDecl=c [Context:c] |
| 110 | // CHECK: c-index-api-test.m:77:14: VarDecl=c [Context:c] |
| 111 | // CHECK: c-index-api-test.m:77:15: VarDecl=c [Context:c] |
Steve Naroff | 7416524 | 2009-09-25 22:15:54 +0000 | [diff] [blame] | 112 | // CHECK: c-index-api-test.m:77:16: ObjCSelectorRef=fooC:16:1 [Context:c] |
| 113 | // CHECK: c-index-api-test.m:77:17: ObjCSelectorRef=fooC:16:1 [Context:c] |
| 114 | // CHECK: c-index-api-test.m:77:18: ObjCSelectorRef=fooC:16:1 [Context:c] |
| 115 | // CHECK: c-index-api-test.m:77:19: ObjCSelectorRef=fooC:16:1 [Context:c] |
| 116 | // CHECK: c-index-api-test.m:77:20: ObjCSelectorRef=fooC:16:1 [Context:c] |
| 117 | // CHECK: c-index-api-test.m:77:21: ObjCSelectorRef=fooC:16:1 [Context:c] |
| 118 | // CHECK: c-index-api-test.m:77:22: ObjCSelectorRef=fooC:16:1 [Context:c] |
| 119 | // CHECK: c-index-api-test.m:77:23: ObjCSelectorRef=fooC:16:1 [Context:c] |
| 120 | // CHECK: c-index-api-test.m:77:24: ObjCSelectorRef=fooC:16:1 [Context:c] |
| 121 | // CHECK: c-index-api-test.m:77:25: ObjCSelectorRef=fooC:16:1 [Context:c] |
Steve Naroff | ff9e18c | 2009-09-24 20:03:06 +0000 | [diff] [blame] | 122 | // CHECK: c-index-api-test.m:78:13: VarDecl=d [Context:d] |
Steve Naroff | 7416524 | 2009-09-25 22:15:54 +0000 | [diff] [blame] | 123 | // CHECK: c-index-api-test.m:79:2: VarRef=d:78:13 [Context:main] |
| 124 | // CHECK: c-index-api-test.m:79:6: VarRef=c:77:12 [Context:main] |
| 125 | // CHECK: c-index-api-test.m:80:2: ObjCSelectorRef=pMethod:32:1 [Context:main] |
| 126 | // CHECK: c-index-api-test.m:80:3: VarRef=d:78:13 [Context:main] |
| 127 | // CHECK: c-index-api-test.m:80:4: ObjCSelectorRef=pMethod:32:1 [Context:main] |
| 128 | // CHECK: c-index-api-test.m:80:5: ObjCSelectorRef=pMethod:32:1 [Context:main] |
| 129 | // CHECK: c-index-api-test.m:80:6: ObjCSelectorRef=pMethod:32:1 [Context:main] |
| 130 | // CHECK: c-index-api-test.m:80:7: ObjCSelectorRef=pMethod:32:1 [Context:main] |
| 131 | // CHECK: c-index-api-test.m:80:8: ObjCSelectorRef=pMethod:32:1 [Context:main] |
| 132 | // CHECK: c-index-api-test.m:80:9: ObjCSelectorRef=pMethod:32:1 [Context:main] |
| 133 | // CHECK: c-index-api-test.m:80:10: ObjCSelectorRef=pMethod:32:1 [Context:main] |
| 134 | // CHECK: c-index-api-test.m:80:11: ObjCSelectorRef=pMethod:32:1 [Context:main] |
| 135 | // CHECK: c-index-api-test.m:80:12: ObjCSelectorRef=pMethod:32:1 [Context:main] |
| 136 | // CHECK: c-index-api-test.m:81:2: ObjCSelectorRef=catMethodWithFloat::27:1 [Context:main] |
| 137 | // CHECK: c-index-api-test.m:81:3: VarRef=bee:75:8 [Context:main] |
| 138 | // CHECK: c-index-api-test.m:81:4: VarRef=bee:75:8 [Context:main] |
| 139 | // CHECK: c-index-api-test.m:81:5: VarRef=bee:75:8 [Context:main] |
| 140 | // CHECK: c-index-api-test.m:81:6: ObjCSelectorRef=catMethodWithFloat::27:1 [Context:main] |
| 141 | // CHECK: c-index-api-test.m:81:7: ObjCSelectorRef=catMethodWithFloat::27:1 [Context:main] |
| 142 | // CHECK: c-index-api-test.m:81:8: ObjCSelectorRef=catMethodWithFloat::27:1 [Context:main] |
| 143 | // CHECK: c-index-api-test.m:81:9: ObjCSelectorRef=catMethodWithFloat::27:1 [Context:main] |
| 144 | // CHECK: c-index-api-test.m:81:10: ObjCSelectorRef=catMethodWithFloat::27:1 [Context:main] |
| 145 | // CHECK: c-index-api-test.m:81:11: ObjCSelectorRef=catMethodWithFloat::27:1 [Context:main] |
| 146 | // CHECK: c-index-api-test.m:81:12: ObjCSelectorRef=catMethodWithFloat::27:1 [Context:main] |
| 147 | // CHECK: c-index-api-test.m:81:13: ObjCSelectorRef=catMethodWithFloat::27:1 [Context:main] |
| 148 | // CHECK: c-index-api-test.m:81:14: ObjCSelectorRef=catMethodWithFloat::27:1 [Context:main] |
| 149 | // CHECK: c-index-api-test.m:81:15: ObjCSelectorRef=catMethodWithFloat::27:1 [Context:main] |
| 150 | // CHECK: c-index-api-test.m:81:16: ObjCSelectorRef=catMethodWithFloat::27:1 [Context:main] |
| 151 | // CHECK: c-index-api-test.m:81:17: ObjCSelectorRef=catMethodWithFloat::27:1 [Context:main] |
| 152 | // CHECK: c-index-api-test.m:81:18: ObjCSelectorRef=catMethodWithFloat::27:1 [Context:main] |
| 153 | // CHECK: c-index-api-test.m:81:19: ObjCSelectorRef=catMethodWithFloat::27:1 [Context:main] |
| 154 | // CHECK: c-index-api-test.m:81:20: ObjCSelectorRef=catMethodWithFloat::27:1 [Context:main] |
| 155 | // CHECK: c-index-api-test.m:81:21: ObjCSelectorRef=catMethodWithFloat::27:1 [Context:main] |
| 156 | // CHECK: c-index-api-test.m:81:22: ObjCSelectorRef=catMethodWithFloat::27:1 [Context:main] |
| 157 | // CHECK: c-index-api-test.m:81:23: ObjCSelectorRef=catMethodWithFloat::27:1 [Context:main] |
| 158 | // CHECK: c-index-api-test.m:81:24: ObjCSelectorRef=catMethodWithFloat::27:1 [Context:main] |
| 159 | // CHECK: c-index-api-test.m:81:25: ObjCSelectorRef=catMethodWithFloat::27:1 [Context:main] |
| 160 | // CHECK: c-index-api-test.m:81:26: ObjCSelectorRef=floatMethod:28:1 [Context:main] |
| 161 | // CHECK: c-index-api-test.m:81:27: VarRef=bee:75:8 [Context:main] |
| 162 | // CHECK: c-index-api-test.m:81:28: VarRef=bee:75:8 [Context:main] |
| 163 | // CHECK: c-index-api-test.m:81:29: VarRef=bee:75:8 [Context:main] |
| 164 | // CHECK: c-index-api-test.m:81:30: ObjCSelectorRef=floatMethod:28:1 [Context:main] |
| 165 | // CHECK: c-index-api-test.m:81:31: ObjCSelectorRef=floatMethod:28:1 [Context:main] |
| 166 | // CHECK: c-index-api-test.m:81:32: ObjCSelectorRef=floatMethod:28:1 [Context:main] |
| 167 | // CHECK: c-index-api-test.m:81:33: ObjCSelectorRef=floatMethod:28:1 [Context:main] |
| 168 | // CHECK: c-index-api-test.m:81:34: ObjCSelectorRef=floatMethod:28:1 [Context:main] |
| 169 | // CHECK: c-index-api-test.m:81:35: ObjCSelectorRef=floatMethod:28:1 [Context:main] |
| 170 | // CHECK: c-index-api-test.m:81:36: ObjCSelectorRef=floatMethod:28:1 [Context:main] |
| 171 | // CHECK: c-index-api-test.m:81:37: ObjCSelectorRef=floatMethod:28:1 [Context:main] |
| 172 | // CHECK: c-index-api-test.m:81:38: ObjCSelectorRef=floatMethod:28:1 [Context:main] |
| 173 | // CHECK: c-index-api-test.m:81:39: ObjCSelectorRef=floatMethod:28:1 [Context:main] |
| 174 | // CHECK: c-index-api-test.m:81:40: ObjCSelectorRef=floatMethod:28:1 [Context:main] |
| 175 | // CHECK: c-index-api-test.m:81:41: ObjCSelectorRef=floatMethod:28:1 [Context:main] |
| 176 | // CHECK: c-index-api-test.m:81:42: ObjCSelectorRef=floatMethod:28:1 [Context:main] |
| 177 | // CHECK: c-index-api-test.m:81:43: ObjCSelectorRef=catMethodWithFloat::27:1 [Context:main] |
| 178 | // CHECK: c-index-api-test.m:82:3: FunctionRef=main:74:5 [Context:main] |
| 179 | // CHECK: c-index-api-test.m:82:4: FunctionRef=main:74:5 [Context:main] |
| 180 | // CHECK: c-index-api-test.m:82:5: FunctionRef=main:74:5 [Context:main] |
| 181 | // CHECK: c-index-api-test.m:82:6: FunctionRef=main:74:5 [Context:main] |
| 182 | // CHECK: c-index-api-test.m:82:8: EnumConstantRef=someEnum:49:3 [Context:main] |
| 183 | // CHECK: c-index-api-test.m:82:9: EnumConstantRef=someEnum:49:3 [Context:main] |
| 184 | // CHECK: c-index-api-test.m:82:10: EnumConstantRef=someEnum:49:3 [Context:main] |
| 185 | // CHECK: c-index-api-test.m:82:11: EnumConstantRef=someEnum:49:3 [Context:main] |
| 186 | // CHECK: c-index-api-test.m:82:12: EnumConstantRef=someEnum:49:3 [Context:main] |
| 187 | // CHECK: c-index-api-test.m:82:13: EnumConstantRef=someEnum:49:3 [Context:main] |
| 188 | // CHECK: c-index-api-test.m:82:14: EnumConstantRef=someEnum:49:3 [Context:main] |
| 189 | // CHECK: c-index-api-test.m:82:15: EnumConstantRef=someEnum:49:3 [Context:main] |
| 190 | // CHECK: c-index-api-test.m:82:33: VarRef=bee:75:8 [Context:main] |
| 191 | // CHECK: c-index-api-test.m:82:34: VarRef=bee:75:8 [Context:main] |
| 192 | // CHECK: c-index-api-test.m:82:35: VarRef=bee:75:8 [Context:main] |