[PATCH] D81529: [ObjectYAML][test] Use a single test file to test the empty 'DWARF' entry.
James Henderson via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 10 02:41:46 PDT 2020
jhenderson added inline comments.
================
Comment at: llvm/test/tools/yaml2obj/ELF/DWARF/empty-dwarf-entry.yaml:4
+# RUN: yaml2obj %s -o %t.o
+# RUN: llvm-readobj --sections %t.o | FileCheck /dev/null --implicit-check-not=debug
+
----------------
grimar wrote:
> I'd go a bit stricter way here:
>
> You can use `llvm-readelf --sections` and check the whole section header:
>
> ```
> There are 3 section headers, starting at offset 0x58:
>
> Section Headers:
> [Nr] Name
> [ 0]
> [ 1] .strtab
> [ 2] .shstrtab
> ```
>
>
>
>
I'm not a massive fan of just relying on --implicit-check-not in a test, as it risks a spelling error or similar strange change. In this case, it's probably fine, but perhaps a suggestion is to also check the number of section headers is as expected (i.e. 3 - null shdr, .strtab and .shstrtab). You can do that using llvm-readelf instead of llvm-readobj, as that includes the number of section headers before the table itself.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D81529/new/
https://reviews.llvm.org/D81529
More information about the llvm-commits
mailing list