aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-02-21 20:15:42 +0000
committerDouglas Gregor <dgregor@apple.com>2010-02-21 20:15:42 +0000
commit5f8e1be5b5ed996b31f11d970e8fbbc47cdef699 (patch)
treea30a87638d2586c6d1f8c7725ab7dd1ee97008e4
parentb10cd04880672103660e5844e51ee91af7361a20 (diff)
Attempt to fix the MSVC9 failure with c-indext-test, where the CIndex DLL
and the c-index-test executable end up getting different copies of stderr, causing non-deterministic ordering of output. Fixed by flushing the file after printing a diagnostic (only on Windows). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96754 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--test/Index/cindex-on-invalid.m1
-rw-r--r--tools/CIndex/CIndexDiagnostic.cpp7
2 files changed, 7 insertions, 1 deletions
diff --git a/test/Index/cindex-on-invalid.m b/test/Index/cindex-on-invalid.m
index 626f566202..7e190eb079 100644
--- a/test/Index/cindex-on-invalid.m
+++ b/test/Index/cindex-on-invalid.m
@@ -1,6 +1,5 @@
// RUN: not c-index-test -test-load-source local %s > %t 2> %t.err
// RUN: FileCheck %s < %t.err
-// XFAIL: win32
// CHECK: error: expected identifier or '('
// CHECK: Unable to load translation unit!
diff --git a/tools/CIndex/CIndexDiagnostic.cpp b/tools/CIndex/CIndexDiagnostic.cpp
index 97d5017077..75da335afc 100644
--- a/tools/CIndex/CIndexDiagnostic.cpp
+++ b/tools/CIndex/CIndexDiagnostic.cpp
@@ -116,6 +116,13 @@ void clang_displayDiagnostic(CXDiagnostic Diagnostic, FILE *Out,
else
fprintf(Out, "<no diagnostic text>\n");
clang_disposeString(Text);
+
+#ifdef LLVM_ON_WIN32
+ // On Windows, force a flush, since there may be multiple copies of
+ // stderr and stdout in the file system, all with different buffers
+ // but writing to the same device.
+ fflush(Out);
+#endif
}
unsigned clang_defaultDiagnosticDisplayOptions() {