aboutsummaryrefslogtreecommitdiff
path: root/test/Index
diff options
context:
space:
mode:
Diffstat (limited to 'test/Index')
-rw-r--r--test/Index/annotate-tokens.c17
-rw-r--r--test/Index/code-completion.cpp6
-rw-r--r--test/Index/complete-call.cpp805
-rw-r--r--test/Index/complete-constructor-params.cpp140
-rw-r--r--test/Index/complete-functor-call.cpp191
-rw-r--r--test/Index/complete-macros.c2
-rw-r--r--test/Index/complete-optional-params.cpp75
-rw-r--r--test/Index/complete-pointer-and-reference-to-functions.cpp62
-rw-r--r--test/Index/complete-template-friends-defined.cpp33
-rw-r--r--test/Index/complete-type-factors.m16
-rw-r--r--test/Index/get-cursor.c13
-rw-r--r--test/Index/index-module.m15
-rw-r--r--test/Index/index-pch-with-module.m2
-rw-r--r--test/Index/load-stmts.cpp2
-rw-r--r--test/Index/print-type-size.cpp5
-rw-r--r--test/Index/print-type.cpp7
16 files changed, 1364 insertions, 27 deletions
diff --git a/test/Index/annotate-tokens.c b/test/Index/annotate-tokens.c
index ffe3f632f930..2f95ca6f458c 100644
--- a/test/Index/annotate-tokens.c
+++ b/test/Index/annotate-tokens.c
@@ -57,6 +57,17 @@ TYPE_INST(Foo,
void func2(void);
+typedef union {
+ struct {
+ int field : 16;
+ };
+} r_t;
+
+void test() {
+ r_t reg;
+ reg.field = 1;
+}
+
// RUN: c-index-test -test-annotate-tokens=%s:4:1:37:1 %s | FileCheck %s
// CHECK: Identifier: "T" [4:3 - 4:4] TypeRef=T:1:13
// CHECK: Punctuation: "*" [4:4 - 4:5] VarDecl=t_ptr:4:6 (Definition)
@@ -205,7 +216,7 @@ void func2(void);
// CHECK-RANGE1: Literal: "1" [54:10 - 54:11] IntegerLiteral=
// CHECK-RANGE1: Punctuation: "," [54:11 - 54:12] InitListExpr=
-// RUN: c-index-test -test-annotate-tokens=%s:54:1:59:1 %s | FileCheck %s -check-prefix=CHECK-RANGE2
+// RUN: c-index-test -test-annotate-tokens=%s:54:1:70:1 %s | FileCheck %s -check-prefix=CHECK-RANGE2
// CHECK-RANGE2: Punctuation: "." [54:5 - 54:6] UnexposedExpr=
// CHECK-RANGE2: Identifier: "y" [54:6 - 54:7] MemberRef=y:52:1
// CHECK-RANGE2: Punctuation: "=" [54:8 - 54:9] UnexposedExpr=
@@ -224,3 +235,7 @@ void func2(void);
// CHECK-RANGE2: Keyword: "void" [58:12 - 58:16] FunctionDecl=func2:58:6
// CHECK-RANGE2: Punctuation: ")" [58:16 - 58:17] FunctionDecl=func2:58:6
// CHECK-RANGE2: Punctuation: ";" [58:17 - 58:18]
+
+// CHECK-RANGE2: Identifier: "reg" [68:3 - 68:6] DeclRefExpr=reg:67:7
+// CHECK-RANGE2: Punctuation: "." [68:6 - 68:7] MemberRefExpr=field:62:9
+// CHECK-RANGE2: Identifier: "field" [68:7 - 68:12] MemberRefExpr=field:62:9
diff --git a/test/Index/code-completion.cpp b/test/Index/code-completion.cpp
index 5789d3b9fa07..83aa94374438 100644
--- a/test/Index/code-completion.cpp
+++ b/test/Index/code-completion.cpp
@@ -58,9 +58,9 @@ Z::operator int() const {
// CHECK-MEMBER-NEXT: Container is complete
// CHECK-MEMBER-NEXT: Container USR: c:@S@Z
-// CHECK-OVERLOAD: NotImplemented:{ResultType int &}{Text overloaded}{LeftParen (}{Text Z z}{Comma , }{CurrentParameter int second}{RightParen )}
-// CHECK-OVERLOAD: NotImplemented:{ResultType float &}{Text overloaded}{LeftParen (}{Text int i}{Comma , }{CurrentParameter long second}{RightParen )}
-// CHECK-OVERLOAD: NotImplemented:{ResultType double &}{Text overloaded}{LeftParen (}{Text float f}{Comma , }{CurrentParameter int second}{RightParen )}
+// CHECK-OVERLOAD: OverloadCandidate:{ResultType int &}{Text overloaded}{LeftParen (}{Placeholder Z z}{Comma , }{CurrentParameter int second}{RightParen )}
+// CHECK-OVERLOAD: OverloadCandidate:{ResultType float &}{Text overloaded}{LeftParen (}{Placeholder int i}{Comma , }{CurrentParameter long second}{RightParen )}
+// CHECK-OVERLOAD: OverloadCandidate:{ResultType double &}{Text overloaded}{LeftParen (}{Placeholder float f}{Comma , }{CurrentParameter int second}{RightParen )}
// CHECK-OVERLOAD: Completion contexts:
// CHECK-OVERLOAD-NEXT: Any type
// CHECK-OVERLOAD-NEXT: Any value
diff --git a/test/Index/complete-call.cpp b/test/Index/complete-call.cpp
new file mode 100644
index 000000000000..9750bd6f7100
--- /dev/null
+++ b/test/Index/complete-call.cpp
@@ -0,0 +1,805 @@
+// Note: the run lines follow their respective tests, since line/column
+// matter in this test.
+
+void foo_1();
+void foo_2(int);
+void foo_2(void *);
+void foo_3(int, int);
+void foo_3(void *, void *);
+void foo_4(int, int);
+void foo_4(void *, int);
+void foo_5(int, int);
+void foo_5(int, void *);
+template<class T> void foo_6();
+template<class T> void foo_7(T);
+template<class T> void foo_8(T, T);
+template<class T> void foo_9(int, T);
+template<class T> void foo_9(void *, T);
+template<class T> void foo_10(T, int, int);
+template<class U> void foo_10(U, void *, void *);
+template<class T, class U> void foo_11(T, U);
+template<class T = int> void foo_12(T, T);
+template<class V>
+struct S {
+ void foo_1();
+ void foo_2(int);
+ void foo_2(void *);
+ void foo_3(int, int);
+ void foo_3(void *, void *);
+ void foo_4(int, int);
+ void foo_4(void *, int);
+ void foo_5(int, int);
+ void foo_5(int, void *);
+ template<class T> void foo_6();
+ template<class T> void foo_7(T);
+ template<class T> void foo_8(T, T);
+ template<class T> void foo_9(int, T);
+ template<class T> void foo_9(void *, T);
+ template<class T> void foo_10(T, int, int);
+ template<class U> void foo_10(U, void *, void *);
+ template<class T, class U> void foo_11(T, U);
+ template<class T = int> void foo_12(T, T);
+ template<class T> void foo_13(V, T, T);
+};
+
+int main() {
+ void *p = 0;
+ foo_1();
+ foo_2(42);
+ foo_3(42, 42);
+ foo_3(p, p);
+ foo_4(42, 42);
+ foo_4(p, 42);
+ foo_5(42, 42);
+ foo_6<int>();
+ foo_7(42);
+ foo_7<int>(42);
+ foo_8(42, 42);
+ foo_9(42, 42);
+ foo_9(p, 42);
+ foo_10(42, 42, 42);
+ foo_11(42, 42);
+ foo_11<int>(42, 42);
+ foo_11<int, void *>(42, p);
+ foo_12(p, p);
+
+ S<int> s;
+ s.foo_1();
+ s.foo_2(42);
+ s.foo_3(42, 42);
+ s.foo_3(p, p);
+ s.foo_4(42, 42);
+ s.foo_4(p, 42);
+ s.foo_5(42, 42);
+ s.foo_6<int>();
+ s.foo_7(42);
+ s.foo_7<int>(42);
+ s.foo_8(42, 42);
+ s.foo_9(42, 42);
+ s.foo_9(p, 42);
+ s.foo_10(42, 42, 42);
+ s.foo_11(42, 42);
+ s.foo_11<int>(42, 42);
+ s.foo_11<int, void *>(42, p);
+ s.foo_12(p, p);
+ s.foo_13(42, 42, 42);
+
+ foo_1(42,);
+ foo_2(42,);
+ foo_6<int>(42,);
+ foo_7(42,);
+ s.foo_1(42,);
+ s.foo_2(42,);
+ s.foo_6<int>(42,);
+ s.foo_7(42,);
+}
+
+// RUN: c-index-test -code-completion-at=%s:47:9 %s | FileCheck -check-prefix=CHECK-CC1 %s
+// CHECK-CC1: OverloadCandidate:{ResultType void}{Text foo_1}{LeftParen (}{RightParen )} (1)
+// CHECK-CC1: Completion contexts:
+// CHECK-CC1-NEXT: Any type
+// CHECK-CC1-NEXT: Any value
+// CHECK-CC1-NEXT: Enum tag
+// CHECK-CC1-NEXT: Union tag
+// CHECK-CC1-NEXT: Struct tag
+// CHECK-CC1-NEXT: Class name
+// CHECK-CC1-NEXT: Nested name specifier
+// CHECK-CC1-NEXT: Objective-C interface
+
+// RUN: c-index-test -code-completion-at=%s:48:9 %s | FileCheck -check-prefix=CHECK-CC2 %s
+// CHECK-CC2: OverloadCandidate:{ResultType void}{Text foo_2}{LeftParen (}{CurrentParameter void *}{RightParen )} (1)
+// CHECK-CC2: OverloadCandidate:{ResultType void}{Text foo_2}{LeftParen (}{CurrentParameter int}{RightParen )} (1)
+// CHECK-CC2: Completion contexts:
+// CHECK-CC2-NEXT: Any type
+// CHECK-CC2-NEXT: Any value
+// CHECK-CC2-NEXT: Enum tag
+// CHECK-CC2-NEXT: Union tag
+// CHECK-CC2-NEXT: Struct tag
+// CHECK-CC2-NEXT: Class name
+// CHECK-CC2-NEXT: Nested name specifier
+// CHECK-CC2-NEXT: Objective-C interface
+
+// RUN: c-index-test -code-completion-at=%s:49:9 %s | FileCheck -check-prefix=CHECK-CC3 %s
+// CHECK-CC3: OverloadCandidate:{ResultType void}{Text foo_3}{LeftParen (}{CurrentParameter void *}{Comma , }{Placeholder void *}{RightParen )} (1)
+// CHECK-CC3: OverloadCandidate:{ResultType void}{Text foo_3}{LeftParen (}{CurrentParameter int}{Comma , }{Placeholder int}{RightParen )} (1)
+// CHECK-CC3: Completion contexts:
+// CHECK-CC3-NEXT: Any type
+// CHECK-CC3-NEXT: Any value
+// CHECK-CC3-NEXT: Enum tag
+// CHECK-CC3-NEXT: Union tag
+// CHECK-CC3-NEXT: Struct tag
+// CHECK-CC3-NEXT: Class name
+// CHECK-CC3-NEXT: Nested name specifier
+// CHECK-CC3-NEXT: Objective-C interface
+
+// RUN: c-index-test -code-completion-at=%s:49:12 %s | FileCheck -check-prefix=CHECK-CC4 %s
+// CHECK-CC4: OverloadCandidate:{ResultType void}{Text foo_3}{LeftParen (}{Placeholder int}{Comma , }{CurrentParameter int}{RightParen )} (1)
+// CHECK-CC4: Completion contexts:
+// CHECK-CC4-NEXT: Any type
+// CHECK-CC4-NEXT: Any value
+// CHECK-CC4-NEXT: Enum tag
+// CHECK-CC4-NEXT: Union tag
+// CHECK-CC4-NEXT: Struct tag
+// CHECK-CC4-NEXT: Class name
+// CHECK-CC4-NEXT: Nested name specifier
+// CHECK-CC4-NEXT: Objective-C interface
+
+// RUN: c-index-test -code-completion-at=%s:50:11 %s | FileCheck -check-prefix=CHECK-CC5 %s
+// CHECK-CC5: OverloadCandidate:{ResultType void}{Text foo_3}{LeftParen (}{Placeholder void *}{Comma , }{CurrentParameter void *}{RightParen )} (1)
+// CHECK-CC5: Completion contexts:
+// CHECK-CC5-NEXT: Any type
+// CHECK-CC5-NEXT: Any value
+// CHECK-CC5-NEXT: Enum tag
+// CHECK-CC5-NEXT: Union tag
+// CHECK-CC5-NEXT: Struct tag
+// CHECK-CC5-NEXT: Class name
+// CHECK-CC5-NEXT: Nested name specifier
+// CHECK-CC5-NEXT: Objective-C interface
+
+// RUN: c-index-test -code-completion-at=%s:51:12 %s | FileCheck -check-prefix=CHECK-CC6 %s
+// CHECK-CC6: OverloadCandidate:{ResultType void}{Text foo_4}{LeftParen (}{Placeholder int}{Comma , }{CurrentParameter int}{RightParen )} (1)
+// CHECK-CC6: Completion contexts:
+// CHECK-CC6-NEXT: Any type
+// CHECK-CC6-NEXT: Any value
+// CHECK-CC6-NEXT: Enum tag
+// CHECK-CC6-NEXT: Union tag
+// CHECK-CC6-NEXT: Struct tag
+// CHECK-CC6-NEXT: Class name
+// CHECK-CC6-NEXT: Nested name specifier
+// CHECK-CC6-NEXT: Objective-C interface
+
+// RUN: c-index-test -code-completion-at=%s:52:11 %s | FileCheck -check-prefix=CHECK-CC7 %s
+// CHECK-CC7: OverloadCandidate:{ResultType void}{Text foo_4}{LeftParen (}{Placeholder void *}{Comma , }{CurrentParameter int}{RightParen )} (1)
+// CHECK-CC7: Completion contexts:
+// CHECK-CC7-NEXT: Any type
+// CHECK-CC7-NEXT: Any value
+// CHECK-CC7-NEXT: Enum tag
+// CHECK-CC7-NEXT: Union tag
+// CHECK-CC7-NEXT: Struct tag
+// CHECK-CC7-NEXT: Class name
+// CHECK-CC7-NEXT: Nested name specifier
+// CHECK-CC7-NEXT: Objective-C interface
+
+// RUN: c-index-test -code-completion-at=%s:53:12 %s | FileCheck -check-prefix=CHECK-CC8 %s
+// CHECK-CC8: OverloadCandidate:{ResultType void}{Text foo_5}{LeftParen (}{Placeholder int}{Comma , }{CurrentParameter void *}{RightParen )} (1)
+// CHECK-CC8: OverloadCandidate:{ResultType void}{Text foo_5}{LeftParen (}{Placeholder int}{Comma , }{CurrentParameter int}{RightParen )} (1)
+// CHECK-CC8: Completion contexts:
+// CHECK-CC8-NEXT: Any type
+// CHECK-CC8-NEXT: Any value
+// CHECK-CC8-NEXT: Enum tag
+// CHECK-CC8-NEXT: Union tag
+// CHECK-CC8-NEXT: Struct tag
+// CHECK-CC8-NEXT: Class name
+// CHECK-CC8-NEXT: Nested name specifier
+// CHECK-CC8-NEXT: Objective-C interface
+
+// RUN: c-index-test -code-completion-at=%s:54:14 %s | FileCheck -check-prefix=CHECK-CC9 %s
+// CHECK-CC9: OverloadCandidate:{ResultType void}{Text foo_6}{LeftParen (}{RightParen )} (1)
+// CHECK-CC9: Completion contexts:
+// CHECK-CC9-NEXT: Any type
+// CHECK-CC9-NEXT: Any value
+// CHECK-CC9-NEXT: Enum tag
+// CHECK-CC9-NEXT: Union tag
+// CHECK-CC9-NEXT: Struct tag
+// CHECK-CC9-NEXT: Class name
+// CHECK-CC9-NEXT: Nested name specifier
+// CHECK-CC9-NEXT: Objective-C interface
+
+// RUN: c-index-test -code-completion-at=%s:55:9 %s | FileCheck -check-prefix=CHECK-CC10 %s
+// CHECK-CC10: OverloadCandidate:{ResultType void}{Text foo_7}{LeftParen (}{CurrentParameter T}{RightParen )} (1)
+// CHECK-CC10: Completion contexts:
+// CHECK-CC10-NEXT: Any type
+// CHECK-CC10-NEXT: Any value
+// CHECK-CC10-NEXT: Enum tag
+// CHECK-CC10-NEXT: Union tag
+// CHECK-CC10-NEXT: Struct tag
+// CHECK-CC10-NEXT: Class name
+// CHECK-CC10-NEXT: Nested name specifier
+// CHECK-CC10-NEXT: Objective-C interface
+
+// RUN: c-index-test -code-completion-at=%s:56:14 %s | FileCheck -check-prefix=CHECK-CC11 %s
+// CHECK-CC11: OverloadCandidate:{ResultType void}{Text foo_7}{LeftParen (}{CurrentParameter int}{RightParen )} (1)
+// CHECK-CC11: Completion contexts:
+// CHECK-CC11-NEXT: Any type
+// CHECK-CC11-NEXT: Any value
+// CHECK-CC11-NEXT: Enum tag
+// CHECK-CC11-NEXT: Union tag
+// CHECK-CC11-NEXT: Struct tag
+// CHECK-CC11-NEXT: Class name
+// CHECK-CC11-NEXT: Nested name specifier
+// CHECK-CC11-NEXT: Objective-C interface
+
+// RUN: c-index-test -code-completion-at=%s:57:12 %s | FileCheck -check-prefix=CHECK-CC12 %s
+// CHECK-CC12: OverloadCandidate:{ResultType void}{Text foo_8}{LeftParen (}{Placeholder int}{Comma , }{CurrentParameter int}{RightParen )} (1)
+// CHECK-CC12: Completion contexts:
+// CHECK-CC12-NEXT: Any type
+// CHECK-CC12-NEXT: Any value
+// CHECK-CC12-NEXT: Enum tag
+// CHECK-CC12-NEXT: Union tag
+// CHECK-CC12-NEXT: Struct tag
+// CHECK-CC12-NEXT: Class name
+// CHECK-CC12-NEXT: Nested name specifier
+// CHECK-CC12-NEXT: Objective-C interface
+
+// RUN: c-index-test -code-completion-at=%s:58:12 %s | FileCheck -check-prefix=CHECK-CC13 %s
+// CHECK-CC13: OverloadCandidate:{ResultType void}{Text foo_9}{LeftParen (}{Placeholder int}{Comma , }{CurrentParameter T}{RightParen )} (1)
+// CHECK-CC13: Completion contexts:
+// CHECK-CC13-NEXT: Any type
+// CHECK-CC13-NEXT: Any value
+// CHECK-CC13-NEXT: Enum tag
+// CHECK-CC13-NEXT: Union tag
+// CHECK-CC13-NEXT: Struct tag
+// CHECK-CC13-NEXT: Class name
+// CHECK-CC13-NEXT: Nested name specifier
+// CHECK-CC13-NEXT: Objective-C interface
+
+// RUN: c-index-test -code-completion-at=%s:59:11 %s | FileCheck -check-prefix=CHECK-CC14 %s
+// CHECK-CC14: OverloadCandidate:{ResultType void}{Text foo_9}{LeftParen (}{Placeholder void *}{Comma , }{CurrentParameter T}{RightParen )} (1)
+// CHECK-CC14: Completion contexts:
+// CHECK-CC14-NEXT: Any type
+// CHECK-CC14-NEXT: Any value
+// CHECK-CC14-NEXT: Enum tag
+// CHECK-CC14-NEXT: Union tag
+// CHECK-CC14-NEXT: Struct tag
+// CHECK-CC14-NEXT: Class name
+// CHECK-CC14-NEXT: Nested name specifier
+// CHECK-CC14-NEXT: Objective-C interface
+
+// RUN: c-index-test -code-completion-at=%s:60:10 %s | FileCheck -check-prefix=CHECK-CC15 %s
+// CHECK-CC15: OverloadCandidate:{ResultType void}{Text foo_10}{LeftParen (}{CurrentParameter U}{Comma , }{Placeholder void *}{Comma , }{Placeholder void *}{RightParen )} (1)
+// CHECK-CC15: OverloadCandidate:{ResultType void}{Text foo_10}{LeftParen (}{CurrentParameter T}{Comma , }{Placeholder int}{Comma , }{Placeholder int}{RightParen )} (1)
+// CHECK-CC15: Completion contexts:
+// CHECK-CC15-NEXT: Any type
+// CHECK-CC15-NEXT: Any value
+// CHECK-CC15-NEXT: Enum tag
+// CHECK-CC15-NEXT: Union tag
+// CHECK-CC15-NEXT: Struct tag
+// CHECK-CC15-NEXT: Class name
+// CHECK-CC15-NEXT: Nested name specifier
+// CHECK-CC15-NEXT: Objective-C interface
+
+// RUN: c-index-test -code-completion-at=%s:60:13 %s | FileCheck -check-prefix=CHECK-CC16 %s
+// CHECK-CC16: OverloadCandidate:{ResultType void}{Text foo_10}{LeftParen (}{Placeholder int}{Comma , }{CurrentParameter void *}{Comma , }{Placeholder void *}{RightParen )} (1)
+// CHECK-CC16: OverloadCandidate:{ResultType void}{Text foo_10}{LeftParen (}{Placeholder int}{Comma , }{CurrentParameter int}{Comma , }{Placeholder int}{RightParen )} (1)
+// CHECK-CC16: Completion contexts:
+// CHECK-CC16-NEXT: Any type
+// CHECK-CC16-NEXT: Any value
+// CHECK-CC16-NEXT: Enum tag
+// CHECK-CC16-NEXT: Union tag
+// CHECK-CC16-NEXT: Struct tag
+// CHECK-CC16-NEXT: Class name
+// CHECK-CC16-NEXT: Nested name specifier
+// CHECK-CC16-NEXT: Objective-C interface
+
+// RUN: c-index-test -code-completion-at=%s:60:17 %s | FileCheck -check-prefix=CHECK-CC17 %s
+// CHECK-CC17: OverloadCandidate:{ResultType void}{Text foo_10}{LeftParen (}{Placeholder int}{Comma , }{Placeholder int}{Comma , }{CurrentParameter int}{RightParen )} (1)
+// CHECK-CC17: Completion contexts:
+// CHECK-CC17-NEXT: Any type
+// CHECK-CC17-NEXT: Any value
+// CHECK-CC17-NEXT: Enum tag
+// CHECK-CC17-NEXT: Union tag
+// CHECK-CC17-NEXT: Struct tag
+// CHECK-CC17-NEXT: Class name
+// CHECK-CC17-NEXT: Nested name specifier
+// CHECK-CC17-NEXT: Objective-C interface
+
+// RUN: c-index-test -code-completion-at=%s:61:10 %s | FileCheck -check-prefix=CHECK-CC18 %s
+// CHECK-CC18: OverloadCandidate:{ResultType void}{Text foo_11}{LeftParen (}{CurrentParameter T}{Comma , }{Placeholder U}{RightParen )} (1)
+// CHECK-CC18: Completion contexts:
+// CHECK-CC18-NEXT: Any type
+// CHECK-CC18-NEXT: Any value
+// CHECK-CC18-NEXT: Enum tag
+// CHECK-CC18-NEXT: Union tag
+// CHECK-CC18-NEXT: Struct tag
+// CHECK-CC18-NEXT: Class name
+// CHECK-CC18-NEXT: Nested name specifier
+// CHECK-CC18-NEXT: Objective-C interface
+
+// RUN: c-index-test -code-completion-at=%s:61:13 %s | FileCheck -check-prefix=CHECK-CC19 %s
+// CHECK-CC19: OverloadCandidate:{ResultType void}{Text foo_11}{LeftParen (}{Placeholder int}{Comma , }{CurrentParameter U}{RightParen )} (1)
+// CHECK-CC19: Completion contexts:
+// CHECK-CC19-NEXT: Any type
+// CHECK-CC19-NEXT: Any value
+// CHECK-CC19-NEXT: Enum tag
+// CHECK-CC19-NEXT: Union tag
+// CHECK-CC19-NEXT: Struct tag
+// CHECK-CC19-NEXT: Class name
+// CHECK-CC19-NEXT: Nested name specifier
+// CHECK-CC19-NEXT: Objective-C interface
+
+// RUN: c-index-test -code-completion-at=%s:62:15 %s | FileCheck -check-prefix=CHECK-CC20 %s
+// CHECK-CC20: OverloadCandidate:{ResultType void}{Text foo_11}{LeftParen (}{CurrentParameter int}{Comma , }{Placeholder U}{RightParen )} (1)
+// CHECK-CC20: Completion contexts:
+// CHECK-CC20-NEXT: Any type
+// CHECK-CC20-NEXT: Any value
+// CHECK-CC20-NEXT: Enum tag
+// CHECK-CC20-NEXT: Union tag
+// CHECK-CC20-NEXT: Struct tag
+// CHECK-CC20-NEXT: Class name
+// CHECK-CC20-NEXT: Nested name specifier
+// CHECK-CC20-NEXT: Objective-C interface
+
+// RUN: c-index-test -code-completion-at=%s:62:18 %s | FileCheck -check-prefix=CHECK-CC21 %s
+// CHECK-CC21: OverloadCandidate:{ResultType void}{Text foo_11}{LeftParen (}{Placeholder int}{Comma , }{CurrentParameter U}{RightParen )} (1)
+// CHECK-CC21: Completion contexts:
+// CHECK-CC21-NEXT: Any type
+// CHECK-CC21-NEXT: Any value
+// CHECK-CC21-NEXT: Enum tag
+// CHECK-CC21-NEXT: Union tag
+// CHECK-CC21-NEXT: Struct tag
+// CHECK-CC21-NEXT: Class name
+// CHECK-CC21-NEXT: Nested name specifier
+// CHECK-CC21-NEXT: Objective-C interface
+
+// RUN: c-index-test -code-completion-at=%s:63:26 %s | FileCheck -check-prefix=CHECK-CC22 %s
+// CHECK-CC22: OverloadCandidate:{ResultType void}{Text foo_11}{LeftParen (}{Placeholder int}{Comma , }{CurrentParameter void *}{RightParen )} (1)
+// CHECK-CC22: Completion contexts:
+// CHECK-CC22-NEXT: Any type
+// CHECK-CC22-NEXT: Any value
+// CHECK-CC22-NEXT: Enum tag
+// CHECK-CC22-NEXT: Union tag
+// CHECK-CC22-NEXT: Struct tag
+// CHECK-CC22-NEXT: Class name
+// CHECK-CC22-NEXT: Nested name specifier
+// CHECK-CC22-NEXT: Objective-C interface
+
+// RUN: c-index-test -code-completion-at=%s:64:10 %s | FileCheck -check-prefix=CHECK-CC23 %s
+// CHECK-CC23: OverloadCandidate:{ResultType void}{Text foo_12}{LeftParen (}{CurrentParameter int}{Comma , }{Placeholder int}{RightParen )} (1)
+// CHECK-CC23: Completion contexts:
+// CHECK-CC23-NEXT: Any type
+// CHECK-CC23-NEXT: Any value
+// CHECK-CC23-NEXT: Enum tag
+// CHECK-CC23-NEXT: Union tag
+// CHECK-CC23-NEXT: Struct tag
+// CHECK-CC23-NEXT: Class name
+// CHECK-CC23-NEXT: Nested name specifier
+// CHECK-CC23-NEXT: Objective-C interface
+
+// RUN: c-index-test -code-completion-at=%s:64:12 %s | FileCheck -check-prefix=CHECK-CC24 %s
+// CHECK-CC24: OverloadCandidate:{ResultType void}{Text foo_12}{LeftParen (}{Placeholder void *}{Comma , }{CurrentParameter void *}{RightParen )} (1)
+// CHECK-CC24: Completion contexts:
+// CHECK-CC24-NEXT: Any type
+// CHECK-CC24-NEXT: Any value
+// CHECK-CC24-NEXT: Enum tag
+// CHECK-CC24-NEXT: Union tag
+// CHECK-CC24-NEXT: Struct tag
+// CHECK-CC24-NEXT: Class name
+// CHECK-CC24-NEXT: Nested name specifier
+// CHECK-CC24-NEXT: Objective-C interface
+
+// RUN: c-index-test -code-completion-at=%s:67:11 %s | FileCheck -check-prefix=CHECK-CC25 %s
+// CHECK-CC25: OverloadCandidate:{ResultType void}{Text foo_1}{LeftParen (}{RightParen )} (1)
+// CHECK-CC25: Completion contexts:
+// CHECK-CC25-NEXT: Any type
+// CHECK-CC25-NEXT: Any value
+// CHECK-CC25-NEXT: Enum tag
+// CHECK-CC25-NEXT: Union tag
+// CHECK-CC25-NEXT: Struct tag
+// CHECK-CC25-NEXT: Class name
+// CHECK-CC25-NEXT: Nested name specifier
+// CHECK-CC25-NEXT: Objective-C interface
+
+// RUN: c-index-test -code-completion-at=%s:68:11 %s | FileCheck -check-prefix=CHECK-CC26 %s
+// CHECK-CC26: OverloadCandidate:{ResultType void}{Text foo_2}{LeftParen (}{CurrentParameter int}{RightParen )} (1)
+// CHECK-CC26: OverloadCandidate:{ResultType void}{Text foo_2}{LeftParen (}{CurrentParameter void *}{RightParen )} (1)
+// CHECK-CC26: Completion contexts:
+// CHECK-CC26-NEXT: Any type
+// CHECK-CC26-NEXT: Any value
+// CHECK-CC26-NEXT: Enum tag
+// CHECK-CC26-NEXT: Union tag
+// CHECK-CC26-NEXT: Struct tag
+// CHECK-CC26-NEXT: Class name
+// CHECK-CC26-NEXT: Nested name specifier
+// CHECK-CC26-NEXT: Objective-C interface
+
+// RUN: c-index-test -code-completion-at=%s:69:11 %s | FileCheck -check-prefix=CHECK-CC27 %s
+// CHECK-CC27: OverloadCandidate:{ResultType void}{Text foo_3}{LeftParen (}{CurrentParameter int}{Comma , }{Placeholder int}{RightParen )} (1)
+// CHECK-CC27: OverloadCandidate:{ResultType void}{Text foo_3}{LeftParen (}{CurrentParameter void *}{Comma , }{Placeholder void *}{RightParen )} (1)
+// CHECK-CC27: Completion contexts:
+// CHECK-CC27-NEXT: Any type
+// CHECK-CC27-NEXT: Any value
+// CHECK-CC27-NEXT: Enum tag
+// CHECK-CC27-NEXT: Union tag
+// CHECK-CC27-NEXT: Struct tag
+// CHECK-CC27-NEXT: Class name
+// CHECK-CC27-NEXT: Nested name specifier
+// CHECK-CC27-NEXT: Objective-C interface
+
+// RUN: c-index-test -code-completion-at=%s:69:14 %s | FileCheck -check-prefix=CHECK-CC28 %s
+// CHECK-CC28: OverloadCandidate:{ResultType void}{Text foo_3}{LeftParen (}{Placeholder int}{Comma , }{CurrentParameter int}{RightParen )} (1)
+// CHECK-CC28: Completion contexts:
+// CHECK-CC28-NEXT: Any type
+// CHECK-CC28-NEXT: Any value
+// CHECK-CC28-NEXT: Enum tag
+// CHECK-CC28-NEXT: Union tag
+// CHECK-CC28-NEXT: Struct tag
+// CHECK-CC28-NEXT: Class name
+// CHECK-CC28-NEXT: Nested name specifier
+// CHECK-CC28-NEXT: Objective-C interface
+
+// RUN: c-index-test -code-completion-at=%s:70:13 %s | FileCheck -check-prefix=CHECK-CC29 %s
+// CHECK-CC29: OverloadCandidate:{ResultType void}{Text foo_3}{LeftParen (}{Placeholder void *}{Comma , }{CurrentParameter void *}{RightParen )} (1)
+// CHECK-CC29: Completion contexts:
+// CHECK-CC29-NEXT: Any type
+// CHECK-CC29-NEXT: Any value
+// CHECK-CC29-NEXT: Enum tag
+// CHECK-CC29-NEXT: Union tag
+// CHECK-CC29-NEXT: Struct tag
+// CHECK-CC29-NEXT: Class name
+// CHECK-CC29-NEXT: Nested name specifier
+// CHECK-CC29-NEXT: Objective-C interface
+
+// RUN: c-index-test -code-completion-at=%s:71:14 %s | FileCheck -check-prefix=CHECK-CC30 %s
+// CHECK-CC30: OverloadCandidate:{ResultType void}{Text foo_4}{LeftParen (}{Placeholder int}{Comma , }{CurrentParameter int}{RightParen )} (1)
+// CHECK-CC30: Completion contexts:
+// CHECK-CC30-NEXT: Any type
+// CHECK-CC30-NEXT: Any value
+// CHECK-CC30-NEXT: Enum tag
+// CHECK-CC30-NEXT: Union tag
+// CHECK-CC30-NEXT: Struct tag
+// CHECK-CC30-NEXT: Class name
+// CHECK-CC30-NEXT: Nested name specifier
+// CHECK-CC30-NEXT: Objective-C interface
+
+// RUN: c-index-test -code-completion-at=%s:72:13 %s | FileCheck -check-prefix=CHECK-CC31 %s
+// CHECK-CC31: OverloadCandidate:{ResultType void}{Text foo_4}{LeftParen (}{Placeholder void *}{Comma , }{CurrentParameter int}{RightParen )} (1)
+// CHECK-CC31: Completion contexts:
+// CHECK-CC31-NEXT: Any type
+// CHECK-CC31-NEXT: Any value
+// CHECK-CC31-NEXT: Enum tag
+// CHECK-CC31-NEXT: Union tag
+// CHECK-CC31-NEXT: Struct tag
+// CHECK-CC31-NEXT: Class name
+// CHECK-CC31-NEXT: Nested name specifier
+// CHECK-CC31-NEXT: Objective-C interface
+
+// RUN: c-index-test -code-completion-at=%s:73:14 %s | FileCheck -check-prefix=CHECK-CC32 %s
+// CHECK-CC32: OverloadCandidate:{ResultType void}{Text foo_5}{LeftParen (}{Placeholder int}{Comma , }{CurrentParameter int}{RightParen )} (1)
+// CHECK-CC32: OverloadCandidate:{ResultType void}{Text foo_5}{LeftParen (}{Placeholder int}{Comma , }{CurrentParameter void *}{RightParen )} (1)
+// CHECK-CC32: Completion contexts:
+// CHECK-CC32-NEXT: Any type
+// CHECK-CC32-NEXT: Any value
+// CHECK-CC32-NEXT: Enum tag
+// CHECK-CC32-NEXT: Union tag
+// CHECK-CC32-NEXT: Struct tag
+// CHECK-CC32-NEXT: Class name
+// CHECK-CC32-NEXT: Nested name specifier
+// CHECK-CC32-NEXT: Objective-C interface
+
+// RUN: c-index-test -code-completion-at=%s:74:16 %s | FileCheck -check-prefix=CHECK-CC33 %s
+// CHECK-CC33: OverloadCandidate:{ResultType void}{Text foo_6}{LeftParen (}{RightParen )} (1)
+// CHECK-CC33: Completion contexts:
+// CHECK-CC33-NEXT: Any type
+// CHECK-CC33-NEXT: Any value
+// CHECK-CC33-NEXT: Enum tag
+// CHECK-CC33-NEXT: Union tag
+// CHECK-CC33-NEXT: Struct tag
+// CHECK-CC33-NEXT: Class name
+// CHECK-CC33-NEXT: Nested name specifier
+// CHECK-CC33-NEXT: Objective-C interface
+
+// RUN: c-index-test -code-completion-at=%s:75:11 %s | FileCheck -check-prefix=CHECK-CC34 %s
+// CHECK-CC34: OverloadCandidate:{ResultType void}{Text foo_7}{LeftParen (}{CurrentParameter T}{RightParen )} (1)
+// CHECK-CC34: Completion contexts:
+// CHECK-CC34-NEXT: Any type
+// CHECK-CC34-NEXT: Any value
+// CHECK-CC34-NEXT: Enum tag
+// CHECK-CC34-NEXT: Union tag
+// CHECK-CC34-NEXT: Struct tag
+// CHECK-CC34-NEXT: Class name
+// CHECK-CC34-NEXT: Nested name specifier
+// CHECK-CC34-NEXT: Objective-C interface
+
+// RUN: c-index-test -code-completion-at=%s:76:16 %s | FileCheck -check-prefix=CHECK-CC35 %s
+// CHECK-CC35: OverloadCandidate:{ResultType void}{Text foo_7}{LeftParen (}{CurrentParameter int}{RightParen )} (1)
+// CHECK-CC35: Completion contexts:
+// CHECK-CC35-NEXT: Any type
+// CHECK-CC35-NEXT: Any value
+// CHECK-CC35-NEXT: Enum tag
+// CHECK-CC35-NEXT: Union tag
+// CHECK-CC35-NEXT: Struct tag
+// CHECK-CC35-NEXT: Class name
+// CHECK-CC35-NEXT: Nested name specifier
+// CHECK-CC35-NEXT: Objective-C interface
+
+// RUN: c-index-test -code-completion-at=%s:77:14 %s | FileCheck -check-prefix=CHECK-CC36 %s
+// CHECK-CC36: OverloadCandidate:{ResultType void}{Text foo_8}{LeftParen (}{Placeholder int}{Comma , }{CurrentParameter int}{RightParen )} (1)
+// CHECK-CC36: Completion contexts:
+// CHECK-CC36-NEXT: Any type
+// CHECK-CC36-NEXT: Any value
+// CHECK-CC36-NEXT: Enum tag
+// CHECK-CC36-NEXT: Union tag
+// CHECK-CC36-NEXT: Struct tag
+// CHECK-CC36-NEXT: Class name
+// CHECK-CC36-NEXT: Nested name specifier
+// CHECK-CC36-NEXT: Objective-C interface
+
+// RUN: c-index-test -code-completion-at=%s:78:14 %s | FileCheck -check-prefix=CHECK-CC37 %s
+// CHECK-CC37: OverloadCandidate:{ResultType void}{Text foo_9}{LeftParen (}{Placeholder int}{Comma , }{CurrentParameter T}{RightParen )} (1)
+// CHECK-CC37: Completion contexts:
+// CHECK-CC37-NEXT: Any type
+// CHECK-CC37-NEXT: Any value
+// CHECK-CC37-NEXT: Enum tag
+// CHECK-CC37-NEXT: Union tag
+// CHECK-CC37-NEXT: Struct tag
+// CHECK-CC37-NEXT: Class name
+// CHECK-CC37-NEXT: Nested name specifier
+// CHECK-CC37-NEXT: Objective-C interface
+
+// RUN: c-index-test -code-completion-at=%s:79:13 %s | FileCheck -check-prefix=CHECK-CC38 %s
+// CHECK-CC38: OverloadCandidate:{ResultType void}{Text foo_9}{LeftParen (}{Placeholder void *}{Comma , }{CurrentParameter T}{RightParen )} (1)
+// CHECK-CC38: Completion contexts:
+// CHECK-CC38-NEXT: Any type
+// CHECK-CC38-NEXT: Any value
+// CHECK-CC38-NEXT: Enum tag
+// CHECK-CC38-NEXT: Union tag
+// CHECK-CC38-NEXT: Struct tag
+// CHECK-CC38-NEXT: Class name
+// CHECK-CC38-NEXT: Nested name specifier
+// CHECK-CC38-NEXT: Objective-C interface
+
+// RUN: c-index-test -code-completion-at=%s:80:12 %s | FileCheck -check-prefix=CHECK-CC39 %s
+// CHECK-CC39: OverloadCandidate:{ResultType void}{Text foo_10}{LeftParen (}{CurrentParameter T}{Comma , }{Placeholder int}{Comma , }{Placeholder int}{RightParen )} (1)
+// CHECK-CC39: OverloadCandidate:{ResultType void}{Text foo_10}{LeftParen (}{CurrentParameter U}{Comma , }{Placeholder void *}{Comma , }{Placeholder void *}{RightParen )} (1)
+// CHECK-CC39: Completion contexts:
+// CHECK-CC39-NEXT: Any type
+// CHECK-CC39-NEXT: Any value
+// CHECK-CC39-NEXT: Enum tag
+// CHECK-CC39-NEXT: Union tag
+// CHECK-CC39-NEXT: Struct tag
+// CHECK-CC39-NEXT: Class name
+// CHECK-CC39-NEXT: Nested name specifier
+// CHECK-CC39-NEXT: Objective-C interface
+
+// RUN: c-index-test -code-completion-at=%s:80:15 %s | FileCheck -check-prefix=CHECK-CC40 %s
+// CHECK-CC40: OverloadCandidate:{ResultType void}{Text foo_10}{LeftParen (}{Placeholder int}{Comma , }{CurrentParameter int}{Comma , }{Placeholder int}{RightParen )} (1)
+// CHECK-CC40: OverloadCandidate:{ResultType void}{Text foo_10}{LeftParen (}{Placeholder int}{Comma , }{CurrentParameter void *}{Comma , }{Placeholder void *}{RightParen )} (1)
+// CHECK-CC40: Completion contexts:
+// CHECK-CC40-NEXT: Any type
+// CHECK-CC40-NEXT: Any value
+// CHECK-CC40-NEXT: Enum tag
+// CHECK-CC40-NEXT: Union tag
+// CHECK-CC40-NEXT: Struct tag
+// CHECK-CC40-NEXT: Class name
+// CHECK-CC40-NEXT: Nested name specifier
+// CHECK-CC40-NEXT: Objective-C interface
+
+// RUN: c-index-test -code-completion-at=%s:80:19 %s | FileCheck -check-prefix=CHECK-CC41 %s
+// CHECK-CC41: OverloadCandidate:{ResultType void}{Text foo_10}{LeftParen (}{Placeholder int}{Comma , }{Placeholder int}{Comma , }{CurrentParameter int}{RightParen )} (1)
+// CHECK-CC41: Completion contexts:
+// CHECK-CC41-NEXT: Any type
+// CHECK-CC41-NEXT: Any value
+// CHECK-CC41-NEXT: Enum tag
+// CHECK-CC41-NEXT: Union tag
+// CHECK-CC41-NEXT: Struct tag
+// CHECK-CC41-NEXT: Class name
+// CHECK-CC41-NEXT: Nested name specifier
+// CHECK-CC41-NEXT: Objective-C interface
+
+// RUN: c-index-test -code-completion-at=%s:81:12 %s | FileCheck -check-prefix=CHECK-CC42 %s
+// CHECK-CC42: OverloadCandidate:{ResultType void}{Text foo_11}{LeftParen (}{CurrentParameter T}{Comma , }{Placeholder U}{RightParen )} (1)
+// CHECK-CC42: Completion contexts:
+// CHECK-CC42-NEXT: Any type
+// CHECK-CC42-NEXT: Any value
+// CHECK-CC42-NEXT: Enum tag
+// CHECK-CC42-NEXT: Union tag
+// CHECK-CC42-NEXT: Struct tag
+// CHECK-CC42-NEXT: Class name
+// CHECK-CC42-NEXT: Nested name specifier
+// CHECK-CC42-NEXT: Objective-C interface
+
+// RUN: c-index-test -code-completion-at=%s:81:15 %s | FileCheck -check-prefix=CHECK-CC43 %s
+// CHECK-CC43: OverloadCandidate:{ResultType void}{Text foo_11}{LeftParen (}{Placeholder int}{Comma , }{CurrentParameter U}{RightParen )} (1)
+// CHECK-CC43: Completion contexts:
+// CHECK-CC43-NEXT: Any type
+// CHECK-CC43-NEXT: Any value
+// CHECK-CC43-NEXT: Enum tag
+// CHECK-CC43-NEXT: Union tag
+// CHECK-CC43-NEXT: Struct tag
+// CHECK-CC43-NEXT: Class name
+// CHECK-CC43-NEXT: Nested name specifier
+// CHECK-CC43-NEXT: Objective-C interface
+
+// RUN: c-index-test -code-completion-at=%s:82:17 %s | FileCheck -check-prefix=CHECK-CC44 %s
+// CHECK-CC44: OverloadCandidate:{ResultType void}{Text foo_11}{LeftParen (}{CurrentParameter int}{Comma , }{Placeholder U}{RightParen )} (1)
+// CHECK-CC44: Completion contexts:
+// CHECK-CC44-NEXT: Any type
+// CHECK-CC44-NEXT: Any value
+// CHECK-CC44-NEXT: Enum tag
+// CHECK-CC44-NEXT: Union tag
+// CHECK-CC44-NEXT: Struct tag
+// CHECK-CC44-NEXT: Class name
+// CHECK-CC44-NEXT: Nested name specifier
+// CHECK-CC44-NEXT: Objective-C interface
+
+// RUN: c-index-test -code-completion-at=%s:82:20 %s | FileCheck -check-prefix=CHECK-CC45 %s
+// CHECK-CC45: OverloadCandidate:{ResultType void}{Text foo_11}{LeftParen (}{Placeholder int}{Comma , }{CurrentParameter U}{RightParen )} (1)
+// CHECK-CC45: Completion contexts:
+// CHECK-CC45-NEXT: Any type
+// CHECK-CC45-NEXT: Any value
+// CHECK-CC45-NEXT: Enum tag
+// CHECK-CC45-NEXT: Union tag
+// CHECK-CC45-NEXT: Struct tag
+// CHECK-CC45-NEXT: Class name
+// CHECK-CC45-NEXT: Nested name specifier
+// CHECK-CC45-NEXT: Objective-C interface
+
+// RUN: c-index-test -code-completion-at=%s:83:28 %s | FileCheck -check-prefix=CHECK-CC46 %s
+// CHECK-CC46: OverloadCandidate:{ResultType void}{Text foo_11}{LeftParen (}{Placeholder int}{Comma , }{CurrentParameter void *}{RightParen )} (1)
+// CHECK-CC46: Completion contexts:
+// CHECK-CC46-NEXT: Any type
+// CHECK-CC46-NEXT: Any value
+// CHECK-CC46-NEXT: Enum tag
+// CHECK-CC46-NEXT: Union tag
+// CHECK-CC46-NEXT: Struct tag
+// CHECK-CC46-NEXT: Class name
+// CHECK-CC46-NEXT: Nested name specifier
+// CHECK-CC46-NEXT: Objective-C interface
+
+// RUN: c-index-test -code-completion-at=%s:84:12 %s | FileCheck -check-prefix=CHECK-CC47 %s
+// CHECK-CC47: OverloadCandidate:{ResultType void}{Text foo_12}{LeftParen (}{CurrentParameter int}{Comma , }{Placeholder int}{RightParen )} (1)
+// CHECK-CC47: Completion contexts:
+// CHECK-CC47-NEXT: Any type
+// CHECK-CC47-NEXT: Any value
+// CHECK-CC47-NEXT: Enum tag
+// CHECK-CC47-NEXT: Union tag
+// CHECK-CC47-NEXT: Struct tag
+// CHECK-CC47-NEXT: Class name
+// CHECK-CC47-NEXT: Nested name specifier
+// CHECK-CC47-NEXT: Objective-C interface
+
+// RUN: c-index-test -code-completion-at=%s:84:14 %s | FileCheck -check-prefix=CHECK-CC48 %s
+// CHECK-CC48: OverloadCandidate:{ResultType void}{Text foo_12}{LeftParen (}{Placeholder void *}{Comma , }{CurrentParameter void *}{RightParen )} (1)
+// CHECK-CC48: Completion contexts:
+// CHECK-CC48-NEXT: Any type
+// CHECK-CC48-NEXT: Any value
+// CHECK-CC48-NEXT: Enum tag
+// CHECK-CC48-NEXT: Union tag
+// CHECK-CC48-NEXT: Struct tag
+// CHECK-CC48-NEXT: Class name
+// CHECK-CC48-NEXT: Nested name specifier
+// CHECK-CC48-NEXT: Objective-C interface
+
+// RUN: c-index-test -code-completion-at=%s:85:12 %s | FileCheck -check-prefix=CHECK-CC49 %s
+// CHECK-CC49: OverloadCandidate:{ResultType void}{Text foo_13}{LeftParen (}{CurrentParameter int}{Comma , }{Placeholder T}{Comma , }{Placeholder T}{RightParen )} (1)
+// CHECK-CC49: Completion contexts:
+// CHECK-CC49-NEXT: Any type
+// CHECK-CC49-NEXT: Any value
+// CHECK-CC49-NEXT: Enum tag
+// CHECK-CC49-NEXT: Union tag
+// CHECK-CC49-NEXT: Struct tag
+// CHECK-CC49-NEXT: Class name
+// CHECK-CC49-NEXT: Nested name specifier
+// CHECK-CC49-NEXT: Objective-C interface
+
+// RUN: c-index-test -code-completion-at=%s:85:15 %s | FileCheck -check-prefix=CHECK-CC50 %s
+// CHECK-CC50: OverloadCandidate:{ResultType void}{Text foo_13}{LeftParen (}{Placeholder int}{Comma , }{CurrentParameter T}{Comma , }{Placeholder T}{RightParen )} (1)
+// CHECK-CC50: Completion contexts:
+// CHECK-CC50-NEXT: Any type
+// CHECK-CC50-NEXT: Any value
+// CHECK-CC50-NEXT: Enum tag
+// CHECK-CC50-NEXT: Union tag
+// CHECK-CC50-NEXT: Struct tag
+// CHECK-CC50-NEXT: Class name
+// CHECK-CC50-NEXT: Nested name specifier
+// CHECK-CC50-NEXT: Objective-C interface
+
+// RUN: c-index-test -code-completion-at=%s:85:19 %s | FileCheck -check-prefix=CHECK-CC51 %s
+// CHECK-CC51: OverloadCandidate:{ResultType void}{Text foo_13}{LeftParen (}{Placeholder int}{Comma , }{Placeholder int}{Comma , }{CurrentParameter int}{RightParen )} (1)
+// CHECK-CC51: Completion contexts:
+// CHECK-CC51-NEXT: Any type
+// CHECK-CC51-NEXT: Any value
+// CHECK-CC51-NEXT: Enum tag
+// CHECK-CC51-NEXT: Union tag
+// CHECK-CC51-NEXT: Struct tag
+// CHECK-CC51-NEXT: Class name
+// CHECK-CC51-NEXT: Nested name specifier
+// CHECK-CC51-NEXT: Objective-C interface
+
+// RUN: c-index-test -code-completion-at=%s:87:12 %s | FileCheck -check-prefix=CHECK-CC52 %s
+// CHECK-CC52: Completion contexts:
+// CHECK-CC52-NEXT: Any type
+// CHECK-CC52-NEXT: Any value
+// CHECK-CC52-NEXT: Enum tag
+// CHECK-CC52-NEXT: Union tag
+// CHECK-CC52-NEXT: Struct tag
+// CHECK-CC52-NEXT: Class name
+// CHECK-CC52-NEXT: Nested name specifier
+// CHECK-CC52-NEXT: Objective-C interface
+
+// RUN: c-index-test -code-completion-at=%s:88:12 %s | FileCheck -check-prefix=CHECK-CC53 %s
+// CHECK-CC53: Completion contexts:
+// CHECK-CC53-NEXT: Any type
+// CHECK-CC53-NEXT: Any value
+// CHECK-CC53-NEXT: Enum tag
+// CHECK-CC53-NEXT: Union tag
+// CHECK-CC53-NEXT: Struct tag
+// CHECK-CC53-NEXT: Class name
+// CHECK-CC53-NEXT: Nested name specifier
+// CHECK-CC53-NEXT: Objective-C interface
+
+// RUN: c-index-test -code-completion-at=%s:89:17 %s | FileCheck -check-prefix=CHECK-CC54 %s
+// CHECK-CC54: Completion contexts:
+// CHECK-CC54-NEXT: Any type
+// CHECK-CC54-NEXT: Any value
+// CHECK-CC54-NEXT: Enum tag
+// CHECK-CC54-NEXT: Union tag
+// CHECK-CC54-NEXT: Struct tag
+// CHECK-CC54-NEXT: Class name
+// CHECK-CC54-NEXT: Nested name specifier
+// CHECK-CC54-NEXT: Objective-C interface
+
+// RUN: c-index-test -code-completion-at=%s:90:12 %s | FileCheck -check-prefix=CHECK-CC55 %s
+// CHECK-CC55: Completion contexts:
+// CHECK-CC55-NEXT: Any type
+// CHECK-CC55-NEXT: Any value
+// CHECK-CC55-NEXT: Enum tag
+// CHECK-CC55-NEXT: Union tag
+// CHECK-CC55-NEXT: Struct tag
+// CHECK-CC55-NEXT: Class name
+// CHECK-CC55-NEXT: Nested name specifier
+// CHECK-CC55-NEXT: Objective-C interface
+
+// RUN: c-index-test -code-completion-at=%s:91:14 %s | FileCheck -check-prefix=CHECK-CC56 %s
+// CHECK-CC56: Completion contexts:
+// CHECK-CC56-NEXT: Any type
+// CHECK-CC56-NEXT: Any value
+// CHECK-CC56-NEXT: Enum tag
+// CHECK-CC56-NEXT: Union tag
+// CHECK-CC56-NEXT: Struct tag
+// CHECK-CC56-NEXT: Class name
+// CHECK-CC56-NEXT: Nested name specifier
+// CHECK-CC56-NEXT: Objective-C interface
+
+// RUN: c-index-test -code-completion-at=%s:92:14 %s | FileCheck -check-prefix=CHECK-CC57 %s
+// CHECK-CC57: Completion contexts:
+// CHECK-CC57-NEXT: Any type
+// CHECK-CC57-NEXT: Any value
+// CHECK-CC57-NEXT: Enum tag
+// CHECK-CC57-NEXT: Union tag
+// CHECK-CC57-NEXT: Struct tag
+// CHECK-CC57-NEXT: Class name
+// CHECK-CC57-NEXT: Nested name specifier
+// CHECK-CC57-NEXT: Objective-C interface
+
+// RUN: c-index-test -code-completion-at=%s:93:19 %s | FileCheck -check-prefix=CHECK-CC58 %s
+// CHECK-CC58: Completion contexts:
+// CHECK-CC58-NEXT: Any type
+// CHECK-CC58-NEXT: Any value
+// CHECK-CC58-NEXT: Enum tag
+// CHECK-CC58-NEXT: Union tag
+// CHECK-CC58-NEXT: Struct tag
+// CHECK-CC58-NEXT: Class name
+// CHECK-CC58-NEXT: Nested name specifier
+// CHECK-CC58-NEXT: Objective-C interface
+
+// RUN: c-index-test -code-completion-at=%s:94:14 %s | FileCheck -check-prefix=CHECK-CC59 %s
+// CHECK-CC59: Completion contexts:
+// CHECK-CC59-NEXT: Any type
+// CHECK-CC59-NEXT: Any value
+// CHECK-CC59-NEXT: Enum tag
+// CHECK-CC59-NEXT: Union tag
+// CHECK-CC59-NEXT: Struct tag
+// CHECK-CC59-NEXT: Class name
+// CHECK-CC59-NEXT: Nested name specifier
+// CHECK-CC59-NEXT: Objective-C interface
diff --git a/test/Index/complete-constructor-params.cpp b/test/Index/complete-constructor-params.cpp
new file mode 100644
index 000000000000..6685626a5875
--- /dev/null
+++ b/test/Index/complete-constructor-params.cpp
@@ -0,0 +1,140 @@
+// Note: the run lines follow their respective tests, since line/column
+// matter in this test.
+
+template<class T>
+struct S {
+ template<class U>
+ S(T, U, U) {}
+};
+
+int main() {
+ S<int>(42, 42, 42);
+ S<int>(42, 42, 42);
+ S<int> s(42, 42, 42);
+
+ S<int>(42, 42, 42,);
+ S<int> z(42, 42, 42,);
+
+ int(42);
+}
+
+// RUN: c-index-test -code-completion-at=%s:11:10 %s | FileCheck -check-prefix=CHECK-CC1 %s
+// CHECK-CC1: OverloadCandidate:{Text S}{LeftParen (}{CurrentParameter const S<int> &}{RightParen )} (1)
+// CHECK-CC1: OverloadCandidate:{Text S}{LeftParen (}{CurrentParameter int}{Comma , }{Placeholder U}{Comma , }{Placeholder U}{RightParen )} (1)
+// CHECK-CC1: Completion contexts:
+// CHECK-CC1-NEXT: Any type
+// CHECK-CC1-NEXT: Any value
+// CHECK-CC1-NEXT: Enum tag
+// CHECK-CC1-NEXT: Union tag
+// CHECK-CC1-NEXT: Struct tag
+// CHECK-CC1-NEXT: Class name
+// CHECK-CC1-NEXT: Nested name specifier
+// CHECK-CC1-NEXT: Objective-C interface
+
+// RUN: c-index-test -code-completion-at=%s:12:10 %s | FileCheck -check-prefix=CHECK-CC2 %s
+// CHECK-CC2: OverloadCandidate:{Text S}{LeftParen (}{CurrentParameter const S<int> &}{RightParen )} (1)
+// CHECK-CC2: OverloadCandidate:{Text S}{LeftParen (}{CurrentParameter int}{Comma , }{Placeholder U}{Comma , }{Placeholder U}{RightParen )} (1)
+// CHECK-CC2: Completion contexts:
+// CHECK-CC2-NEXT: Any type
+// CHECK-CC2-NEXT: Any value
+// CHECK-CC2-NEXT: Enum tag
+// CHECK-CC2-NEXT: Union tag
+// CHECK-CC2-NEXT: Struct tag
+// CHECK-CC2-NEXT: Class name
+// CHECK-CC2-NEXT: Nested name specifier
+// CHECK-CC2-NEXT: Objective-C interface
+
+// RUN: c-index-test -code-completion-at=%s:12:13 %s | FileCheck -check-prefix=CHECK-CC3 %s
+// CHECK-CC3: OverloadCandidate:{Text S}{LeftParen (}{Placeholder int}{Comma , }{CurrentParameter U}{Comma , }{Placeholder U}{RightParen )} (1)
+// CHECK-CC3: Completion contexts:
+// CHECK-CC3-NEXT: Any type
+// CHECK-CC3-NEXT: Any value
+// CHECK-CC3-NEXT: Enum tag
+// CHECK-CC3-NEXT: Union tag
+// CHECK-CC3-NEXT: Struct tag
+// CHECK-CC3-NEXT: Class name
+// CHECK-CC3-NEXT: Nested name specifier
+// CHECK-CC3-NEXT: Objective-C interface
+
+// RUN: c-index-test -code-completion-at=%s:12:17 %s | FileCheck -check-prefix=CHECK-CC4 %s
+// CHECK-CC4: OverloadCandidate:{Text S}{LeftParen (}{Placeholder int}{Comma , }{Placeholder int}{Comma , }{CurrentParameter int}{RightParen )} (1)
+// CHECK-CC4: Completion contexts:
+// CHECK-CC4-NEXT: Any type
+// CHECK-CC4-NEXT: Any value
+// CHECK-CC4-NEXT: Enum tag
+// CHECK-CC4-NEXT: Union tag
+// CHECK-CC4-NEXT: Struct tag
+// CHECK-CC4-NEXT: Class name
+// CHECK-CC4-NEXT: Nested name specifier
+// CHECK-CC4-NEXT: Objective-C interface
+
+// RUN: c-index-test -code-completion-at=%s:13:12 %s | FileCheck -check-prefix=CHECK-CC5 %s
+// CHECK-CC5: OverloadCandidate:{Text S}{LeftParen (}{CurrentParameter const S<int> &}{RightParen )} (1)
+// CHECK-CC5: OverloadCandidate:{Text S}{LeftParen (}{CurrentParameter int}{Comma , }{Placeholder U}{Comma , }{Placeholder U}{RightParen )} (1)
+// CHECK-CC5: Completion contexts:
+// CHECK-CC5-NEXT: Any type
+// CHECK-CC5-NEXT: Any value
+// CHECK-CC5-NEXT: Enum tag
+// CHECK-CC5-NEXT: Union tag
+// CHECK-CC5-NEXT: Struct tag
+// CHECK-CC5-NEXT: Class name
+// CHECK-CC5-NEXT: Nested name specifier
+// CHECK-CC5-NEXT: Objective-C interface
+
+// RUN: c-index-test -code-completion-at=%s:13:15 %s | FileCheck -check-prefix=CHECK-CC6 %s
+// CHECK-CC6: OverloadCandidate:{Text S}{LeftParen (}{Placeholder int}{Comma , }{CurrentParameter U}{Comma , }{Placeholder U}{RightParen )} (1)
+// CHECK-CC6: Completion contexts:
+// CHECK-CC6-NEXT: Any type
+// CHECK-CC6-NEXT: Any value
+// CHECK-CC6-NEXT: Enum tag
+// CHECK-CC6-NEXT: Union tag
+// CHECK-CC6-NEXT: Struct tag
+// CHECK-CC6-NEXT: Class name
+// CHECK-CC6-NEXT: Nested name specifier
+// CHECK-CC6-NEXT: Objective-C interface
+
+// RUN: c-index-test -code-completion-at=%s:13:19 %s | FileCheck -check-prefix=CHECK-CC7 %s
+// CHECK-CC7: OverloadCandidate:{Text S}{LeftParen (}{Placeholder int}{Comma , }{Placeholder int}{Comma , }{CurrentParameter int}{RightParen )} (1)
+// CHECK-CC7: Completion contexts:
+// CHECK-CC7-NEXT: Any type
+// CHECK-CC7-NEXT: Any value
+// CHECK-CC7-NEXT: Enum tag
+// CHECK-CC7-NEXT: Union tag
+// CHECK-CC7-NEXT: Struct tag
+// CHECK-CC7-NEXT: Class name
+// CHECK-CC7-NEXT: Nested name specifier
+// CHECK-CC7-NEXT: Objective-C interface
+
+// RUN: c-index-test -code-completion-at=%s:15:21 %s | FileCheck -check-prefix=CHECK-CC8 %s
+// CHECK-CC8: Completion contexts:
+// CHECK-CC8-NEXT: Any type
+// CHECK-CC8-NEXT: Any value
+// CHECK-CC8-NEXT: Enum tag
+// CHECK-CC8-NEXT: Union tag
+// CHECK-CC8-NEXT: Struct tag
+// CHECK-CC8-NEXT: Class name
+// CHECK-CC8-NEXT: Nested name specifier
+// CHECK-CC8-NEXT: Objective-C interface
+
+// RUN: c-index-test -code-completion-at=%s:16:23 %s | FileCheck -check-prefix=CHECK-CC9 %s
+// CHECK-CC9: Completion contexts:
+// CHECK-CC9-NEXT: Any type
+// CHECK-CC9-NEXT: Any value
+// CHECK-CC9-NEXT: Enum tag
+// CHECK-CC9-NEXT: Union tag
+// CHECK-CC9-NEXT: Struct tag
+// CHECK-CC9-NEXT: Class name
+// CHECK-CC9-NEXT: Nested name specifier
+// CHECK-CC9-NEXT: Objective-C interface
+
+// RUN: c-index-test -code-completion-at=%s:18:7 %s | FileCheck -check-prefix=CHECK-CC10 %s
+// CHECK-CC10: FunctionDecl:{ResultType int}{TypedText main}{LeftParen (}{RightParen )} (12)
+// CHECK-CC10: Completion contexts:
+// CHECK-CC10-NEXT: Any type
+// CHECK-CC10-NEXT: Any value
+// CHECK-CC10-NEXT: Enum tag
+// CHECK-CC10-NEXT: Union tag
+// CHECK-CC10-NEXT: Struct tag
+// CHECK-CC10-NEXT: Class name
+// CHECK-CC10-NEXT: Nested name specifier
+// CHECK-CC10-NEXT: Objective-C interface
diff --git a/test/Index/complete-functor-call.cpp b/test/Index/complete-functor-call.cpp
new file mode 100644
index 000000000000..b6aed7eb19e2
--- /dev/null
+++ b/test/Index/complete-functor-call.cpp
@@ -0,0 +1,191 @@
+// Note: the run lines follow their respective tests, since line/column
+// matter in this test.
+
+template<class V>
+struct S {
+ void operator()(int) const {}
+ template<class T> void operator()(T) const {}
+ template<class T> void operator()(V, T, T) const {}
+ template<class T> const S<T> *operator()(const S<T> &s) const { return &s; }
+};
+
+void foo(S<void *> &s) { s(42); }
+
+int main() {
+ S<void *> s;
+ s(42);
+ s(s);
+ s(0, s, s);
+ (*S<void *>()(S<int>()))(42, 42, 42);
+
+ s(42,);
+ s(s,);
+ s(0, 42, 42,);
+}
+
+// RUN: c-index-test -code-completion-at=%s:16:5 %s | FileCheck -check-prefix=CHECK-CC1 %s
+// CHECK-CC1: OverloadCandidate:{ResultType void}{Text operator()}{LeftParen (}{CurrentParameter int}{RightParen )} (1)
+// CHECK-CC1: OverloadCandidate:{ResultType void}{Text operator()}{LeftParen (}{CurrentParameter T}{RightParen )} (1)
+// CHECK-CC1: OverloadCandidate:{ResultType void}{Text operator()}{LeftParen (}{CurrentParameter void *}{Comma , }{Placeholder T}{Comma , }{Placeholder T}{RightParen )} (1)
+// CHECK-CC1: Completion contexts:
+// CHECK-CC1-NEXT: Any type
+// CHECK-CC1-NEXT: Any value
+// CHECK-CC1-NEXT: Enum tag
+// CHECK-CC1-NEXT: Union tag
+// CHECK-CC1-NEXT: Struct tag
+// CHECK-CC1-NEXT: Class name
+// CHECK-CC1-NEXT: Nested name specifier
+// CHECK-CC1-NEXT: Objective-C interface
+
+// RUN: c-index-test -code-completion-at=%s:17:5 %s | FileCheck -check-prefix=CHECK-CC2 %s
+// CHECK-CC2: OverloadCandidate:{ResultType void}{Text operator()}{LeftParen (}{CurrentParameter int}{RightParen )} (1)
+// CHECK-CC2: OverloadCandidate:{ResultType void}{Text operator()}{LeftParen (}{CurrentParameter T}{RightParen )} (1)
+// CHECK-CC2: OverloadCandidate:{ResultType void}{Text operator()}{LeftParen (}{CurrentParameter void *}{Comma , }{Placeholder T}{Comma , }{Placeholder T}{RightParen )} (1)
+// CHECK-CC2: Completion contexts:
+// CHECK-CC2-NEXT: Any type
+// CHECK-CC2-NEXT: Any value
+// CHECK-CC2-NEXT: Enum tag
+// CHECK-CC2-NEXT: Union tag
+// CHECK-CC2-NEXT: Struct tag
+// CHECK-CC2-NEXT: Class name
+// CHECK-CC2-NEXT: Nested name specifier
+// CHECK-CC2-NEXT: Objective-C interface
+
+// RUN: c-index-test -code-completion-at=%s:18:5 %s | FileCheck -check-prefix=CHECK-CC3 %s
+// CHECK-CC3: OverloadCandidate:{ResultType void}{Text operator()}{LeftParen (}{CurrentParameter int}{RightParen )} (1)
+// CHECK-CC3: OverloadCandidate:{ResultType void}{Text operator()}{LeftParen (}{CurrentParameter T}{RightParen )} (1)
+// CHECK-CC3: OverloadCandidate:{ResultType void}{Text operator()}{LeftParen (}{CurrentParameter void *}{Comma , }{Placeholder T}{Comma , }{Placeholder T}{RightParen )} (1)
+// CHECK-CC3: Completion contexts:
+// CHECK-CC3-NEXT: Any type
+// CHECK-CC3-NEXT: Any value
+// CHECK-CC3-NEXT: Enum tag
+// CHECK-CC3-NEXT: Union tag
+// CHECK-CC3-NEXT: Struct tag
+// CHECK-CC3-NEXT: Class name
+// CHECK-CC3-NEXT: Nested name specifier
+// CHECK-CC3-NEXT: Objective-C interface
+
+// RUN: c-index-test -code-completion-at=%s:18:7 %s | FileCheck -check-prefix=CHECK-CC4 %s
+// CHECK-CC4: OverloadCandidate:{ResultType void}{Text operator()}{LeftParen (}{Placeholder void *}{Comma , }{CurrentParameter T}{Comma , }{Placeholder T}{RightParen )} (1)
+// CHECK-CC4: Completion contexts:
+// CHECK-CC4-NEXT: Any type
+// CHECK-CC4-NEXT: Any value
+// CHECK-CC4-NEXT: Enum tag
+// CHECK-CC4-NEXT: Union tag
+// CHECK-CC4-NEXT: Struct tag
+// CHECK-CC4-NEXT: Class name
+// CHECK-CC4-NEXT: Nested name specifier
+// CHECK-CC4-NEXT: Objective-C interface
+
+// RUN: c-index-test -code-completion-at=%s:18:10 %s | FileCheck -check-prefix=CHECK-CC5 %s
+// CHECK-CC5: OverloadCandidate:{ResultType void}{Text operator()}{LeftParen (}{Placeholder void *}{Comma , }{Placeholder S<void *>}{Comma , }{CurrentParameter S<void *>}{RightParen )} (1)
+// CHECK-CC5: Completion contexts:
+// CHECK-CC5-NEXT: Any type
+// CHECK-CC5-NEXT: Any value
+// CHECK-CC5-NEXT: Enum tag
+// CHECK-CC5-NEXT: Union tag
+// CHECK-CC5-NEXT: Struct tag
+// CHECK-CC5-NEXT: Class name
+// CHECK-CC5-NEXT: Nested name specifier
+// CHECK-CC5-NEXT: Objective-C interface
+
+// RUN: c-index-test -code-completion-at=%s:19:17 %s | FileCheck -check-prefix=CHECK-CC6 %s
+// CHECK-CC6: OverloadCandidate:{ResultType void}{Text operator()}{LeftParen (}{CurrentParameter int}{RightParen )} (1)
+// CHECK-CC6: OverloadCandidate:{ResultType void}{Text operator()}{LeftParen (}{CurrentParameter T}{RightParen )} (1)
+// CHECK-CC6: OverloadCandidate:{ResultType void}{Text operator()}{LeftParen (}{CurrentParameter void *}{Comma , }{Placeholder T}{Comma , }{Placeholder T}{RightParen )} (1)
+// CHECK-CC6: OverloadCandidate:{ResultType const S<T> *}{Text operator()}{LeftParen (}{CurrentParameter const S<T> &s}{RightParen )} (1)
+// CHECK-CC6: Completion contexts:
+// CHECK-CC6-NEXT: Any type
+// CHECK-CC6-NEXT: Any value
+// CHECK-CC6-NEXT: Enum tag
+// CHECK-CC6-NEXT: Union tag
+// CHECK-CC6-NEXT: Struct tag
+// CHECK-CC6-NEXT: Class name
+// CHECK-CC6-NEXT: Nested name specifier
+// CHECK-CC6-NEXT: Objective-C interface
+
+// RUN: c-index-test -code-completion-at=%s:19:28 %s | FileCheck -check-prefix=CHECK-CC7 %s
+// CHECK-CC7: OverloadCandidate:{ResultType void}{Text operator()}{LeftParen (}{CurrentParameter int}{RightParen )} (1)
+// CHECK-CC7: OverloadCandidate:{ResultType void}{Text operator()}{LeftParen (}{CurrentParameter T}{RightParen )} (1)
+// CHECK-CC7: OverloadCandidate:{ResultType void}{Text operator()}{LeftParen (}{CurrentParameter int}{Comma , }{Placeholder T}{Comma , }{Placeholder T}{RightParen )} (1)
+// CHECK-CC7: OverloadCandidate:{ResultType const S<T> *}{Text operator()}{LeftParen (}{CurrentParameter const S<T> &s}{RightParen )} (1)
+// CHECK-CC7: Completion contexts:
+// CHECK-CC7-NEXT: Any type
+// CHECK-CC7-NEXT: Any value
+// CHECK-CC7-NEXT: Enum tag
+// CHECK-CC7-NEXT: Union tag
+// CHECK-CC7-NEXT: Struct tag
+// CHECK-CC7-NEXT: Class name
+// CHECK-CC7-NEXT: Nested name specifier
+// CHECK-CC7-NEXT: Objective-C interface
+
+// RUN: c-index-test -code-completion-at=%s:19:31 %s | FileCheck -check-prefix=CHECK-CC8 %s
+// CHECK-CC8: OverloadCandidate:{ResultType void}{Text operator()}{LeftParen (}{Placeholder int}{Comma , }{CurrentParameter T}{Comma , }{Placeholder T}{RightParen )} (1)
+// CHECK-CC8: Completion contexts:
+// CHECK-CC8-NEXT: Any type
+// CHECK-CC8-NEXT: Any value
+// CHECK-CC8-NEXT: Enum tag
+// CHECK-CC8-NEXT: Union tag
+// CHECK-CC8-NEXT: Struct tag
+// CHECK-CC8-NEXT: Class name
+// CHECK-CC8-NEXT: Nested name specifier
+// CHECK-CC8-NEXT: Objective-C interface
+
+// RUN: c-index-test -code-completion-at=%s:19:35 %s | FileCheck -check-prefix=CHECK-CC9 %s
+// CHECK-CC9: OverloadCandidate:{ResultType void}{Text operator()}{LeftParen (}{Placeholder int}{Comma , }{Placeholder int}{Comma , }{CurrentParameter int}{RightParen )} (1)
+// CHECK-CC9: Completion contexts:
+// CHECK-CC9-NEXT: Any type
+// CHECK-CC9-NEXT: Any value
+// CHECK-CC9-NEXT: Enum tag
+// CHECK-CC9-NEXT: Union tag
+// CHECK-CC9-NEXT: Struct tag
+// CHECK-CC9-NEXT: Class name
+// CHECK-CC9-NEXT: Nested name specifier
+// CHECK-CC9-NEXT: Objective-C interface
+
+// RUN: c-index-test -code-completion-at=%s:21:8 %s | FileCheck -check-prefix=CHECK-CC10 %s
+// CHECK-CC10: Completion contexts:
+// CHECK-CC10-NEXT: Any type
+// CHECK-CC10-NEXT: Any value
+// CHECK-CC10-NEXT: Enum tag
+// CHECK-CC10-NEXT: Union tag
+// CHECK-CC10-NEXT: Struct tag
+// CHECK-CC10-NEXT: Class name
+// CHECK-CC10-NEXT: Nested name specifier
+// CHECK-CC10-NEXT: Objective-C interface
+
+// RUN: c-index-test -code-completion-at=%s:22:7 %s | FileCheck -check-prefix=CHECK-CC11 %s
+// CHECK-CC11: Completion contexts:
+// CHECK-CC11-NEXT: Any type
+// CHECK-CC11-NEXT: Any value
+// CHECK-CC11-NEXT: Enum tag
+// CHECK-CC11-NEXT: Union tag
+// CHECK-CC11-NEXT: Struct tag
+// CHECK-CC11-NEXT: Class name
+// CHECK-CC11-NEXT: Nested name specifier
+// CHECK-CC11-NEXT: Objective-C interface
+
+// RUN: c-index-test -code-completion-at=%s:23:15 %s | FileCheck -check-prefix=CHECK-CC12 %s
+// CHECK-CC12: Completion contexts:
+// CHECK-CC12-NEXT: Any type
+// CHECK-CC12-NEXT: Any value
+// CHECK-CC12-NEXT: Enum tag
+// CHECK-CC12-NEXT: Union tag
+// CHECK-CC12-NEXT: Struct tag
+// CHECK-CC12-NEXT: Class name
+// CHECK-CC12-NEXT: Nested name specifier
+// CHECK-CC12-NEXT: Objective-C interface
+
+// RUN: c-index-test -code-completion-at=%s:12:28 %s | FileCheck -check-prefix=CHECK-CC13 %s
+// CHECK-CC13: OverloadCandidate:{ResultType void}{Text operator()}{LeftParen (}{CurrentParameter int}{RightParen )} (1)
+// CHECK-CC13: OverloadCandidate:{ResultType void}{Text operator()}{LeftParen (}{CurrentParameter T}{RightParen )} (1)
+// CHECK-CC13: OverloadCandidate:{ResultType void}{Text operator()}{LeftParen (}{CurrentParameter void *}{Comma , }{Placeholder T}{Comma , }{Placeholder T}{RightParen )} (1)
+// CHECK-CC13: Completion contexts:
+// CHECK-CC13-NEXT: Any type
+// CHECK-CC13-NEXT: Any value
+// CHECK-CC13-NEXT: Enum tag
+// CHECK-CC13-NEXT: Union tag
+// CHECK-CC13-NEXT: Struct tag
+// CHECK-CC13-NEXT: Class name
+// CHECK-CC13-NEXT: Nested name specifier
+// CHECK-CC13-NEXT: Objective-C interface
diff --git a/test/Index/complete-macros.c b/test/Index/complete-macros.c
index c81c8caad8d4..394f93dea0e2 100644
--- a/test/Index/complete-macros.c
+++ b/test/Index/complete-macros.c
@@ -28,7 +28,7 @@ void test_variadic() {
// RUN: c-index-test -code-completion-at=%s:7:1 %s -I%S | FileCheck -check-prefix=CHECK-CC0 %s
// CHECK-CC0-NOT: FOO
// RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_CACHING=1 c-index-test -code-completion-at=%s:7:1 %s -I%S | FileCheck -check-prefix=CHECK-CC1 %s
-// CHECK-CC1: macro definition:{TypedText FOO}{LeftParen (}{Placeholder Arg1}{Comma , }{Placeholder Arg2}{RightParen )}
+// CHECK-CC1: macro definition:{TypedText FOO} (70)
// RUN: c-index-test -code-completion-at=%s:13:13 %s -I%S | FileCheck -check-prefix=CHECK-CC2 %s
// RUN: c-index-test -code-completion-at=%s:14:8 %s -I%S | FileCheck -check-prefix=CHECK-CC2 %s
// RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_CACHING=1 c-index-test -code-completion-at=%s:14:8 %s -I%S | FileCheck -check-prefix=CHECK-CC2 %s
diff --git a/test/Index/complete-optional-params.cpp b/test/Index/complete-optional-params.cpp
new file mode 100644
index 000000000000..88d810502424
--- /dev/null
+++ b/test/Index/complete-optional-params.cpp
@@ -0,0 +1,75 @@
+// Note: the run lines follow their respective tests, since line/column
+// matter in this test.
+
+void foo(int a = 42, int = 42);
+void bar(int a, int b = 42, int c = 42);
+void baz(int a = 42, ...);
+struct S{ S(int a = 42, int = 42) {} };
+
+int main() {
+ foo(42, 42);
+ bar(42, 42, 42);
+ baz(42, 42, 42);
+ S s(42, 42);
+}
+
+// RUN: c-index-test -code-completion-at=%s:10:9 %s | FileCheck -check-prefix=CHECK-CC1 %s
+// CHECK-CC1: OverloadCandidate:{ResultType void}{Text foo}{LeftParen (}{Optional {CurrentParameter int a}{Optional {Comma , }{Placeholder int}}}{RightParen )} (1)
+// CHECK-CC1: Completion contexts:
+// CHECK-CC1-NEXT: Any type
+// CHECK-CC1-NEXT: Any value
+// CHECK-CC1-NEXT: Enum tag
+// CHECK-CC1-NEXT: Union tag
+// CHECK-CC1-NEXT: Struct tag
+// CHECK-CC1-NEXT: Class name
+// CHECK-CC1-NEXT: Nested name specifier
+// CHECK-CC1-NEXT: Objective-C interface
+
+// RUN: c-index-test -code-completion-at=%s:11:9 %s | FileCheck -check-prefix=CHECK-CC2 %s
+// CHECK-CC2: OverloadCandidate:{ResultType void}{Text bar}{LeftParen (}{CurrentParameter int a}{Optional {Comma , }{Placeholder int b}{Optional {Comma , }{Placeholder int c}}}{RightParen )} (1)
+// CHECK-CC2: Completion contexts:
+// CHECK-CC2-NEXT: Any type
+// CHECK-CC2-NEXT: Any value
+// CHECK-CC2-NEXT: Enum tag
+// CHECK-CC2-NEXT: Union tag
+// CHECK-CC2-NEXT: Struct tag
+// CHECK-CC2-NEXT: Class name
+// CHECK-CC2-NEXT: Nested name specifier
+// CHECK-CC2-NEXT: Objective-C interface
+
+// RUN: c-index-test -code-completion-at=%s:11:16 %s | FileCheck -check-prefix=CHECK-CC3 %s
+// CHECK-CC3: OverloadCandidate:{ResultType void}{Text bar}{LeftParen (}{Placeholder int a}{Optional {Comma , }{Placeholder int b}{Optional {Comma , }{CurrentParameter int c}}}{RightParen )} (1)
+// CHECK-CC3: Completion contexts:
+// CHECK-CC3-NEXT: Any type
+// CHECK-CC3-NEXT: Any value
+// CHECK-CC3-NEXT: Enum tag
+// CHECK-CC3-NEXT: Union tag
+// CHECK-CC3-NEXT: Struct tag
+// CHECK-CC3-NEXT: Class name
+// CHECK-CC3-NEXT: Nested name specifier
+// CHECK-CC3-NEXT: Objective-C interface
+
+// RUN: c-index-test -code-completion-at=%s:12:16 %s | FileCheck -check-prefix=CHECK-CC4 %s
+// CHECK-CC4: OverloadCandidate:{ResultType void}{Text baz}{LeftParen (}{Optional {Placeholder int a}{Optional {Comma , }{CurrentParameter ...}}}{RightParen )} (1)
+// CHECK-CC4: Completion contexts:
+// CHECK-CC4-NEXT: Any type
+// CHECK-CC4-NEXT: Any value
+// CHECK-CC4-NEXT: Enum tag
+// CHECK-CC4-NEXT: Union tag
+// CHECK-CC4-NEXT: Struct tag
+// CHECK-CC4-NEXT: Class name
+// CHECK-CC4-NEXT: Nested name specifier
+// CHECK-CC4-NEXT: Objective-C interface
+
+// RUN: c-index-test -code-completion-at=%s:13:9 %s | FileCheck -check-prefix=CHECK-CC5 %s
+// CHECK-CC5: OverloadCandidate:{Text S}{LeftParen (}{Optional {CurrentParameter int a}{Optional {Comma , }{Placeholder int}}}{RightParen )} (1)
+// CHECK-CC5: OverloadCandidate:{Text S}{LeftParen (}{CurrentParameter const S &}{RightParen )} (1)
+// CHECK-CC5: Completion contexts:
+// CHECK-CC5-NEXT: Any type
+// CHECK-CC5-NEXT: Any value
+// CHECK-CC5-NEXT: Enum tag
+// CHECK-CC5-NEXT: Union tag
+// CHECK-CC5-NEXT: Struct tag
+// CHECK-CC5-NEXT: Class name
+// CHECK-CC5-NEXT: Nested name specifier
+// CHECK-CC5-NEXT: Objective-C interface
diff --git a/test/Index/complete-pointer-and-reference-to-functions.cpp b/test/Index/complete-pointer-and-reference-to-functions.cpp
new file mode 100644
index 000000000000..12e6cb9f7249
--- /dev/null
+++ b/test/Index/complete-pointer-and-reference-to-functions.cpp
@@ -0,0 +1,62 @@
+// Note: the run lines follow their respective tests, since line/column
+// matter in this test.
+
+template<class T> void (&foo(T))(T);
+template<class T> void (*bar(T))(T);
+template<class T> void (&baz(T))(T, ...);
+template<class T> void (*fiz(T))(T, ...);
+
+int main() {
+ foo(42)(42);
+ bar(42)(42);
+ baz(42)(42, 42, 42);
+ fiz(42)(42, 42, 42);
+}
+
+// RUN: c-index-test -code-completion-at=%s:10:11 %s | FileCheck -check-prefix=CHECK-CC1 %s
+// CHECK-CC1: OverloadCandidate:{ResultType void}{LeftParen (}{CurrentParameter int}{RightParen )} (1)
+// CHECK-CC1: Completion contexts:
+// CHECK-CC1-NEXT: Any type
+// CHECK-CC1-NEXT: Any value
+// CHECK-CC1-NEXT: Enum tag
+// CHECK-CC1-NEXT: Union tag
+// CHECK-CC1-NEXT: Struct tag
+// CHECK-CC1-NEXT: Class name
+// CHECK-CC1-NEXT: Nested name specifier
+// CHECK-CC1-NEXT: Objective-C interface
+
+// RUN: c-index-test -code-completion-at=%s:11:11 %s | FileCheck -check-prefix=CHECK-CC2 %s
+// CHECK-CC2: OverloadCandidate:{ResultType void}{LeftParen (}{CurrentParameter int}{RightParen )} (1)
+// CHECK-CC2: Completion contexts:
+// CHECK-CC2-NEXT: Any type
+// CHECK-CC2-NEXT: Any value
+// CHECK-CC2-NEXT: Enum tag
+// CHECK-CC2-NEXT: Union tag
+// CHECK-CC2-NEXT: Struct tag
+// CHECK-CC2-NEXT: Class name
+// CHECK-CC2-NEXT: Nested name specifier
+// CHECK-CC2-NEXT: Objective-C interface
+
+// RUN: c-index-test -code-completion-at=%s:12:18 %s | FileCheck -check-prefix=CHECK-CC3 %s
+// CHECK-CC3: OverloadCandidate:{ResultType void}{LeftParen (}{Placeholder int}{Optional {Comma , }{CurrentParameter ...}}{RightParen )} (1)
+// CHECK-CC3: Completion contexts:
+// CHECK-CC3-NEXT: Any type
+// CHECK-CC3-NEXT: Any value
+// CHECK-CC3-NEXT: Enum tag
+// CHECK-CC3-NEXT: Union tag
+// CHECK-CC3-NEXT: Struct tag
+// CHECK-CC3-NEXT: Class name
+// CHECK-CC3-NEXT: Nested name specifier
+// CHECK-CC3-NEXT: Objective-C interface
+
+// RUN: c-index-test -code-completion-at=%s:13:18 %s | FileCheck -check-prefix=CHECK-CC4 %s
+// CHECK-CC4: OverloadCandidate:{ResultType void}{LeftParen (}{Placeholder int}{Optional {Comma , }{CurrentParameter ...}}{RightParen )} (1)
+// CHECK-CC4: Completion contexts:
+// CHECK-CC4-NEXT: Any type
+// CHECK-CC4-NEXT: Any value
+// CHECK-CC4-NEXT: Enum tag
+// CHECK-CC4-NEXT: Union tag
+// CHECK-CC4-NEXT: Struct tag
+// CHECK-CC4-NEXT: Class name
+// CHECK-CC4-NEXT: Nested name specifier
+// CHECK-CC4-NEXT: Objective-C interface
diff --git a/test/Index/complete-template-friends-defined.cpp b/test/Index/complete-template-friends-defined.cpp
new file mode 100644
index 000000000000..f1d09c1f33d7
--- /dev/null
+++ b/test/Index/complete-template-friends-defined.cpp
@@ -0,0 +1,33 @@
+// The run lines are below, because this test is line- and
+// column-number sensitive.
+
+namespace N {
+ template<typename T> struct A {
+ template<typename U> friend class B;
+ };
+
+ template<typename T> struct B { };
+}
+
+void foo() {
+ N::A<int> a1;
+ N::A<int> a2;
+}
+
+namespace M {
+ template<typename T> struct C {
+ template<typename U> friend struct C;
+ };
+}
+
+void bar() {
+ M::C<int> c1;
+ M::C<int> c2;
+}
+
+// RUN: c-index-test -code-completion-at=%s:14:6 %s | FileCheck -check-prefix=CHECK-ACCESS-1 %s
+// CHECK-ACCESS-1: ClassTemplate:{TypedText A}{LeftAngle <}{Placeholder typename T}{RightAngle >} (50)
+// CHECK-ACCESS-1: ClassTemplate:{TypedText B}{LeftAngle <}{Placeholder typename T}{RightAngle >} (50)
+
+// RUN: c-index-test -code-completion-at=%s:25:6 %s | FileCheck -check-prefix=CHECK-ACCESS-2 %s
+// CHECK-ACCESS-2: ClassTemplate:{TypedText C}{LeftAngle <}{Placeholder typename T}{RightAngle >} (50)
diff --git a/test/Index/complete-type-factors.m b/test/Index/complete-type-factors.m
index e5aa893eaabf..f2588e6fe65e 100644
--- a/test/Index/complete-type-factors.m
+++ b/test/Index/complete-type-factors.m
@@ -78,19 +78,19 @@ void test2(A *a) {
// CHECK-CC3: NotImplemented:{ResultType size_t}{TypedText sizeof}{LeftParen (}{Placeholder expression-or-type}{RightParen )} (40)
// CHECK-CC3: FunctionDecl:{ResultType enum Priority}{TypedText test1}{LeftParen (}{Placeholder enum Priority priority}{Comma , }{Placeholder enum Color color}{Comma , }{Placeholder int integer}{RightParen )} (12)
// RUN: c-index-test -code-completion-at=%s:19:9 -Xclang -code-completion-patterns %s | FileCheck -check-prefix=CHECK-CC4 %s
-// CHECK-CC4: EnumConstantDecl:{ResultType enum Color}{TypedText Blue} (16)
-// CHECK-CC4: VarDecl:{ResultType enum Color}{TypedText c} (8)
-// CHECK-CC4: ParmDecl:{ResultType enum Color}{TypedText color} (8)
-// CHECK-CC4: FunctionDecl:{ResultType int}{TypedText func1}{LeftParen (}{Placeholder enum Color}{RightParen )} (25)
+// CHECK-CC4: EnumConstantDecl:{ResultType enum Color}{TypedText Blue} (65)
+// CHECK-CC4: VarDecl:{ResultType enum Color}{TypedText c} (34)
+// CHECK-CC4: ParmDecl:{ResultType enum Color}{TypedText color} (34)
+// CHECK-CC4: FunctionDecl:{ResultType int}{TypedText func1}{LeftParen (}{Placeholder enum Color}{RightParen )} (50)
// CHECK-CC4: FunctionDecl:{ResultType enum Priority}{TypedText func2}{LeftParen (}{Placeholder int}{RightParen )} (50)
// CHECK-CC4: FunctionDecl:{ResultType void}{TypedText func3}{LeftParen (}{Placeholder float}{RightParen )} (50)
-// CHECK-CC4: EnumConstantDecl:{ResultType enum Color}{TypedText Green} (16)
+// CHECK-CC4: EnumConstantDecl:{ResultType enum Color}{TypedText Green} (65)
// CHECK-CC4: EnumConstantDecl:{ResultType enum Priority}{TypedText High} (65)
-// CHECK-CC4: VarDecl:{ResultType int}{TypedText i} (17)
-// CHECK-CC4: ParmDecl:{ResultType int}{TypedText integer} (17)
+// CHECK-CC4: VarDecl:{ResultType int}{TypedText i} (34)
+// CHECK-CC4: ParmDecl:{ResultType int}{TypedText integer} (34)
// CHECK-CC4: EnumConstantDecl:{ResultType enum Priority}{TypedText Low} (65)
// CHECK-CC4: ParmDecl:{ResultType enum Priority}{TypedText priority} (34)
-// CHECK-CC4: EnumConstantDecl:{ResultType enum Color}{TypedText Red} (16)
+// CHECK-CC4: EnumConstantDecl:{ResultType enum Color}{TypedText Red} (65)
// CHECK-CC4: NotImplemented:{ResultType size_t}{TypedText sizeof}{LeftParen (}{Placeholder expression-or-type}{RightParen )} (40)
// CHECK-CC4: FunctionDecl:{ResultType enum Priority}{TypedText test1}{LeftParen (}{Placeholder enum Priority priority}{Comma , }{Placeholder enum Color color}{Comma , }{Placeholder int integer}{RightParen )} (50)
// RUN: c-index-test -code-completion-at=%s:21:9 -Xclang -code-completion-patterns %s | FileCheck -check-prefix=CHECK-CC4 %s
diff --git a/test/Index/get-cursor.c b/test/Index/get-cursor.c
index c0614af5dd34..867181039478 100644
--- a/test/Index/get-cursor.c
+++ b/test/Index/get-cursor.c
@@ -6,11 +6,23 @@ struct _MyS ww;
int x, y;
+typedef union {
+ struct {
+ int field : 16;
+ };
+} r_t;
+
+void test() {
+ r_t reg;
+ reg.field = 1;
+}
+
// RUN: c-index-test -cursor-at=%s:1:9 \
// RUN: -cursor-at=%s:2:9 \
// RUN: -cursor-at=%s:5:9 \
// RUN: -cursor-at=%s:7:5 \
// RUN: -cursor-at=%s:7:8 \
+// RUN: -cursor-at=%s:17:8 \
// RUN: %s | FileCheck %s
// CHECK: StructDecl=_MyS:1:8 (Definition)
@@ -18,3 +30,4 @@ int x, y;
// CHECK: TypeRef=struct _MyS:1:8
// CHECK: VarDecl=x:7:5
// CHECK: VarDecl=y:7:8
+// CHECK: 17:7 MemberRefExpr=field:11:9 \ No newline at end of file
diff --git a/test/Index/index-module.m b/test/Index/index-module.m
index 8ed7a84e2e1a..a973e91af833 100644
--- a/test/Index/index-module.m
+++ b/test/Index/index-module.m
@@ -8,8 +8,8 @@ int glob;
// RUN: -Xclang -fdisable-module-hash | FileCheck %s
// CHECK-NOT: [indexDeclaration]
-// CHECK: [importedASTFile]: [[PCM:.*[/\\]DependsOnModule\.pcm]] | loc: 2:2 | name: "DependsOnModule" | isImplicit: 1
-// CHECK-NEXT: [ppIncludedFile]: {{.*}}/Modules/Inputs/DependsOnModule.framework{{[/\\]}}Headers{{[/\\]}}DependsOnModule.h | name: "DependsOnModule/DependsOnModule.h" | hash loc: 2:1 | isImport: 0 | isAngled: 1 | isModule: 1
+// CHECK: [ppIncludedFile]: {{.*}}/Modules/Inputs/DependsOnModule.framework{{[/\\]}}Headers{{[/\\]}}DependsOnModule.h | name: "DependsOnModule/DependsOnModule.h" | hash loc: 2:1 | isImport: 0 | isAngled: 1 | isModule: 1
+// CHECK-NEXT: [importedASTFile]: [[PCM:.*[/\\]DependsOnModule\.pcm]] | loc: 2:1 | name: "DependsOnModule" | isImplicit: 1
// CHECK-NOT: [indexDeclaration]
// CHECK: [importedASTFile]: [[PCM]] | loc: 3:1 | name: "DependsOnModule" | isImplicit: 0
// CHECK-NEXT: [indexDeclaration]: kind: variable | name: glob | {{.*}} | loc: 4:5
@@ -25,10 +25,9 @@ int glob;
// CHECK-DMOD-NEXT: [ppIncludedFile]: [[DMOD_SUB_H:.*/Modules/Inputs/DependsOnModule\.framework[/\\]Frameworks[/\\]SubFramework\.framework[/\\]Headers[/\\]SubFramework\.h]] | {{.*}} | hash loc: <invalid> | {{.*}} | module: DependsOnModule.SubFramework
// CHECK-DMOD-NEXT: [ppIncludedFile]: [[DMOD_SUB_OTHER_H:.*/Modules/Inputs/DependsOnModule.framework[/\\]Frameworks/SubFramework\.framework/Headers/Other\.h]] | name: "SubFramework/Other.h" | hash loc: [[DMOD_SUB_H]]:1:1 | isImport: 0 | isAngled: 0 | isModule: 0 | module: DependsOnModule.SubFramework.Other
// CHECK-DMOD-NEXT: [ppIncludedFile]: [[DMOD_PRIVATE_H:.*/Modules/Inputs/DependsOnModule.framework[/\\]PrivateHeaders[/\\]DependsOnModulePrivate.h]] | {{.*}} | hash loc: <invalid> | {{.*}} | module: DependsOnModule.Private.DependsOnModule
-// CHECK-DMOD-NEXT: [importedASTFile]: {{.*}}.cache{{[/\\]}}Module.pcm | loc: [[DMOD_MODULE_H]]:1:2 | name: "Module" | isImplicit: 1
+// CHECK-DMOD-NEXT: [importedASTFile]: {{.*}}.cache{{[/\\]}}Module.pcm | loc: [[DMOD_MODULE_H]]:1:1 | name: "Module" | isImplicit: 1
// CHECK-DMOD-NEXT: [indexDeclaration]: kind: variable | name: depends_on_module_other | {{.*}} | loc: [[DMOD_OTHER_H]]:1:5
// CHECK-DMOD-NEXT: [indexDeclaration]: kind: variable | name: template | {{.*}} | loc: [[DMOD_NOT_CXX_H]]:1:12
-// CHECK-DMOD-NEXT: [importedASTFile]: {{.*}}.cache/DependsOnModule.pcm | loc: {{.*}}SubFramework.h:1:2 | name: "DependsOnModule.SubFramework.Other" | isImplicit: 1
// CHECK-DMOD-NEXT: [indexDeclaration]: kind: variable | name: sub_framework | {{.*}} | loc: [[DMOD_SUB_H]]:2:8
// CHECK-DMOD-NEXT: [indexDeclaration]: kind: variable | name: sub_framework_other | {{.*}} | loc: [[DMOD_SUB_OTHER_H]]:1:9
// CHECK-DMOD-NEXT: [indexDeclaration]: kind: variable | name: depends_on_module_private | {{.*}} | loc: [[DMOD_PRIVATE_H]]:1:5
@@ -47,9 +46,11 @@ int glob;
// CHECK-TMOD-NEXT: <ObjCContainerInfo>: kind: interface
// CHECK-TMOD-NEXT: [indexDeclaration]: kind: objc-class-method | name: version | {{.*}} | loc: [[TMOD_MODULE_H]]:16:1
// CHECK-TMOD-NEXT: [indexDeclaration]: kind: objc-class-method | name: alloc | {{.*}} | loc: [[TMOD_MODULE_H]]:17:1
-// CHECK-TMOD-NEXT: [importedASTFile]: [[PCM:.*\.cache/Module\.pcm]] | loc: [[TMOD_MODULE_H]]:23:2 | name: "Module.Sub" | isImplicit: 1
-// CHECK-TMOD-NEXT: [importedASTFile]: [[PCM]] | loc: [[TMOD_MODULE_H]]:24:2 | name: "Module.Buried.Treasure" | isImplicit: 1
-// CHECK-TMOD-NEXT: [importedASTFile]: [[PCM]] | loc: [[TMODHDR]]Sub.h:1:2 | name: "Module.Sub2" | isImplicit: 1
+// CHECK-TMOD-NEXT: [indexDeclaration]: kind: typedef | name: FILE | {{.*}} | loc: [[TMOD_MODULE_H]]:30:3
+// CHECK-TMOD-NEXT: [indexDeclaration]: kind: struct | name: __sFILE | {{.*}} | loc: [[TMOD_MODULE_H]]:28:16
+// CHECK-TMOD-NEXT: [indexDeclaration]: kind: field | name: _offset | {{.*}} | loc: [[TMOD_MODULE_H]]:29:7
+// CHECK-TMOD-NEXT: [indexDeclaration]: kind: variable | name: myFile | {{.*}} | loc: [[TMOD_MODULE_H]]:32:14
+// CHECK-TMOD-NEXT: [indexEntityReference]: kind: typedef | name: FILE | {{.*}} | loc: [[TMOD_MODULE_H]]:32:8
// CHECK-TMOD-NEXT: [indexDeclaration]: kind: variable | name: Module_Sub | {{.*}} | loc: [[TMODHDR]]Sub.h:2:6
// CHECK-TMOD-NEXT: [indexDeclaration]: kind: variable | name: Module_Sub2 | USR: c:@Module_Sub2 | {{.*}} | loc: [[TMODHDR]]Sub2.h:1:6
// CHECK-TMOD-NEXT: [indexDeclaration]: kind: variable | name: Buried_Treasure | {{.*}} | loc: [[TMODHDR]]Buried{{[/\\]}}Treasure.h:1:11
diff --git a/test/Index/index-pch-with-module.m b/test/Index/index-pch-with-module.m
index ef0392ee9601..53bac1e44600 100644
--- a/test/Index/index-pch-with-module.m
+++ b/test/Index/index-pch-with-module.m
@@ -27,5 +27,5 @@ int glob;
// CHECK-PCH: [enteredMainFile]: {{.*[/\\]}}index-pch-with-module.m
// CHECK-PCH: [startedTranslationUnit]
-// CHECK-PCH: [importedASTFile]: {{.*}}.cache{{[/\\]}}DependsOnModule.pcm | loc: 5:2 | name: "DependsOnModule" | isImplicit: 1
+// CHECK-PCH: [importedASTFile]: {{.*}}.cache{{[/\\]}}DependsOnModule.pcm | loc: 5:1 | name: "DependsOnModule" | isImplicit: 1
// CHECK-PCH: [indexDeclaration]: kind: variable | name: pch_glob | {{.*}} | loc: 6:12
diff --git a/test/Index/load-stmts.cpp b/test/Index/load-stmts.cpp
index ed0debdd762b..4a44c66156b5 100644
--- a/test/Index/load-stmts.cpp
+++ b/test/Index/load-stmts.cpp
@@ -117,7 +117,7 @@ void casts(int *ip) {
(void)reinterpret_cast<float *>(ip);
}
-// RUN: c-index-test -test-load-source all -fno-delayed-template-parsing %s | FileCheck %s
+// RUN: c-index-test -test-load-source all -fno-delayed-template-parsing -frtti %s | FileCheck %s
// CHECK: load-stmts.cpp:1:13: TypedefDecl=T:1:13 (Definition) Extent=[1:1 - 1:14]
// CHECK: load-stmts.cpp:2:8: StructDecl=X:2:8 (Definition) Extent=[2:1 - 2:23]
// CHECK: load-stmts.cpp:2:16: FieldDecl=a:2:16 (Definition) Extent=[2:12 - 2:17]
diff --git a/test/Index/print-type-size.cpp b/test/Index/print-type-size.cpp
index 58f2e14c33a4..45de93f30824 100644
--- a/test/Index/print-type-size.cpp
+++ b/test/Index/print-type-size.cpp
@@ -65,12 +65,12 @@ struct Test2 {
int foo;
};
struct {
-//CHECK64: FieldDecl=bar:[[@LINE+1]]:11 (Definition) [type=int] [typekind=Int] [sizeof=4] [alignof=4] [offsetof=32]
+//CHECK64: FieldDecl=bar:[[@LINE+1]]:11 (Definition) [type=int] [typekind=Int] [sizeof=4] [alignof=4] [offsetof=32/0]
int bar;
};
struct {
struct {
-//CHECK64: FieldDecl=foobar:[[@LINE+1]]:15 (Definition) [type=int] [typekind=Int] [sizeof=4] [alignof=4] [offsetof=64]
+//CHECK64: FieldDecl=foobar:[[@LINE+1]]:15 (Definition) [type=int] [typekind=Int] [sizeof=4] [alignof=4] [offsetof=64/0]
int foobar;
};
};
@@ -160,6 +160,7 @@ struct s4a {
struct {
struct {
struct {
+//CHECK64: FieldDecl=s4_e1:[[@LINE+1]]:17 (Definition) [type=int] [typekind=Int] [sizeof=4] [alignof=4] [offsetof=-1/0]
int s4_e1;
};
};
diff --git a/test/Index/print-type.cpp b/test/Index/print-type.cpp
index af5c556c4dc6..f73f1b442f83 100644
--- a/test/Index/print-type.cpp
+++ b/test/Index/print-type.cpp
@@ -44,6 +44,7 @@ void foo(int i, int incomplete_array[]) { int variable_array[i]; }
struct Blob {
int i;
+ int j;
};
int Blob::*member_pointer;
@@ -58,7 +59,7 @@ int Blob::*member_pointer;
// CHECK: NonTypeTemplateParameter=U:8:32 (Definition) [type=unsigned int] [typekind=UInt] [isPOD=1]
// CHECK: TemplateTemplateParameter=W:8:60 (Definition) [type=] [typekind=Invalid] [isPOD=0]
// CHECK: Namespace=inner:14:11 (Definition) [type=] [typekind=Invalid] [isPOD=0]
-// CHECK: StructDecl=Bar:16:8 (Definition) [type=outer::inner::Bar] [typekind=Record] [isPOD=0]
+// CHECK: StructDecl=Bar:16:8 (Definition) [type=outer::inner::Bar] [typekind=Record] [isPOD=0] [nbFields=3]
// CHECK: CXXConstructor=Bar:17:3 (Definition) [type=void (outer::Foo<bool> *){{.*}}] [typekind=FunctionProto] [canonicaltype=void (outer::Foo<bool> *){{.*}}] [canonicaltypekind=FunctionProto] [resulttype=void] [resulttypekind=Void] [args= [outer::Foo<bool> *] [Pointer]] [isPOD=0]
// CHECK: ParmDecl=foo:17:25 (Definition) [type=outer::Foo<bool> *] [typekind=Pointer] [canonicaltype=outer::Foo<bool> *] [canonicaltypekind=Pointer] [isPOD=1] [pointeetype=outer::Foo<bool>] [pointeekind=Unexposed]
// CHECK: NamespaceRef=outer:1:11 [type=] [typekind=Invalid] [isPOD=0]
@@ -115,6 +116,6 @@ int Blob::*member_pointer;
// CHECK: DeclStmt= [type=] [typekind=Invalid] [isPOD=0]
// CHECK: VarDecl=variable_array:43:47 (Definition) [type=int [i]] [typekind=VariableArray] [isPOD=1]
// CHECK: DeclRefExpr=i:43:14 [type=int] [typekind=Int] [isPOD=1]
-// CHECK: StructDecl=Blob:45:8 (Definition) [type=Blob] [typekind=Record] [isPOD=1]
+// CHECK: StructDecl=Blob:45:8 (Definition) [type=Blob] [typekind=Record] [isPOD=1] [nbFields=2]
// CHECK: FieldDecl=i:46:7 (Definition) [type=int] [typekind=Int] [isPOD=1]
-// CHECK: VarDecl=member_pointer:48:12 (Definition) [type=int Blob::*] [typekind=MemberPointer] [isPOD=1]
+// CHECK: VarDecl=member_pointer:49:12 (Definition) [type=int Blob::*] [typekind=MemberPointer] [isPOD=1]