diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-08-04 20:04:59 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-08-04 20:04:59 +0000 |
commit | 8fa0a80b4482ad94e82c4a19e23de17fd69140b5 (patch) | |
tree | 690f18df1cf27cab3b3abc41040ffadba2e8fc1d /test/Index/get-cursor.cpp | |
parent | 0e7bf40027f75c0c62fb002af7eab0882de6d332 (diff) |
Add a new libclang API to return a CXCompletionString for an arbitrary
cursor, from Connor Wakamo! Addresses <rdar://problem/9087798>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136911 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Index/get-cursor.cpp')
-rw-r--r-- | test/Index/get-cursor.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/Index/get-cursor.cpp b/test/Index/get-cursor.cpp index 2aa76c4725..441ed1cdab 100644 --- a/test/Index/get-cursor.cpp +++ b/test/Index/get-cursor.cpp @@ -35,6 +35,14 @@ void test() { X foo; } +// RUN: c-index-test -cursor-at=%s:6:4 %s | FileCheck -check-prefix=CHECK-COMPLETION-1 %s +// CHECK-COMPLETION-1: CXXConstructor=X:6:3 +// CHECK-COMPLETION-1-NEXT: Completion string: {TypedText X}{LeftParen (}{Placeholder int}{Comma , }{Placeholder int}{RightParen )} + +// RUN: c-index-test -cursor-at=%s:31:16 %s | FileCheck -check-prefix=CHECK-COMPLETION-2 %s +// CHECK-COMPLETION-2: CXXMethod=getAnotherX:31:5 (Definition) +// CHECK-COMPLETION-2-NEXT: Completion string: {ResultType X}{TypedText getAnotherX}{LeftParen (}{RightParen )} + // RUN: c-index-test -cursor-at=%s:12:20 %s | FileCheck -check-prefix=CHECK-VALUE-REF %s // RUN: c-index-test -cursor-at=%s:13:21 %s | FileCheck -check-prefix=CHECK-VALUE-REF %s // RUN: c-index-test -cursor-at=%s:13:28 %s | FileCheck -check-prefix=CHECK-VALUE-REF %s @@ -68,3 +76,7 @@ void test() { // RUN: c-index-test -cursor-at=%s:35:5 %s | FileCheck -check-prefix=CHECK-DECL %s // CHECK-DECL: VarDecl=foo:35:5 + +// RUN: c-index-test -cursor-at=%s:21:3 %s | FileCheck -check-prefix=CHECK-MEMBER %s +// CHECK-MEMBER: FieldDecl=member:21:7 (Definition) +// CHECK-MEMBER-NEXT: Completion string: {ResultType int}{TypedText member} |