This is an archive of the discontinued LLVM Phabricator instance.

[lld-macho][easy] Use substitution for test
AbandonedPublic

Authored by int3 on Mar 30 2020, 1:24 PM.

Diff Detail

Event Timeline

int3 created this revision.Mar 30 2020, 1:24 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 30 2020, 1:24 PM
MaskRay added a comment.EditedMar 30 2020, 1:26 PM

I like the idea but this patch means we should do this with the initial patch D75382.

int3 added a comment.Mar 30 2020, 1:29 PM

I have half a dozen commits (with tests in all of them) since then. Rebasing-splitting this would be a lot of work

ruiu added a comment.Mar 30 2020, 10:17 PM

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.

int3 added a comment.Mar 31 2020, 7:50 PM

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.

ruiu added a comment.Mar 31 2020, 8:02 PM

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.

int3 abandoned this revision.Mar 31 2020, 8:52 PM

Okay, fair enough