[llvm-commits] [PATCH[WIN32] fix clang\test\Lexer\preamble.c in win32

Francois Pichet pichet2000 at gmail.com
Mon Oct 4 04:44:10 PDT 2010


Hi,

I am investigating all the win32 XFAIL in clang test.
This patch is necessary to remove the XFAIL from Lexer\preamble.c

The failing was due to this:
1. preamble.c contains CR+LF new lines
2. write() is called with a buffer containing the original (CR+LF) to
output the result on the console.
3. In text mode(the default), write() convert LF to CR+LF even if LF
is preceded by CR, hence we have CR+CR+LF which filecheck interprets
as 2 lines.
4. Filecheck fails

Solution: always use binary mode for output stream. Should not affect
unix where O_BINARY is not defined (I believe)

After this patch is accepted, i'll remove the XFAIL from preamble.c in
the clang svn.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: preamble_win32_fix.patch
Type: application/octet-stream
Size: 1613 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20101004/08baa63a/attachment.obj>


More information about the llvm-commits mailing list