This is an archive of the discontinued LLVM Phabricator instance.

[Object/invalid.test] - Convert Object/corrupt.test to YAML and merge the result into invalid.test
ClosedPublic

Authored by grimar on Jun 28 2019, 5:54 AM.

Details

Summary

Object/corrupt.test has the same purpose as Object/invalid.test:
it tests the behavior on invalid inputs.

In this patch I converted it to YAML, merged into invalid.test,
added comments and removed a few precompiled binaries.

Depends on D63879

Diff Detail

Repository
rL LLVM

Event Timeline

grimar created this revision.Jun 28 2019, 5:54 AM
jhenderson added inline comments.Jul 1 2019, 3:35 AM
test/Object/invalid.test
314 ↗(On Diff #207045)

Nit: -sections -> --sections (for consistency with the rest of the file).

Same below with other switches.

344–346 ↗(On Diff #207045)

Could you line these values up?

393 ↗(On Diff #207045)

Nit: I find it easier to read the test if the '|' is on the next line, i.e:

# RUN: | FileCheck --check-prefix=PHENTSIZE %s

Same applies below.

427 ↗(On Diff #207045)

report -> reports

428 ↗(On Diff #207045)

which -> with

436 ↗(On Diff #207045)

report -> reports

How is the size "invalid"? The comment needs to be adjusted to say that the size is not a multiple of a dynamic tag's size, or something to that effect.

455 ↗(On Diff #207045)

than object -> than the object

I think you can use the ProgramHeader Offset field here to make this with YAML. Aternatively, you could try using python's trucate() function to shorten the file?

464 ↗(On Diff #207045)

than the object

This case can be written in YAML using a custom FileSize field in the program header.

grimar updated this revision to Diff 207524.Jul 2 2019, 5:23 AM
grimar marked 9 inline comments as done.
  • Addressed review comments.
test/Object/invalid.test
455 ↗(On Diff #207045)

Great, thanks!

jhenderson added inline comments.Jul 2 2019, 5:33 AM
test/Object/invalid.test
366 ↗(On Diff #207524)

-sections -> --sections
-section-data --section-data

385 ↗(On Diff #207524)

-symbols -> --symbols

469 ↗(On Diff #207524)

has an invalid size

grimar updated this revision to Diff 207526.Jul 2 2019, 5:47 AM
grimar marked 4 inline comments as done.
  • Addressed review comments.
test/Object/invalid.test
366 ↗(On Diff #207524)

Sorry, I missed this and below place somehow previously.

This revision is now accepted and ready to land.Jul 2 2019, 5:53 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptJul 2 2019, 5:59 AM
llvm/trunk/test/Object/Inputs/corrupt-invalid-dynamic-table-size.elf.x86-64