From a79b10c2f1a56d0f3da874099513d99fbd00afea Mon Sep 17 00:00:00 2001 From: Zhen Cao Date: Fri, 17 Nov 2017 16:17:56 +0000 Subject: [PATCH] =?UTF-8?q?[MC]=20Fix=20regression=20tests=20on=20Windows?= =?UTF-8?q?=20when=20git=20=E2=80=9Ccore.autocrlf=E2=80=9D=20is=20set=20to?= =?UTF-8?q?=20true.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Differential Revision: https://reviews.llvm.org/D39737 llvm-svn: 318528 --- .gitattributes | 12 ++++++++++++ docs/GettingStartedVS.rst | 5 +++++ lib/MC/MCParser/AsmLexer.cpp | 2 ++ test/MC/AsmParser/preserve-comments-crlf.s | Bin 0 -> 292 bytes 4 files changed, 19 insertions(+) create mode 100644 .gitattributes create mode 100644 test/MC/AsmParser/preserve-comments-crlf.s diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000000..e7d6fd6d93d --- /dev/null +++ b/.gitattributes @@ -0,0 +1,12 @@ +# binary files +test/Object/Inputs/*.a-* binary +test/tools/dsymutil/Inputs/* binary +test/tools/llvm-ar/Inputs/*.lib binary +test/tools/llvm-objdump/Inputs/*.a binary +test/tools/llvm-rc/Inputs/* binary +test/tools/llvm-strings/Inputs/numbers binary +test/MC/AsmParser/incbin_abcd binary +test/YAMLParser/spec-09-02.test binary + +# Windows line ending test +test/MC/AsmParser/preserve-comments-crlf.s text eol=crlf diff --git a/docs/GettingStartedVS.rst b/docs/GettingStartedVS.rst index 50f7aa123c5..a4ff2b822fc 100644 --- a/docs/GettingStartedVS.rst +++ b/docs/GettingStartedVS.rst @@ -76,6 +76,11 @@ Here's the short story for getting up and running quickly with LLVM: * With anonymous Subversion access: + *Note:* some regression tests require Unix-style line ending (``\n``). To + pass all regression tests, please add two lines *enable-auto-props = yes* + and *\* = svn:mime-type=application/octet-stream* to + ``C:\Users\\AppData\Roaming\Subversion\config``. + 1. ``cd `` 2. ``svn co http://llvm.org/svn/llvm-project/llvm/trunk llvm`` 3. ``cd llvm`` diff --git a/lib/MC/MCParser/AsmLexer.cpp b/lib/MC/MCParser/AsmLexer.cpp index b83b6d3dcf6..74835fd70c0 100644 --- a/lib/MC/MCParser/AsmLexer.cpp +++ b/lib/MC/MCParser/AsmLexer.cpp @@ -210,6 +210,8 @@ AsmToken AsmLexer::LexLineComment() { int CurChar = getNextChar(); while (CurChar != '\n' && CurChar != '\r' && CurChar != EOF) CurChar = getNextChar(); + if (CurChar == '\r' && CurPtr != CurBuf.end() && *CurPtr == '\n') + ++CurPtr; // If we have a CommentConsumer, notify it about the comment. if (CommentConsumer) { diff --git a/test/MC/AsmParser/preserve-comments-crlf.s b/test/MC/AsmParser/preserve-comments-crlf.s new file mode 100644 index 0000000000000000000000000000000000000000..a0f50196213cdcc756e2b7bf65e4100857bb7a56 GIT binary patch literal 292 zcmYk1L2AP=5JlJWDF(UTS*9frnovT(6|KRsAtdeERmQHUED1?5K7M7AMV9mC&*KkC zkLP9!N=+jh1u*N-qnnTkGmfZ(2d04qC#^z|tJgJCQeS5_=qtQI=3xg}NXX4{k$u0g zg%knjkR-h^TauPH8T_Kd7{0sjqc%1&*~5Ev;bm-qvrLUnq837wZl!>ZU6&opj5iVy*zg*E|;kLJvL S=)@n*Db4rRnc+tUpZo(wnN-pM literal 0 HcmV?d00001