[Cygwin] Work around to flush stdout in a thread, or stdout in threads won't be flushed at exit.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154254 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/tools/c-arcmt-test/c-arcmt-test.c b/tools/c-arcmt-test/c-arcmt-test.c
index b91d3e1..56a4132 100644
--- a/tools/c-arcmt-test/c-arcmt-test.c
+++ b/tools/c-arcmt-test/c-arcmt-test.c
@@ -97,6 +97,9 @@
void thread_runner(void *client_data_v) {
thread_info *client_data = client_data_v;
client_data->result = carcmttest_main(client_data->argc, client_data->argv);
+#ifdef __CYGWIN__
+ fflush(stdout); /* stdout is not flushed on Cygwin. */
+#endif
}
int main(int argc, const char **argv) {
diff --git a/tools/c-index-test/c-index-test.c b/tools/c-index-test/c-index-test.c
index b76661f..f82d2d2 100644
--- a/tools/c-index-test/c-index-test.c
+++ b/tools/c-index-test/c-index-test.c
@@ -2781,6 +2781,9 @@
void thread_runner(void *client_data_v) {
thread_info *client_data = client_data_v;
client_data->result = cindextest_main(client_data->argc, client_data->argv);
+#ifdef __CYGWIN__
+ fflush(stdout); /* stdout is not flushed on Cygwin. */
+#endif
}
int main(int argc, const char **argv) {