During code completion, give the "nil" and "NULL" macros the same
priority as other constants. And, if we're in a place where we prefer
a pointer type, consider "nil" and "NULL" to be close matches.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107910 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/Index/complete-macros.c b/test/Index/complete-macros.c
index c33d8c0..9a898e1 100644
--- a/test/Index/complete-macros.c
+++ b/test/Index/complete-macros.c
@@ -2,10 +2,23 @@
// matter in this test.
#define FOO(Arg1,Arg2) foobar
-
+#define nil 0
void f() {
}
+void g(int);
+
+void f2() {
+ int *ip = nil;
+ ip = nil;
+ g(nil);
+}
+
// RUN: c-index-test -code-completion-at=%s:7:1 %s | FileCheck -check-prefix=CHECK-CC1 %s
// CHECK-CC1: macro definition:{TypedText FOO}{LeftParen (}{Placeholder Arg1}{Comma , }{Placeholder Arg2}{RightParen )}
+// RUN: c-index-test -code-completion-at=%s:13:13 %s | FileCheck -check-prefix=CHECK-CC2 %s
+// RUN: c-index-test -code-completion-at=%s:14:8 %s | FileCheck -check-prefix=CHECK-CC2 %s
+// CHECK-CC2: macro definition:{TypedText nil} (30)
+// RUN: c-index-test -code-completion-at=%s:15:5 %s | FileCheck -check-prefix=CHECK-CC3 %s
+// CHECK-CC3: macro definition:{TypedText nil} (60)