[all-commits] [llvm/llvm-project] 4ea39c: [LIT] Use forward slashes in substitutions when LL...

Junji Watanabe via All-commits all-commits at lists.llvm.org
Mon Mar 2 21:45:28 PST 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 4ea39c43e1338a16cf165f234dd88b8ecb53dcd1
      https://github.com/llvm/llvm-project/commit/4ea39c43e1338a16cf165f234dd88b8ecb53dcd1
  Author: Junji Watanabe <watanabe0621 at gmail.com>
  Date:   2026-03-03 (Tue, 03 Mar 2026)

  Changed paths:
    M llvm/utils/lit/lit/LitConfig.py
    M llvm/utils/lit/lit/TestRunner.py
    M llvm/utils/lit/lit/llvm/config.py
    M llvm/utils/lit/tests/lit.cfg
    M llvm/utils/lit/tests/shtest-readfile.py
    M llvm/utils/llvm-lit/llvm-lit.in

  Log Message:
  -----------
  [LIT] Use forward slashes in substitutions when LLVM_WINDOWS_PREFER_FORWARD_SLASH is set (#179865)

When building with `-DLLVM_WINDOWS_PREFER_FORWARD_SLASH=ON`, tools like
lld output paths with forward slashes on Windows. However, lit's default
substitutions (`%t`, `%p`) typically use backslashes on Windows, causing
FileCheck failures in tests that strictly match path separators.

This patch propagates the `LLVM_WINDOWS_PREFER_FORWARD_SLASH` build flag
to llvm-lit via `builtin_parameters`. It also updates lit's TestRunner
to respect the 'use_normalized_slashes' parameter. When enabled, lit
normalizes paths in substitutions to use forward slashes, ensuring that
test expectations align with the tool output.

With this fix, the number of failed tests with
`-DLLVM_WINDOWS_PREFER_FORWARD_SLASH=ON` changes as follow:

- The total number of failed tests: 303 -> 168
- Break down:
  - `Builtins-i386-windows` tests: 99 -> 0
  - `Clang` tests: 28 -> 5
  - `Clang Tools` tests: 7 -> 1
  - `LLVM` tests: 6 -> 4
  - `lld` tests: 2 -> 0
- Other failed tests:
  - `glang`: 1
  - `Clang-Unit`: 5
  - `Clangd`: 3
  - `Clangd Unit Tests`: 150
  - `LLVM-Unit`: 1



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list