Skip to content
This repository has been archived by the owner on Jan 15, 2020. It is now read-only.

Commit

Permalink
[MC] Fix regression tests on Windows when git “core.autocrlf” is set …
Browse files Browse the repository at this point in the history
…to true.

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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318560 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
cao-z committed Nov 17, 2017
1 parent 9f8c017 commit fc1a0ac
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .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
5 changes: 5 additions & 0 deletions docs/GettingStartedVS.rst
Expand Up @@ -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\<username>\AppData\Roaming\Subversion\config``.

1. ``cd <where-you-want-llvm-to-live>``
2. ``svn co http://llvm.org/svn/llvm-project/llvm/trunk llvm``
3. ``cd llvm``
Expand Down
2 changes: 2 additions & 0 deletions lib/MC/MCParser/AsmLexer.cpp
Expand Up @@ -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) {
Expand Down
13 changes: 13 additions & 0 deletions test/MC/AsmParser/preserve-comments-crlf.s
@@ -0,0 +1,13 @@
#RUN: llvm-mc -preserve-comments -n -triple i386-linux-gnu < %s > %t
#RUN: diff --strip-trailing-cr %s %t
.text

foo: #Comment here
#comment here
nop
#if DIRECTIVE COMMENT
## WHOLE LINE COMMENT
cmpl $196, %eax ## EOL COMMENT
#endif
.ident "clang version 3.9.0"
.section ".note.GNU-stack","",@progbits

0 comments on commit fc1a0ac

Please sign in to comment.