[cfe-commits] r96754 - in /cfe/trunk: test/Index/cindex-on-invalid.m tools/CIndex/CIndexDiagnostic.cpp
Douglas Gregor
dgregor at apple.com
Sun Feb 21 12:15:42 PST 2010
Author: dgregor
Date: Sun Feb 21 14:15:42 2010
New Revision: 96754
URL: http://llvm.org/viewvc/llvm-project?rev=96754&view=rev
Log:
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).
Modified:
cfe/trunk/test/Index/cindex-on-invalid.m
cfe/trunk/tools/CIndex/CIndexDiagnostic.cpp
Modified: cfe/trunk/test/Index/cindex-on-invalid.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Index/cindex-on-invalid.m?rev=96754&r1=96753&r2=96754&view=diff
==============================================================================
--- cfe/trunk/test/Index/cindex-on-invalid.m (original)
+++ cfe/trunk/test/Index/cindex-on-invalid.m Sun Feb 21 14:15:42 2010
@@ -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!
Modified: cfe/trunk/tools/CIndex/CIndexDiagnostic.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/CIndex/CIndexDiagnostic.cpp?rev=96754&r1=96753&r2=96754&view=diff
==============================================================================
--- cfe/trunk/tools/CIndex/CIndexDiagnostic.cpp (original)
+++ cfe/trunk/tools/CIndex/CIndexDiagnostic.cpp Sun Feb 21 14:15:42 2010
@@ -116,6 +116,13 @@
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() {
More information about the cfe-commits
mailing list