[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:19 PDT 2026
================
@@ -1,7 +1,11 @@
# Test that the `llvm-objdump -l` can print correct line numbers.
-# RUN: llvm-objdump -d -l %p/Inputs/basic32.o | FileCheck %s --check-prefix=LINES32
-# RUN: llvm-objdump -d -l %p/Inputs/basic64.o | FileCheck %s --check-prefix=LINES64
+## The path recorded in these objects is "/basic.c". Source paths are normalized
+## to the host separator before printing, so the leading separator is the one
+## sys::path::native() produces here, which [[SEP]] expands to.
----------------
jh7370 wrote:
`sys::path::native()` is again an unnecessary mention of an implementation detail to and it's also not needed to specifically call out the FileCheck variable, since that's just restating the meaning of the FileCheck command and check patterns. The second sentence would therefore be better as: "Source paths are normalized to the preferred directory separator before printing, so use a FileCheck variable to check for that in a portable manner." This explains the "why" for the FileCheck variable, which is what I believe was missing before.
https://github.com/llvm/llvm-project/pull/215225
More information about the llvm-commits
mailing list