[llvm] [DWARF5][COFF] Fix wrong relocation in .debug_line (PR #83773)

Martin Storsjö via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 7 00:02:56 PST 2024


mstorsjo wrote:

> > Ah, fair enough - if there's similar code elsewhere I'm more or less happy to hand-wave/not think about it too much harder. But yeah, some test coverage would be good.
> 
> You're right, some tests would be good, I'll add one; though it will probably early next week when I'll get around to it. If you _really_ wanted to test this you'd have to compile code, link it & inspect the dwarf information - though with LLVM's test system it's probably easier to just verify that the relocations in the object file are correct. What I don't like about that is that it assumes that section-relative relocations are indeed the correct choice here instead of verifying that they are. We can test if we emit section relative relocs, but not if section relative relocs are in fact correct.

Indeed, but that's how most of LLVMs tests work - they test one detail in isolation (which allows catching regressions in simple tests on any platform by just executing these code generation tools). Details like whether the big picture works or not, which often requires a full working toolchain, is left for higher level integration tests, as those normally are harder to run (requiring to have suitable target headers and libraries etc, and be running on the right platform above all).

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


More information about the llvm-commits mailing list