[PATCH] D14543: llvm-config: Explicitly flush ostream so output can be piped into other programs.

Tom Stellard via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 10 09:28:57 PST 2015


tstellarAMD created this revision.
tstellarAMD added a reviewer: jroelofs.
tstellarAMD added a subscriber: llvm-commits.

This is required on my Fedora 21 system, but not on Ubuntu based systems I tested.
Maybe it has something to do with the default shell being used?

http://reviews.llvm.org/D14543

Files:
  test/tools/llvm-config/flush-stdout.test
  tools/llvm-config/llvm-config.cpp

Index: tools/llvm-config/llvm-config.cpp
===================================================================
--- tools/llvm-config/llvm-config.cpp
+++ tools/llvm-config/llvm-config.cpp
@@ -606,5 +606,6 @@
     usage();
   }
 
+  OS.flush();
   return 0;
 }
Index: test/tools/llvm-config/flush-stdout.test
===================================================================
--- /dev/null
+++ test/tools/llvm-config/flush-stdout.test
@@ -0,0 +1,4 @@
+RUN: llvm-config --version | grep '\.'
+
+Test that stdout is flushed when llvm-config exits, so that the output can be
+piped to other programs.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D14543.39816.patch
Type: text/x-patch
Size: 595 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151110/904f680e/attachment.bin>


More information about the llvm-commits mailing list