c-index-api-loadTU-test.m revision c72af578b2a9d0c27b1908dd4082b94db42cd9b7
1// RUN: clang-cc -triple x86_64-apple-darwin10 -fobjc-nonfragile-abi -fblocks -emit-pch -x objective-c %s -o %t.ast 2// RUN: c-index-test -test-load-tu %t.ast all | FileCheck %s 3 4// CHECK: <invalid loc>:0:0: TypedefDecl=__int128_t:0:0 [Context=c-index-api-loadTU-test.m] 5// CHECK: <invalid loc>:0:0: TypedefDecl=__uint128_t:0:0 [Context=c-index-api-loadTU-test.m] 6// CHECK: <invalid loc>:0:0: StructDecl=objc_selector:0:0 [Context=c-index-api-loadTU-test.m] 7// CHECK: <invalid loc>:0:0: TypedefDecl=SEL:0:0 [Context=c-index-api-loadTU-test.m] 8// CHECK: <invalid loc>:0:0: ObjCInterfaceDecl=Protocol:0:0 [Context=c-index-api-loadTU-test.m] 9// CHECK: <invalid loc>:0:0: TypedefDecl=id:0:0 [Context=c-index-api-loadTU-test.m] 10// CHECK: <invalid loc>:0:0: TypedefDecl=Class:0:0 [Context=c-index-api-loadTU-test.m] 11// CHECK: <invalid loc>:81:16: StructDecl=__va_list_tag:81:16 [Context=c-index-api-loadTU-test.m] 12// CHECK: <invalid loc>:81:42: FieldDecl=gp_offset:81:42 [Context=__va_list_tag] 13// CHECK: <invalid loc>:81:63: FieldDecl=fp_offset:81:63 [Context=__va_list_tag] 14// CHECK: <invalid loc>:81:81: FieldDecl=overflow_arg_area:81:81 [Context=__va_list_tag] 15// CHECK: <invalid loc>:81:107: FieldDecl=reg_save_area:81:107 [Context=__va_list_tag] 16// CHECK: <invalid loc>:81:123: TypedefDecl=__va_list_tag:81:123 [Context=c-index-api-loadTU-test.m] 17// CHECK: <invalid loc>:81:159: TypedefDecl=__builtin_va_list:81:159 [Context=c-index-api-loadTU-test.m] 18// 19 20@interface Foo 21{ 22} 23 24- foo; 25+ fooC; 26 27@end 28 29@interface Bar : Foo 30{ 31} 32 33@end 34 35@interface Foo (FooCat) 36- (int) catMethodWithFloat:(float) fArg; 37- (float) floatMethod; 38@end 39 40@protocol Proto 41- pMethod; 42@end 43 44@protocol SubP <Proto> 45- spMethod; 46@end 47 48@interface Baz : Bar <SubP> 49{ 50 int _anIVar; 51} 52 53- (Foo *) bazMethod; 54 55@end 56 57enum { 58 someEnum 59}; 60 61// CHECK: c-index-api-loadTU-test.m:20:12: ObjCInterfaceDecl=Foo:20:1 [Context=c-index-api-loadTU-test.m] 62// CHECK: c-index-api-loadTU-test.m:24:1: ObjCInstanceMethodDecl=foo:24:1 [Context=Foo] 63// CHECK: c-index-api-loadTU-test.m:25:1: ObjCClassMethodDecl=fooC:25:1 [Context=Foo] 64// CHECK: c-index-api-loadTU-test.m:29:12: ObjCInterfaceDecl=Bar:29:1 [Context=c-index-api-loadTU-test.m] 65// CHECK: c-index-api-loadTU-test.m:29:18: ObjCSuperClassRef=Foo:29:1 [Context=Bar] 66// CHECK: c-index-api-loadTU-test.m:35:1: ObjCCategoryDecl=FooCat:35:1 [Context=c-index-api-loadTU-test.m] 67// CHECK: c-index-api-loadTU-test.m:20:1: ObjCClassRef=Foo:35:1 [Context=FooCat] 68// CHECK: c-index-api-loadTU-test.m:36:1: ObjCInstanceMethodDecl=catMethodWithFloat::36:1 [Context=FooCat] 69// CHECK: c-index-api-loadTU-test.m:37:1: ObjCInstanceMethodDecl=floatMethod:37:1 [Context=FooCat] 70// CHECK: c-index-api-loadTU-test.m:40:1: ObjCProtocolDecl=Proto:40:1 [Context=c-index-api-loadTU-test.m] 71// CHECK: c-index-api-loadTU-test.m:41:1: ObjCInstanceMethodDecl=pMethod:41:1 [Context=Proto] 72// CHECK: c-index-api-loadTU-test.m:44:1: ObjCProtocolDecl=SubP:44:1 [Context=c-index-api-loadTU-test.m] 73// CHECK: c-index-api-loadTU-test.m:40:1: ObjCProtocolRef=Proto:40:1 [Context=SubP] 74// CHECK: c-index-api-loadTU-test.m:45:1: ObjCInstanceMethodDecl=spMethod:45:1 [Context=SubP] 75// CHECK: c-index-api-loadTU-test.m:48:12: ObjCInterfaceDecl=Baz:48:1 [Context=c-index-api-loadTU-test.m] 76// CHECK: c-index-api-loadTU-test.m:48:18: ObjCSuperClassRef=Bar:48:1 [Context=Baz] 77// CHECK: c-index-api-loadTU-test.m:44:1: ObjCProtocolRef=SubP:44:1 [Context=Baz] 78// CHECK: c-index-api-loadTU-test.m:50:9: ObjCIvarDecl=_anIVar:50:9 [Context=Baz] 79// CHECK: c-index-api-loadTU-test.m:53:1: ObjCInstanceMethodDecl=bazMethod:53:1 [Context=Baz] 80// CHECK: c-index-api-loadTU-test.m:57:1: EnumDecl=:57:1 [Context=c-index-api-loadTU-test.m] 81// CHECK: c-index-api-loadTU-test.m:58:3: EnumConstantDecl=someEnum:58:3 [Context=] 82 83int main (int argc, const char * argv[]) { 84 Baz * bee; 85 id a = [bee foo]; 86 id <SubP> c = [Foo fooC]; 87 id <Proto> d; 88 d = c; 89 [d pMethod]; 90 [bee catMethodWithFloat:[bee floatMethod]]; 91 main(someEnum, (const char **)bee); 92} 93 94// CHECK: c-index-api-loadTU-test.m:83:5: FunctionDefn=main [Context=c-index-api-loadTU-test.m] 95// CHECK: c-index-api-loadTU-test.m:83:15: ParmDecl=argc:83:15 [Context=main] 96// CHECK: c-index-api-loadTU-test.m:83:34: ParmDecl=argv:83:34 [Context=main] 97// CHECK: c-index-api-loadTU-test.m:84:8: VarDecl=bee:84:8 [Context=main] 98// CHECK: c-index-api-loadTU-test.m:85:5: VarDecl=a:85:5 [Context=main] 99// CHECK: c-index-api-loadTU-test.m:86:12: VarDecl=c:86:12 [Context=main] 100// CHECK: c-index-api-loadTU-test.m:87:13: VarDecl=d:87:13 [Context=main] 101// CHECK: c-index-api-loadTU-test.m:84:2: ObjCClassRef=Baz:84:8 [Context:Baz] 102// CHECK: c-index-api-loadTU-test.m:84:3: ObjCClassRef=Baz:84:8 [Context:Baz] 103// CHECK: c-index-api-loadTU-test.m:84:4: ObjCClassRef=Baz:84:8 [Context:Baz] 104// CHECK: c-index-api-loadTU-test.m:84:6: VarDecl=bee:84:8 [Context:bee] 105// CHECK: c-index-api-loadTU-test.m:84:8: VarDecl=bee:84:8 [Context:bee] 106// CHECK: c-index-api-loadTU-test.m:84:9: VarDecl=bee:84:8 [Context:bee] 107// CHECK: c-index-api-loadTU-test.m:84:10: VarDecl=bee:84:8 [Context:bee] 108// CHECK: <invalid loc>:85:2: TypedefDecl=id:0:0 [Context:id] 109// CHECK: <invalid loc>:85:3: TypedefDecl=id:0:0 [Context:id] 110// CHECK: c-index-api-loadTU-test.m:85:5: VarDecl=a:85:5 [Context:a] 111// CHECK: c-index-api-loadTU-test.m:85:6: VarDecl=a:85:5 [Context:a] 112// CHECK: c-index-api-loadTU-test.m:85:7: VarDecl=a:85:5 [Context:a] 113// CHECK: c-index-api-loadTU-test.m:85:8: VarDecl=a:85:5 [Context:a] 114// CHECK: c-index-api-loadTU-test.m:85:9: ObjCSelectorRef=foo:24:1 [Context:a] 115// CHECK: c-index-api-loadTU-test.m:85:10: VarRef=bee:84:8 [Context:a] 116// CHECK: c-index-api-loadTU-test.m:85:11: VarRef=bee:84:8 [Context:a] 117// CHECK: c-index-api-loadTU-test.m:85:12: VarRef=bee:84:8 [Context:a] 118// CHECK: c-index-api-loadTU-test.m:85:13: ObjCSelectorRef=foo:24:1 [Context:a] 119// CHECK: c-index-api-loadTU-test.m:85:14: ObjCSelectorRef=foo:24:1 [Context:a] 120// CHECK: c-index-api-loadTU-test.m:85:15: ObjCSelectorRef=foo:24:1 [Context:a] 121// CHECK: c-index-api-loadTU-test.m:85:16: ObjCSelectorRef=foo:24:1 [Context:a] 122// CHECK: c-index-api-loadTU-test.m:85:17: ObjCSelectorRef=foo:24:1 [Context:a] 123// CHECK: <invalid loc>:86:2: TypedefDecl=id:0:0 [Context:id] 124// CHECK: <invalid loc>:86:3: TypedefDecl=id:0:0 [Context:id] 125// CHECK: c-index-api-loadTU-test.m:86:5: VarDecl=c:86:12 [Context:c] 126// CHECK: c-index-api-loadTU-test.m:86:6: ObjCProtocolRef=SubP:86:12 [Context:SubP] 127// CHECK: c-index-api-loadTU-test.m:86:7: ObjCProtocolRef=SubP:86:12 [Context:SubP] 128// CHECK: c-index-api-loadTU-test.m:86:8: ObjCProtocolRef=SubP:86:12 [Context:SubP] 129// CHECK: c-index-api-loadTU-test.m:86:9: ObjCProtocolRef=SubP:86:12 [Context:SubP] 130// CHECK: c-index-api-loadTU-test.m:86:10: VarDecl=c:86:12 [Context:c] 131// CHECK: c-index-api-loadTU-test.m:86:12: VarDecl=c:86:12 [Context:c] 132// CHECK: c-index-api-loadTU-test.m:86:13: VarDecl=c:86:12 [Context:c] 133// CHECK: c-index-api-loadTU-test.m:86:14: VarDecl=c:86:12 [Context:c] 134// CHECK: c-index-api-loadTU-test.m:86:15: VarDecl=c:86:12 [Context:c] 135// CHECK: c-index-api-loadTU-test.m:86:16: ObjCSelectorRef=fooC:25:1 [Context:c] 136// CHECK: c-index-api-loadTU-test.m:86:17: ObjCSelectorRef=fooC:25:1 [Context:c] 137// CHECK: c-index-api-loadTU-test.m:86:18: ObjCSelectorRef=fooC:25:1 [Context:c] 138// CHECK: c-index-api-loadTU-test.m:86:19: ObjCSelectorRef=fooC:25:1 [Context:c] 139// CHECK: c-index-api-loadTU-test.m:86:20: ObjCSelectorRef=fooC:25:1 [Context:c] 140// CHECK: c-index-api-loadTU-test.m:86:21: ObjCSelectorRef=fooC:25:1 [Context:c] 141// CHECK: c-index-api-loadTU-test.m:86:22: ObjCSelectorRef=fooC:25:1 [Context:c] 142// CHECK: c-index-api-loadTU-test.m:86:23: ObjCSelectorRef=fooC:25:1 [Context:c] 143// CHECK: c-index-api-loadTU-test.m:86:24: ObjCSelectorRef=fooC:25:1 [Context:c] 144// CHECK: c-index-api-loadTU-test.m:86:25: ObjCSelectorRef=fooC:25:1 [Context:c] 145// CHECK: <invalid loc>:87:2: TypedefDecl=id:0:0 [Context:id] 146// CHECK: <invalid loc>:87:3: TypedefDecl=id:0:0 [Context:id] 147// CHECK: c-index-api-loadTU-test.m:87:5: VarDecl=d:87:13 [Context:d] 148// CHECK: c-index-api-loadTU-test.m:87:6: ObjCProtocolRef=Proto:87:13 [Context:Proto] 149// CHECK: c-index-api-loadTU-test.m:87:7: ObjCProtocolRef=Proto:87:13 [Context:Proto] 150// CHECK: c-index-api-loadTU-test.m:87:8: ObjCProtocolRef=Proto:87:13 [Context:Proto] 151// CHECK: c-index-api-loadTU-test.m:87:9: ObjCProtocolRef=Proto:87:13 [Context:Proto] 152// CHECK: c-index-api-loadTU-test.m:87:10: ObjCProtocolRef=Proto:87:13 [Context:Proto] 153// CHECK: c-index-api-loadTU-test.m:87:11: VarDecl=d:87:13 [Context:d] 154// CHECK: c-index-api-loadTU-test.m:87:13: VarDecl=d:87:13 [Context:d] 155// CHECK: c-index-api-loadTU-test.m:88:2: VarRef=d:87:13 [Context:main] 156// CHECK: c-index-api-loadTU-test.m:88:6: VarRef=c:86:12 [Context:main] 157// CHECK: c-index-api-loadTU-test.m:89:2: ObjCSelectorRef=pMethod:41:1 [Context:main] 158// CHECK: c-index-api-loadTU-test.m:89:3: VarRef=d:87:13 [Context:main] 159// CHECK: c-index-api-loadTU-test.m:89:4: ObjCSelectorRef=pMethod:41:1 [Context:main] 160// CHECK: c-index-api-loadTU-test.m:89:5: ObjCSelectorRef=pMethod:41:1 [Context:main] 161// CHECK: c-index-api-loadTU-test.m:89:6: ObjCSelectorRef=pMethod:41:1 [Context:main] 162// CHECK: c-index-api-loadTU-test.m:89:7: ObjCSelectorRef=pMethod:41:1 [Context:main] 163// CHECK: c-index-api-loadTU-test.m:89:8: ObjCSelectorRef=pMethod:41:1 [Context:main] 164// CHECK: c-index-api-loadTU-test.m:89:9: ObjCSelectorRef=pMethod:41:1 [Context:main] 165// CHECK: c-index-api-loadTU-test.m:89:10: ObjCSelectorRef=pMethod:41:1 [Context:main] 166// CHECK: c-index-api-loadTU-test.m:89:11: ObjCSelectorRef=pMethod:41:1 [Context:main] 167// CHECK: c-index-api-loadTU-test.m:89:12: ObjCSelectorRef=pMethod:41:1 [Context:main] 168// CHECK: c-index-api-loadTU-test.m:90:2: ObjCSelectorRef=catMethodWithFloat::36:1 [Context:main] 169// CHECK: c-index-api-loadTU-test.m:90:3: VarRef=bee:84:8 [Context:main] 170// CHECK: c-index-api-loadTU-test.m:90:4: VarRef=bee:84:8 [Context:main] 171// CHECK: c-index-api-loadTU-test.m:90:5: VarRef=bee:84:8 [Context:main] 172// CHECK: c-index-api-loadTU-test.m:90:6: ObjCSelectorRef=catMethodWithFloat::36:1 [Context:main] 173// CHECK: c-index-api-loadTU-test.m:90:7: ObjCSelectorRef=catMethodWithFloat::36:1 [Context:main] 174// CHECK: c-index-api-loadTU-test.m:90:8: ObjCSelectorRef=catMethodWithFloat::36:1 [Context:main] 175// CHECK: c-index-api-loadTU-test.m:90:9: ObjCSelectorRef=catMethodWithFloat::36:1 [Context:main] 176// CHECK: c-index-api-loadTU-test.m:90:10: ObjCSelectorRef=catMethodWithFloat::36:1 [Context:main] 177// CHECK: c-index-api-loadTU-test.m:90:11: ObjCSelectorRef=catMethodWithFloat::36:1 [Context:main] 178// CHECK: c-index-api-loadTU-test.m:90:12: ObjCSelectorRef=catMethodWithFloat::36:1 [Context:main] 179// CHECK: c-index-api-loadTU-test.m:90:13: ObjCSelectorRef=catMethodWithFloat::36:1 [Context:main] 180// CHECK: c-index-api-loadTU-test.m:90:14: ObjCSelectorRef=catMethodWithFloat::36:1 [Context:main] 181// CHECK: c-index-api-loadTU-test.m:90:15: ObjCSelectorRef=catMethodWithFloat::36:1 [Context:main] 182// CHECK: c-index-api-loadTU-test.m:90:16: ObjCSelectorRef=catMethodWithFloat::36:1 [Context:main] 183// CHECK: c-index-api-loadTU-test.m:90:17: ObjCSelectorRef=catMethodWithFloat::36:1 [Context:main] 184// CHECK: c-index-api-loadTU-test.m:90:18: ObjCSelectorRef=catMethodWithFloat::36:1 [Context:main] 185// CHECK: c-index-api-loadTU-test.m:90:19: ObjCSelectorRef=catMethodWithFloat::36:1 [Context:main] 186// CHECK: c-index-api-loadTU-test.m:90:20: ObjCSelectorRef=catMethodWithFloat::36:1 [Context:main] 187// CHECK: c-index-api-loadTU-test.m:90:21: ObjCSelectorRef=catMethodWithFloat::36:1 [Context:main] 188// CHECK: c-index-api-loadTU-test.m:90:22: ObjCSelectorRef=catMethodWithFloat::36:1 [Context:main] 189// CHECK: c-index-api-loadTU-test.m:90:23: ObjCSelectorRef=catMethodWithFloat::36:1 [Context:main] 190// CHECK: c-index-api-loadTU-test.m:90:24: ObjCSelectorRef=catMethodWithFloat::36:1 [Context:main] 191// CHECK: c-index-api-loadTU-test.m:90:25: ObjCSelectorRef=catMethodWithFloat::36:1 [Context:main] 192// CHECK: c-index-api-loadTU-test.m:90:26: ObjCSelectorRef=floatMethod:37:1 [Context:main] 193// CHECK: c-index-api-loadTU-test.m:90:27: VarRef=bee:84:8 [Context:main] 194// CHECK: c-index-api-loadTU-test.m:90:28: VarRef=bee:84:8 [Context:main] 195// CHECK: c-index-api-loadTU-test.m:90:29: VarRef=bee:84:8 [Context:main] 196// CHECK: c-index-api-loadTU-test.m:90:30: ObjCSelectorRef=floatMethod:37:1 [Context:main] 197// CHECK: c-index-api-loadTU-test.m:90:31: ObjCSelectorRef=floatMethod:37:1 [Context:main] 198// CHECK: c-index-api-loadTU-test.m:90:32: ObjCSelectorRef=floatMethod:37:1 [Context:main] 199// CHECK: c-index-api-loadTU-test.m:90:33: ObjCSelectorRef=floatMethod:37:1 [Context:main] 200// CHECK: c-index-api-loadTU-test.m:90:34: ObjCSelectorRef=floatMethod:37:1 [Context:main] 201// CHECK: c-index-api-loadTU-test.m:90:35: ObjCSelectorRef=floatMethod:37:1 [Context:main] 202// CHECK: c-index-api-loadTU-test.m:90:36: ObjCSelectorRef=floatMethod:37:1 [Context:main] 203// CHECK: c-index-api-loadTU-test.m:90:37: ObjCSelectorRef=floatMethod:37:1 [Context:main] 204// CHECK: c-index-api-loadTU-test.m:90:38: ObjCSelectorRef=floatMethod:37:1 [Context:main] 205// CHECK: c-index-api-loadTU-test.m:90:39: ObjCSelectorRef=floatMethod:37:1 [Context:main] 206// CHECK: c-index-api-loadTU-test.m:90:40: ObjCSelectorRef=floatMethod:37:1 [Context:main] 207// CHECK: c-index-api-loadTU-test.m:90:41: ObjCSelectorRef=floatMethod:37:1 [Context:main] 208// CHECK: c-index-api-loadTU-test.m:90:42: ObjCSelectorRef=floatMethod:37:1 [Context:main] 209// CHECK: c-index-api-loadTU-test.m:90:43: ObjCSelectorRef=catMethodWithFloat::36:1 [Context:main] 210// CHECK: c-index-api-loadTU-test.m:91:3: FunctionRef=main:83:5 [Context:main] 211// CHECK: c-index-api-loadTU-test.m:91:4: FunctionRef=main:83:5 [Context:main] 212// CHECK: c-index-api-loadTU-test.m:91:5: FunctionRef=main:83:5 [Context:main] 213// CHECK: c-index-api-loadTU-test.m:91:6: FunctionRef=main:83:5 [Context:main] 214// CHECK: c-index-api-loadTU-test.m:91:8: EnumConstantRef=someEnum:58:3 [Context:main] 215// CHECK: c-index-api-loadTU-test.m:91:9: EnumConstantRef=someEnum:58:3 [Context:main] 216// CHECK: c-index-api-loadTU-test.m:91:10: EnumConstantRef=someEnum:58:3 [Context:main] 217// CHECK: c-index-api-loadTU-test.m:91:11: EnumConstantRef=someEnum:58:3 [Context:main] 218// CHECK: c-index-api-loadTU-test.m:91:12: EnumConstantRef=someEnum:58:3 [Context:main] 219// CHECK: c-index-api-loadTU-test.m:91:13: EnumConstantRef=someEnum:58:3 [Context:main] 220// CHECK: c-index-api-loadTU-test.m:91:14: EnumConstantRef=someEnum:58:3 [Context:main] 221// CHECK: c-index-api-loadTU-test.m:91:15: EnumConstantRef=someEnum:58:3 [Context:main] 222// CHECK: c-index-api-loadTU-test.m:91:33: VarRef=bee:84:8 [Context:main] 223// CHECK: c-index-api-loadTU-test.m:91:34: VarRef=bee:84:8 [Context:main] 224// CHECK: c-index-api-loadTU-test.m:91:35: VarRef=bee:84:8 [Context:main] 225