[llvm] Normalize file path to fix problems with different folder separators. (PR #215225)
James Henderson via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 18 02:12:18 PDT 2026
================
@@ -27,9 +27,13 @@
; LINE-NEXT: retq
; RUN: llvm-objdump --no-print-imm-hex -d --source %t.o 2>&1 | \
-; RUN: FileCheck %s --check-prefix=SOURCE-MISSING -DFILE=%t.o
+; RUN: FileCheck %s --check-prefix=SOURCE-MISSING -DFILE=%t.o -DSEP=%{fs-sep}
-; SOURCE-MISSING: warning: '[[FILE]]': failed to find source {{[/\\]}}wrong{{[/\\]}}Inputs{{[/\\]}}source-interleave-x86_64.c
+;; The compilation directory is spelled with '/' but is joined to the file name
+;; with the host separator, so on Windows the recorded path mixes the two.
----------------
jh7370 wrote:
I think it would be better to say "preferred directory separator" and reword the following part of the sentence, since the chosen separator is (on Windows at least) impacted by an LLVM configuration variable:
> The compilation directory is spelled with '/' but is joined to the file name with the preferred directory separator. On Windows, when LLVM_WINDOWS_PREFER_FORWARD_SLASH is not enabled, this means the path contains a mix of slash directions, which llvm-objdump then normalises.
https://github.com/llvm/llvm-project/pull/215225
More information about the llvm-commits
mailing list