aboutsummaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
authorNAKAMURA Takumi <geek4civic@gmail.com>2010-11-14 03:28:22 +0000
committerNAKAMURA Takumi <geek4civic@gmail.com>2010-11-14 03:28:22 +0000
commit9f6e03fa1e05f7c59379e68d7626400ca508cfb0 (patch)
tree2e4b17217ee260e4d52863accf0d139a5b68e9b7 /utils
parentab4a7afe98fcd86418bd1672f880b7d3672f4543 (diff)
downloadexternal_llvm-9f6e03fa1e05f7c59379e68d7626400ca508cfb0.zip
external_llvm-9f6e03fa1e05f7c59379e68d7626400ca508cfb0.tar.gz
external_llvm-9f6e03fa1e05f7c59379e68d7626400ca508cfb0.tar.bz2
FileCheck: Eliminate DOSish \r from input file.
It can pass two tests below on Win32. - Clang :: CodeGenCXX/dyncast.cpp - LLVM :: CodeGen/ARM/globals.ll git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119023 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils')
-rw-r--r--utils/FileCheck/FileCheck.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/utils/FileCheck/FileCheck.cpp b/utils/FileCheck/FileCheck.cpp
index c6b2ff7..5e30c22 100644
--- a/utils/FileCheck/FileCheck.cpp
+++ b/utils/FileCheck/FileCheck.cpp
@@ -456,6 +456,11 @@ static MemoryBuffer *CanonicalizeInputFile(MemoryBuffer *MB) {
for (const char *Ptr = MB->getBufferStart(), *End = MB->getBufferEnd();
Ptr != End; ++Ptr) {
+ // Eliminate trailing dosish \r.
+ if (Ptr <= End - 2 && Ptr[0] == '\r' && Ptr[1] == '\n') {
+ continue;
+ }
+
// If C is not a horizontal whitespace, skip it.
if (*Ptr != ' ' && *Ptr != '\t') {
NewFile.push_back(*Ptr);