Skip to content

Commit

Permalink
[llvm/test/Object] - Cleanup and move out the yaml2obj tests.
Browse files Browse the repository at this point in the history
There are multiple yaml2obj-* tests in llvm/test/Object
folder. This is not correct place to have them and my intention
was to move them out to test\tools\yaml2obj folder. I reviewed
them, made some changes, and my comments are below.

For all tests I:

Added comments when needed.
Moved them from llvm/test/Object to yaml2obj tests.
Another changes performed:

1) yaml2obj-invalid.yaml. It was a test for an invalid YAML input.
I just moved it.

2) yaml2obj-coff-multi-doc.test/yaml2obj-elf-multi-doc.test:
these were a tests for testing --docnum=x functionality,
one was for COFF and one for ELF. I merged them into one.

3) yaml2obj-elf-bits-endian.test:
I removed its 4 YAML inputs (merged into the main test).

4) yaml2obj-readobj.test:
This file has a long history. It was added to check the
"parsing of header charactestics" initially. Then was used to test
how yaml2obj writes the relocations. Then was upgraded to check how
yaml2obj handle "-o" option. I think it should be heavily splitted
and refactored in a separate patch. For now I leaved it as is, but restyled
to reduce the changes in a follow-ups.

5) yaml2obj-elf-alignment.yaml: its intention was to check we
can set sh-addralign field. I moved, renamed (to elf-sh-addralign.yaml)
and updated this test.

6) yaml2obj-elf-file-headers.yaml: I removed it.
It's intention was to check that
yaml2obj handles OS/ABI and ELF type (e.g Relocatable).
We are testing this already, for example in D64800. We might want
to add a better (more complete) test, but keeping the existent test
does not have much sense I think.

7) yaml2obj-elf-file-headers-with-e_flags.yaml: I would describe its intention
as "testing MIPS e_flags". It is far from being complete and tests only
a few flags. I leaved it alone for now.

8) yaml2obj-elf-rel.yaml: its intention is to check the MIPS32 relocations.
We have a version for MIPS64 here: test\Object\Mips\elf-mips64-rel.yaml
Seems them both are incomplete. I leaved them alone for now.

9) yaml2obj-elf-rel-noref.yaml: was introduced to check the support of arm32
R_ARM_V4BX relocatiion. I leaved it alone for now.

10) yaml2obj-elf-section-basic.yaml: it just checked that we are able to recognise
trivial fields like section 'Name', 'Type', 'Flags' and others. All of our yaml2obj
tests are heavily using it. I just removed this test.

11) yaml2obj-elf-section-invalid-size.yaml: its intention was to check the
"Section size must be greater than or equal to the content size" error.
I moved this test to `tools\yaml2obj\section-size-content.yaml'

12) yaml2obj-elf-symbol-basic.yaml: its intention seems was to support declarations
of the symbols in yaml2obj. I removed it. We use this in almost each test we already have.

13) yaml2obj-elf-symbol-LocalGlobalWeak.yaml: its intention was to check that we can
declare different symbol bindings. I moved it to tools\yaml2obj\elf-symbol-binding.yaml.

14) yaml2obj-coff-invalid-alignment.test: check that error is reported for a too large coff
section alignment. Moved it to tools\yaml2obj\coff-invalid-alignment.test

15) yaml2obj-elf-symbol-visibility.yaml: tests ELF symbols visibility. I improved it and
moved to tools\yaml2obj\elf-symbol-visibility.yaml and tools\obj2yaml\elf-symbol-visibility.yaml

Differential revision: https://reviews.llvm.org/D65652

llvm-svn: 367988
  • Loading branch information
George Rimar committed Aug 6, 2019
1 parent ebc2cf9 commit c056dd1
Show file tree
Hide file tree
Showing 22 changed files with 361 additions and 521 deletions.
6 changes: 0 additions & 6 deletions llvm/test/Object/Inputs/ELF/BE32.yaml

This file was deleted.

6 changes: 0 additions & 6 deletions llvm/test/Object/Inputs/ELF/BE64.yaml

This file was deleted.

6 changes: 0 additions & 6 deletions llvm/test/Object/Inputs/ELF/LE32.yaml

This file was deleted.

6 changes: 0 additions & 6 deletions llvm/test/Object/Inputs/ELF/LE64.yaml

This file was deleted.

54 changes: 0 additions & 54 deletions llvm/test/Object/yaml2obj-elf-alignment.yaml

This file was deleted.

16 changes: 0 additions & 16 deletions llvm/test/Object/yaml2obj-elf-bits-endian.test

This file was deleted.

11 changes: 0 additions & 11 deletions llvm/test/Object/yaml2obj-elf-file-headers.yaml

This file was deleted.

56 changes: 0 additions & 56 deletions llvm/test/Object/yaml2obj-elf-multi-doc.test

This file was deleted.

79 changes: 0 additions & 79 deletions llvm/test/Object/yaml2obj-elf-section-basic.yaml

This file was deleted.

26 changes: 0 additions & 26 deletions llvm/test/Object/yaml2obj-elf-section-invalid-size.yaml

This file was deleted.

42 changes: 0 additions & 42 deletions llvm/test/Object/yaml2obj-elf-symbol-basic.yaml

This file was deleted.

0 comments on commit c056dd1

Please sign in to comment.