[llvm] [llvm-objdump] Add --substitute-path and --source-dir for --source (PR #201096)

James Henderson via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 12 01:24:57 PDT 2026


================
@@ -0,0 +1,129 @@
+;; Test --substitute-path and --source-dir with --source and --line-numbers.
+;;
+;; The object records source paths under /wrong/Inputs, but the source file
+;; lives in this test's Inputs directory. Without path remapping, --source
+;; cannot load the file from disk.
+;;
+;; --source-dir: one directory per flag; later flags on the command line are
+;; searched before earlier ones.
+;;
+;; --substitute-path: rules are tried in command-line order; the first match
+;; wins (same as GDB set substitute-path).
+
+; RUN: sed -e "s,SRC_COMPDIR,/wrong/Inputs,g" %p/Inputs/source-interleave.ll > %t.ll
+; RUN: llc -o %t.o -filetype=obj -mtriple=x86_64-pc-linux %t.ll
+; REQUIRES: x86-registered-target
----------------
jh7370 wrote:

This isn't needed: the X86 directory has it in a lit.local.cfg.

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


More information about the llvm-commits mailing list