[llvm-readelf][test] - Refine the merged.test
authorGeorgii Rymar <grimar@accesssoftek.com>
Thu, 20 Aug 2020 12:45:27 +0000 (15:45 +0300)
committerGeorgii Rymar <grimar@accesssoftek.com>
Fri, 21 Aug 2020 12:07:37 +0000 (15:07 +0300)
commit88dd7c85497a104ab7e3e52e41fe61be7175d8a9
tree3aed880d3bfb0138305cbd42a82a8c02b44f7d09
parent57903cf09335cd687e9fcfad4af7a9ef4bc84a95
[llvm-readelf][test] - Refine the merged.test

The testing in merged.test is not ideal.
It uses the following set of flags: `-aeWhSrnudlVgIs`
and the precompiled object `trivial.obj.elf-i386`.

In fact, this object, for example, does not contain versioning stuff,
so specifying `-V` does not make much sense for it, so it is not really tested.
Also, we want to avoid using of precompiled objects, ideally we
want to use a YAML that triggers an output for each of the short options in use:

```
-a: --all
-e: --headers
-W: --wide
-h: --file-headers, --file-header
-S: --section-headers, --sections
-r: --relocations
-n: --notes
-u: --unwind
-d: --dynamic-table
-l: --program-headers
-V: --version-info
-g: --elf-section-groups
-I: --elf-hash-histogram
-s: --symbols
```

Note that, for example, we do not need to have groups to test `-g`, because for a
object with no groups llvm-readelf still prints "There are no section groups in this file.",
but that is not always the case. E.g. for `-d` we don't print anything when we have
no dynamic table, so we have to describe it in a YAML to test `-d` properly.

Also, we probably want to test cases with and without `-a`(-all) option separately
to be sure that we handle all options and not only the first one in the sequence.

Differential revision: https://reviews.llvm.org/D86283
llvm/test/tools/llvm-readobj/ELF/merged.test