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

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
347

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

Same below with other switches.

377–379

Could you line these values up?

426

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.

460

report -> reports

461

which -> with

469

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.

488

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?

497

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
488

Great, thanks!

jhenderson added inline comments.Jul 2 2019, 5:33 AM
test/Object/invalid.test
366

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

385

-symbols -> --symbols

469

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

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