[cfe-commits] r90907 - /cfe/trunk/test/Preprocessor/dump_macros.c

Chris Lattner clattner at apple.com
Tue Dec 8 17:08:25 PST 2009


On Dec 8, 2009, at 5:07 PM, Chris Lattner wrote:

>
> On Dec 8, 2009, at 4:04 PM, Daniel Dunbar wrote:
>
>> Author: ddunbar
>> Date: Tue Dec  8 18:04:46 2009
>> New Revision: 90907
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=90907&view=rev
>> Log:
>> Improve test portability; I can't figure out how to get the regexp
>> library to
>> match $ correctly with \r\n, unfortunately.
>
> Why is it getting \r\n?  It sounds like the real problem is that
> filecheck is opening the memory buffer as ascii instead of binary?

in lib/Support/MemoryBuffer.cpp, is this code failing?

MemoryBuffer *MemoryBuffer::getFile(StringRef Filename, std::string  
*ErrStr,
                                     int64_t FileSize) {
   int OpenFlags = 0;
#ifdef O_BINARY
   OpenFlags |= O_BINARY;  // Open input file in binary mode on win32.
#endif
   int FD = ::open(Filename.str().c_str(), O_RDONLY|OpenFlags);
   if (FD == -1) {
     if (ErrStr) *ErrStr = strerror(errno);
     return 0;
   }


-Chris




More information about the cfe-commits mailing list