This is an archive of the discontinued LLVM Phabricator instance.

[lld][ELF][test] Add additional --symbol-ordering-file testing
ClosedPublic

Authored by jhenderson on Nov 6 2020, 5:59 AM.

Details

Summary

This covers a few cases that aren't otherwise tested:

  1. Non-ascii symbol names are ordered.
  2. Comments, whitespace and blank lines are trimmed.
  3. Missing order files result in an error.

Diff Detail

Event Timeline

jhenderson created this revision.Nov 6 2020, 5:59 AM
Herald added a project: Restricted Project. · View Herald Transcript
Herald added a subscriber: emaste. · View Herald Transcript
jhenderson requested review of this revision.Nov 6 2020, 5:59 AM
MaskRay added inline comments.Nov 6 2020, 1:23 PM
lld/test/ELF/symbol-ordering-file.s
35
46

Prepend error:

jhenderson marked 2 inline comments as done.Nov 9 2020, 1:45 AM
jhenderson added inline comments.
lld/test/ELF/symbol-ordering-file.s
35

Okay. I was deliberately trying to avoid testing the message in detail, since it somewhat duplicates coverage provided by symbol-ordering-file-warnings.s. Ideally, I'd not check it at all, but I want to show that there are no other warnings, caused by the whitespace/comments etc. However, I also don't want to lose the coverage given by the duplicate symbol (i.e. which one determines the order for that symbol). I'm open to alternative suggestions that would help with this.

jhenderson updated this revision to Diff 303776.Nov 9 2020, 1:46 AM
jhenderson marked an inline comment as done.

Address review comments.

grimar added a comment.Nov 9 2020, 1:51 AM

Have a minor question/suggestion. The rest LG.

lld/test/ELF/symbol-ordering-file.s
23

Does it make sence to test the mix of different line endings? I.e windows ("\r\n") vs linux ("\n")

jhenderson updated this revision to Diff 303790.Nov 9 2020, 2:23 AM

Confirm all special whitespace characters are trimmed.

jhenderson marked an inline comment as done.Nov 9 2020, 2:24 AM
jhenderson added inline comments.
lld/test/ELF/symbol-ordering-file.s
23

I've gone further and tested all the special whitespace characters currently handled.

grimar accepted this revision.Nov 9 2020, 2:25 AM

LGTM!

This revision is now accepted and ready to land.Nov 9 2020, 2:25 AM
jhenderson marked an inline comment as done.Nov 9 2020, 6:08 AM
MaskRay accepted this revision.Nov 9 2020, 9:44 AM

LGTM.