[all-commits] [llvm/llvm-project] fc5bf0: fix check-clang-tools tests that fail due to Windo...

Richard Thomson via All-commits all-commits at lists.llvm.org
Fri Feb 11 14:25:05 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: fc5bf040d810fbad424e609cda1ad56fc15cc403
      https://github.com/llvm/llvm-project/commit/fc5bf040d810fbad424e609cda1ad56fc15cc403
  Author: Conrad Poelman <poelmanc at reviews.llvm.org>
  Date:   2022-02-11 (Fri, 11 Feb 2022)

  Changed paths:
    A test/.gitattributes

  Log Message:
  -----------
  fix check-clang-tools tests that fail due to Windows CRLF line endings

Running check-clang-tools on Windows produces 5 test failures:

Failed Tests (5):
  Clang Tools :: clang-apply-replacements/ClangRenameClassReplacements.cpp
  Clang Tools :: clang-apply-replacements/basic.cpp
  Clang Tools :: clang-apply-replacements/format.cpp
  Clang Tools :: clang-move/move-used-helper-decls.cpp
  Clang Tools :: clang-tidy/infrastructure/export-diagnostics.cpp

Four of these failures are simply due to fixed character position
offsets differing on Windows versus Linux, since Windows line endings
take up two characters instead of one:

clang-apply-replacements/ClangRenameClassReplacements.cpp runs clang-rename -offset=254
clang-apply-replacements/Inputs/basic/file[12].yaml specify e.g.  FileOffset: 148 and Offset: 298
clang-apply-replacements/Inputs/format/{no,yes}.yaml specify e.g.  FileOffset: 94 and Offset: 94
clang-tidy/infrastructure/export-diagnostics.cpp specifies e.g.  CHECK-YAML-NEXT: FileOffset: 30

(The move-used-helper-decls.cpp failure seems more complex; clang-move
adds a blank line after void HelperFun1() {} when
clang-move/Inputs/helper_decls_test.cpp has LF line endings, but does
not add a blank line when the input files has CRLF line endings. That
difference in behavior seems like it may be an actual bug, but I have
yet to track it down.)

Differential Revision: https://reviews.llvm.org/D97625




More information about the All-commits mailing list