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
// 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!
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() {