diff options
-rw-r--r-- | clang/test/Index/Inputs/remap-complete-to.c | 7 | ||||
-rw-r--r-- | clang/test/Index/remap-complete.c | 7 | ||||
-rw-r--r-- | clang/tools/CIndex/CIndexDiagnostic.cpp | 1 |
3 files changed, 12 insertions, 3 deletions
diff --git a/clang/test/Index/Inputs/remap-complete-to.c b/clang/test/Index/Inputs/remap-complete-to.c index 9f8be2cbec2..30199db51a0 100644 --- a/clang/test/Index/Inputs/remap-complete-to.c +++ b/clang/test/Index/Inputs/remap-complete-to.c @@ -1 +1,6 @@ -void f0() { } +int f0(int *pointer1, float *pointer2) { + return pointer2 - pointer1; +} + +void g() { + diff --git a/clang/test/Index/remap-complete.c b/clang/test/Index/remap-complete.c index 9b7de0699d4..813d1dfcf41 100644 --- a/clang/test/Index/remap-complete.c +++ b/clang/test/Index/remap-complete.c @@ -1,5 +1,8 @@ -// RUN: c-index-test -code-completion-at=%s:1:12 -remap-file="%s;%S/Inputs/remap-complete-to.c" %s | FileCheck %s +// RUN: c-index-test -code-completion-at=%s:6:2 -remap-file="%s;%S/Inputs/remap-complete-to.c" %s 2> %t.err | FileCheck %s +// RUN: FileCheck -check-prefix=CHECK-DIAGS %s < %t.err // XFAIL: win32 -// CHECK: FunctionDecl:{ResultType void}{TypedText f0}{LeftParen (}{RightParen )} +// CHECK: FunctionDecl:{ResultType int}{TypedText f0}{LeftParen (} void f() { } + +// CHECK-DIAGS: remap-complete.c:2:19 diff --git a/clang/tools/CIndex/CIndexDiagnostic.cpp b/clang/tools/CIndex/CIndexDiagnostic.cpp index 6aed49eaaee..f4454d46f67 100644 --- a/clang/tools/CIndex/CIndexDiagnostic.cpp +++ b/clang/tools/CIndex/CIndexDiagnostic.cpp @@ -265,6 +265,7 @@ void clang::LoadSerializedDiagnostics(const llvm::sys::Path &DiagnosticsPath, } SourceMgr.overrideFileContents(File, Buffer); + SourceMgr.createFileID(File, SourceLocation(), SrcMgr::C_User); } // Parse the diagnostics, emitting them one by one until we've |