llvm-project/llvm/test/ObjectYAML/MachO
Chris Bieneman 92b2e8a295 [YAML] Fix YAML tags appearing before the start of sequence elements
Our existing yaml::Output code writes tags immediately when mapTag is called, without any state handling. This results in tags on sequence elements being written before the element itself. For example, we see this:

SomeArray:     !elem_type
  - key1:         1
    key2:         2 !elem_type2
  - key3:         3
    key4:         4

We should instead see:

SomeArray:
  - !elem_type
    key1:         1
    key2:         2
  - !elem_type2
    key3:         3
    key4:         4

Our reader handles reading properly, so this bug only impacts writing yaml sequences with tagged elements.

As a test for this I've modified the Mach-O yaml encoding to allways apply the !mach-o tag when encoding MachOYAML::Object entries. This results in the !mach-o tag appearing as expected in dumped fat files.

llvm-svn: 274067
2016-06-28 21:10:26 +00:00
..
bind_opcode.yaml [yaml2obj] Remove --format option in favor of YAML tags 2016-06-27 19:53:53 +00:00
bogus_load_command.yaml [yaml2obj] Remove --format option in favor of YAML tags 2016-06-27 19:53:53 +00:00
dylib_dylinker_command.yaml [yaml2obj] Remove --format option in favor of YAML tags 2016-06-27 19:53:53 +00:00
export_trie.yaml [yaml2obj] Remove --format option in favor of YAML tags 2016-06-27 19:53:53 +00:00
fat_macho_i386_x86_64.yaml [YAML] Fix YAML tags appearing before the start of sequence elements 2016-06-28 21:10:26 +00:00
lazy_bind_opcode.yaml [yaml2obj] Remove --format option in favor of YAML tags 2016-06-27 19:53:53 +00:00
load_commands.yaml [yaml2obj] Remove --format option in favor of YAML tags 2016-06-27 19:53:53 +00:00
mach_header.yaml [yaml2obj] Remove --format option in favor of YAML tags 2016-06-27 19:53:53 +00:00
mach_header_32_malformed.yaml [yaml2obj] Remove --format option in favor of YAML tags 2016-06-27 19:53:53 +00:00
mach_header_64.yaml [yaml2obj] Remove --format option in favor of YAML tags 2016-06-27 19:53:53 +00:00
out_of_order_linkedit.yaml [yaml2obj] Remove --format option in favor of YAML tags 2016-06-27 19:53:53 +00:00
rebase_opcode.yaml [yaml2obj] Remove --format option in favor of YAML tags 2016-06-27 19:53:53 +00:00
sections.yaml [yaml2obj] Remove --format option in favor of YAML tags 2016-06-27 19:53:53 +00:00
symtab.yaml [yaml2obj] Remove --format option in favor of YAML tags 2016-06-27 19:53:53 +00:00
weak_bind_opcode.yaml [yaml2obj] Remove --format option in favor of YAML tags 2016-06-27 19:53:53 +00:00