From 1c1b0027e86fab2b0877488abc1625a457ca70b3 Mon Sep 17 00:00:00 2001 From: Chris Bieneman Date: Tue, 18 Jan 2022 11:01:36 -0600 Subject: [PATCH] [NFC] Set gitattributes for line endings A clean checkout of LLVM using core.autocrlf=on for Windows cannot pass the LLVM test suite because several test input files rely on specific line endings. This change updates the line ending attributes for impacted tests and re-normalizes a CRLF test case that was committed as LF to the git index. --- llvm/.gitattributes | 17 +++++++----- .../MC/AsmParser/preserve-comments-crlf.s | 26 +++++++++---------- 2 files changed, 24 insertions(+), 19 deletions(-) diff --git a/llvm/.gitattributes b/llvm/.gitattributes index 8812053169ff..f7d256947d22 100644 --- a/llvm/.gitattributes +++ b/llvm/.gitattributes @@ -1,20 +1,25 @@ # binary files -test/Object/Inputs/*.a-* binary +test/Object/Inputs/*.a* binary test/tools/dsymutil/Inputs/*.o binary test/tools/dsymutil/Inputs/*.a binary test/tools/dsymutil/Inputs/*.i386 binary test/tools/dsymutil/Inputs/*.x86_64 binary test/tools/dsymutil/Inputs/*.armv7m binary test/tools/dsymutil/Inputs/*.dylib binary +test/tools/dsymutil/Inputs/*.dSYM binary +test/tools/dsymutil/Inputs/*.swiftmodule binary test/tools/llvm-ar/Inputs/*.lib binary +test/tools/llvm-ar/Inputs/*.a 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 -# These files must have CRLF line endings, therefore git should treat them as -# binary and not autoconvert line endings (for example, when core.autocrlf is -# on). -test/MC/AsmParser/preserve-comments-crlf.s binary -test/tools/llvm-mca/X86/directives-handle-crlf.s binary +# These files must have CRLF line endings, therefore git should explicity treat +# them as always having crlf line endings +test/MC/AsmParser/preserve-comments-crlf.s text eol=crlf +test/tools/llvm-mca/X86/directives-handle-crlf.s text eol=crlf + +# These files must have LF line endings because the test requires exact matching +test/tools/llvm-strings/radix.test text eol=lf diff --git a/llvm/test/MC/AsmParser/preserve-comments-crlf.s b/llvm/test/MC/AsmParser/preserve-comments-crlf.s index 8bf094b73ef9..27c5b2e07071 100644 --- a/llvm/test/MC/AsmParser/preserve-comments-crlf.s +++ b/llvm/test/MC/AsmParser/preserve-comments-crlf.s @@ -1,13 +1,13 @@ - #RUN: llvm-mc -preserve-comments -n -triple i386-linux-gnu < %s > %t - #RUN: diff -b %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 + #RUN: llvm-mc -preserve-comments -n -triple i386-linux-gnu < %s > %t + #RUN: diff -b %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