From 8fa0a80b4482ad94e82c4a19e23de17fd69140b5 Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Thu, 4 Aug 2011 20:04:59 +0000 Subject: Add a new libclang API to return a CXCompletionString for an arbitrary cursor, from Connor Wakamo! Addresses . git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136911 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/Index/get-cursor.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'test/Index/get-cursor.cpp') 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} -- cgit v1.2.3-70-g09d2