diff options
| author | Chris Bieneman <beanz@apple.com> | 2016-06-28 21:10:26 +0000 |
|---|---|---|
| committer | Chris Bieneman <beanz@apple.com> | 2016-06-28 21:10:26 +0000 |
| commit | 92b2e8a2958e22dbec732b34d828ebe6a9f82b59 (patch) | |
| tree | 45534734f85c759e4c512c37b679bad823ed177f /llvm/test | |
| parent | 347db3e18ee7375cf038a8173880466fd0fe6312 (diff) | |
| download | bcm5719-llvm-92b2e8a2958e22dbec732b34d828ebe6a9f82b59.tar.gz bcm5719-llvm-92b2e8a2958e22dbec732b34d828ebe6a9f82b59.zip | |
[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
Diffstat (limited to 'llvm/test')
| -rw-r--r-- | llvm/test/ObjectYAML/MachO/fat_macho_i386_x86_64.yaml | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/test/ObjectYAML/MachO/fat_macho_i386_x86_64.yaml b/llvm/test/ObjectYAML/MachO/fat_macho_i386_x86_64.yaml index 75043a9de74..a3d566b920d 100644 --- a/llvm/test/ObjectYAML/MachO/fat_macho_i386_x86_64.yaml +++ b/llvm/test/ObjectYAML/MachO/fat_macho_i386_x86_64.yaml @@ -52,7 +52,8 @@ Slices: #CHECK: size: 15380 #CHECK: align: 12 #CHECK: Slices: -#CHECK: - FileHeader: +#CHECK: - !mach-o +#CHECK FileHeader: #CHECK: magic: 0xFEEDFACE #CHECK: cputype: 0x00000007 #CHECK: cpusubtype: 0x00000003 @@ -60,7 +61,8 @@ Slices: #CHECK: ncmds: 0 #CHECK: sizeofcmds: 0 #CHECK: flags: 0x01218085 -#CHECK: - FileHeader: +#CHECK: - !mach-o +#CHECK FileHeader: #CHECK: magic: 0xFEEDFACF #CHECK: cputype: 0x01000007 #CHECK: cpusubtype: 0x80000003 |

