A number of the ICF tests were not updated to use --print-icf-sections
instead of --verbose and various '-NOT' checks were not updated to the
latest output format of --print-icf-sections. Because these are all
'negative' tests, these issues have gone unnoticed.
Details
- Reviewers
MaskRay - Commits
- rG39f3f7c08fb6: [ELF][test] Fix several LLD ICF tests
Diff Detail
Event Timeline
lld/test/ELF/icf-non-mergeable.s | ||
---|---|---|
11 | If the number of sections is small, prefer positive tests. CHECK: CHECK-NEXT: CHECK-NOT: {{.}} If necessary, add a comment explaining that we don't want to see some sections. |
lld/test/ELF/icf-non-mergeable.s | ||
---|---|---|
11 | These tests are checking that no merging has occurred due to ICF, so there are no positive checks as far as the ICF output is concerned. This is the same pattern used in some of the other ICF tests. It's just that these tests were somehow not updated correctly for the ICF related changes and that's what I'm trying to correct. |
Looking at some of the other ICF tests, another approach to checking for no merging is: ... --print-icf-sections | count 0. Would this be preferable to using CHECK-NOT: patterns?
Replaced negative checks with checking that there is no output from --print-icf-sections using count.
If the number of sections is small, prefer positive tests.
If necessary, add a comment explaining that we don't want to see some sections.