This is an archive of the discontinued LLVM Phabricator instance.

[ObjectYAML][test] Use a single test file to test the empty 'DWARF' entry.

Authored by Higuoxing on Jun 9 2020, 9:19 PM.

Diff Detail

Event Timeline

Higuoxing created this revision.Jun 9 2020, 9:19 PM
Herald added a project: Restricted Project. · View Herald Transcript
grimar added inline comments.Jun 10 2020, 2:16 AM

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
jhenderson added inline comments.Jun 10 2020, 2:41 AM

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.

Higuoxing marked 2 inline comments as done.

Address comments.

jhenderson accepted this revision.Jun 11 2020, 1:24 AM

Looks good, thanks!

This revision is now accepted and ready to land.Jun 11 2020, 1:24 AM
This revision was automatically updated to reflect the committed changes.