From fe37e55f9883b97e672610c6464d92b9b4698db5 Mon Sep 17 00:00:00 2001 From: Zhen Cao Date: Fri, 17 Nov 2017 21:59:43 +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 This is the second attempt to commit this. The test was broken on Linux in the first attempt. llvm-svn: 318560 --- .gitattributes | 12 ++++++++++++ docs/GettingStartedVS.rst | 5 +++++ lib/MC/MCParser/AsmLexer.cpp | 2 ++ test/MC/AsmParser/preserve-comments-crlf.s | Bin 0 -> 312 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..90a71ea798426b4bf7cdbf9b12570f334fbf3384 GIT binary patch literal 312 zcmYk1L2H9R5QWd{uNc;PbEPE^novT(N-G$JkhEvJ8ST<_S9Ukz&+kZb$Z_6$@69|G zAJ6p`w4MerND!k#k8VOC?J%GT9)tlAoEkNPTD`7?R^~d3-dy1g5)V5_Ld0$<7u9tj zgkNy-w2IhXNVjkcl?9wb6m`~aS)AVvz%M$afcw4sXzWOu>fpUR7Wt|CDj;tThoU}_ z9K-i#Qx#B^^@A*jQM0F)%{qky+j+r?rh2fUq5tR!b)jC2OWm3tCUjm|1FLM4J#*T6 elz{}sGh+j0AN85~wDOOqoTvNI+5SfbAN>P)R9puD literal 0 HcmV?d00001