Fixing PR25717: fatal IO error writing large outputs to console on Windows.
authorYunzhong Gao <Yunzhong_Gao@playstation.sony.com>
Wed, 6 Jan 2016 00:50:06 +0000 (00:50 +0000)
committerYunzhong Gao <Yunzhong_Gao@playstation.sony.com>
Wed, 6 Jan 2016 00:50:06 +0000 (00:50 +0000)
commit46ee2eb7c71ad894dff6ae190cee878dd6ed8192
tree7c7381362f086a84304eb1fd67b5787d4c7d0668
parentf4e4e5eca8a849bfebcc7d6eb33848f48b2bf27a
Fixing PR25717: fatal IO error writing large outputs to console on Windows.

This patch is similar to the Python issue#11395. We need to cap the output
size to 32767 on Windows to work around the size limit of WriteConsole().
Reference: https://bugs.python.org/issue11395

Writing a test for this bug turns out to be harder than I thought. I am
still working on it (see phabricator review D15705).

Differential Revision: http://reviews.llvm.org/D15553

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256892 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Support/Windows/WindowsSupport.h
lib/Support/raw_ostream.cpp