This is an archive of the discontinued LLVM Phabricator instance.

Do not automatically append --full-shutdown to lld tests.
ClosedPublic

Authored by ruiu on Feb 16 2018, 2:14 PM.

Details

Summary

I don't think appending "--full-shtudown" to every invocation of ld.lld
in the test suit doesn't make much sense. We havne't caught any errors
by doing that, and that's perhaps rather harmful from the testing point
of view because users are using ld.lld without "--full-shutdown" option.
So this patch I removed that rule.

I added one test so that ld.lld to make sure that ld.lld works with
"--full-shutdown".

Diff Detail

Repository
rL LLVM

Event Timeline

ruiu created this revision.Feb 16 2018, 2:14 PM
pcc added a subscriber: pcc.Feb 16 2018, 2:21 PM

Isn't --full-shutdown necessary for the leak sanitizer to work correctly?

ruiu updated this revision to Diff 134723.Feb 16 2018, 2:24 PM
  • rebased
ruiu added a comment.Feb 16 2018, 2:26 PM

Isn't --full-shutdown necessary for the leak sanitizer to work correctly?

Hmm, that's probably true. I believe we do _exit in lld COFF linker. Maybe we should stop doing that as well?

pcc added a comment.Feb 16 2018, 3:05 PM

Isn't --full-shutdown necessary for the leak sanitizer to work correctly?

Hmm, that's probably true. I believe we do _exit in lld COFF linker. Maybe we should stop doing that as well?

Yes, it would probably be worth adding a /fullshutdown flag and using it in the tests to detect memory leaks. Same for wasm I'd imagine.

ruiu added a comment.Feb 16 2018, 3:08 PM

If this is needed by all tests, how about making it an environment variable (e.g. "LLD_IN_TEST=1") and detect it in lld.cpp instead of in each driver?

pcc added a comment.Feb 16 2018, 3:12 PM

If this is needed by all tests, how about making it an environment variable (e.g. "LLD_IN_TEST=1") and detect it in lld.cpp instead of in each driver?

Yes, that sounds better.

ruiu updated this revision to Diff 134747.Feb 16 2018, 3:23 PM
  • redesign
pcc added inline comments.Feb 16 2018, 3:29 PM
lld/test/ELF/lto/timepasses.ll
3 ↗(On Diff #134747)

Could this be env LLD_IN_TEST=0 ld.lld %t.o ...? Then you wouldn't need a --no-full-shutdown flag.

ruiu updated this revision to Diff 134751.Feb 16 2018, 3:34 PM
  • removed --full-shutdown
pcc accepted this revision.Feb 16 2018, 3:41 PM

LGTM with an updated commit message.

This revision is now accepted and ready to land.Feb 16 2018, 3:41 PM
This revision was automatically updated to reflect the committed changes.