[clang] [clang-tools-extra] [compiler-rt] [flang] [lld] [lldb] [llvm] [mlir] [openmp] [pstl] Finally formalise our defacto line-ending policy (PR #86318)

via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 22 11:04:50 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-clangd

@llvm/pr-subscribers-lldb

Author: None (ldrumm)

<details>
<summary>Changes</summary>

Historically, we've not automatically enforced how git tracks line endings, but there are many, many commits that "undo" unintended CRLFs getting into history.

`git log --pretty=oneline --grep=CRLF` shows nearly 100 commits involving reverts of CRLF making its way into the index and then history. As far as I can tell, there are none the other way round except for specific cases like `.bat` files or tests for parsers that need to accept such sequences.

Of note, one of the earliest of those listed in that output is:

  commit 9795860250734e5c2a879546c534e35d9edd5944
  Author: NAKAMURA Takumi <geek4civic@<!-- -->gmail.com>
  Date:   Thu Feb 3 11:41:27 2011 +0000

      cmake/*: Add svn:eol-style=native and fix CRLF.

      llvm-svn: 124793

...which introduced such a defacto policy for subversion.

With old versions of git, it's been a bit of a crapshoot whether enforcing storing line endings in the history will upset checkouts on machines where such line endings are the norm. Indeed many users have enforced that git checks out the working copy according to a global or per-user config via core crlf, or core autocrlf.

However, for ~8 years now[1], however, git has supported the ability to "do as the Romans do" on checkout, but internally store subsets of text files with line-endings specified via a system of patterns in the gitattributes file. Since we now have this ability, and we've been specifying attributes for various binary files, I think it makes sense to rid us of all that work converting things "back", and just let git handle the local checkout. Thus the new toplevel policy here is

  * text=auto

In simple terms this means "unless otherwise specified, convert all files considered "text" files to LF in the project history, but checkout them out as expected on the local machine. What is "expected on the local machine" is dependent on configuration and default.

For those files in the repository that *do* need CRLF endings, I've adopted a policy of `eol=crlf` which means that git will store them in history with LF, but regardless of user config, they'll be checked out in tree with CRLF.

There also appears to be a single test,
clang/test/Frontend/rewrite-includes-mixed-eol-crlf.[ch] which needs mixed line endings. This one uses eol=input to preserve it as-is.

Finally, existing files have been "corrected" in history via `git add --renormalize .`

[1]: git 2.10 was released with fixed support for fine-grained line-ending tracking that respects user-config *and* repo policy. This can be considered the point at which git will respect both the user's local working tree preference *and* the history as specified by the maintainers. See
https://github.com/git/git/blob/master/Documentation/RelNotes/2.10.0.txt#L248 for the release note.

---

Patch is 1.90 MiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/86318.diff


254 Files Affected:

- (modified) .gitattributes (+6) 
- (added) clang-tools-extra/clangd/test/.gitattributes (+3) 
- (modified) clang-tools-extra/clangd/test/delimited-input-comment-at-the-end.test (+11-11) 
- (modified) clang-tools-extra/clangd/test/hover.test (+57-57) 
- (modified) clang-tools-extra/clangd/test/input-mirror.test (+17-17) 
- (modified) clang-tools-extra/clangd/test/protocol.test (+113-113) 
- (modified) clang-tools-extra/clangd/test/spaces-in-delimited-input.test (+13-13) 
- (modified) clang-tools-extra/clangd/test/too_large.test (+7-7) 
- (modified) clang-tools-extra/test/clang-tidy/checkers/readability/Inputs/duplicate-include/duplicate-include.h (+15-15) 
- (modified) clang-tools-extra/test/clang-tidy/checkers/readability/Inputs/duplicate-include/duplicate-include2.h (+1-1) 
- (modified) clang-tools-extra/test/clang-tidy/checkers/readability/Inputs/duplicate-include/system/sys/types.h (+1-1) 
- (modified) clang-tools-extra/test/clang-tidy/checkers/readability/else-after-return-if-constexpr.cpp (+22-22) 
- (modified) clang-tools-extra/test/modularize/Inputs/CompileError/module.modulemap (+10-10) 
- (modified) clang-tools-extra/test/modularize/Inputs/MissingHeader/module.modulemap (+10-10) 
- (modified) clang-tools-extra/test/pp-trace/Inputs/module.modulemap (+18-18) 
- (modified) clang/lib/Tooling/DumpTool/ClangSrcLocDump.cpp (+155-155) 
- (added) clang/test/.gitattributes (+3) 
- (modified) clang/test/AST/HLSL/this-reference-template.hlsl (+46-46) 
- (modified) clang/test/AST/HLSL/this-reference.hlsl (+62-62) 
- (modified) clang/test/AST/objc-default-ctor-init.mm (+21-21) 
- (modified) clang/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p5-examples.cpp (+56-56) 
- (modified) clang/test/CXX/expr/expr.prim/expr.prim.lambda/p15-star-this-capture.cpp (+22-22) 
- (modified) clang/test/CXX/lex/lex.literal/lex.string/p4.cpp (+17-17) 
- (modified) clang/test/CodeGen/fpconstrained.c (+25-25) 
- (modified) clang/test/CodeGen/fpconstrained.cpp (+49-49) 
- (modified) clang/test/CodeGenCXX/attr-x86-no_caller_saved_registers.cpp (+31-31) 
- (modified) clang/test/CodeGenCXX/debug-info-atexit-stub.cpp (+22-22) 
- (modified) clang/test/CodeGenHLSL/builtins/bitreverse.hlsl (+155-155) 
- (modified) clang/test/CodeGenHLSL/builtins/clamp.hlsl (+134-134) 
- (modified) clang/test/CodeGenHLSL/builtins/cos.hlsl (+41-41) 
- (modified) clang/test/CodeGenHLSL/builtins/floor.hlsl (+56-56) 
- (modified) clang/test/CodeGenHLSL/builtins/lerp-builtin.hlsl (+15-15) 
- (modified) clang/test/CodeGenHLSL/builtins/lerp.hlsl (+78-78) 
- (modified) clang/test/CodeGenHLSL/builtins/log.hlsl (+41-41) 
- (modified) clang/test/CodeGenHLSL/builtins/log2.hlsl (+41-41) 
- (modified) clang/test/CodeGenHLSL/builtins/mad.hlsl (+191-191) 
- (modified) clang/test/CodeGenHLSL/builtins/max.hlsl (+134-134) 
- (modified) clang/test/CodeGenHLSL/builtins/pow.hlsl (+54-54) 
- (modified) clang/test/CodeGenHLSL/builtins/reversebits.hlsl (+155-155) 
- (modified) clang/test/CodeGenHLSL/builtins/sin.hlsl (+41-41) 
- (modified) clang/test/CodeGenHLSL/builtins/trunc.hlsl (+47-47) 
- (modified) clang/test/CodeGenHLSL/semantics/DispatchThreadID.hlsl (+25-25) 
- (modified) clang/test/CodeGenHLSL/sret_output.hlsl (+22-22) 
- (modified) clang/test/CodeGenHLSL/this-assignment-overload.hlsl (+55-55) 
- (modified) clang/test/CodeGenHLSL/this-assignment.hlsl (+45-45) 
- (modified) clang/test/CodeGenHLSL/this-reference.hlsl (+34-34) 
- (modified) clang/test/CodeGenObjC/exceptions-personality.m (+53-53) 
- (modified) clang/test/Driver/ps4-ps5-relax-relocations.c (+29-29) 
- (modified) clang/test/FixIt/fixit-newline-style.c (+11-11) 
- (modified) clang/test/Frontend/rewrite-includes-macros.cpp (+15-15) 
- (modified) clang/test/Frontend/rewrite-includes-mixed-eol-crlf.c (+8-8) 
- (modified) clang/test/Frontend/rewrite-includes-mixed-eol-crlf.h (+11-11) 
- (modified) clang/test/Frontend/system-header-line-directive-ms-lineendings.c (+21-21) 
- (modified) clang/test/Lexer/minimize_source_to_dependency_directives_include.c (+8-8) 
- (modified) clang/test/Lexer/minimize_source_to_dependency_directives_utf8bom.c (+10-10) 
- (modified) clang/test/Options/HV.hlsl (+20-20) 
- (modified) clang/test/Parser/objc-attr.m (+28-28) 
- (modified) clang/test/Preprocessor/macro_vaopt_check.cpp (+76-76) 
- (modified) clang/test/Preprocessor/macro_vaopt_expand.cpp (+150-150) 
- (modified) clang/test/Sema/aarch64-sve-vector-log-ops.c (+23-23) 
- (modified) clang/test/Sema/aarch64-sve-vector-trig-ops.c (+18-18) 
- (modified) clang/test/Sema/incorrect_pure.cpp (+14-14) 
- (modified) clang/test/Sema/riscv-rvv-vector-log-ops.c (+25-25) 
- (modified) clang/test/Sema/riscv-rvv-vector-trig-ops.c (+19-19) 
- (modified) clang/test/SemaCXX/attr-non-x86-no_caller_saved_registers.cpp (+29-29) 
- (modified) clang/test/SemaCXX/attr-x86-no_caller_saved_registers.cpp (+33-33) 
- (modified) clang/test/SemaCXX/compound-literal.cpp (+131-131) 
- (modified) clang/test/SemaCXX/cxx23-static-callop-lambda-expression.cpp (+33-33) 
- (modified) clang/test/SemaCXX/vla-ext-diag.cpp (+40-40) 
- (modified) clang/test/SemaCXX/warn-redundant-move.cpp (+116-116) 
- (modified) clang/test/SemaCXX/warn-shadow.cpp (+47-47) 
- (modified) clang/test/SemaHLSL/BuiltIns/clamp-errors.hlsl (+91-91) 
- (modified) clang/test/SemaHLSL/BuiltIns/dot-errors.hlsl (+119-119) 
- (modified) clang/test/SemaHLSL/BuiltIns/lerp-errors.hlsl (+109-109) 
- (modified) clang/test/SemaHLSL/BuiltIns/mad-errors.hlsl (+86-86) 
- (modified) clang/test/SemaObjCXX/block-cleanup.mm (+16-16) 
- (modified) clang/test/SemaTemplate/default-expr-arguments-3.cpp (+55-55) 
- (modified) clang/tools/clang-format-vs/ClangFormat.sln (+22-22) 
- (modified) clang/tools/clang-format-vs/ClangFormat/ClangFormat.csproj (+261-261) 
- (modified) clang/tools/clang-format-vs/ClangFormat/ClangFormat.vsct (+127-127) 
- (modified) clang/tools/clang-format-vs/ClangFormat/GlobalSuppressions.cs (+11-11) 
- (modified) clang/tools/clang-format-vs/ClangFormat/Guids.cs (+12-12) 
- (modified) clang/tools/clang-format-vs/ClangFormat/PkgCmdID.cs (+8-8) 
- (modified) clang/tools/clang-format-vs/ClangFormat/Properties/AssemblyInfo.cs (+33-33) 
- (modified) clang/tools/clang-format-vs/ClangFormat/Resources.Designer.cs (+63-63) 
- (modified) clang/tools/clang-format-vs/ClangFormat/Resources.resx (+128-128) 
- (modified) clang/tools/clang-format-vs/ClangFormat/VSPackage.resx (+139-139) 
- (modified) clang/tools/clang-format-vs/README.txt (+51-51) 
- (modified) clang/tools/clang-format-vs/source.extension.vsixmanifest.in (+19-19) 
- (modified) clang/tools/scan-build/bin/scan-build.bat (+1-1) 
- (modified) clang/tools/scan-build/libexec/c++-analyzer.bat (+1-1) 
- (modified) clang/tools/scan-build/libexec/ccc-analyzer.bat (+1-1) 
- (modified) clang/utils/ClangVisualizers/clang.natvis (+1089-1089) 
- (modified) compiler-rt/test/asan/TestCases/Posix/strndup_oob_test2.cpp (+21-21) 
- (modified) flang/test/Driver/msvc-dependent-lib-flags.f90 (+40-40) 
- (modified) lld/test/COFF/Inputs/combined-resources.rc (+50-50) 
- (modified) lld/test/COFF/pdb-type-server-invalid-signature.yaml (+2-2) 
- (modified) lld/test/COFF/pdb_char8_t.ll (+46-46) 
- (modified) lld/test/ELF/dynamic-list-cpp.s (+18-18) 
- (modified) lldb/test/API/commands/expression/ir-interpreter-phi-nodes/Makefile (+4-4) 
- (modified) lldb/test/API/functionalities/postmortem/minidump/fizzbuzz.syms (+2-2) 
- (modified) lldb/test/API/functionalities/unwind/zeroth_frame/Makefile (+3-3) 
- (modified) lldb/test/API/functionalities/unwind/zeroth_frame/TestZerothFrame.py (+89-89) 
- (modified) lldb/test/API/python_api/debugger/Makefile (+3-3) 
- (modified) lldb/test/Shell/BuildScript/modes.test (+35-35) 
- (modified) lldb/test/Shell/BuildScript/script-args.test (+32-32) 
- (modified) lldb/test/Shell/BuildScript/toolchain-clang-cl.test (+49-49) 
- (modified) lldb/test/Shell/Minidump/Windows/Sigsegv/Inputs/sigsegv.cpp (+40-40) 
- (modified) lldb/test/Shell/SymbolFile/NativePDB/Inputs/inline_sites.s (+622-622) 
- (modified) lldb/test/Shell/SymbolFile/NativePDB/Inputs/inline_sites_live.lldbinit (+7-7) 
- (modified) lldb/test/Shell/SymbolFile/NativePDB/Inputs/local-variables-registers.lldbinit (+35-35) 
- (modified) lldb/test/Shell/SymbolFile/NativePDB/Inputs/lookup-by-types.lldbinit (+3-3) 
- (modified) lldb/test/Shell/SymbolFile/NativePDB/Inputs/subfield_register_simple_type.lldbinit (+2-2) 
- (modified) lldb/test/Shell/SymbolFile/NativePDB/function-types-classes.cpp (+6-6) 
- (modified) lldb/test/Shell/SymbolFile/NativePDB/inline_sites_live.cpp (+34-34) 
- (modified) lldb/test/Shell/SymbolFile/NativePDB/lookup-by-types.cpp (+46-46) 
- (modified) lldb/unittests/Breakpoint/CMakeLists.txt (+10-10) 
- (modified) llvm/docs/CommandGuide/llvm-pdbutil.rst (+38-38) 
- (modified) llvm/docs/GettingInvolved.rst (+494-494) 
- (modified) llvm/docs/GettingStartedTutorials.rst (+43-43) 
- (modified) llvm/docs/PDB/CodeViewSymbols.rst (+3-3) 
- (modified) llvm/docs/Reference.rst (+230-230) 
- (modified) llvm/docs/UserGuides.rst (+286-286) 
- (modified) llvm/test/Analysis/MustExecute/const-cond.ll (+47-47) 
- (modified) llvm/test/CodeGen/MIR/X86/dbg-value-list.mir (+64-64) 
- (modified) llvm/test/CodeGen/NVPTX/bf16x2-instructions-approx.ll (+42-42) 
- (modified) llvm/test/CodeGen/NVPTX/bf16x2-instructions.ll (+532-532) 
- (modified) llvm/test/CodeGen/NVPTX/zeroext-32bit.ll (+27-27) 
- (modified) llvm/test/CodeGen/SPARC/LeonSMACUMACInstructionUT.ll (+20-20) 
- (modified) llvm/test/CodeGen/X86/dbg-value-superreg-copy2.mir (+1-1) 
- (modified) llvm/test/CodeGen/X86/non-value-mem-operand.mir (+293-293) 
- (modified) llvm/test/CodeGen/X86/patchable-prologue-debuginfo.ll (+56-56) 
- (modified) llvm/test/CodeGen/X86/post-ra-sched-with-debug.mir (+2-2) 
- (modified) llvm/test/CodeGen/X86/windows-seh-EHa-CppCatchDotDotDot.ll (+290-290) 
- (modified) llvm/test/CodeGen/X86/windows-seh-EHa-CppDtors01.ll (+255-255) 
- (modified) llvm/test/CodeGen/X86/windows-seh-EHa-TryInFinally.ll (+224-224) 
- (modified) llvm/test/DebugInfo/AArch64/instr-ref-const-physreg.ll (+1-1) 
- (modified) llvm/test/DebugInfo/ARM/instr-ref-tcreturn.ll (+1-1) 
- (modified) llvm/test/DebugInfo/COFF/AArch64/lit.local.cfg (+2-2) 
- (modified) llvm/test/DebugInfo/COFF/jump-table-with-indirect-ptr-null.ll (+72-72) 
- (modified) llvm/test/DebugInfo/COFF/jump-table.ll (+262-262) 
- (modified) llvm/test/DebugInfo/COFF/pieces.ll (+1-1) 
- (modified) llvm/test/DebugInfo/Generic/debug_value_list.ll (+50-50) 
- (modified) llvm/test/DebugInfo/MIR/InstrRef/accept-nonlive-reg-phis.mir (+1-1) 
- (modified) llvm/test/DebugInfo/MIR/InstrRef/dbg-phi-subregister-location.mir (+3-3) 
- (modified) llvm/test/DebugInfo/MIR/InstrRef/dbg-phis-in-ldv.mir (+3-3) 
- (modified) llvm/test/DebugInfo/MIR/InstrRef/dbg-phis-in-ldv2.mir (+12-12) 
- (modified) llvm/test/DebugInfo/MIR/InstrRef/dbg-phis-merging-in-ldv.mir (+12-12) 
- (modified) llvm/test/DebugInfo/MIR/InstrRef/dbg-phis-with-loops.mir (+12-12) 
- (modified) llvm/test/DebugInfo/MIR/InstrRef/follow-spill-of-live-value.mir (+3-3) 
- (modified) llvm/test/DebugInfo/MIR/InstrRef/livedebugvalues_illegal_locs.mir (+24-24) 
- (modified) llvm/test/DebugInfo/MIR/InstrRef/livedebugvalues_instrref_tolocs.mir (+27-27) 
- (modified) llvm/test/DebugInfo/MIR/InstrRef/livedebugvalues_stackslot_subregs.mir (+2-2) 
- (modified) llvm/test/DebugInfo/MIR/InstrRef/livedebugvalues_subreg_substitutions.mir (+24-24) 
- (modified) llvm/test/DebugInfo/MIR/InstrRef/memory-operand-folding-tieddef.mir (+1-1) 
- (modified) llvm/test/DebugInfo/MIR/InstrRef/memory-operand-load-folding.mir (+1-1) 
- (modified) llvm/test/DebugInfo/MIR/InstrRef/memory-operand-tracking.mir (+14-14) 
- (modified) llvm/test/DebugInfo/MIR/InstrRef/out-of-scope-blocks.mir (+15-15) 
- (modified) llvm/test/DebugInfo/MIR/InstrRef/phi-coalesce-subreg.mir (+1-1) 
- (modified) llvm/test/DebugInfo/MIR/InstrRef/phi-on-stack-coalesced.mir (+2-2) 
- (modified) llvm/test/DebugInfo/MIR/InstrRef/phi-on-stack-coalesced2.mir (+2-2) 
- (modified) llvm/test/DebugInfo/MIR/InstrRef/phi-regallocd-to-stack.mir (+2-2) 
- (modified) llvm/test/DebugInfo/MIR/InstrRef/phi-through-regalloc.mir (+2-2) 
- (modified) llvm/test/DebugInfo/MIR/InstrRef/spill-slot-limits.mir (+8-8) 
- (modified) llvm/test/DebugInfo/MIR/InstrRef/substitusions-roundtrip.mir (+2-2) 
- (modified) llvm/test/DebugInfo/MIR/InstrRef/twoaddr-to-threeaddr-sub.mir (+2-2) 
- (modified) llvm/test/DebugInfo/MIR/InstrRef/win32-chkctk-modifies-esp.mir (+10-10) 
- (modified) llvm/test/DebugInfo/MIR/InstrRef/x86-drop-compare-inst.mir (+1-1) 
- (modified) llvm/test/DebugInfo/MIR/X86/dvl-livedebugvalues-clobber.mir (+106-106) 
- (modified) llvm/test/DebugInfo/MIR/X86/dvl-livedebugvalues-join.mir (+160-160) 
- (modified) llvm/test/DebugInfo/MIR/X86/dvl-livedebugvalues-movements.mir (+90-90) 
- (modified) llvm/test/DebugInfo/MIR/X86/dvl-livedebugvalues-spillrestore.mir (+77-77) 
- (modified) llvm/test/DebugInfo/MIR/X86/dvl-livedebugvars-movements.mir (+109-109) 
- (modified) llvm/test/DebugInfo/MIR/X86/dvl-livedebugvars-stackptr.mir (+113-113) 
- (modified) llvm/test/DebugInfo/MIR/X86/instr-ref-join-def-vphi.mir (+4-4) 
- (modified) llvm/test/DebugInfo/PDB/Inputs/longname-truncation.yaml (+26-26) 
- (modified) llvm/test/DebugInfo/PDB/Inputs/merge-types-1.yaml (+52-52) 
- (modified) llvm/test/DebugInfo/PDB/Inputs/merge-types-2.yaml (+52-52) 
- (modified) llvm/test/DebugInfo/PDB/Inputs/one-symbol.yaml (+11-11) 
- (modified) llvm/test/DebugInfo/PDB/pdb-longname-truncation.test (+3-3) 
- (modified) llvm/test/DebugInfo/PDB/pdbdump-raw-bytes.test (+25-25) 
- (modified) llvm/test/DebugInfo/X86/dbg-val-list-dangling.ll (+69-69) 
- (modified) llvm/test/DebugInfo/X86/dbg-value-arg-movement.ll (+1-1) 
- (modified) llvm/test/DebugInfo/X86/dbg-value-funcarg.ll (+4-4) 
- (modified) llvm/test/DebugInfo/X86/dbg-value-funcarg2.ll (+2-2) 
- (modified) llvm/test/DebugInfo/X86/dbg-value-funcarg4.ll (+2-2) 
- (modified) llvm/test/DebugInfo/X86/dbg-value-list-dag-combine.ll (+61-61) 
- (modified) llvm/test/DebugInfo/X86/dbg_value_list_clobbers.mir (+84-84) 
- (modified) llvm/test/DebugInfo/X86/dbg_value_list_emission.mir (+107-107) 
- (modified) llvm/test/DebugInfo/X86/instr-ref-dbg-declare.ll (+1-1) 
- (modified) llvm/test/DebugInfo/X86/instr-ref-dyn-alloca-win32.ll (+1-1) 
- (modified) llvm/test/DebugInfo/X86/instr-ref-ir-reg-read.ll (+1-1) 
- (modified) llvm/test/DebugInfo/X86/live-debug-values-expr-conflict.ll (+6-6) 
- (modified) llvm/test/DebugInfo/X86/pieces-4.ll (+1-1) 
- (modified) llvm/test/DebugInfo/X86/pr34545.ll (+11-11) 
- (modified) llvm/test/DebugInfo/X86/pr40427.ll (+1-1) 
- (modified) llvm/test/DebugInfo/X86/sdag-combine.ll (+1-1) 
- (modified) llvm/test/DebugInfo/X86/sdag-dangling-dbgvalue.ll (+7-7) 
- (modified) llvm/test/DebugInfo/X86/sdag-dbgvalue-phi-use-1.ll (+4-4) 
- (modified) llvm/test/DebugInfo/X86/sdag-dbgvalue-phi-use-2.ll (+7-7) 
- (modified) llvm/test/DebugInfo/X86/sdag-dbgvalue-phi-use-3.ll (+6-6) 
- (modified) llvm/test/DebugInfo/X86/sdag-dbgvalue-phi-use-4.ll (+5-5) 
- (modified) llvm/test/DebugInfo/X86/sdag-dbgvalue-ssareg.ll (+1-1) 
- (modified) llvm/test/DebugInfo/X86/sdag-ir-salvage.ll (+1-1) 
- (modified) llvm/test/DebugInfo/X86/sdag-salvage-add.ll (+8-8) 
- (modified) llvm/test/DebugInfo/X86/sdag-transfer-dbgvalue.ll (+1-1) 
- (modified) llvm/test/DebugInfo/X86/sdagsplit-1.ll (+2-2) 
- (modified) llvm/test/DebugInfo/X86/spill-nospill.ll (+1-1) 
- (modified) llvm/test/DebugInfo/precomp.test (+57-57) 
- (modified) llvm/test/DebugInfo/salvage-nonconst-binop.ll (+45-45) 
- (modified) llvm/test/Demangle/ms-options.test (+43-43) 
- (added) llvm/test/FileCheck/.gitattributes (+1) 
- (modified) llvm/test/FileCheck/dos-style-eol.txt (+10-10) 
- (modified) llvm/test/MC/AMDGPU/v_illegal-atomics.s (+6-6) 
- (modified) llvm/test/MC/AsmParser/directive_file-g.s (+24-24) 
- (modified) llvm/test/Transforms/InstCombine/debuginfo-sink.ll (+31-31) 
- (modified) llvm/test/Transforms/InstSimplify/ConstProp/gep-alias.ll (+17-17) 
- (modified) llvm/test/Transforms/InstSimplify/ConstProp/gep-constanfolding-error.ll (+52-52) 
- (modified) llvm/test/Transforms/InstSimplify/ConstProp/timeout.ll (+70-70) 
- (modified) llvm/test/Transforms/LoopStrengthReduce/pr51329.ll (+54-54) 
- (modified) llvm/test/Transforms/PhaseOrdering/pr32544.ll (+1-1) 
- (modified) llvm/test/Transforms/Reassociate/undef_intrinsics_when_deleting_instructions.ll (+61-61) 
- (modified) llvm/test/Transforms/ThinLTOBitcodeWriter/split-typed-decl.ll (+12-12) 
- (modified) llvm/test/tools/dxil-dis/shuffle.ll (+27-27) 
- (added) llvm/test/tools/llvm-ar/Inputs/.gitattributes (+1) 
- (modified) llvm/test/tools/llvm-ar/Inputs/mri-crlf.mri (+4-4) 
- (modified) llvm/test/tools/llvm-cvtres/Inputs/languages.rc (+36-36) 
- (modified) llvm/test/tools/llvm-cvtres/Inputs/test_resource.rc (+49-49) 
- (modified) llvm/test/tools/llvm-dwarfdump/X86/parent_recurse_depth.s (+67-67) 
- (modified) llvm/test/tools/llvm-dwarfdump/X86/quiet.s (+10-10) 
- (modified) llvm/test/tools/llvm-objcopy/ELF/dynrelocsec-remove-shinfo-reference.test (+30-30) 
- (modified) llvm/test/tools/llvm-objcopy/ELF/dynrelocsec-remove-shlink-reference.test (+34-34) 
- (modified) llvm/test/tools/llvm-objdump/ELF/ARM/literal-arm.s (+66-66) 
- (modified) llvm/test/tools/llvm-objdump/ELF/ARM/literal-thumb.s (+24-24) 
- (modified) llvm/test/tools/llvm-objdump/ELF/ARM/literal-thumb2.s (+116-116) 
- (modified) llvm/test/tools/llvm-objdump/ELF/ARM/literal-vldr-arm.s (+48-48) 
- (modified) llvm/test/tools/llvm-objdump/ELF/ARM/literal-vldr-thumb2.s (+66-66) 
- (modified) llvm/test/tools/llvm-objdump/X86/print-imm-hex.s (+29-29) 
- (modified) llvm/test/tools/llvm-pdbutil/Inputs/TypeServerTest.cpp (+6-6) 
- (modified) llvm/test/tools/llvm-pdbutil/complex-padding-graphical.test (+55-55) 
- (modified) llvm/test/tools/llvm-profgen/Inputs/coff-profile.perfscript (+13-13) 
- (modified) llvm/test/tools/llvm-readobj/COFF/Inputs/resources/test_resource.rc (+44-44) 
- (modified) llvm/test/tools/llvm-symbolizer/Inputs/discrim.inp (+8-8) 
- (modified) llvm/test/tools/obj2yaml/ELF/relr-section.yaml (+63-63) 
- (modified) llvm/utils/LLVMVisualizers/llvm.natvis (+408-408) 
- (modified) llvm/utils/emacs/llvm-mir-mode.el (+70-70) 
- (modified) llvm/utils/lit/tests/Inputs/shtest-shell/diff-in.dos (+3-3) 
- (modified) llvm/utils/release/build_llvm_release.bat (+512-512) 
- (modified) mlir/test/Conversion/GPUCommon/transfer_write.mlir (+13-13) 
- (modified) mlir/test/Dialect/Shape/arg_with_shape.mlir (+16-16) 
- (modified) mlir/test/Target/LLVMIR/Import/metadata-linker-options.ll (+15-15) 
- (modified) mlir/test/mlir-vulkan-runner/addf_if.mlir (+54-54) 
- (modified) openmp/runtime/doc/doxygen/config (+1822-1822) 
- (modified) pstl/CREDITS.txt (+21-21) 


``````````diff
diff --git a/.gitattributes b/.gitattributes
index 6b281f33f737db9..a5a0ecb8ccb2b87 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -1,3 +1,9 @@
+# Checkout as native, commit as LF except in specific circumstances
+* text=auto
+*.bat text eol=crlf
+*.rc text eol=crlf
+*.sln text eol=crlf
+
 libcxx/src/**/*.cpp     merge=libcxx-reformat
 libcxx/include/**/*.h   merge=libcxx-reformat
 
diff --git a/clang-tools-extra/clangd/test/.gitattributes b/clang-tools-extra/clangd/test/.gitattributes
new file mode 100644
index 000000000000000..20971adc2b5d033
--- /dev/null
+++ b/clang-tools-extra/clangd/test/.gitattributes
@@ -0,0 +1,3 @@
+input-mirror.test text eol=crlf
+too_large.test text eol=crlf
+protocol.test text eol=crlf
diff --git a/clang-tools-extra/clangd/test/delimited-input-comment-at-the-end.test b/clang-tools-extra/clangd/test/delimited-input-comment-at-the-end.test
index bbbd72f8c59f6f2..85a1f2199fadf90 100644
--- a/clang-tools-extra/clangd/test/delimited-input-comment-at-the-end.test
+++ b/clang-tools-extra/clangd/test/delimited-input-comment-at-the-end.test
@@ -1,11 +1,11 @@
-# RUN: clangd -input-style=delimited -sync -input-mirror-file %t < %s
-# RUN: grep '{"jsonrpc":"2.0","id":3,"method":"exit"}' %t
-#
-# RUN: clangd -lit-test -input-mirror-file %t < %s
-# RUN: grep '{"jsonrpc":"2.0","id":3,"method":"exit"}' %t
-#
-{"jsonrpc":"2.0","id":0,"method":"initialize","params":{"processId":123,"rootPath":"clangd","capabilities":{},"trace":"off"}}
----
-{"jsonrpc":"2.0","id":3,"method":"shutdown"}
----
-{"jsonrpc":"2.0","method":"exit"}
+# RUN: clangd -input-style=delimited -sync -input-mirror-file %t < %s
+# RUN: grep '{"jsonrpc":"2.0","id":3,"method":"exit"}' %t
+#
+# RUN: clangd -lit-test -input-mirror-file %t < %s
+# RUN: grep '{"jsonrpc":"2.0","id":3,"method":"exit"}' %t
+#
+{"jsonrpc":"2.0","id":0,"method":"initialize","params":{"processId":123,"rootPath":"clangd","capabilities":{},"trace":"off"}}
+---
+{"jsonrpc":"2.0","id":3,"method":"shutdown"}
+---
+{"jsonrpc":"2.0","method":"exit"}
diff --git a/clang-tools-extra/clangd/test/hover.test b/clang-tools-extra/clangd/test/hover.test
index ec8d0488fa5ed11..dc76ae85fa41dd3 100644
--- a/clang-tools-extra/clangd/test/hover.test
+++ b/clang-tools-extra/clangd/test/hover.test
@@ -1,57 +1,57 @@
-# RUN: clangd -lit-test < %s | FileCheck %s
-{"jsonrpc":"2.0","id":0,"method":"initialize","params":{"processId":123,"rootPath":"clangd","capabilities":{},"trace":"off"}}
----
-{"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{"uri":"test:///main.cpp","languageId":"cpp","version":1,"text":"void foo(); int main() { foo(); }\n"}}}
----
-{"jsonrpc":"2.0","id":1,"method":"textDocument/hover","params":{"textDocument":{"uri":"test:///main.cpp"},"position":{"line":0,"character":27}}}
-#      CHECK:  "id": 1,
-# CHECK-NEXT:  "jsonrpc": "2.0",
-# CHECK-NEXT:  "result": {
-# CHECK-NEXT:    "contents": {
-# CHECK-NEXT:      "kind": "plaintext",
-# CHECK-NEXT:      "value": "function foo\n\n→ void\n\nvoid foo()"
-# CHECK-NEXT:    },
-# CHECK-NEXT:    "range": {
-# CHECK-NEXT:      "end": {
-# CHECK-NEXT:        "character": 28,
-# CHECK-NEXT:        "line": 0
-# CHECK-NEXT:      },
-# CHECK-NEXT:      "start": {
-# CHECK-NEXT:        "character": 25,
-# CHECK-NEXT:        "line": 0
-# CHECK-NEXT:      }
-# CHECK-NEXT:    }
-# CHECK-NEXT:  }
-# CHECK-NEXT:}
----
-{"jsonrpc":"2.0","id":1,"method":"textDocument/hover","params":{"textDocument":{"uri":"test:///main.cpp"},"position":{"line":0,"character":10}}}
-#      CHECK:  "id": 1,
-# CHECK-NEXT:  "jsonrpc": "2.0",
-# CHECK-NEXT:  "result": null
----
-{"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{"uri":"test:///main2.cpp","languageId":"cpp","version":1,"text":"enum foo{}; int main() { foo f; }\n"}}}
----
-{"jsonrpc":"2.0","id":1,"method":"textDocument/hover","params":{"textDocument":{"uri":"test:///main2.cpp"},"position":{"line":0,"character":27}}}
-#      CHECK:  "id": 1,
-# CHECK-NEXT:  "jsonrpc": "2.0",
-# CHECK-NEXT:  "result": {
-# CHECK-NEXT:    "contents": {
-# CHECK-NEXT:      "kind": "plaintext",
-# CHECK-NEXT:      "value": "enum foo\n\nenum foo {}"
-# CHECK-NEXT:    },
-# CHECK-NEXT:    "range": {
-# CHECK-NEXT:      "end": {
-# CHECK-NEXT:        "character": 28,
-# CHECK-NEXT:        "line": 0
-# CHECK-NEXT:      },
-# CHECK-NEXT:      "start": {
-# CHECK-NEXT:        "character": 25,
-# CHECK-NEXT:        "line": 0
-# CHECK-NEXT:      }
-# CHECK-NEXT:    }
-# CHECK-NEXT:  }
-# CHECK-NEXT:}
----
-{"jsonrpc":"2.0","id":3,"method":"shutdown"}
----
-{"jsonrpc":"2.0","method":"exit"}
+# RUN: clangd -lit-test < %s | FileCheck %s
+{"jsonrpc":"2.0","id":0,"method":"initialize","params":{"processId":123,"rootPath":"clangd","capabilities":{},"trace":"off"}}
+---
+{"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{"uri":"test:///main.cpp","languageId":"cpp","version":1,"text":"void foo(); int main() { foo(); }\n"}}}
+---
+{"jsonrpc":"2.0","id":1,"method":"textDocument/hover","params":{"textDocument":{"uri":"test:///main.cpp"},"position":{"line":0,"character":27}}}
+#      CHECK:  "id": 1,
+# CHECK-NEXT:  "jsonrpc": "2.0",
+# CHECK-NEXT:  "result": {
+# CHECK-NEXT:    "contents": {
+# CHECK-NEXT:      "kind": "plaintext",
+# CHECK-NEXT:      "value": "function foo\n\n→ void\n\nvoid foo()"
+# CHECK-NEXT:    },
+# CHECK-NEXT:    "range": {
+# CHECK-NEXT:      "end": {
+# CHECK-NEXT:        "character": 28,
+# CHECK-NEXT:        "line": 0
+# CHECK-NEXT:      },
+# CHECK-NEXT:      "start": {
+# CHECK-NEXT:        "character": 25,
+# CHECK-NEXT:        "line": 0
+# CHECK-NEXT:      }
+# CHECK-NEXT:    }
+# CHECK-NEXT:  }
+# CHECK-NEXT:}
+---
+{"jsonrpc":"2.0","id":1,"method":"textDocument/hover","params":{"textDocument":{"uri":"test:///main.cpp"},"position":{"line":0,"character":10}}}
+#      CHECK:  "id": 1,
+# CHECK-NEXT:  "jsonrpc": "2.0",
+# CHECK-NEXT:  "result": null
+---
+{"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{"uri":"test:///main2.cpp","languageId":"cpp","version":1,"text":"enum foo{}; int main() { foo f; }\n"}}}
+---
+{"jsonrpc":"2.0","id":1,"method":"textDocument/hover","params":{"textDocument":{"uri":"test:///main2.cpp"},"position":{"line":0,"character":27}}}
+#      CHECK:  "id": 1,
+# CHECK-NEXT:  "jsonrpc": "2.0",
+# CHECK-NEXT:  "result": {
+# CHECK-NEXT:    "contents": {
+# CHECK-NEXT:      "kind": "plaintext",
+# CHECK-NEXT:      "value": "enum foo\n\nenum foo {}"
+# CHECK-NEXT:    },
+# CHECK-NEXT:    "range": {
+# CHECK-NEXT:      "end": {
+# CHECK-NEXT:        "character": 28,
+# CHECK-NEXT:        "line": 0
+# CHECK-NEXT:      },
+# CHECK-NEXT:      "start": {
+# CHECK-NEXT:        "character": 25,
+# CHECK-NEXT:        "line": 0
+# CHECK-NEXT:      }
+# CHECK-NEXT:    }
+# CHECK-NEXT:  }
+# CHECK-NEXT:}
+---
+{"jsonrpc":"2.0","id":3,"method":"shutdown"}
+---
+{"jsonrpc":"2.0","method":"exit"}
diff --git a/clang-tools-extra/clangd/test/input-mirror.test b/clang-tools-extra/clangd/test/input-mirror.test
index a34a4a08cf60cfa..bce3f9923a3b901 100644
--- a/clang-tools-extra/clangd/test/input-mirror.test
+++ b/clang-tools-extra/clangd/test/input-mirror.test
@@ -1,17 +1,17 @@
-# RUN: clangd -pretty -sync -input-mirror-file %t < %s
-# Note that we have to use '-b' as -input-mirror-file does not have a newline at the end of file.
-# RUN: diff -b %t %s
-# It is absolutely vital that this file has CRLF line endings.
-#
-Content-Length: 125
-
-{"jsonrpc":"2.0","id":0,"method":"initialize","params":{"processId":123,"rootPath":"clangd","capabilities":{},"trace":"off"}}
-Content-Length: 172
-
-{"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{"uri":"test:///main.cpp","languageId":"cpp","version":1,"text":"int main() {\nint a;\na;\n}\n"}}}
-Content-Length: 44
-
-{"jsonrpc":"2.0","id":3,"method":"shutdown"}
-Content-Length: 33
-
-{"jsonrpc":"2.0","method":"exit"}
+# RUN: clangd -pretty -sync -input-mirror-file %t < %s
+# Note that we have to use '-b' as -input-mirror-file does not have a newline at the end of file.
+# RUN: diff -b %t %s
+# It is absolutely vital that this file has CRLF line endings.
+#
+Content-Length: 125
+
+{"jsonrpc":"2.0","id":0,"method":"initialize","params":{"processId":123,"rootPath":"clangd","capabilities":{},"trace":"off"}}
+Content-Length: 172
+
+{"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{"uri":"test:///main.cpp","languageId":"cpp","version":1,"text":"int main() {\nint a;\na;\n}\n"}}}
+Content-Length: 44
+
+{"jsonrpc":"2.0","id":3,"method":"shutdown"}
+Content-Length: 33
+
+{"jsonrpc":"2.0","method":"exit"}
diff --git a/clang-tools-extra/clangd/test/protocol.test b/clang-tools-extra/clangd/test/protocol.test
index 5e852d1d9deebca..64ccfaef1891115 100644
--- a/clang-tools-extra/clangd/test/protocol.test
+++ b/clang-tools-extra/clangd/test/protocol.test
@@ -1,113 +1,113 @@
-# RUN: not clangd -pretty -sync -enable-test-uri-scheme < %s | FileCheck -strict-whitespace %s
-# RUN: not clangd -pretty -sync -enable-test-uri-scheme < %s 2>&1 | FileCheck -check-prefix=STDERR %s
-# vim: fileformat=dos
-# It is absolutely vital that this file has CRLF line endings.
-#
-# Note that we invert the test because we intent to let clangd exit prematurely.
-#
-# Test protocol parsing
-Content-Length: 125
-Content-Type: application/vscode-jsonrpc; charset-utf-8
-
-{"jsonrpc":"2.0","id":0,"method":"initialize","params":{"processId":123,"rootPath":"clangd","capabilities":{},"trace":"off"}}
-# Test message with Content-Type after Content-Length
-#
-#      CHECK:  "jsonrpc": "2.0",
-# CHECK-NEXT:  "result": {
-#      CHECK:  }
-Content-Length: 246
-
-{"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{"uri":"test:///main.cpp","languageId":"cpp","version":1,"text":"struct fake { int a, bb, ccc; int f(int i, const float f) const; };\nint main() {\n  fake f;\n  f.\n}\n"}}}
-
-Content-Length: 104
-
-{"jsonrpc":"2.0","method":"textDocument/didChange","params":{"textDocument":{"uri":"test:///main.cpp"}}}
-
-Content-Type: application/vscode-jsonrpc; charset-utf-8
-Content-Length: 146
-
-{"jsonrpc":"2.0","id":1,"method":"textDocument/completion","params":{"textDocument":{"uri":"test:/main.cpp"},"position":{"line":3,"character":5}}}
-# Test message with Content-Type before Content-Length
-#
-#      CHECK:  "id": 1,
-# CHECK-NEXT:  "jsonrpc": "2.0",
-# CHECK-NEXT:  "result": {
-# CHECK-NEXT:    "isIncomplete": false,
-# CHECK-NEXT:    "items": [
-#      CHECK:        "filterText": "a",
-# CHECK-NEXT:        "insertText": "a",
-# CHECK-NEXT:        "insertTextFormat": 1,
-# CHECK-NEXT:        "kind": 5,
-# CHECK-NEXT:        "label": " a",
-# CHECK-NEXT:        "score": {{[0-9]+.[0-9]+}},
-# CHECK-NEXT:        "sortText": "{{.*}}"
-#      CHECK:    ]
-# CHECK-NEXT:  }
-
-X-Test: Testing
-Content-Type: application/vscode-jsonrpc; charset-utf-8
-Content-Length: 146
-Content-Type: application/vscode-jsonrpc; charset-utf-8
-X-Testing: Test
-
-{"jsonrpc":"2.0","id":2,"method":"textDocument/completion","params":{"textDocument":{"uri":"test:/main.cpp"},"position":{"line":3,"character":5}}}
-
-Content-Type: application/vscode-jsonrpc; charset-utf-8
-Content-Length: 10
-Content-Length: 146
-
-{"jsonrpc":"2.0","id":3,"method":"textDocument/completion","params":{"textDocument":{"uri":"test:/main.cpp"},"position":{"line":3,"character":5}}}
-# Test message with duplicate Content-Length headers
-#
-#      CHECK:  "id": 3,
-# CHECK-NEXT:  "jsonrpc": "2.0",
-# CHECK-NEXT:  "result": {
-# CHECK-NEXT:    "isIncomplete": false,
-# CHECK-NEXT:    "items": [
-#      CHECK:        "filterText": "a",
-# CHECK-NEXT:        "insertText": "a",
-# CHECK-NEXT:        "insertTextFormat": 1,
-# CHECK-NEXT:        "kind": 5,
-# CHECK-NEXT:        "label": " a",
-# CHECK-NEXT:        "score": {{[0-9]+.[0-9]+}},
-# CHECK-NEXT:        "sortText": "{{.*}}"
-#      CHECK:    ]
-# CHECK-NEXT:  }
-# STDERR: Warning: Duplicate Content-Length header received. The previous value for this message (10) was ignored.
-
-Content-Type: application/vscode-jsonrpc; charset-utf-8
-Content-Length: 10
-
-{"jsonrpc":"2.0","id":4,"method":"textDocument/completion","params":{"textDocument":{"uri":"test:/main.cpp"},"position":{"line":3,"character":5}}}
-# Test message with malformed Content-Length
-#
-# STDERR: JSON parse error
-# Ensure we recover by sending another (valid) message
-
-Content-Length: 146
-
-{"jsonrpc":"2.0","id":5,"method":"textDocument/completion","params":{"textDocument":{"uri":"test:/main.cpp"},"position":{"line":3,"character":5}}}
-# Test message with Content-Type before Content-Length
-#
-#      CHECK:  "id": 5,
-# CHECK-NEXT:  "jsonrpc": "2.0",
-# CHECK-NEXT:  "result": {
-# CHECK-NEXT:    "isIncomplete": false,
-# CHECK-NEXT:    "items": [
-#      CHECK:        "filterText": "a",
-# CHECK-NEXT:        "insertText": "a",
-# CHECK-NEXT:        "insertTextFormat": 1,
-# CHECK-NEXT:        "kind": 5,
-# CHECK-NEXT:        "label": " a",
-# CHECK-NEXT:        "score": {{[0-9]+.[0-9]+}},
-# CHECK-NEXT:        "sortText": "{{.*}}"
-#      CHECK:    ]
-# CHECK-NEXT:  }
-Content-Length: 1024
-
-{"jsonrpc":"2.0","id":5,"method":"textDocument/completion","params":{"textDocument":{"uri":"test:/main.cpp"},"position":{"line":3,"character":5}}}
-# Test message which reads beyond the end of the stream.
-#
-# Ensure this is the last test in the file!
-# STDERR: Input was aborted. Read only {{[0-9]+}} bytes of expected {{[0-9]+}}.
-
+# RUN: not clangd -pretty -sync -enable-test-uri-scheme < %s | FileCheck -strict-whitespace %s
+# RUN: not clangd -pretty -sync -enable-test-uri-scheme < %s 2>&1 | FileCheck -check-prefix=STDERR %s
+# vim: fileformat=dos
+# It is absolutely vital that this file has CRLF line endings.
+#
+# Note that we invert the test because we intent to let clangd exit prematurely.
+#
+# Test protocol parsing
+Content-Length: 125
+Content-Type: application/vscode-jsonrpc; charset-utf-8
+
+{"jsonrpc":"2.0","id":0,"method":"initialize","params":{"processId":123,"rootPath":"clangd","capabilities":{},"trace":"off"}}
+# Test message with Content-Type after Content-Length
+#
+#      CHECK:  "jsonrpc": "2.0",
+# CHECK-NEXT:  "result": {
+#      CHECK:  }
+Content-Length: 246
+
+{"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{"uri":"test:///main.cpp","languageId":"cpp","version":1,"text":"struct fake { int a, bb, ccc; int f(int i, const float f) const; };\nint main() {\n  fake f;\n  f.\n}\n"}}}
+
+Content-Length: 104
+
+{"jsonrpc":"2.0","method":"textDocument/didChange","params":{"textDocument":{"uri":"test:///main.cpp"}}}
+
+Content-Type: application/vscode-jsonrpc; charset-utf-8
+Content-Length: 146
+
+{"jsonrpc":"2.0","id":1,"method":"textDocument/completion","params":{"textDocument":{"uri":"test:/main.cpp"},"position":{"line":3,"character":5}}}
+# Test message with Content-Type before Content-Length
+#
+#      CHECK:  "id": 1,
+# CHECK-NEXT:  "jsonrpc": "2.0",
+# CHECK-NEXT:  "result": {
+# CHECK-NEXT:    "isIncomplete": false,
+# CHECK-NEXT:    "items": [
+#      CHECK:        "filterText": "a",
+# CHECK-NEXT:        "insertText": "a",
+# CHECK-NEXT:        "insertTextFormat": 1,
+# CHECK-NEXT:        "kind": 5,
+# CHECK-NEXT:        "label": " a",
+# CHECK-NEXT:        "score": {{[0-9]+.[0-9]+}},
+# CHECK-NEXT:        "sortText": "{{.*}}"
+#      CHECK:    ]
+# CHECK-NEXT:  }
+
+X-Test: Testing
+Content-Type: application/vscode-jsonrpc; charset-utf-8
+Content-Length: 146
+Content-Type: application/vscode-jsonrpc; charset-utf-8
+X-Testing: Test
+
+{"jsonrpc":"2.0","id":2,"method":"textDocument/completion","params":{"textDocument":{"uri":"test:/main.cpp"},"position":{"line":3,"character":5}}}
+
+Content-Type: application/vscode-jsonrpc; charset-utf-8
+Content-Length: 10
+Content-Length: 146
+
+{"jsonrpc":"2.0","id":3,"method":"textDocument/completion","params":{"textDocument":{"uri":"test:/main.cpp"},"position":{"line":3,"character":5}}}
+# Test message with duplicate Content-Length headers
+#
+#      CHECK:  "id": 3,
+# CHECK-NEXT:  "jsonrpc": "2.0",
+# CHECK-NEXT:  "result": {
+# CHECK-NEXT:    "isIncomplete": false,
+# CHECK-NEXT:    "items": [
+#      CHECK:        "filterText": "a",
+# CHECK-NEXT:        "insertText": "a",
+# CHECK-NEXT:        "insertTextFormat": 1,
+# CHECK-NEXT:        "kind": 5,
+# CHECK-NEXT:        "label": " a",
+# CHECK-NEXT:        "score": {{[0-9]+.[0-9]+}},
+# CHECK-NEXT:        "sortText": "{{.*}}"
+#      CHECK:    ]
+# CHECK-NEXT:  }
+# STDERR: Warning: Duplicate Content-Length header received. The previous value for this message (10) was ignored.
+
+Content-Type: application/vscode-jsonrpc; charset-utf-8
+Content-Length: 10
+
+{"jsonrpc":"2.0","id":4,"method":"textDocument/completion","params":{"textDocument":{"uri":"test:/main.cpp"},"position":{"line":3,"character":5}}}
+# Test message with malformed Content-Length
+#
+# STDERR: JSON parse error
+# Ensure we recover by sending another (valid) message
+
+Content-Length: 146
+
+{"jsonrpc":"2.0","id":5,"method":"textDocument/completion","params":{"textDocument":{"uri":"test:/main.cpp"},"position":{"line":3,"character":5}}}
+# Test message with Content-Type before Content-Length
+#
+#      CHECK:  "id": 5,
+# CHECK-NEXT:  "jsonrpc": "2.0",
+# CHECK-NEXT:  "result": {
+# CHECK-NEXT:    "isIncomplete": false,
+# CHECK-NEXT:    "items": [
+#      CHECK:        "filterText": "a",
+# CHECK-NEXT:        "insertText": "a",
+# CHECK-NEXT:        "insertTextFormat": 1,
+# CHECK-NEXT:        "kind": 5,
+# CHECK-NEXT:        "label": " a",
+# CHECK-NEXT:        "score": {{[0-9]+.[0-9]+}},
+# CHECK-NEXT:        "sortText": "{{.*}}"
+#      CHECK:    ]
+# CHECK-NEXT:  }
+Content-Length: 1024
+
+{"jsonrpc":"2.0","id":5,"method":"textDocument/completion","params":{"textDocument":{"uri":"test:/main.cpp"},"position":{"line":3,"character":5}}}
+# Test message which reads beyond the end of the stream.
+#
+# Ensure this is the last test in the file!
+# STDERR: Input was aborted. Read only {{[0-9]+}} bytes of expected {{[0-9]+}}.
+
diff --git a/clang-tools-extra/clangd/test/spaces-in-delimited-input.test b/clang-tools-extra/clangd/test/spaces-in-delimited-input.test
index dc2e2f5ea0f64dd..aa191b6f2097f97 100644
--- a/clang-tools-extra/clangd/test/spaces-in-delimited-input.test
+++ b/clang-tools-extra/clangd/test/spaces-in-delimited-input.test
@@ -1,13 +1,13 @@
-# RUN: clangd -input-style=delimited -sync < %s 2>&1 | FileCheck %s
-# RUN: clangd -lit-test -sync < %s 2>&1 | FileCheck %s
-#
-{"jsonrpc":"2.0","id":0,"method":"initialize","params":{"processId":123,"rootPath":"clangd","capabilities":{},"trace":"off"}}
-
----
-
-{"jsonrpc":"2.0","id":3,"method":"shutdown"}
-
----
-
-{"jsonrpc":"2.0","method":"exit"}
-# CHECK-NOT: JSON parse error
+# RUN: clangd -input-style=delimited -sync < %s 2>&1 | FileCheck %s
+# RUN: clangd -lit-test -sync < %s 2>&1 | FileCheck %s
+#
+{"jsonrpc":"2.0","id":0,"method":"initialize","params":{"processId":123,"rootPath":"clangd","capabilities":{},"trace":"off"}}
+
+---
+
+{"jsonrpc":"2.0","id":3,"method":"shutdown"}
+
+---
+
+{"jsonrpc":"2.0","method":"exit"}
+# CHECK-NOT: JSON parse error
diff --git a/clang-tools-extra/clangd/test/too_large.test b/clang-tools-extra/clangd/test/too_large.test
index 7df981e7942073a..6986bd5e258e87a 100644
--- a/clang-tools-extra/clangd/test/too_large.test
+++ b/clang-tools-extra/clangd/test/too_large.test
@@ -1,7 +1,7 @@
-# RUN: not clangd -sync < %s 2>&1 | FileCheck -check-prefix=STDERR %s
-# vim: fileformat=dos
-# It is absolutely vital that this file has CRLF line endings.
-#
-Content-Length: 2147483648
-
-# STDERR: Refusing to read message
+# RUN: not clangd -sync < %s 2>&1 | FileCheck -check-prefix=STDERR %s
+# vim: fileformat=dos
+# It is absolutely vital that this file has CRLF line endings.
+#
+Content-Length: 2147483648
+
+# STDERR: Refusing to read message
diff --git a/clang-tools-extra/test/clang-tidy/checkers/readability/Inputs/duplicate-include/duplicate-include.h b/clang-tools-extra/test/clang-tidy/checkers/readability/Inputs/duplicate-include/duplicate-include.h
index bf288023274b155..22d3a3acbc916ed 100644
--- a/clang-tools-extra/test/clang-tidy/checkers/readability/Inputs/duplicate-in...
[truncated]

``````````

</details>


https://github.com/llvm/llvm-project/pull/86318


More information about the cfe-commits mailing list