[lld-macho] Reorganize + extend ICF test
authorJez Ng <jezng@fb.com>
Fri, 23 Jul 2021 15:33:26 +0000 (11:33 -0400)
committerJez Ng <jezng@fb.com>
Fri, 23 Jul 2021 15:49:00 +0000 (11:49 -0400)
commit8eac5dcb36ddbb66dff467eda3fc0eee31d73631
tree73c594bb12c2f22a307a5236b04291656a26bfe7
parent0ad562b48bfd7a487eb38ceaa309cdd9a1ad87e7
[lld-macho] Reorganize + extend ICF test

I found icf.s a bit hard to work with as it was not possible to
extend any of the functions `_a` ... `_k` to test new relocation /
referent types without modifying every single one of them. Additionally,
their one-letter names were not descriptive (though the comments
helped).

I've renamed all the functions to reflect the feature they are testing,
and shrunk them so that they contain just enough to test that one
feature.

I've also added tests for non-zero addends (via the
`_abs1a_ref_with_addend` and `_defined_ref_with_addend_1` functions).

Reviewed By: #lld-macho, gkm

Differential Revision: https://reviews.llvm.org/D106211
lld/test/MachO/icf.s