[llvm] [DebugInfo] Preserve line and column number when merging debug info. (PR #129960)
Reid Kleckner via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 31 13:43:29 PDT 2025
================
@@ -0,0 +1,65 @@
+; RUN: opt %s -passes=simplifycfg -hoist-common-insts -preserve-merged-debug-info -S | FileCheck %s
+; CHECK: tail call i32 @bar{{.*!dbg !}}[[TAG:[0-9]+]]
+; CHECK: ![[TAG]] = !DILocation(line: 9, column: 16, scope: !9)
+
----------------
rnk wrote:
You know, we have unit tests for this API with decent fixtures:
https://github.com/llvm/llvm-project/blob/a8d2d169c7add4b0106ae76e186cf815c0b84825/llvm/unittests/IR/MetadataTest.cpp#L921
Maybe this is more trouble than it's worth, but you could make the cl::opt non-static, declare it in the unittest, modify it directly (`PreserveMergedDebugInfo = true/false`) and test it that way. No strong preference on my part, though,
https://github.com/llvm/llvm-project/pull/129960
More information about the llvm-commits
mailing list