diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-01-19 23:20:36 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-01-19 23:20:36 +0000 |
commit | 8f40bbee78b8b4b589d374a4ea80fdc62a70b995 (patch) | |
tree | 4964f0a21c5903a9d49ecfbef61008558a58603f /clang/test/Index | |
parent | 314825bc8ac6ef3245ca4c1b3aee89f0da2632f6 (diff) | |
download | bcm5719-llvm-8f40bbee78b8b4b589d374a4ea80fdc62a70b995.tar.gz bcm5719-llvm-8f40bbee78b8b4b589d374a4ea80fdc62a70b995.zip |
Extend the CIndex API with direct support for expressions and
statements, moving some of the more unnatural kinds of references
(VarRef, EnumConstantRef, etc.) over to the expressions. We can now
poke at arbitrary expressions and statements with, e.g.,
clang_getCursor() and get back useful information (e.g., source
ranges).
llvm-svn: 93946
Diffstat (limited to 'clang/test/Index')
-rw-r--r-- | clang/test/Index/TestClassDecl.m | 2 | ||||
-rw-r--r-- | clang/test/Index/TestClassForwardDecl.m | 2 | ||||
-rw-r--r-- | clang/test/Index/c-index-api-fn-scan.m | 178 | ||||
-rw-r--r-- | clang/test/Index/c-index-getCursor-test.m | 164 |
4 files changed, 176 insertions, 170 deletions
diff --git a/clang/test/Index/TestClassDecl.m b/clang/test/Index/TestClassDecl.m index 884289de96f..900629d593f 100644 --- a/clang/test/Index/TestClassDecl.m +++ b/clang/test/Index/TestClassDecl.m @@ -29,7 +29,7 @@ void function(Foo * arg) // CHECK-scan: {start_line=13 start_col=19 end_line=13 end_col=19} ParmDecl=arg:13:21 // CHECK-scan: {start_line=13 start_col=20 end_line=13 end_col=20} FunctionDecl=function:13:6 (Definition) // CHECK-scan: {start_line=13 start_col=21 end_line=13 end_col=23} ParmDecl=arg:13:21 -// CHECK-scan: {start_line=13 start_col=24 end_line=16 end_col=1} FunctionDecl=function:13:6 (Definition) +// CHECK-scan: {start_line=14 start_col=1 end_line=16 end_col=1} UnexposedStmt=function // CHECK-scan: {start_line=16 start_col=2 end_line=38 end_col=1} Invalid Cursor => NoDeclFound // CHECK-load: TestClassDecl.m:10:12: ObjCInterfaceDecl=Foo:10:12 [Extent=10:1:11:4] diff --git a/clang/test/Index/TestClassForwardDecl.m b/clang/test/Index/TestClassForwardDecl.m index 12f67fff66c..ffb96f4f38d 100644 --- a/clang/test/Index/TestClassForwardDecl.m +++ b/clang/test/Index/TestClassForwardDecl.m @@ -24,7 +24,7 @@ void function(Foo * arg) // CHECK-scan: {start_line=10 start_col=19 end_line=10 end_col=19} ParmDecl=arg:10:21 // CHECK-scan: {start_line=10 start_col=20 end_line=10 end_col=20} FunctionDecl=function:10:6 (Definition) // CHECK-scan: {start_line=10 start_col=21 end_line=10 end_col=23} ParmDecl=arg:10:21 -// CHECK-scan: {start_line=10 start_col=24 end_line=13 end_col=1} FunctionDecl=function:10:6 (Definition) +// CHECK-scan: {start_line=11 start_col=1 end_line=13 end_col=1} UnexposedStmt=function // CHECK-scan: {start_line=13 start_col=2 end_line=46 end_col=1} Invalid Cursor => NoDeclFound diff --git a/clang/test/Index/c-index-api-fn-scan.m b/clang/test/Index/c-index-api-fn-scan.m index 07fbcc6143b..ecd04fe4b4a 100644 --- a/clang/test/Index/c-index-api-fn-scan.m +++ b/clang/test/Index/c-index-api-fn-scan.m @@ -104,15 +104,15 @@ int main (int argc, const char * argv[]) { // CHECK: c-index-api-fn-scan.m:85:6: VarDecl=a:85:5 // CHECK: c-index-api-fn-scan.m:85:7: VarDecl=a:85:5 // CHECK: c-index-api-fn-scan.m:85:8: VarDecl=a:85:5 -// CHECK: c-index-api-fn-scan.m:85:9: ObjCSelectorRef=foo:24:1 -// CHECK: c-index-api-fn-scan.m:85:10: VarRef=bee:84:8 -// CHECK: c-index-api-fn-scan.m:85:11: VarRef=bee:84:8 -// CHECK: c-index-api-fn-scan.m:85:12: VarRef=bee:84:8 -// CHECK: c-index-api-fn-scan.m:85:13: ObjCSelectorRef=foo:24:1 -// CHECK: c-index-api-fn-scan.m:85:14: ObjCSelectorRef=foo:24:1 -// CHECK: c-index-api-fn-scan.m:85:15: ObjCSelectorRef=foo:24:1 -// CHECK: c-index-api-fn-scan.m:85:16: ObjCSelectorRef=foo:24:1 -// CHECK: c-index-api-fn-scan.m:85:17: ObjCSelectorRef=foo:24:1 +// CHECK: c-index-api-fn-scan.m:85:9: ObjCMessageExpr=foo:24:1 +// CHECK: c-index-api-fn-scan.m:85:10: DeclRefExpr=bee:84:8 +// CHECK: c-index-api-fn-scan.m:85:11: DeclRefExpr=bee:84:8 +// CHECK: c-index-api-fn-scan.m:85:12: DeclRefExpr=bee:84:8 +// CHECK: c-index-api-fn-scan.m:85:13: ObjCMessageExpr=foo:24:1 +// CHECK: c-index-api-fn-scan.m:85:14: ObjCMessageExpr=foo:24:1 +// CHECK: c-index-api-fn-scan.m:85:15: ObjCMessageExpr=foo:24:1 +// CHECK: c-index-api-fn-scan.m:85:16: ObjCMessageExpr=foo:24:1 +// CHECK: c-index-api-fn-scan.m:85:17: ObjCMessageExpr=foo:24:1 // CHECK: <invalid loc>:86:2: TypedefDecl=id:0:0 // CHECK: <invalid loc>:86:3: TypedefDecl=id:0:0 // CHECK: c-index-api-fn-scan.m:86:5: VarDecl=c:86:12 @@ -125,16 +125,16 @@ int main (int argc, const char * argv[]) { // CHECK: c-index-api-fn-scan.m:86:13: VarDecl=c:86:12 // CHECK: c-index-api-fn-scan.m:86:14: VarDecl=c:86:12 // CHECK: c-index-api-fn-scan.m:86:15: VarDecl=c:86:12 -// CHECK: c-index-api-fn-scan.m:86:16: ObjCSelectorRef=fooC:25:1 -// CHECK: c-index-api-fn-scan.m:86:17: ObjCSelectorRef=fooC:25:1 -// CHECK: c-index-api-fn-scan.m:86:18: ObjCSelectorRef=fooC:25:1 -// CHECK: c-index-api-fn-scan.m:86:19: ObjCSelectorRef=fooC:25:1 -// CHECK: c-index-api-fn-scan.m:86:20: ObjCSelectorRef=fooC:25:1 -// CHECK: c-index-api-fn-scan.m:86:21: ObjCSelectorRef=fooC:25:1 -// CHECK: c-index-api-fn-scan.m:86:22: ObjCSelectorRef=fooC:25:1 -// CHECK: c-index-api-fn-scan.m:86:23: ObjCSelectorRef=fooC:25:1 -// CHECK: c-index-api-fn-scan.m:86:24: ObjCSelectorRef=fooC:25:1 -// CHECK: c-index-api-fn-scan.m:86:25: ObjCSelectorRef=fooC:25:1 +// CHECK: c-index-api-fn-scan.m:86:16: ObjCMessageExpr=fooC:25:1 +// CHECK: c-index-api-fn-scan.m:86:17: ObjCMessageExpr=fooC:25:1 +// CHECK: c-index-api-fn-scan.m:86:18: ObjCMessageExpr=fooC:25:1 +// CHECK: c-index-api-fn-scan.m:86:19: ObjCMessageExpr=fooC:25:1 +// CHECK: c-index-api-fn-scan.m:86:20: ObjCMessageExpr=fooC:25:1 +// CHECK: c-index-api-fn-scan.m:86:21: ObjCMessageExpr=fooC:25:1 +// CHECK: c-index-api-fn-scan.m:86:22: ObjCMessageExpr=fooC:25:1 +// CHECK: c-index-api-fn-scan.m:86:23: ObjCMessageExpr=fooC:25:1 +// CHECK: c-index-api-fn-scan.m:86:24: ObjCMessageExpr=fooC:25:1 +// CHECK: c-index-api-fn-scan.m:86:25: ObjCMessageExpr=fooC:25:1 // CHECK: <invalid loc>:87:2: TypedefDecl=id:0:0 // CHECK: <invalid loc>:87:3: TypedefDecl=id:0:0 // CHECK: c-index-api-fn-scan.m:87:5: VarDecl=d:87:13 @@ -145,73 +145,73 @@ int main (int argc, const char * argv[]) { // CHECK: c-index-api-fn-scan.m:87:10: ObjCProtocolRef=Proto:40:1 // CHECK: c-index-api-fn-scan.m:87:11: VarDecl=d:87:13 // CHECK: c-index-api-fn-scan.m:87:13: VarDecl=d:87:13 -// CHECK: c-index-api-fn-scan.m:88:2: VarRef=d:87:13 -// CHECK: c-index-api-fn-scan.m:88:6: VarRef=c:86:12 -// CHECK: c-index-api-fn-scan.m:89:2: ObjCSelectorRef=pMethod:41:1 -// CHECK: c-index-api-fn-scan.m:89:3: VarRef=d:87:13 -// CHECK: c-index-api-fn-scan.m:89:4: ObjCSelectorRef=pMethod:41:1 -// CHECK: c-index-api-fn-scan.m:89:5: ObjCSelectorRef=pMethod:41:1 -// CHECK: c-index-api-fn-scan.m:89:6: ObjCSelectorRef=pMethod:41:1 -// CHECK: c-index-api-fn-scan.m:89:7: ObjCSelectorRef=pMethod:41:1 -// CHECK: c-index-api-fn-scan.m:89:8: ObjCSelectorRef=pMethod:41:1 -// CHECK: c-index-api-fn-scan.m:89:9: ObjCSelectorRef=pMethod:41:1 -// CHECK: c-index-api-fn-scan.m:89:10: ObjCSelectorRef=pMethod:41:1 -// CHECK: c-index-api-fn-scan.m:89:11: ObjCSelectorRef=pMethod:41:1 -// CHECK: c-index-api-fn-scan.m:89:12: ObjCSelectorRef=pMethod:41:1 -// CHECK: c-index-api-fn-scan.m:90:2: ObjCSelectorRef=catMethodWithFloat::36:1 -// CHECK: c-index-api-fn-scan.m:90:3: VarRef=bee:84:8 -// CHECK: c-index-api-fn-scan.m:90:4: VarRef=bee:84:8 -// CHECK: c-index-api-fn-scan.m:90:5: VarRef=bee:84:8 -// CHECK: c-index-api-fn-scan.m:90:6: ObjCSelectorRef=catMethodWithFloat::36:1 -// CHECK: c-index-api-fn-scan.m:90:7: ObjCSelectorRef=catMethodWithFloat::36:1 -// CHECK: c-index-api-fn-scan.m:90:8: ObjCSelectorRef=catMethodWithFloat::36:1 -// CHECK: c-index-api-fn-scan.m:90:9: ObjCSelectorRef=catMethodWithFloat::36:1 -// CHECK: c-index-api-fn-scan.m:90:10: ObjCSelectorRef=catMethodWithFloat::36:1 -// CHECK: c-index-api-fn-scan.m:90:11: ObjCSelectorRef=catMethodWithFloat::36:1 -// CHECK: c-index-api-fn-scan.m:90:12: ObjCSelectorRef=catMethodWithFloat::36:1 -// CHECK: c-index-api-fn-scan.m:90:13: ObjCSelectorRef=catMethodWithFloat::36:1 -// CHECK: c-index-api-fn-scan.m:90:14: ObjCSelectorRef=catMethodWithFloat::36:1 -// CHECK: c-index-api-fn-scan.m:90:15: ObjCSelectorRef=catMethodWithFloat::36:1 -// CHECK: c-index-api-fn-scan.m:90:16: ObjCSelectorRef=catMethodWithFloat::36:1 -// CHECK: c-index-api-fn-scan.m:90:17: ObjCSelectorRef=catMethodWithFloat::36:1 -// CHECK: c-index-api-fn-scan.m:90:18: ObjCSelectorRef=catMethodWithFloat::36:1 -// CHECK: c-index-api-fn-scan.m:90:19: ObjCSelectorRef=catMethodWithFloat::36:1 -// CHECK: c-index-api-fn-scan.m:90:20: ObjCSelectorRef=catMethodWithFloat::36:1 -// CHECK: c-index-api-fn-scan.m:90:21: ObjCSelectorRef=catMethodWithFloat::36:1 -// CHECK: c-index-api-fn-scan.m:90:22: ObjCSelectorRef=catMethodWithFloat::36:1 -// CHECK: c-index-api-fn-scan.m:90:23: ObjCSelectorRef=catMethodWithFloat::36:1 -// CHECK: c-index-api-fn-scan.m:90:24: ObjCSelectorRef=catMethodWithFloat::36:1 -// CHECK: c-index-api-fn-scan.m:90:25: ObjCSelectorRef=catMethodWithFloat::36:1 -// CHECK: c-index-api-fn-scan.m:90:26: ObjCSelectorRef=floatMethod:37:1 -// CHECK: c-index-api-fn-scan.m:90:27: VarRef=bee:84:8 -// CHECK: c-index-api-fn-scan.m:90:28: VarRef=bee:84:8 -// CHECK: c-index-api-fn-scan.m:90:29: VarRef=bee:84:8 -// CHECK: c-index-api-fn-scan.m:90:30: ObjCSelectorRef=floatMethod:37:1 -// CHECK: c-index-api-fn-scan.m:90:31: ObjCSelectorRef=floatMethod:37:1 -// CHECK: c-index-api-fn-scan.m:90:32: ObjCSelectorRef=floatMethod:37:1 -// CHECK: c-index-api-fn-scan.m:90:33: ObjCSelectorRef=floatMethod:37:1 -// CHECK: c-index-api-fn-scan.m:90:34: ObjCSelectorRef=floatMethod:37:1 -// CHECK: c-index-api-fn-scan.m:90:35: ObjCSelectorRef=floatMethod:37:1 -// CHECK: c-index-api-fn-scan.m:90:36: ObjCSelectorRef=floatMethod:37:1 -// CHECK: c-index-api-fn-scan.m:90:37: ObjCSelectorRef=floatMethod:37:1 -// CHECK: c-index-api-fn-scan.m:90:38: ObjCSelectorRef=floatMethod:37:1 -// CHECK: c-index-api-fn-scan.m:90:39: ObjCSelectorRef=floatMethod:37:1 -// CHECK: c-index-api-fn-scan.m:90:40: ObjCSelectorRef=floatMethod:37:1 -// CHECK: c-index-api-fn-scan.m:90:41: ObjCSelectorRef=floatMethod:37:1 -// CHECK: c-index-api-fn-scan.m:90:42: ObjCSelectorRef=floatMethod:37:1 -// CHECK: c-index-api-fn-scan.m:90:43: ObjCSelectorRef=catMethodWithFloat::36:1 -// CHECK: c-index-api-fn-scan.m:91:3: FunctionRef=main:83:5 -// CHECK: c-index-api-fn-scan.m:91:4: FunctionRef=main:83:5 -// CHECK: c-index-api-fn-scan.m:91:5: FunctionRef=main:83:5 -// CHECK: c-index-api-fn-scan.m:91:6: FunctionRef=main:83:5 -// CHECK: c-index-api-fn-scan.m:91:8: EnumConstantRef=someEnum:58:3 -// CHECK: c-index-api-fn-scan.m:91:9: EnumConstantRef=someEnum:58:3 -// CHECK: c-index-api-fn-scan.m:91:10: EnumConstantRef=someEnum:58:3 -// CHECK: c-index-api-fn-scan.m:91:11: EnumConstantRef=someEnum:58:3 -// CHECK: c-index-api-fn-scan.m:91:12: EnumConstantRef=someEnum:58:3 -// CHECK: c-index-api-fn-scan.m:91:13: EnumConstantRef=someEnum:58:3 -// CHECK: c-index-api-fn-scan.m:91:14: EnumConstantRef=someEnum:58:3 -// CHECK: c-index-api-fn-scan.m:91:15: EnumConstantRef=someEnum:58:3 -// CHECK: c-index-api-fn-scan.m:91:33: VarRef=bee:84:8 -// CHECK: c-index-api-fn-scan.m:91:34: VarRef=bee:84:8 -// CHECK: c-index-api-fn-scan.m:91:35: VarRef=bee:84:8 +// CHECK: c-index-api-fn-scan.m:88:2: DeclRefExpr=d:87:13 +// CHECK: c-index-api-fn-scan.m:88:6: DeclRefExpr=c:86:12 +// CHECK: c-index-api-fn-scan.m:89:2: ObjCMessageExpr=pMethod:41:1 +// CHECK: c-index-api-fn-scan.m:89:3: DeclRefExpr=d:87:13 +// CHECK: c-index-api-fn-scan.m:89:4: ObjCMessageExpr=pMethod:41:1 +// CHECK: c-index-api-fn-scan.m:89:5: ObjCMessageExpr=pMethod:41:1 +// CHECK: c-index-api-fn-scan.m:89:6: ObjCMessageExpr=pMethod:41:1 +// CHECK: c-index-api-fn-scan.m:89:7: ObjCMessageExpr=pMethod:41:1 +// CHECK: c-index-api-fn-scan.m:89:8: ObjCMessageExpr=pMethod:41:1 +// CHECK: c-index-api-fn-scan.m:89:9: ObjCMessageExpr=pMethod:41:1 +// CHECK: c-index-api-fn-scan.m:89:10: ObjCMessageExpr=pMethod:41:1 +// CHECK: c-index-api-fn-scan.m:89:11: ObjCMessageExpr=pMethod:41:1 +// CHECK: c-index-api-fn-scan.m:89:12: ObjCMessageExpr=pMethod:41:1 +// CHECK: c-index-api-fn-scan.m:90:2: ObjCMessageExpr=catMethodWithFloat::36:1 +// CHECK: c-index-api-fn-scan.m:90:3: DeclRefExpr=bee:84:8 +// CHECK: c-index-api-fn-scan.m:90:4: DeclRefExpr=bee:84:8 +// CHECK: c-index-api-fn-scan.m:90:5: DeclRefExpr=bee:84:8 +// CHECK: c-index-api-fn-scan.m:90:6: ObjCMessageExpr=catMethodWithFloat::36:1 +// CHECK: c-index-api-fn-scan.m:90:7: ObjCMessageExpr=catMethodWithFloat::36:1 +// CHECK: c-index-api-fn-scan.m:90:8: ObjCMessageExpr=catMethodWithFloat::36:1 +// CHECK: c-index-api-fn-scan.m:90:9: ObjCMessageExpr=catMethodWithFloat::36:1 +// CHECK: c-index-api-fn-scan.m:90:10: ObjCMessageExpr=catMethodWithFloat::36:1 +// CHECK: c-index-api-fn-scan.m:90:11: ObjCMessageExpr=catMethodWithFloat::36:1 +// CHECK: c-index-api-fn-scan.m:90:12: ObjCMessageExpr=catMethodWithFloat::36:1 +// CHECK: c-index-api-fn-scan.m:90:13: ObjCMessageExpr=catMethodWithFloat::36:1 +// CHECK: c-index-api-fn-scan.m:90:14: ObjCMessageExpr=catMethodWithFloat::36:1 +// CHECK: c-index-api-fn-scan.m:90:15: ObjCMessageExpr=catMethodWithFloat::36:1 +// CHECK: c-index-api-fn-scan.m:90:16: ObjCMessageExpr=catMethodWithFloat::36:1 +// CHECK: c-index-api-fn-scan.m:90:17: ObjCMessageExpr=catMethodWithFloat::36:1 +// CHECK: c-index-api-fn-scan.m:90:18: ObjCMessageExpr=catMethodWithFloat::36:1 +// CHECK: c-index-api-fn-scan.m:90:19: ObjCMessageExpr=catMethodWithFloat::36:1 +// CHECK: c-index-api-fn-scan.m:90:20: ObjCMessageExpr=catMethodWithFloat::36:1 +// CHECK: c-index-api-fn-scan.m:90:21: ObjCMessageExpr=catMethodWithFloat::36:1 +// CHECK: c-index-api-fn-scan.m:90:22: ObjCMessageExpr=catMethodWithFloat::36:1 +// CHECK: c-index-api-fn-scan.m:90:23: ObjCMessageExpr=catMethodWithFloat::36:1 +// CHECK: c-index-api-fn-scan.m:90:24: ObjCMessageExpr=catMethodWithFloat::36:1 +// CHECK: c-index-api-fn-scan.m:90:25: ObjCMessageExpr=catMethodWithFloat::36:1 +// CHECK: c-index-api-fn-scan.m:90:26: ObjCMessageExpr=floatMethod:37:1 +// CHECK: c-index-api-fn-scan.m:90:27: DeclRefExpr=bee:84:8 +// CHECK: c-index-api-fn-scan.m:90:28: DeclRefExpr=bee:84:8 +// CHECK: c-index-api-fn-scan.m:90:29: DeclRefExpr=bee:84:8 +// CHECK: c-index-api-fn-scan.m:90:30: ObjCMessageExpr=floatMethod:37:1 +// CHECK: c-index-api-fn-scan.m:90:31: ObjCMessageExpr=floatMethod:37:1 +// CHECK: c-index-api-fn-scan.m:90:32: ObjCMessageExpr=floatMethod:37:1 +// CHECK: c-index-api-fn-scan.m:90:33: ObjCMessageExpr=floatMethod:37:1 +// CHECK: c-index-api-fn-scan.m:90:34: ObjCMessageExpr=floatMethod:37:1 +// CHECK: c-index-api-fn-scan.m:90:35: ObjCMessageExpr=floatMethod:37:1 +// CHECK: c-index-api-fn-scan.m:90:36: ObjCMessageExpr=floatMethod:37:1 +// CHECK: c-index-api-fn-scan.m:90:37: ObjCMessageExpr=floatMethod:37:1 +// CHECK: c-index-api-fn-scan.m:90:38: ObjCMessageExpr=floatMethod:37:1 +// CHECK: c-index-api-fn-scan.m:90:39: ObjCMessageExpr=floatMethod:37:1 +// CHECK: c-index-api-fn-scan.m:90:40: ObjCMessageExpr=floatMethod:37:1 +// CHECK: c-index-api-fn-scan.m:90:41: ObjCMessageExpr=floatMethod:37:1 +// CHECK: c-index-api-fn-scan.m:90:42: ObjCMessageExpr=floatMethod:37:1 +// CHECK: c-index-api-fn-scan.m:90:43: ObjCMessageExpr=catMethodWithFloat::36:1 +// CHECK: c-index-api-fn-scan.m:91:3: DeclRefExpr=main:83:5 +// CHECK: c-index-api-fn-scan.m:91:4: DeclRefExpr=main:83:5 +// CHECK: c-index-api-fn-scan.m:91:5: DeclRefExpr=main:83:5 +// CHECK: c-index-api-fn-scan.m:91:6: DeclRefExpr=main:83:5 +// CHECK: c-index-api-fn-scan.m:91:8: DeclRefExpr=someEnum:58:3 +// CHECK: c-index-api-fn-scan.m:91:9: DeclRefExpr=someEnum:58:3 +// CHECK: c-index-api-fn-scan.m:91:10: DeclRefExpr=someEnum:58:3 +// CHECK: c-index-api-fn-scan.m:91:11: DeclRefExpr=someEnum:58:3 +// CHECK: c-index-api-fn-scan.m:91:12: DeclRefExpr=someEnum:58:3 +// CHECK: c-index-api-fn-scan.m:91:13: DeclRefExpr=someEnum:58:3 +// CHECK: c-index-api-fn-scan.m:91:14: DeclRefExpr=someEnum:58:3 +// CHECK: c-index-api-fn-scan.m:91:15: DeclRefExpr=someEnum:58:3 +// CHECK: c-index-api-fn-scan.m:91:33: DeclRefExpr=bee:84:8 +// CHECK: c-index-api-fn-scan.m:91:34: DeclRefExpr=bee:84:8 +// CHECK: c-index-api-fn-scan.m:91:35: DeclRefExpr=bee:84:8 diff --git a/clang/test/Index/c-index-getCursor-test.m b/clang/test/Index/c-index-getCursor-test.m index 8e2f37f1344..e0d8588bc2a 100644 --- a/clang/test/Index/c-index-getCursor-test.m +++ b/clang/test/Index/c-index-getCursor-test.m @@ -53,108 +53,114 @@ int main (int argc, const char * argv[]) { } // CHECK: {start_line=1 start_col=1 end_line=2 end_col=62} Invalid Cursor => NoDeclFound -// CHECK: {start_line=3 start_col=1 end_line=6 end_col=1} ObjCInterfaceDecl=Foo:3:1 +// CHECK: {start_line=3 start_col=1 end_line=6 end_col=1} ObjCInterfaceDecl=Foo:3:12 // CHECK: {start_line=7 start_col=1 end_line=7 end_col=6} ObjCInstanceMethodDecl=foo:7:1 -// CHECK: {start_line=7 start_col=7 end_line=7 end_col=7} ObjCInterfaceDecl=Foo:3:1 +// CHECK: {start_line=7 start_col=7 end_line=7 end_col=7} ObjCInterfaceDecl=Foo:3:12 // CHECK: {start_line=8 start_col=1 end_line=8 end_col=7} ObjCClassMethodDecl=fooC:8:1 -// CHECK: {start_line=8 start_col=8 end_line=10 end_col=4} ObjCInterfaceDecl=Foo:3:1 +// CHECK: {start_line=8 start_col=8 end_line=10 end_col=4} ObjCInterfaceDecl=Foo:3:12 // CHECK: {start_line=10 start_col=5 end_line=11 end_col=1} Invalid Cursor => NoDeclFound -// CHECK: {start_line=12 start_col=1 end_line=16 end_col=4} ObjCInterfaceDecl=Bar:12:1 +// CHECK: {start_line=12 start_col=1 end_line=16 end_col=4} ObjCInterfaceDecl=Bar:12:12 // CHECK: {start_line=16 start_col=5 end_line=17 end_col=1} Invalid Cursor => NoDeclFound -// CHECK: {start_line=18 start_col=1 end_line=18 end_col=24} ObjCCategoryDecl=FooCat:18:1 +// CHECK: {start_line=18 start_col=1 end_line=18 end_col=24} ObjCCategoryDecl=FooCat:18:12 // CHECK: {start_line=19 start_col=1 end_line=19 end_col=28} ObjCInstanceMethodDecl=catMethodWithFloat::19:1 -// CHECK: {start_line=19 start_col=29 end_line=19 end_col=33} ParmDecl=fArg:19:36 +// CHECK: {start_line=19 start_col=29 end_line=19 end_col=33} ParmDecl=fArg:19:36 (Definition) // CHECK: {start_line=19 start_col=34 end_line=19 end_col=35} ObjCInstanceMethodDecl=catMethodWithFloat::19:1 -// CHECK: {start_line=19 start_col=36 end_line=19 end_col=39} ParmDecl=fArg:19:36 +// CHECK: {start_line=19 start_col=36 end_line=19 end_col=39} ParmDecl=fArg:19:36 (Definition) // CHECK: {start_line=19 start_col=40 end_line=19 end_col=40} ObjCInstanceMethodDecl=catMethodWithFloat::19:1 -// CHECK: {start_line=19 start_col=41 end_line=19 end_col=41} ObjCCategoryDecl=FooCat:18:1 +// CHECK: {start_line=19 start_col=41 end_line=19 end_col=41} ObjCCategoryDecl=FooCat:18:12 // CHECK: {start_line=20 start_col=1 end_line=20 end_col=22} ObjCInstanceMethodDecl=floatMethod:20:1 -// CHECK: {start_line=20 start_col=23 end_line=21 end_col=4} ObjCCategoryDecl=FooCat:18:1 +// CHECK: {start_line=20 start_col=23 end_line=21 end_col=4} ObjCCategoryDecl=FooCat:18:12 // CHECK: {start_line=21 start_col=5 end_line=22 end_col=1} Invalid Cursor => NoDeclFound -// CHECK: {start_line=23 start_col=1 end_line=23 end_col=16} ObjCProtocolDecl=Proto:23:1 +// CHECK: {start_line=23 start_col=1 end_line=23 end_col=16} ObjCProtocolDecl=Proto:23:1 (Definition) // CHECK: {start_line=24 start_col=1 end_line=24 end_col=10} ObjCInstanceMethodDecl=pMethod:24:1 -// CHECK: {start_line=24 start_col=11 end_line=25 end_col=4} ObjCProtocolDecl=Proto:23:1 +// CHECK: {start_line=24 start_col=11 end_line=25 end_col=4} ObjCProtocolDecl=Proto:23:1 (Definition) // CHECK: {start_line=25 start_col=5 end_line=26 end_col=1} Invalid Cursor => NoDeclFound -// CHECK: {start_line=27 start_col=1 end_line=27 end_col=23} ObjCProtocolDecl=SubP:27:1 +// CHECK: {start_line=27 start_col=1 end_line=27 end_col=23} ObjCProtocolDecl=SubP:27:1 (Definition) // CHECK: {start_line=28 start_col=1 end_line=28 end_col=11} ObjCInstanceMethodDecl=spMethod:28:1 -// CHECK: {start_line=28 start_col=12 end_line=29 end_col=4} ObjCProtocolDecl=SubP:27:1 +// CHECK: {start_line=28 start_col=12 end_line=29 end_col=4} ObjCProtocolDecl=SubP:27:1 (Definition) // CHECK: {start_line=29 start_col=5 end_line=30 end_col=1} Invalid Cursor => NoDeclFound -// CHECK: {start_line=31 start_col=1 end_line=33 end_col=4} ObjCInterfaceDecl=Baz:31:1 -// CHECK: {start_line=33 start_col=5 end_line=33 end_col=7} ObjCIvarDecl=_anIVar:33:9 -// CHECK: {start_line=33 start_col=8 end_line=33 end_col=8} ObjCInterfaceDecl=Baz:31:1 -// CHECK: {start_line=33 start_col=9 end_line=33 end_col=15} ObjCIvarDecl=_anIVar:33:9 -// CHECK: {start_line=33 start_col=16 end_line=35 end_col=1} ObjCInterfaceDecl=Baz:31:1 +// CHECK: {start_line=31 start_col=1 end_line=33 end_col=4} ObjCInterfaceDecl=Baz:31:12 +// CHECK: {start_line=33 start_col=5 end_line=33 end_col=7} ObjCIvarDecl=_anIVar:33:9 (Definition) +// CHECK: {start_line=33 start_col=8 end_line=33 end_col=8} ObjCInterfaceDecl=Baz:31:12 +// CHECK: {start_line=33 start_col=9 end_line=33 end_col=15} ObjCIvarDecl=_anIVar:33:9 (Definition) +// CHECK: {start_line=33 start_col=16 end_line=35 end_col=1} ObjCInterfaceDecl=Baz:31:12 // CHECK: {start_line=36 start_col=1 end_line=36 end_col=20} ObjCInstanceMethodDecl=bazMethod:36:1 -// CHECK: {start_line=36 start_col=21 end_line=38 end_col=4} ObjCInterfaceDecl=Baz:31:1 +// CHECK: {start_line=36 start_col=21 end_line=38 end_col=4} ObjCInterfaceDecl=Baz:31:12 // CHECK: {start_line=38 start_col=5 end_line=39 end_col=1} Invalid Cursor => NoDeclFound -// CHECK: {start_line=40 start_col=1 end_line=41 end_col=2} EnumDecl=:40:1 -// CHECK: {start_line=41 start_col=3 end_line=41 end_col=10} EnumConstantDecl=someEnum:41:3 -// CHECK: {start_line=41 start_col=11 end_line=42 end_col=1} EnumDecl=:40:1 +// CHECK: {start_line=40 start_col=1 end_line=41 end_col=2} EnumDecl=:40:1 (Definition) +// CHECK: {start_line=41 start_col=3 end_line=41 end_col=10} EnumConstantDecl=someEnum:41:3 (Definition) +// CHECK: {start_line=41 start_col=11 end_line=42 end_col=1} EnumDecl=:40:1 (Definition) // CHECK: {start_line=42 start_col=2 end_line=43 end_col=1} Invalid Cursor => NoDeclFound // CHECK: {start_line=44 start_col=1 end_line=44 end_col=3} FunctionDecl=main:44:5 (Definition) // CHECK: {start_line=44 start_col=4 end_line=44 end_col=4} Invalid Cursor => NoDeclFound // CHECK: {start_line=44 start_col=5 end_line=44 end_col=10} FunctionDecl=main:44:5 (Definition) -// CHECK: {start_line=44 start_col=11 end_line=44 end_col=13} ParmDecl=argc:44:15 +// CHECK: {start_line=44 start_col=11 end_line=44 end_col=13} ParmDecl=argc:44:15 (Definition) // CHECK: {start_line=44 start_col=14 end_line=44 end_col=14} FunctionDecl=main:44:5 (Definition) -// CHECK: {start_line=44 start_col=15 end_line=44 end_col=18} ParmDecl=argc:44:15 +// CHECK: {start_line=44 start_col=15 end_line=44 end_col=18} ParmDecl=argc:44:15 (Definition) // CHECK: {start_line=44 start_col=19 end_line=44 end_col=26} FunctionDecl=main:44:5 (Definition) -// CHECK: {start_line=44 start_col=27 end_line=44 end_col=30} ParmDecl=argv:44:34 +// CHECK: {start_line=44 start_col=27 end_line=44 end_col=30} ParmDecl=argv:44:34 (Definition) // CHECK: {start_line=44 start_col=31 end_line=44 end_col=31} FunctionDecl=main:44:5 (Definition) -// CHECK: {start_line=44 start_col=32 end_line=44 end_col=32} ParmDecl=argv:44:34 +// CHECK: {start_line=44 start_col=32 end_line=44 end_col=32} ParmDecl=argv:44:34 (Definition) // CHECK: {start_line=44 start_col=33 end_line=44 end_col=33} FunctionDecl=main:44:5 (Definition) -// CHECK: {start_line=44 start_col=34 end_line=44 end_col=39} ParmDecl=argv:44:34 -// CHECK: {start_line=44 start_col=40 end_line=45 end_col=1} FunctionDecl=main:44:5 (Definition) -// CHECK: {start_line=45 start_col=2 end_line=45 end_col=4} ObjCClassRef=Baz:31:1 -// CHECK: {start_line=45 start_col=5 end_line=45 end_col=5} FunctionDecl=main:44:5 (Definition) -// CHECK: {start_line=45 start_col=6 end_line=45 end_col=6} VarDecl=bee:45:8 -// CHECK: {start_line=45 start_col=7 end_line=45 end_col=7} FunctionDecl=main:44:5 (Definition) -// CHECK: {start_line=45 start_col=8 end_line=45 end_col=10} VarDecl=bee:45:8 -// CHECK: {start_line=45 start_col=11 end_line=46 end_col=1} FunctionDecl=main:44:5 (Definition) -// CHECK: {start_line=46 start_col=2 end_line=46 end_col=3} TypedefDecl=id:0:0 -// CHECK: {start_line=46 start_col=4 end_line=46 end_col=4} FunctionDecl=main:44:5 (Definition) -// CHECK: {start_line=46 start_col=5 end_line=46 end_col=8} VarDecl=a:46:5 -// CHECK: {start_line=46 start_col=9 end_line=46 end_col=9} ObjCSelectorRef=foo:7:1 -// CHECK: {start_line=46 start_col=10 end_line=46 end_col=12} VarRef=bee:45:8 -// CHECK: {start_line=46 start_col=13 end_line=46 end_col=17} ObjCSelectorRef=foo:7:1 -// CHECK: {start_line=46 start_col=18 end_line=47 end_col=1} FunctionDecl=main:44:5 (Definition) -// CHECK: {start_line=47 start_col=2 end_line=47 end_col=3} TypedefDecl=id:0:0 -// CHECK: {start_line=47 start_col=4 end_line=47 end_col=4} FunctionDecl=main:44:5 (Definition) -// CHECK: {start_line=47 start_col=5 end_line=47 end_col=5} VarDecl=c:47:12 +// CHECK: {start_line=44 start_col=34 end_line=44 end_col=39} ParmDecl=argv:44:34 (Definition) +// CHECK: {start_line=44 start_col=40 end_line=44 end_col=41} FunctionDecl=main:44:5 (Definition) +// CHECK: {start_line=44 start_col=42 end_line=45 end_col=1} UnexposedStmt=main +// CHECK: {start_line=45 start_col=2 end_line=45 end_col=4} ObjCClassRef=Baz:31:12 +// CHECK: {start_line=45 start_col=5 end_line=45 end_col=5} UnexposedStmt=main +// CHECK: {start_line=45 start_col=6 end_line=45 end_col=6} VarDecl=bee:45:8 (Definition) +// CHECK: {start_line=45 start_col=7 end_line=45 end_col=7} UnexposedStmt=main +// CHECK: {start_line=45 start_col=8 end_line=45 end_col=10} VarDecl=bee:45:8 (Definition) +// CHECK: {start_line=45 start_col=11 end_line=45 end_col=11} UnexposedStmt=main +// CHECK: {start_line=45 start_col=12 end_line=46 end_col=1} UnexposedStmt=main +// CHECK: {start_line=46 start_col=2 end_line=46 end_col=3} TypedefDecl=id:0:0 (Definition) +// CHECK: {start_line=46 start_col=4 end_line=46 end_col=4} UnexposedStmt=main +// CHECK: {start_line=46 start_col=5 end_line=46 end_col=8} VarDecl=a:46:5 (Definition) +// CHECK: {start_line=46 start_col=9 end_line=46 end_col=9} ObjCMessageExpr=foo:7:1 +// CHECK: {start_line=46 start_col=10 end_line=46 end_col=12} DeclRefExpr=bee:45:8 +// CHECK: {start_line=46 start_col=13 end_line=46 end_col=17} ObjCMessageExpr=foo:7:1 +// CHECK: {start_line=46 start_col=18 end_line=46 end_col=18} UnexposedStmt=main +// CHECK: {start_line=46 start_col=19 end_line=47 end_col=1} UnexposedStmt=main +// CHECK: {start_line=47 start_col=2 end_line=47 end_col=3} TypedefDecl=id:0:0 (Definition) +// CHECK: {start_line=47 start_col=4 end_line=47 end_col=4} UnexposedStmt=main +// CHECK: {start_line=47 start_col=5 end_line=47 end_col=5} VarDecl=c:47:12 (Definition) // CHECK: {start_line=47 start_col=6 end_line=47 end_col=9} ObjCProtocolRef=SubP:27:1 -// CHECK: {start_line=47 start_col=10 end_line=47 end_col=10} VarDecl=c:47:12 -// CHECK: {start_line=47 start_col=11 end_line=47 end_col=11} FunctionDecl=main:44:5 (Definition) -// CHECK: {start_line=47 start_col=12 end_line=47 end_col=15} VarDecl=c:47:12 -// CHECK: {start_line=47 start_col=16 end_line=47 end_col=25} ObjCSelectorRef=fooC:8:1 -// CHECK: {start_line=47 start_col=26 end_line=48 end_col=1} FunctionDecl=main:44:5 (Definition) -// CHECK: {start_line=48 start_col=2 end_line=48 end_col=3} TypedefDecl=id:0:0 -// CHECK: {start_line=48 start_col=4 end_line=48 end_col=4} FunctionDecl=main:44:5 (Definition) -// CHECK: {start_line=48 start_col=5 end_line=48 end_col=5} VarDecl=d:48:13 +// CHECK: {start_line=47 start_col=10 end_line=47 end_col=10} VarDecl=c:47:12 (Definition) +// CHECK: {start_line=47 start_col=11 end_line=47 end_col=11} UnexposedStmt=main +// CHECK: {start_line=47 start_col=12 end_line=47 end_col=15} VarDecl=c:47:12 (Definition) +// CHECK: {start_line=47 start_col=16 end_line=47 end_col=25} ObjCMessageExpr=fooC:8:1 +// CHECK: {start_line=47 start_col=26 end_line=47 end_col=26} UnexposedStmt=main +// CHECK: {start_line=47 start_col=27 end_line=48 end_col=1} UnexposedStmt=main +// CHECK: {start_line=48 start_col=2 end_line=48 end_col=3} TypedefDecl=id:0:0 (Definition) +// CHECK: {start_line=48 start_col=4 end_line=48 end_col=4} UnexposedStmt=main +// CHECK: {start_line=48 start_col=5 end_line=48 end_col=5} VarDecl=d:48:13 (Definition) // CHECK: {start_line=48 start_col=6 end_line=48 end_col=10} ObjCProtocolRef=Proto:23:1 -// CHECK: {start_line=48 start_col=11 end_line=48 end_col=11} VarDecl=d:48:13 -// CHECK: {start_line=48 start_col=12 end_line=48 end_col=12} FunctionDecl=main:44:5 (Definition) -// CHECK: {start_line=48 start_col=13 end_line=48 end_col=13} VarDecl=d:48:13 -// CHECK: {start_line=48 start_col=14 end_line=49 end_col=1} FunctionDecl=main:44:5 (Definition) -// CHECK: {start_line=49 start_col=2 end_line=49 end_col=2} VarRef=d:48:13 -// CHECK: {start_line=49 start_col=3 end_line=49 end_col=5} FunctionDecl=main:44:5 (Definition) -// CHECK: {start_line=49 start_col=6 end_line=49 end_col=6} VarRef=c:47:12 -// CHECK: {start_line=49 start_col=7 end_line=50 end_col=1} FunctionDecl=main:44:5 (Definition) -// CHECK: {start_line=50 start_col=2 end_line=50 end_col=2} ObjCSelectorRef=pMethod:24:1 -// CHECK: {start_line=50 start_col=3 end_line=50 end_col=3} VarRef=d:48:13 -// CHECK: {start_line=50 start_col=4 end_line=50 end_col=12} ObjCSelectorRef=pMethod:24:1 -// CHECK: {start_line=50 start_col=13 end_line=51 end_col=1} FunctionDecl=main:44:5 (Definition) -// CHECK: {start_line=51 start_col=2 end_line=51 end_col=2} ObjCSelectorRef=catMethodWithFloat::19:1 -// CHECK: {start_line=51 start_col=3 end_line=51 end_col=5} VarRef=bee:45:8 -// CHECK: {start_line=51 start_col=6 end_line=51 end_col=25} ObjCSelectorRef=catMethodWithFloat::19:1 -// CHECK: {start_line=51 start_col=26 end_line=51 end_col=26} ObjCSelectorRef=floatMethod:20:1 -// CHECK: {start_line=51 start_col=27 end_line=51 end_col=29} VarRef=bee:45:8 -// CHECK: {start_line=51 start_col=30 end_line=51 end_col=42} ObjCSelectorRef=floatMethod:20:1 -// CHECK: {start_line=51 start_col=43 end_line=51 end_col=43} ObjCSelectorRef=catMethodWithFloat::19:1 -// CHECK: {start_line=51 start_col=44 end_line=52 end_col=2} FunctionDecl=main:44:5 (Definition) -// CHECK: {start_line=52 start_col=3 end_line=52 end_col=6} FunctionRef=main:44:5 -// CHECK: {start_line=52 start_col=7 end_line=52 end_col=7} FunctionDecl=main:44:5 (Definition) -// CHECK: {start_line=52 start_col=8 end_line=52 end_col=15} EnumConstantRef=someEnum:41:3 -// CHECK: {start_line=52 start_col=16 end_line=52 end_col=32} FunctionDecl=main:44:5 (Definition) -// CHECK: {start_line=52 start_col=33 end_line=52 end_col=35} VarRef=bee:45:8 -// CHECK: {start_line=52 start_col=36 end_line=53 end_col=1} FunctionDecl=main:44:5 (Definition) -// CHECK: {start_line=53 start_col=2 end_line=160 end_col=1} Invalid Cursor => NoDeclFound +// CHECK: {start_line=48 start_col=11 end_line=48 end_col=11} VarDecl=d:48:13 (Definition) +// CHECK: {start_line=48 start_col=12 end_line=48 end_col=12} UnexposedStmt=main +// CHECK: {start_line=48 start_col=13 end_line=48 end_col=13} VarDecl=d:48:13 (Definition) +// CHECK: {start_line=48 start_col=14 end_line=48 end_col=14} UnexposedStmt=main +// CHECK: {start_line=48 start_col=15 end_line=49 end_col=1} UnexposedStmt=main +// CHECK: {start_line=49 start_col=2 end_line=49 end_col=2} DeclRefExpr=d:48:13 +// CHECK: {start_line=49 start_col=3 end_line=49 end_col=5} UnexposedExpr= +// CHECK: {start_line=49 start_col=6 end_line=49 end_col=6} DeclRefExpr=c:47:12 +// CHECK: {start_line=49 start_col=7 end_line=50 end_col=1} UnexposedStmt=main +// CHECK: {start_line=50 start_col=2 end_line=50 end_col=2} ObjCMessageExpr=pMethod:24:1 +// CHECK: {start_line=50 start_col=3 end_line=50 end_col=3} DeclRefExpr=d:48:13 +// CHECK: {start_line=50 start_col=4 end_line=50 end_col=12} ObjCMessageExpr=pMethod:24:1 +// CHECK: {start_line=50 start_col=13 end_line=51 end_col=1} UnexposedStmt=main +// CHECK: {start_line=51 start_col=2 end_line=51 end_col=2} ObjCMessageExpr=catMethodWithFloat::19:1 +// CHECK: {start_line=51 start_col=3 end_line=51 end_col=5} DeclRefExpr=bee:45:8 +// CHECK: {start_line=51 start_col=6 end_line=51 end_col=25} ObjCMessageExpr=catMethodWithFloat::19:1 +// CHECK: {start_line=51 start_col=26 end_line=51 end_col=26} ObjCMessageExpr=floatMethod:20:1 +// CHECK: {start_line=51 start_col=27 end_line=51 end_col=29} DeclRefExpr=bee:45:8 +// CHECK: {start_line=51 start_col=30 end_line=51 end_col=42} ObjCMessageExpr=floatMethod:20:1 +// CHECK: {start_line=51 start_col=43 end_line=51 end_col=43} ObjCMessageExpr=catMethodWithFloat::19:1 +// CHECK: {start_line=51 start_col=44 end_line=52 end_col=2} UnexposedStmt=main +// CHECK: {start_line=52 start_col=3 end_line=52 end_col=6} DeclRefExpr=main:44:5 +// CHECK: {start_line=52 start_col=7 end_line=52 end_col=7} CallExpr=main:44:5 +// CHECK: {start_line=52 start_col=8 end_line=52 end_col=15} DeclRefExpr=someEnum:41:3 +// CHECK: {start_line=52 start_col=16 end_line=52 end_col=17} CallExpr=main:44:5 +// CHECK: {start_line=52 start_col=18 end_line=52 end_col=32} UnexposedExpr=bee:45:8 +// CHECK: {start_line=52 start_col=33 end_line=52 end_col=35} DeclRefExpr=bee:45:8 +// CHECK: {start_line=52 start_col=36 end_line=52 end_col=36} CallExpr=main:44:5 +// CHECK: {start_line=52 start_col=37 end_line=53 end_col=1} UnexposedStmt=main |