[lld] [lld][test] Use LLVM helpers for input file discovery (PR #220404)

Jordan Rupprecht via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 28 12:38:20 PDT 2026


rupprecht wrote:

> I think this was bad advice

:wave: author of bad advice here :)

I'm trying to understand the issue a bit more. AFAICT the suggestions on D125783 are:
* **Switch to a lit test** - given these tests are named "AsLibELF", it seems like a unit test is intentional -- this specifically tests library usage, invocation via a binary. So this suggestion is n/a for this use case.
* **Avoid a checked in binary** - I can't find any instructions on how these .o files were built, so I'm not sure how to rebuild them. Maybe they can use yaml2obj (as libraries)? I'll give that a shot to see how feasible it is. These files are trivially small, so exact build steps is probably not important.

Supposing there is no way to avoid a unit test depending on test input from the source tree, is there a recommendation for how do to that?

> This also seems to introduce a source dependency between LLD and LLVM unit tests

What's the new dep that's causing a problem? Is it LLVMTestingSupport? Does LLD not already depend on LLVM?

> if someone is up for it i imagine a llm could easily remove all uses of that macro instead

I can attempt this. There isn't that much usage.

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


More information about the llvm-commits mailing list