summaryrefslogtreecommitdiffstats
path: root/clang/test/Index/get-cursor.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-08-04 20:04:59 +0000
committerDouglas Gregor <dgregor@apple.com>2011-08-04 20:04:59 +0000
commit3f35bb2d15a4df45a4e7d171b42c33c65b9267a3 (patch)
treedc86f5407735dc3be7429f82d2fab4ab5fe3e708 /clang/test/Index/get-cursor.cpp
parentc0174048a4506b437727357c373febb52666940a (diff)
downloadbcm5719-llvm-3f35bb2d15a4df45a4e7d171b42c33c65b9267a3.tar.gz
bcm5719-llvm-3f35bb2d15a4df45a4e7d171b42c33c65b9267a3.zip
Add a new libclang API to return a CXCompletionString for an arbitrary
cursor, from Connor Wakamo! Addresses <rdar://problem/9087798>. llvm-svn: 136911
Diffstat (limited to 'clang/test/Index/get-cursor.cpp')
-rw-r--r--clang/test/Index/get-cursor.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/test/Index/get-cursor.cpp b/clang/test/Index/get-cursor.cpp
index 2aa76c47256..441ed1cdabe 100644
--- a/clang/test/Index/get-cursor.cpp
+++ b/clang/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}
OpenPOWER on IntegriCloud