Depends on D77006.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
I like the idea but this patch means we should do this with the initial patch D75382.
I have half a dozen commits (with tests in all of them) since then. Rebasing-splitting this would be a lot of work
I'm actually not in favor of this change as I want to keep test files self-contained. I'd stick with lld -flavor darwinnew. Once the new lld/mach-o is ready, you can run sed with s/lld -flavor darwinnew/lld.ld64/g to replace all occurrences of lld -flavor darwinnew. So I don't see a need for abstraction here.
Manual line wrapping is kind of a chore, and since we don't have an autoformatter for these files, we'd end up with lines that are too short after doing that sed operation. Plus I was also considering adding -Z to the base %lld substitution to ensure that we never write tests which accidentally depend on system libraries.
We are not strictly enforcing the 80 column rule to the test files, so having long lines are fine for now.
Regarding -Z, shouldn't we turn on that flag whenever LLD_IN_TEST environment variable is set? It's the catch-all flag to change the linker's behavior whenever running in the test environment.