Replace coff-/elf-dump with llvm-readobj

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179361 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/MC/COFF/align-nops.s b/test/MC/COFF/align-nops.s
index 2971ec6..02b4884 100644
--- a/test/MC/COFF/align-nops.s
+++ b/test/MC/COFF/align-nops.s
@@ -1,4 +1,4 @@
-// RUN: llvm-mc -filetype=obj -triple i686-pc-win32 %s -o - | coff-dump.py | FileCheck %s
+// RUN: llvm-mc -filetype=obj -triple i686-pc-win32 %s | llvm-readobj -s -sd | FileCheck %s
 
 // Test that we get optimal nops in text
     .text
@@ -15,36 +15,40 @@
     .long 0
     .align  8
 
-//CHECK:         Name                     = .text
-//CHECK-NEXT:    VirtualSize
-//CHECK-NEXT:    VirtualAddress
-//CHECK-NEXT:    SizeOfRawData            = 16
-//CHECK-NEXT:    PointerToRawData
-//CHECK-NEXT:    PointerToRelocations
-//CHECK-NEXT:    PointerToLineNumbers
-//CHECK-NEXT:    NumberOfRelocations
-//CHECK-NEXT:    NumberOfLineNumbers
-//CHECK-NEXT:    Charateristics           = 0x60400020
-//CHECK-NEXT:        IMAGE_SCN_CNT_CODE
+//CHECK:          Name: .text
+//CHECK-NEXT:     VirtualSize
+//CHECK-NEXT:     VirtualAddress
+//CHECK-NEXT:     RawDataSize: 16
+//CHECK-NEXT:     PointerToRawData
+//CHECK-NEXT:     PointerToRelocations
+//CHECK-NEXT:     PointerToLineNumbers
+//CHECK-NEXT:     RelocationCount
+//CHECK-NEXT:     LineNumberCount
+//CHECK-NEXT:     Characteristics [ (0x60400020)
 //CHECK-NEXT:        IMAGE_SCN_ALIGN_8BYTES
+//CHECK-NEXT:        IMAGE_SCN_CNT_CODE
 //CHECK-NEXT:        IMAGE_SCN_MEM_EXECUTE
 //CHECK-NEXT:        IMAGE_SCN_MEM_READ
-//CHECK-NEXT:      SectionData              =
-//CHECK-NEXT:        00 00 00 00 0F 1F 40 00 - 00 00 00 00 0F 1F 40 00
+//CHECK-NEXT:     ]
+//CHECK-NEXT:     SectionData (
+//CHECK-NEXT:       0000: 00000000 0F1F4000 00000000 0F1F4000
+//CHECK-NEXT:     )
 
-//CHECK:         Name                     = .data
-//CHECK-NEXT:      VirtualSize
-//CHECK-NEXT:      VirtualAddress
-//CHECK-NEXT:      SizeOfRawData            = 16
-//CHECK-NEXT:      PointerToRawData
-//CHECK-NEXT:      PointerToRelocations
-//CHECK-NEXT:      PointerToLineNumbers
-//CHECK-NEXT:      NumberOfRelocations
-//CHECK-NEXT:      NumberOfLineNumbers
-//CHECK-NEXT:      Charateristics           = 0xC0400040
-//CHECK-NEXT:        IMAGE_SCN_CNT_INITIALIZED_DATA
-//CHECK-NEXT:        IMAGE_SCN_ALIGN_8BYTES
-//CHECK-NEXT:        IMAGE_SCN_MEM_READ
-//CHECK-NEXT:        IMAGE_SCN_MEM_WRITE
-//CHECK-NEXT:      SectionData              =
-//CHECK-NEXT:        00 00 00 00 90 90 90 90 - 00 00 00 00 00 00 00 00
+//CHECK:          Name: .data
+//CHECK-NEXT:     VirtualSize:
+//CHECK-NEXT:     VirtualAddress:
+//CHECK-NEXT:     RawDataSize: 16
+//CHECK-NEXT:     PointerToRawData:
+//CHECK-NEXT:     PointerToRelocations:
+//CHECK-NEXT:     PointerToLineNumbers:
+//CHECK-NEXT:     RelocationCount:
+//CHECK-NEXT:     LineNumberCount:
+//CHECK-NEXT:     Characteristics [ (0xC0400040)
+//CHECK-NEXT:       IMAGE_SCN_ALIGN_8BYTES
+//CHECK-NEXT:       IMAGE_SCN_CNT_INITIALIZED_DATA
+//CHECK-NEXT:       IMAGE_SCN_MEM_READ
+//CHECK-NEXT:       IMAGE_SCN_MEM_WRITE
+//CHECK-NEXT:     ]
+//CHECK-NEXT:     SectionData (
+//CHECK-NEXT:       0000: 00000000 90909090 00000000 00000000
+//CHECK-NEXT:     )
diff --git a/test/MC/COFF/basic-coff-64.s b/test/MC/COFF/basic-coff-64.s
new file mode 100644
index 0000000..89d1745
--- /dev/null
+++ b/test/MC/COFF/basic-coff-64.s
@@ -0,0 +1,137 @@
+// This test checks that the COFF object emitter works for the most basic
+// programs.
+
+// RUN: llvm-mc -filetype=obj -triple x86_64-pc-win32 %s | llvm-readobj -h -s -sr -sd -t | FileCheck %s
+
+.def	 _main;
+	.scl	2;
+	.type	32;
+	.endef
+	.text
+	.globl	_main
+	.align	16, 0x90
+_main:                                  # @main
+# BB#0:                                 # %entry
+	subl	$4, %esp
+	movl	$.L_.str, (%esp)
+	call	_printf
+	xorl	%eax, %eax
+	addl	$4, %esp
+	ret
+
+	.data
+.L_.str:                                # @.str
+	.asciz	"Hello World"
+
+// CHECK: ImageFileHeader {
+// CHECK:   Machine: IMAGE_FILE_MACHINE_AMD64
+// CHECK:   SectionCount: 2
+// CHECK:   TimeDateStamp: {{[0-9]+}}
+// CHECK:   PointerToSymbolTable: 0x{{[0-9A-F]+}}
+// CHECK:   SymbolCount: 6
+// CHECK:   OptionalHeaderSize: 0
+// CHECK:   Characteristics [ (0x0)
+// CHECK:   ]
+// CHECK: }
+// CHECK: Sections [
+// CHECK:   Section {
+// CHECK:     Number:               [[TextNum:[0-9]+]]
+// CHECK:     Name:                 .text
+// CHECK:     VirtualSize:          0
+// CHECK:     VirtualAddress:       0
+// CHECK:     RawDataSize:          [[TextSize:[0-9]+]]
+// CHECK:     PointerToRawData:     0x{{[0-9A-F]+}}
+// CHECK:     PointerToRelocations: 0x{{[0-9A-F]+}}
+// CHECK:     PointerToLineNumbers: 0x0
+// CHECK:     RelocationCount:      2
+// CHECK:     LineNumberCount:      0
+// CHECK:     Characteristics [ (0x60500020)
+// CHECK:       IMAGE_SCN_ALIGN_16BYTES
+// CHECK:       IMAGE_SCN_CNT_CODE
+// CHECK:       IMAGE_SCN_MEM_EXECUTE
+// CHECK:       IMAGE_SCN_MEM_READ
+// CHECK:     ]
+// CHECK:     Relocations [
+// CHECK:       0x{{[0-9A-F]+}} IMAGE_REL_AMD64_ADDR32 .data
+// CHECK:       0x{{[0-9A-F]+}} IMAGE_REL_AMD64_REL32 _printf
+// CHECK:     ]
+// CHECK:   }
+// CHECK:   Section {
+// CHECK:     Number:               [[DataNum:[0-9]+]]
+// CHECK:     Name:                 .data
+// CHECK:     VirtualSize:          0
+// CHECK:     VirtualAddress:       0
+// CHECK:     RawDataSize:          [[DataSize:[0-9]+]]
+// CHECK:     PointerToRawData:     0x{{[0-9A-F]+}}
+// CHECK:     PointerToRelocations: 0x0
+// CHECK:     PointerToLineNumbers: 0x0
+// CHECK:     RelocationCount:      0
+// CHECK:     LineNumberCount:      0
+// CHECK:     Characteristics [ (0xC0300040)
+// CHECK:       IMAGE_SCN_ALIGN_4BYTES
+// CHECK:       IMAGE_SCN_CNT_INITIALIZED_DATA
+// CHECK:       IMAGE_SCN_MEM_READ
+// CHECK:       IMAGE_SCN_MEM_WRITE
+// CHECK:     ]
+// CHECK:     Relocations [
+// CHECK:     ]
+// CHECK:     SectionData (
+// CHECK:       0000: 48656C6C 6F20576F 726C6400             |Hello World.|
+// CHECK:     )
+// CHECK:   }
+// CHECK: ]
+// CHECK: Symbols [
+// CHECK:   Symbol {
+// CHECK:     Name:           .text
+// CHECK:     Value:          0
+// CHECK:     Section:        .text
+// CHECK:     BaseType:       Null
+// CHECK:     ComplexType:    Null
+// CHECK:     StorageClass:   Static
+// CHECK:     AuxSymbolCount: 1
+// CHECK:     AuxSectionDef {
+// CHECK:       Length: [[TextSize]]
+// CHECK:       RelocationCount: 2
+// CHECK:       LineNumberCount: 0
+// CHECK:       Checksum: 0x0
+// CHECK:       Number: [[TextNum]]
+// CHECK:       Selection: 0x0
+// CHECK:     }
+// CHECK:   }
+// CHECK:   Symbol {
+// CHECK:     Name:           .data
+// CHECK:     Value:          0
+// CHECK:     Section:        .data
+// CHECK:     BaseType:       Null
+// CHECK:     ComplexType:    Null
+// CHECK:     StorageClass:   Static
+// CHECK:     AuxSymbolCount: 1
+// CHECK:     AuxSectionDef {
+// CHECK:       Length: [[DataSize]]
+// CHECK:       RelocationCount: 0
+// CHECK:       LineNumberCount: 0
+// CHECK:       Checksum: 0x0
+// CHECK:       Number: [[DataNum]]
+// CHECK:       Selection: 0x0
+// CHECK:       Unused: (00 00 00)
+// CHECK:     }
+// CHECK:   }
+// CHECK:   Symbol {
+// CHECK:     Name:           _main
+// CHECK:     Value:          0
+// CHECK:     Section:        .text
+// CHECK:     BaseType:       Null
+// CHECK:     ComplexType:    Function
+// CHECK:     StorageClass:   External
+// CHECK:     AuxSymbolCount: 0
+// CHECK:   }
+// CHECK:   Symbol {
+// CHECK:     Name:           _printf
+// CHECK:     Value:          0
+// CHECK:     Section:        (0)
+// CHECK:     BaseType:       Null
+// CHECK:     ComplexType:    Null
+// CHECK:     StorageClass:   External
+// CHECK:     AuxSymbolCount: 0
+// CHECK:   }
+// CHECK: ]
diff --git a/test/MC/COFF/basic-coff.s b/test/MC/COFF/basic-coff.s
index 23156b8..9b29970 100644
--- a/test/MC/COFF/basic-coff.s
+++ b/test/MC/COFF/basic-coff.s
@@ -1,8 +1,7 @@
 // This test checks that the COFF object emitter works for the most basic
 // programs.
 
-// RUN: llvm-mc -filetype=obj -triple i686-pc-win32 %s | coff-dump.py | FileCheck %s
-// I WOULD RUN, BUT THIS FAILS: llvm-mc -filetype=obj -triple x86_64-pc-win32 %s
+// RUN: llvm-mc -filetype=obj -triple i686-pc-win32 %s | llvm-readobj -h -s -sr -sd -t | FileCheck %s
 
 .def	 _main;
 	.scl	2;
@@ -15,119 +14,124 @@
 # BB#0:                                 # %entry
 	subl	$4, %esp
 	movl	$L_.str, (%esp)
-	calll	_printf
+	call	_printf
 	xorl	%eax, %eax
 	addl	$4, %esp
 	ret
 
 	.data
 L_.str:                                 # @.str
-	.asciz	 "Hello World"
+	.asciz	"Hello World"
 
-// CHECK: {
-// CHECK:   MachineType              = IMAGE_FILE_MACHINE_I386 (0x14C)
-// CHECK:   NumberOfSections         = 2
-// CHECK:   TimeDateStamp            = {{[0-9]+}}
-// CHECK:   PointerToSymbolTable     = 0x{{[0-9A-F]+}}
-// CHECK:   NumberOfSymbols          = 6
-// CHECK:   SizeOfOptionalHeader     = 0
-// CHECK:   Characteristics          = 0x0
-// CHECK:   Sections                 = [
-// CHECK:     1 = {
-// CHECK:       Name                     = .text
-// CHECK:       VirtualSize              = 0
-// CHECK:       VirtualAddress           = 0
-// CHECK:       SizeOfRawData            = {{[0-9]+}}
-// CHECK:       PointerToRawData         = 0x{{[0-9A-F]+}}
-// CHECK:       PointerToRelocations     = 0x{{[0-9A-F]+}}
-// CHECK:       PointerToLineNumbers     = 0x0
-// CHECK:       NumberOfRelocations      = 2
-// CHECK:       NumberOfLineNumbers      = 0
-// CHECK:       Charateristics           = 0x60500020
-// CHECK:         IMAGE_SCN_CNT_CODE
-// CHECK:         IMAGE_SCN_ALIGN_16BYTES
-// CHECK:         IMAGE_SCN_MEM_EXECUTE
-// CHECK:         IMAGE_SCN_MEM_READ
-// CHECK:       SectionData              =
-// CHECK:       Relocations              = [
-// CHECK:         0 = {
-// CHECK:           VirtualAddress           = 0x{{[0-9A-F]+}}
-// CHECK:           SymbolTableIndex         = 2
-// CHECK:           Type                     = IMAGE_REL_I386_DIR32 (6)
-// CHECK:           SymbolName               = .data
-// CHECK:         }
-// CHECK:         1 = {
-// CHECK:           VirtualAddress           = 0x{{[0-9A-F]+}}
-// CHECK:           SymbolTableIndex         = 5
-// CHECK:           Type                     = IMAGE_REL_I386_REL32 (20)
-// CHECK:           SymbolName               = _printf
-// CHECK:         }
-// CHECK:       ]
-// CHECK:     }
-// CHECK:     2 = {
-// CHECK:       Name                     = .data
-// CHECK:       VirtualSize              = 0
-// CHECK:       VirtualAddress           = 0
-// CHECK:       SizeOfRawData            = {{[0-9]+}}
-// CHECK:       PointerToRawData         = 0x{{[0-9A-F]+}}
-// CHECK:       PointerToRelocations     = 0x0
-// CHECK:       PointerToLineNumbers     = 0x0
-// CHECK:       NumberOfRelocations      = 0
-// CHECK:       NumberOfLineNumbers      = 0
-// CHECK:       Charateristics           = 0xC0300040
-// CHECK:         IMAGE_SCN_CNT_INITIALIZED_DATA
-// CHECK:         IMAGE_SCN_ALIGN_4BYTES
-// CHECK:         IMAGE_SCN_MEM_READ
-// CHECK:         IMAGE_SCN_MEM_WRITE
-// CHECK:       SectionData              =
-// CHECK:         48 65 6C 6C 6F 20 57 6F - 72 6C 64 00             |Hello World.|
-// CHECK:       Relocations              = None
-// CHECK:     }
-// CHECK:   ]
-// CHECK:   Symbols                  = [
-// CHECK:     0 = {
-// CHECK:       Name                     = .text
-// CHECK:       Value                    = 0
-// CHECK:       SectionNumber            = 1
-// CHECK:       SimpleType               = IMAGE_SYM_TYPE_NULL (0)
-// CHECK:       ComplexType              = IMAGE_SYM_DTYPE_NULL (0)
-// CHECK:       StorageClass             = IMAGE_SYM_CLASS_STATIC (3)
-// CHECK:       NumberOfAuxSymbols       = 1
-// CHECK:       AuxillaryData            =
-// CHECK:         15 00 00 00 02 00 00 00 - 00 00 00 00 01 00 00 00 |................|
-// CHECK:         00 00                                             |..|
-// CHECK:     }
-// CHECK:     2 = {
-// CHECK:       Name                     = .data
-// CHECK:       Value                    = 0
-// CHECK:       SectionNumber            = 2
-// CHECK:       SimpleType               = IMAGE_SYM_TYPE_NULL (0)
-// CHECK:       ComplexType              = IMAGE_SYM_DTYPE_NULL (0)
-// CHECK:       StorageClass             = IMAGE_SYM_CLASS_STATIC (3)
-// CHECK:       NumberOfAuxSymbols       = 1
-// CHECK:       AuxillaryData            =
-// CHECK:         0C 00 00 00 00 00 00 00 - 00 00 00 00 02 00 00 00 |................|
-// CHECK:         00 00                                             |..|
-// CHECK:     }
-// CHECK:     4 = {
-// CHECK:       Name                     = _main
-// CHECK:       Value                    = 0
-// CHECK:       SectionNumber            = 1
-// CHECK:       SimpleType               = IMAGE_SYM_TYPE_NULL (0)
-// CHECK:       ComplexType              = IMAGE_SYM_DTYPE_FUNCTION (2)
-// CHECK:       StorageClass             = IMAGE_SYM_CLASS_EXTERNAL (2)
-// CHECK:       NumberOfAuxSymbols       = 0
-// CHECK:       AuxillaryData            =
-// CHECK:     }
-// CHECK:     5 = {
-// CHECK:       Name                     = _printf
-// CHECK:       Value                    = 0
-// CHECK:       SectionNumber            = 0
-// CHECK:       SimpleType               = IMAGE_SYM_TYPE_NULL (0)
-// CHECK:       ComplexType              = IMAGE_SYM_DTYPE_NULL (0)
-// CHECK:       StorageClass             = IMAGE_SYM_CLASS_EXTERNAL (2)
-// CHECK:       NumberOfAuxSymbols       = 0
-// CHECK:       AuxillaryData            =
-// CHECK:     }
+// CHECK: ImageFileHeader {
+// CHECK:   Machine: IMAGE_FILE_MACHINE_I386
+// CHECK:   SectionCount: 2
+// CHECK:   TimeDateStamp: {{[0-9]+}}
+// CHECK:   PointerToSymbolTable: 0x{{[0-9A-F]+}}
+// CHECK:   SymbolCount: 6
+// CHECK:   OptionalHeaderSize: 0
+// CHECK:   Characteristics [ (0x0)
 // CHECK:   ]
 // CHECK: }
+// CHECK: Sections [
+// CHECK:   Section {
+// CHECK:     Number:               [[TextNum:[0-9]+]]
+// CHECK:     Name:                 .text
+// CHECK:     VirtualSize:          0
+// CHECK:     VirtualAddress:       0
+// CHECK:     RawDataSize:          {{[0-9]+}}
+// CHECK:     PointerToRawData:     0x{{[0-9A-F]+}}
+// CHECK:     PointerToRelocations: 0x{{[0-9A-F]+}}
+// CHECK:     PointerToLineNumbers: 0x0
+// CHECK:     RelocationCount:      2
+// CHECK:     LineNumberCount:      0
+// CHECK:     Characteristics [ (0x60500020)
+// CHECK:       IMAGE_SCN_ALIGN_16BYTES
+// CHECK:       IMAGE_SCN_CNT_CODE
+// CHECK:       IMAGE_SCN_MEM_EXECUTE
+// CHECK:       IMAGE_SCN_MEM_READ
+// CHECK:     ]
+// CHECK:     Relocations [
+// CHECK:       0x{{[0-9A-F]+}} IMAGE_REL_I386_DIR32 .data
+// CHECK:       0x{{[0-9A-F]+}} IMAGE_REL_I386_REL32 _printf
+// CHECK:     ]
+// CHECK:   }
+// CHECK:   Section {
+// CHECK:     Number:               [[DataNum:[0-9]+]]
+// CHECK:     Name:                 .data
+// CHECK:     VirtualSize:          0
+// CHECK:     VirtualAddress:       0
+// CHECK:     RawDataSize:          {{[0-9]+}}
+// CHECK:     PointerToRawData:     0x{{[0-9A-F]+}}
+// CHECK:     PointerToRelocations: 0x0
+// CHECK:     PointerToLineNumbers: 0x0
+// CHECK:     RelocationCount:      0
+// CHECK:     LineNumberCount:      0
+// CHECK:     Characteristics [ (0xC0300040)
+// CHECK:       IMAGE_SCN_ALIGN_4BYTES
+// CHECK:       IMAGE_SCN_CNT_INITIALIZED_DATA
+// CHECK:       IMAGE_SCN_MEM_READ
+// CHECK:       IMAGE_SCN_MEM_WRITE
+// CHECK:     ]
+// CHECK:     Relocations [
+// CHECK:     ]
+// CHECK:     SectionData (
+// CHECK:       0000: 48656C6C 6F20576F 726C6400             |Hello World.|
+// CHECK:     )
+// CHECK:   }
+// CHECK: ]
+// CHECK: Symbols [
+// CHECK:   Symbol {
+// CHECK:     Name:           .text
+// CHECK:     Value:          0
+// CHECK:     Section:        .text
+// CHECK:     BaseType:       Null
+// CHECK:     ComplexType:    Null
+// CHECK:     StorageClass:   Static
+// CHECK:     AuxSymbolCount: 1
+// CHECK:     AuxSectionDef {
+// CHECK:       Length: 21
+// CHECK:       RelocationCount: 2
+// CHECK:       LineNumberCount: 0
+// CHECK:       Checksum: 0x0
+// CHECK:       Number: 1
+// CHECK:       Selection: 0x0
+// CHECK:     }
+// CHECK:   }
+// CHECK:   Symbol {
+// CHECK:     Name:           .data
+// CHECK:     Value:          0
+// CHECK:     Section:        .data
+// CHECK:     BaseType:       Null
+// CHECK:     ComplexType:    Null
+// CHECK:     StorageClass:   Static
+// CHECK:     AuxSymbolCount: 1
+// CHECK:     AuxSectionDef {
+// CHECK:       Length: 12
+// CHECK:       RelocationCount: 0
+// CHECK:       LineNumberCount: 0
+// CHECK:       Checksum: 0x0
+// CHECK:       Number: 2
+// CHECK:       Selection: 0x0
+// CHECK:       Unused: (00 00 00)
+// CHECK:     }
+// CHECK:   }
+// CHECK:   Symbol {
+// CHECK:     Name:           _main
+// CHECK:     Value:          0
+// CHECK:     Section:        .text
+// CHECK:     BaseType:       Null
+// CHECK:     ComplexType:    Function
+// CHECK:     StorageClass:   External
+// CHECK:     AuxSymbolCount: 0
+// CHECK:   }
+// CHECK:   Symbol {
+// CHECK:     Name:           _printf
+// CHECK:     Value:          0
+// CHECK:     Section:        (0)
+// CHECK:     BaseType:       Null
+// CHECK:     ComplexType:    Null
+// CHECK:     StorageClass:   External
+// CHECK:     AuxSymbolCount: 0
+// CHECK:   }
+// CHECK: ]
diff --git a/test/MC/COFF/bss.s b/test/MC/COFF/bss.s
index 3bed13d..86294c1 100644
--- a/test/MC/COFF/bss.s
+++ b/test/MC/COFF/bss.s
@@ -1,7 +1,7 @@
 // The purpose of this test is to verify that bss sections are emited correctly.
 
-// RUN: llvm-mc -filetype=obj -triple i686-pc-win32 %s | coff-dump.py | FileCheck %s
-// RUN: llvm-mc -filetype=obj -triple x86_64-pc-win32 %s | coff-dump.py | FileCheck %s
+// RUN: llvm-mc -filetype=obj -triple i686-pc-win32 %s | llvm-readobj -s | FileCheck %s
+// RUN: llvm-mc -filetype=obj -triple x86_64-pc-win32 %s | llvm-readobj -s | FileCheck %s
 
     .bss
     .globl _g0
@@ -9,7 +9,7 @@
 _g0:
     .long 0
 
-// CHECK:      Name           = .bss
-// CHECK-NEXT: VirtualSize    = 0
-// CHECK-NEXT: VirtualAddress = 0
-// CHECK-NEXT: SizeOfRawData  = 4
+// CHECK:      Name:            .bss
+// CHECK-NEXT: VirtualSize:     0
+// CHECK-NEXT: VirtualAddress:  0
+// CHECK-NEXT: RawDataSize:     4
diff --git a/test/MC/COFF/diff.s b/test/MC/COFF/diff.s
index aa683f2..820272a 100644
--- a/test/MC/COFF/diff.s
+++ b/test/MC/COFF/diff.s
@@ -1,4 +1,4 @@
-// RUN: llvm-mc -filetype=obj -triple i686-pc-mingw32 %s | coff-dump.py | FileCheck %s
+// RUN: llvm-mc -filetype=obj -triple i686-pc-mingw32 %s | llvm-readobj -s -sr -sd | FileCheck %s
 
 	.def	 _foobar;
 	.scl	2;
@@ -21,26 +21,12 @@
 	.long	_foobar-_rust_crate
 	.long	_foobar-_rust_crate
 
-// CHECK:      Name                     = .data
-// CHECK:      SectionData              =
-// CHECK-NEXT:   00 00 00 00 00 00 00 00 - 1C 00 00 00 20 00 00 00 |............ ...|
-// CHECK:        Relocations              = [
-// CHECK-NEXT:   0 = {
-// CHECK-NEXT:     VirtualAddress           = 0x4
-// CHECK-NEXT:     SymbolTableIndex         =
-// CHECK-NEXT:     Type                     = IMAGE_REL_I386_DIR32 (6)
-// CHECK-NEXT:     SymbolName               = _foobar
-// CHECK-NEXT:   }
-// CHECK-NEXT:   1 = {
-// CHECK-NEXT:     VirtualAddress           = 0x8
-// CHECK-NEXT:     SymbolTableIndex         = 0
-// CHECK-NEXT:     Type                     = IMAGE_REL_I386_REL32 (20)
-// CHECK-NEXT:     SymbolName               = .text
-// CHECK-NEXT:   }
-// CHECK-NEXT:   2 = {
-// CHECK-NEXT:     VirtualAddress           = 0xC
-// CHECK-NEXT:     SymbolTableIndex         = 0
-// CHECK-NEXT:     Type                     = IMAGE_REL_I386_REL32 (20)
-// CHECK-NEXT:     SymbolName               = .text
-// CHECK-NEXT:   }
-// CHECK-NEXT: ]
+// CHECK:        Name: .data
+// CHECK:        Relocations [
+// CHECK-NEXT:     0x4 IMAGE_REL_I386_DIR32 _foobar
+// CHECK-NEXT:     0x8 IMAGE_REL_I386_REL32 .text
+// CHECK-NEXT:     0xC IMAGE_REL_I386_REL32 .text
+// CHECK-NEXT:   ]
+// CHECK:        SectionData (
+// CHECK-NEXT:     0000: 00000000 00000000 1C000000 20000000
+// CHECK-NEXT:   )
diff --git a/test/MC/COFF/module-asm.ll b/test/MC/COFF/module-asm.ll
index 9c6d00d..bf14dc6 100644
--- a/test/MC/COFF/module-asm.ll
+++ b/test/MC/COFF/module-asm.ll
@@ -1,26 +1,28 @@
 ; The purpose of this test is to verify that various module level assembly
 ; constructs work.
 
-; RUN: llc -filetype=obj -mtriple i686-pc-win32 %s -o - | coff-dump.py | FileCheck %s
-; RUN: llc -filetype=obj -mtriple x86_64-pc-win32 %s -o - | coff-dump.py | FileCheck %s
+; RUN: llc -filetype=obj -mtriple i686-pc-win32 %s -o - | llvm-readobj -s -sd | FileCheck %s
+; RUN: llc -filetype=obj -mtriple x86_64-pc-win32 %s -o - | llvm-readobj -s -sd | FileCheck %s
 
 module asm ".text"
 module asm "_foo:"
 module asm "  ret"
 
-; CHECK:            Name                     = .text
-; CHECK-NEXT:       VirtualSize              = 0
-; CHECK-NEXT:       VirtualAddress           = 0
-; CHECK-NEXT:       SizeOfRawData            = {{[0-9]+}}
-; CHECK-NEXT:       PointerToRawData         = 0x{{[0-9A-F]+}}
-; CHECK-NEXT:       PointerToRelocations     = 0x{{[0-9A-F]+}}
-; CHECK-NEXT:       PointerToLineNumbers     = 0x0
-; CHECK-NEXT:       NumberOfRelocations      = 0
-; CHECK-NEXT:       NumberOfLineNumbers      = 0
-; CHECK-NEXT:       Charateristics           = 0x60300020
-; CHECK-NEXT:         IMAGE_SCN_CNT_CODE
+; CHECK:            Name:                      .text
+; CHECK-NEXT:       VirtualSize:               0
+; CHECK-NEXT:       VirtualAddress:            0
+; CHECK-NEXT:       RawDataSize:               {{[0-9]+}}
+; CHECK-NEXT:       PointerToRawData:          0x{{[0-9A-F]+}}
+; CHECK-NEXT:       PointerToRelocations:      0x{{[0-9A-F]+}}
+; CHECK-NEXT:       PointerToLineNumbers:      0x0
+; CHECK-NEXT:       RelocationCount:           0
+; CHECK-NEXT:       LineNumberCount:           0
+; CHECK-NEXT:       Characteristics [ (0x60300020)
 ; CHECK-NEXT:         IMAGE_SCN_ALIGN_4BYTES
+; CHECK-NEXT:         IMAGE_SCN_CNT_CODE
 ; CHECK-NEXT:         IMAGE_SCN_MEM_EXECUTE
 ; CHECK-NEXT:         IMAGE_SCN_MEM_READ
-; CHECK-NEXT:       SectionData              =
-; CHECK-NEXT:         C3
+; CHECK-NEXT:       ]
+; CHECK-NEXT:       SectionData (
+; CHECK-NEXT:         0000: C3
+; CHECK-NEXT:       )
diff --git a/test/MC/COFF/secrel32.s b/test/MC/COFF/secrel32.s
index ce148db..deadfe0 100644
--- a/test/MC/COFF/secrel32.s
+++ b/test/MC/COFF/secrel32.s
@@ -1,14 +1,10 @@
-// RUN: llvm-mc -filetype=obj -triple i686-pc-win32 %s | coff-dump.py | FileCheck %s
+// RUN: llvm-mc -filetype=obj -triple i686-pc-win32 %s | llvm-readobj -s -sr | FileCheck %s
 
 // check that we produce the correct relocation for .secrel32
 
 Lfoo:
 	.secrel32	Lfoo
 
-// CHECK:       Relocations              = [
-// CHECK-NEXT:    0 = {
-// CHECK-NEXT:       VirtualAddress           = 0x0
-// CHECK-NEXT:       SymbolTableIndex         = 0
-// CHECK-NEXT:       Type                     = IMAGE_REL_I386_SECREL (11)
-// CHECK-NEXT:       SymbolName               = .text
-// CHECK-NEXT:     }
+// CHECK:       Relocations [
+// CHECK-NEXT:    0x0 IMAGE_REL_I386_SECREL .text
+// CHECK-NEXT:  ]
diff --git a/test/MC/COFF/seh-section.s b/test/MC/COFF/seh-section.s
index 802cba5..7f05cc3 100644
--- a/test/MC/COFF/seh-section.s
+++ b/test/MC/COFF/seh-section.s
@@ -1,24 +1,26 @@
 // This test ensures that, if the section containing a function has a suffix
 // (e.g. .text$foo), its unwind info section also has a suffix (.xdata$foo).
-// RUN: llvm-mc -filetype=obj -triple x86_64-pc-win32 %s | coff-dump.py | FileCheck %s
+// RUN: llvm-mc -filetype=obj -triple x86_64-pc-win32 %s | llvm-readobj -s -sd | FileCheck %s
 // XFAIL: *
 
-// CHECK:      Name                 = .xdata$foo
+// CHECK:      Name: .xdata$foo
 // CHECK-NEXT: VirtualSize
 // CHECK-NEXT: VirtualAddress
-// CHECK-NEXT: SizeOfRawData        = 8
+// CHECK-NEXT: RawDataSize: 8
 // CHECK-NEXT: PointerToRawData
 // CHECK-NEXT: PointerToRelocations
 // CHECK-NEXT: PointerToLineNumbers
-// CHECK-NEXT: NumberOfRelocations  = 0
-// CHECK-NEXT: NumberOfLineNumbers  = 0
-// CHECK-NEXT: Charateristics
-// CHECK-NEXT:   IMAGE_SCN_CNT_INITIALIZED_DATA
+// CHECK-NEXT: RelocationCount: 0
+// CHECK-NEXT: LineNumberCount: 0
+// CHECK-NEXT: Characteristics [
 // CHECK-NEXT:   IMAGE_SCN_ALIGN_4BYTES
+// CHECK-NEXT:   IMAGE_SCN_CNT_INITIALIZED_DATA
 // CHECK-NEXT:   IMAGE_SCN_MEM_READ
 // CHECK-NEXT:   IMAGE_SCN_MEM_WRITE
-// CHECK-NEXT: SectionData
-// CHECK-NEXT:   01 05 02 00 05 50 04 02
+// CHECK-NEXT: ]
+// CHECK-NEXT: SectionData (
+// CHECK-NEXT:   0000: 01050200 05500402
+// CHECK-NEXT: )
 
     .section .text$foo,"x"
     .globl foo
diff --git a/test/MC/COFF/seh.s b/test/MC/COFF/seh.s
index 3f72805..bef425e 100644
--- a/test/MC/COFF/seh.s
+++ b/test/MC/COFF/seh.s
@@ -1,24 +1,105 @@
 // This test checks that the SEH directives emit the correct unwind data.
-// RUN: llvm-mc -triple x86_64-pc-win32 -filetype=obj %s | coff-dump.py | FileCheck %s
 
-// CHECK:      Name                 = .xdata
-// CHECK-NEXT: VirtualSize
-// CHECK-NEXT: VirtualAddress
-// CHECK-NEXT: SizeOfRawData        = 52
-// CHECK-NEXT: PointerToRawData
-// CHECK-NEXT: PointerToRelocations
-// CHECK-NEXT: PointerToLineNumbers
-// CHECK-NEXT: NumberOfRelocations  = 4
-// CHECK-NEXT: NumberOfLineNumbers  = 0
-// CHECK-NEXT: Charateristics
-// CHECK-NEXT:   IMAGE_SCN_CNT_INITIALIZED_DATA
-// CHECK-NEXT:   IMAGE_SCN_ALIGN_4BYTES
-// CHECK-NEXT:   IMAGE_SCN_MEM_READ
-// CHECK-NEXT: SectionData
-// CHECK-NEXT:   09 12 08 03 00 03 0F 30 - 0E 88 00 00 09 64 02 00
-// CHECK-NEXT:   04 22 00 1A 00 00 00 00 - 00 00 00 00 21 00 00 00
-// CHECK-NEXT:   00 00 00 00 1B 00 00 00 - 00 00 00 00 01 00 00 00
-// CHECK-NEXT:   00 00 00 00
+// TODO: Expected fail because SET_FPREG has a wrong offset.
+// XFAIL: *
+// RUN: llvm-mc -triple x86_64-pc-win32 -filetype=obj %s | llvm-readobj -s -u | FileCheck %s
+
+// CHECK:      Sections [
+// CHECK:        Section {
+// CHECK:          Name: .text
+// CHECK:          RelocationCount: 0
+// CHECK:          Characteristics [
+// CHECK-NEXT:       ALIGN_4BYTES
+// CHECK-NEXT:       CNT_CODE
+// CHECK-NEXT:       MEM_EXECUTE
+// CHECK-NEXT:       MEM_READ
+// CHECK-NEXT:     ]
+// CHECK-NEXT:   }
+// CHECK:        Section {
+// CHECK:          Name: .xdata
+// CHECK:          RawDataSize: 52
+// CHECK:          RelocationCount: 4
+// CHECK:          Characteristics [
+// CHECK-NEXT:       ALIGN_4BYTES
+// CHECK-NEXT:       CNT_INITIALIZED_DATA
+// CHECK-NEXT:       MEM_READ
+// CHECK-NEXT:     ]
+// CHECK-NEXT:   }
+// CHECK:        Section {
+// CHECK:          Name: .pdata
+// CHECK:          RelocationCount: 9
+// CHECK:          Characteristics [
+// CHECK-NEXT:       ALIGN_4BYTES
+// CHECK-NEXT:       CNT_INITIALIZED_DATA
+// CHECK-NEXT:       MEM_READ
+// CHECK-NEXT:     ]
+// CHECK-NEXT:   }
+// CHECK-NEXT: ]
+
+// CHECK:      UnwindInformation [
+// CHECK-NEXT:   RuntimeFunction {
+// CHECK-NEXT:     StartAddress: [[CodeSect1:[^ ]+]] [[BeginDisp1:(\+0x[A-F0-9]+)?]]
+// CHECK-NEXT:     EndAddress: [[CodeSect1]] [[EndDisp1:(\+0x[A-F0-9]+)?]]
+// CHECK-NEXT:     UnwindInfoAddress:
+// CHECK-NEXT:     UnwindInfo {
+// CHECK-NEXT:       Version: 1
+// CHECK-NEXT:       Flags [
+// CHECK-NEXT:         ExceptionHandler
+// CHECK-NEXT:       ]
+// CHECK-NEXT:       PrologSize: 18
+// CHECK-NEXT:       FrameRegister: RBX
+// CHECK-NEXT:       FrameOffset: 0x0
+// CHECK-NEXT:       UnwindCodeCount: 8
+// CHECK-NEXT:       UnwindCodes [
+// CHECK-NEXT:         0x12: SET_FPREG reg=RBX, offset=0x0
+// CHECK-NEXT:         0x0F: PUSH_NONVOL reg=RBX
+// CHECK-NEXT:         0x0E: SAVE_XMM128 reg=XMM8, offset=0x0
+// CHECK-NEXT:         0x09: SAVE_NONVOL reg=RSI, offset=0x10
+// CHECK-NEXT:         0x04: ALLOC_SMALL size=24
+// CHECK-NEXT:         0x00: PUSH_MACHFRAME errcode=yes
+// CHECK-NEXT:       ]
+// CHECK-NEXT:       Handler: __C_specific_handler
+// CHECK-NEXT:     }
+// CHECK-NEXT:   }
+// CHECK-NEXT:   RuntimeFunction {
+// CHECK-NEXT:     StartAddress: [[CodeSect2:[^ ]+]] [[BeginDisp2:(\+0x[A-F0-9]+)?]]
+// CHECK-NEXT:     EndAddress: [[CodeSect2]] [[BeginDisp2:(\+0x[A-F0-9]+)?]]
+// CHECK-NEXT:     UnwindInfoAddress:
+// CHECK-NEXT:     UnwindInfo {
+// CHECK-NEXT:       Version: 1
+// CHECK-NEXT:       Flags [
+// CHECK-NEXT:         ChainInfo
+// CHECK-NEXT:       ]
+// CHECK-NEXT:       PrologSize: 0
+// CHECK-NEXT:       FrameRegister: -
+// CHECK-NEXT:       FrameOffset: -
+// CHECK-NEXT:       UnwindCodeCount: 0
+// CHECK-NEXT:       UnwindCodes [
+// CHECK-NEXT:       ]
+// CHECK-NEXT:       Chained {
+// CHECK-NEXT:         StartAddress: [[CodeSect1]] [[BeginDisp1]]
+// CHECK-NEXT:         EndAddress: [[CodeSect1]] [[EndDisp1]]
+// CHECK-NEXT:         UnwindInfoAddress:
+// CHECK-NEXT:       }
+// CHECK-NEXT:     }
+// CHECK-NEXT:   }
+// CHECK-NEXT:   RuntimeFunction {
+// CHECK-NEXT:     StartAddress: [[CodeSect3:[^ ]+]] [[BeginDisp3:(\+0x[A-F0-9]+)?]]
+// CHECK-NEXT:     EndAddress: [[CodeSect3]] [[BeginDisp3:(\+0x[A-F0-9]+)?]]
+// CHECK-NEXT:     UnwindInfoAddress:
+// CHECK-NEXT:     UnwindInfo {
+// CHECK-NEXT:       Version: 1
+// CHECK-NEXT:       Flags [
+// CHECK-NEXT:       ]
+// CHECK-NEXT:       PrologSize: 0
+// CHECK-NEXT:       FrameRegister: -
+// CHECK-NEXT:       FrameOffset: -
+// CHECK-NEXT:       UnwindCodeCount: 0
+// CHECK-NEXT:       UnwindCodes [
+// CHECK-NEXT:       ]
+// CHECK-NEXT:     }
+// CHECK-NEXT:   }
+// CHECK-NEXT: ]
 
     .text
     .globl func
diff --git a/test/MC/COFF/simple-fixups.s b/test/MC/COFF/simple-fixups.s
index 4c9b4d4..2a74f21 100644
--- a/test/MC/COFF/simple-fixups.s
+++ b/test/MC/COFF/simple-fixups.s
@@ -1,8 +1,8 @@
 // The purpose of this test is to verify that we do not produce unneeded
 // relocations when symbols are in the same section and we know their offset.
 
-// RUN: llvm-mc -filetype=obj -triple i686-pc-win32 %s | coff-dump.py | FileCheck %s
-// I WOULD RUN, BUT THIS FAILS: llvm-mc -filetype=obj -triple x86_64-pc-win32 %s | coff-dump.py | FileCheck %s
+// RUN: llvm-mc -filetype=obj -triple i686-pc-win32 %s | llvm-readobj -s | FileCheck %s
+// RUN: llvm-mc -filetype=obj -triple x86_64-pc-win32 %s | llvm-readobj -s | FileCheck %s
 
 	.def	 _foo;
 	.scl	2;
@@ -41,10 +41,9 @@
 # BB#0:                                 # %e
 	subl	$4, %esp
 Ltmp0:
-	calll	_baz
+	call	_baz
 	addl	$4, %esp
 	ret
 
-// CHECK:     Sections = [
-// CHECK-NOT: NumberOfRelocations = {{[^0]}}
-// CHECK:     Symbols = [
+// CHECK:     Sections [
+// CHECK-NOT: RelocationCount: {{[^0]}}
diff --git a/test/MC/COFF/symbol-alias.s b/test/MC/COFF/symbol-alias.s
index 4b1772c..ccada37 100644
--- a/test/MC/COFF/symbol-alias.s
+++ b/test/MC/COFF/symbol-alias.s
@@ -1,9 +1,9 @@
 // The purpose of this test is to verify that symbol aliases
-// (@foo = alias <type> @bar) generate the correct entries in the symbol table.
+// (@foo:  alias <type> @bar) generate the correct entries in the symbol table.
 // They should be identical except for the name.
 
-// RUN: llvm-mc -filetype=obj -triple i686-pc-win32 %s | coff-dump.py | FileCheck %s
-// RUN: llvm-mc -filetype=obj -triple x86_64-pc-win32 %s | coff-dump.py | FileCheck %s
+// RUN: llvm-mc -filetype=obj -triple i686-pc-win32 %s | llvm-readobj -t | FileCheck %s
+// RUN: llvm-mc -filetype=obj -triple x86_64-pc-win32 %s | llvm-readobj -t | FileCheck %s
 
 	.def	 _foo;
 	.scl	2;
@@ -31,43 +31,43 @@
 	.globl	_bar_alias
 _bar_alias = _bar
 
-// CHECK:      Name               = {{_?}}foo
-// CHECK-NEXT: Value              = [[FOO_VALUE:.*$]]
-// CHECK-NEXT: SectionNumber      = [[FOO_SECTION_NUMBER:.*$]]
-// CHECK-NEXT: SimpleType         = [[FOO_SIMPLE_TYPE:.*$]]
-// CHECK-NEXT: ComplexType        = [[FOO_COMPLEX_TYPE:.*$]]
-// CHECK-NEXT: StorageClass       = [[FOO_STORAGE_CLASS:.*$]]
-// CHECK-NEXT: NumberOfAuxSymbols = [[FOO_NUMBER_OF_AUX_SYMBOLS:.*$]]
+// CHECK:      Name:                {{_?}}foo
+// CHECK-NEXT: Value:               [[FOO_VALUE:.*$]]
+// CHECK-NEXT: Section:             [[FOO_SECTION_NUMBER:.*$]]
+// CHECK-NEXT: BaseType:            [[FOO_SIMPLE_TYPE:.*$]]
+// CHECK-NEXT: ComplexType:         [[FOO_COMPLEX_TYPE:.*$]]
+// CHECK-NEXT: StorageClass:        [[FOO_STORAGE_CLASS:.*$]]
+// CHECK-NEXT: AuxSymbolCount:      [[FOO_NUMBER_OF_AUX_SYMBOLS:.*$]]
 
-// CHECK:      Name               = {{_?}}bar
-// CHECK-NEXT: Value              = [[BAR_VALUE:.*$]]
-// CHECK-NEXT: SectionNumber      = [[BAR_SECTION_NUMBER:.*$]]
-// CHECK-NEXT: SimpleType         = [[BAR_SIMPLE_TYPE:.*$]]
-// CHECK-NEXT: ComplexType        = [[BAR_COMPLEX_TYPE:.*$]]
-// CHECK-NEXT: StorageClass       = [[BAR_STORAGE_CLASS:.*$]]
-// CHECK-NEXT: NumberOfAuxSymbols = [[BAR_NUMBER_OF_AUX_SYMBOLS:.*$]]
+// CHECK:      Name:                {{_?}}bar
+// CHECK-NEXT: Value:               [[BAR_VALUE:.*$]]
+// CHECK-NEXT: Section:             [[BAR_SECTION_NUMBER:.*$]]
+// CHECK-NEXT: BaseType:            [[BAR_SIMPLE_TYPE:.*$]]
+// CHECK-NEXT: ComplexType:         [[BAR_COMPLEX_TYPE:.*$]]
+// CHECK-NEXT: StorageClass:        [[BAR_STORAGE_CLASS:.*$]]
+// CHECK-NEXT: AuxSymbolCount:      [[BAR_NUMBER_OF_AUX_SYMBOLS:.*$]]
 
-// CHECK:      Name               = {{_?}}foo_alias
-// CHECK-NEXT: Value              = [[FOO_VALUE]]
-// CHECK-NEXT: SectionNumber      = [[FOO_SECTION_NUMBER]]
-// CHECK-NEXT: SimpleType         = [[FOO_SIMPLE_TYPE]]
-// CHECK-NEXT: ComplexType        = [[FOO_COMPLEX_TYPE]]
-// CHECK-NEXT: StorageClass       = [[FOO_STORAGE_CLASS]]
-// CHECK-NEXT: NumberOfAuxSymbols = [[FOO_NUMBER_OF_AUX_SYMBOLS]]
+// CHECK:      Name:                {{_?}}foo_alias
+// CHECK-NEXT: Value:               [[FOO_VALUE]]
+// CHECK-NEXT: Section:             [[FOO_SECTION_NUMBER]]
+// CHECK-NEXT: BaseType:            [[FOO_SIMPLE_TYPE]]
+// CHECK-NEXT: ComplexType:         [[FOO_COMPLEX_TYPE]]
+// CHECK-NEXT: StorageClass:        [[FOO_STORAGE_CLASS]]
+// CHECK-NEXT: AuxSymbolCount:      [[FOO_NUMBER_OF_AUX_SYMBOLS]]
 
-// CHECK:      Name               = {{_?}}bar_alias_alias
-// CHECK-NEXT: Value              = [[BAR_VALUE]]
-// CHECK-NEXT: SectionNumber      = [[BAR_SECTION_NUMBER]]
-// CHECK-NEXT: SimpleType         = [[BAR_SIMPLE_TYPE]]
-// CHECK-NEXT: ComplexType        = [[BAR_COMPLEX_TYPE]]
-// CHECK-NEXT: StorageClass       = [[BAR_STORAGE_CLASS]]
-// CHECK-NEXT: NumberOfAuxSymbols = [[BAR_NUMBER_OF_AUX_SYMBOLS]]
+// CHECK:      Name:                {{_?}}bar_alias_alias
+// CHECK-NEXT: Value:               [[BAR_VALUE]]
+// CHECK-NEXT: Section:             [[BAR_SECTION_NUMBER]]
+// CHECK-NEXT: BaseType:            [[BAR_SIMPLE_TYPE]]
+// CHECK-NEXT: ComplexType:         [[BAR_COMPLEX_TYPE]]
+// CHECK-NEXT: StorageClass:        [[BAR_STORAGE_CLASS]]
+// CHECK-NEXT: AuxSymbolCount:      [[BAR_NUMBER_OF_AUX_SYMBOLS]]
 
-// CHECK:      Name               = {{_?}}bar_alias
-// CHECK-NEXT: Value              = [[BAR_VALUE]]
-// CHECK-NEXT: SectionNumber      = [[BAR_SECTION_NUMBER]]
-// CHECK-NEXT: SimpleType         = [[BAR_SIMPLE_TYPE]]
-// CHECK-NEXT: ComplexType        = [[BAR_COMPLEX_TYPE]]
-// CHECK-NEXT: StorageClass       = [[BAR_STORAGE_CLASS]]
-// CHECK-NEXT: NumberOfAuxSymbols = [[BAR_NUMBER_OF_AUX_SYMBOLS]]
+// CHECK:      Name:                {{_?}}bar_alias
+// CHECK-NEXT: Value:               [[BAR_VALUE]]
+// CHECK-NEXT: Section:             [[BAR_SECTION_NUMBER]]
+// CHECK-NEXT: BaseType:            [[BAR_SIMPLE_TYPE]]
+// CHECK-NEXT: ComplexType:         [[BAR_COMPLEX_TYPE]]
+// CHECK-NEXT: StorageClass:        [[BAR_STORAGE_CLASS]]
+// CHECK-NEXT: AuxSymbolCount:      [[BAR_NUMBER_OF_AUX_SYMBOLS]]
 
diff --git a/test/MC/COFF/symbol-fragment-offset-64.s b/test/MC/COFF/symbol-fragment-offset-64.s
new file mode 100644
index 0000000..b824470
--- /dev/null
+++ b/test/MC/COFF/symbol-fragment-offset-64.s
@@ -0,0 +1,168 @@
+// The purpose of this test is to see if the COFF object writer is emitting the
+// proper relocations for multiple pieces of data in a single data fragment.
+
+// RUN: llvm-mc -filetype=obj -triple x86_64-pc-win32 %s | llvm-readobj -h -s -sr -sd -t | FileCheck %s
+
+.def	 _main;
+	.scl	2;
+	.type	32;
+	.endef
+	.text
+	.globl	_main
+	.align	16, 0x90
+_main:                                  # @main
+# BB#0:                                 # %entry
+	subl	$4, %esp
+	movl	$.L_.str0, (%esp)
+	callq	_printf
+	movl	$.L_.str1, (%esp)
+	callq	_puts
+	movl	$.L_.str2, (%esp)
+	callq	_puts
+	xorl	%eax, %eax
+	addl	$4, %esp
+	ret
+
+	.data
+.L_.str0:                                # @.str0
+	.asciz	 "Hello "
+
+.L_.str1:                                # @.str1
+	.asciz	 "World!"
+
+	.align	16                      # @.str2
+.L_.str2:
+	.asciz	 "I'm The Last Line."
+
+// CHECK: {
+// CHECK:   Machine:                   IMAGE_FILE_MACHINE_AMD64
+// CHECK:   SectionCount:              2
+// CHECK:   TimeDateStamp:             {{[0-9]+}}
+// CHECK:   PointerToSymbolTable:      0x{{[0-9A-F]+}}
+// CHECK:   SymbolCount:               7
+// CHECK:   OptionalHeaderSize:        0
+// CHECK:   Characteristics [ (0x0)
+// CHECK:   ]
+// CHECK: }
+// CHECK: Sections [
+// CHECK:   Section {
+// CHECK:     Number:                    1
+// CHECK:     Name:                      .text
+// CHECK:     VirtualSize:               0
+// CHECK:     VirtualAddress:            0
+// CHECK:     RawDataSize:               {{[0-9]+}}
+// CHECK:     PointerToRawData:          0x{{[0-9A-F]+}}
+// CHECK:     PointerToRelocations:      0x{{[0-9A-F]+}}
+// CHECK:     PointerToLineNumbers:      0x0
+// CHECK:     RelocationCount:           6
+// CHECK:     LineNumberCount:           0
+// CHECK:     Characteristics [ (0x60500020)
+// CHECK:       IMAGE_SCN_ALIGN_16BYTES
+// CHECK:       IMAGE_SCN_CNT_CODE
+// CHECK:       IMAGE_SCN_MEM_EXECUTE
+// CHECK:       IMAGE_SCN_MEM_READ
+// CHECK:     ]
+// CHECK:     Relocations [
+// CHECK:       0x7  IMAGE_REL_AMD64_ADDR32 .data
+// CHECK:       0xC  IMAGE_REL_AMD64_REL32 _printf
+// CHECK:       0x14 IMAGE_REL_AMD64_ADDR32 .data
+// CHECK:       0x19 IMAGE_REL_AMD64_REL32 _puts
+// CHECK:       0x21 IMAGE_REL_AMD64_ADDR32 .data
+// CHECK:       0x26 IMAGE_REL_AMD64_REL32 _puts
+// CHECK:     ]
+// CHECK:     SectionData (
+// CHECK:       0000: 83EC0467 C7042400 000000E8 00000000
+// CHECK:       0010: 67C70424 07000000 E8000000 0067C704
+// CHECK:       0020: 24100000 00E80000 000031C0 83C404C3
+// CHECK:     )
+// CHECK:   }
+// CHECK:   Section {
+// CHECK:     Number:                    2
+// CHECK:     Name:                      .data
+// CHECK:     VirtualSize:               0
+// CHECK:     VirtualAddress:            0
+// CHECK:     RawDataSize:               {{[0-9]+}}
+// CHECK:     PointerToRawData:          0x{{[0-9A-F]+}}
+// CHECK:     PointerToRelocations:      0x0
+// CHECK:     PointerToLineNumbers:      0x0
+// CHECK:     RelocationCount:           0
+// CHECK:     LineNumberCount:           0
+// CHECK:     Characteristics [ (0xC0500040)
+// CHECK:       IMAGE_SCN_ALIGN_16BYTES
+// CHECK:       IMAGE_SCN_CNT_INITIALIZED_DATA
+// CHECK:       IMAGE_SCN_MEM_READ
+// CHECK:       IMAGE_SCN_MEM_WRITE
+// CHECK:     Relocations [
+// CHECK:     ]
+// CHECK:     SectionData (
+// CHECK:       0000: 48656C6C 6F200057 6F726C64 21000000 |Hello .World!...|
+// CHECK:       0010: 49276D20 54686520 4C617374 204C696E |I'm The Last Lin|
+// CHECK:       0020: 652E00                              |e..|
+// CHECK:     )
+// CHECK:   }
+// CHECK: ]
+// CHECK: Symbols [
+// CHECK:   Symbol {
+// CHECK:     Name:                      .text
+// CHECK:     Value:                     0
+// CHECK:     Section:                   .text
+// CHECK:     BaseType:                  Null
+// CHECK:     ComplexType:               Null
+// CHECK:     StorageClass:              Static
+// CHECK:     AuxSymbolCount:            1
+// CHECK:     AuxSectionDef {
+// CHECK:       Length: 48
+// CHECK:       RelocationCount: 6
+// CHECK:       LineNumberCount: 0
+// CHECK:       Checksum: 0x0
+// CHECK:       Number: 1
+// CHECK:       Selection: 0x0
+// CHECK:       Unused: (00 00 00)
+// CHECK:     }
+// CHECK:   }
+// CHECK:   Symbol {
+// CHECK:     Name:                      .data
+// CHECK:     Value:                     0
+// CHECK:     Section:                   .data
+// CHECK:     BaseType:                  Null
+// CHECK:     ComplexType:               Null
+// CHECK:     StorageClass:              Static
+// CHECK:     AuxSymbolCount:            1
+// CHECK:     AuxSectionDef {
+// CHECK:       Length: 35
+// CHECK:       RelocationCount: 0
+// CHECK:       LineNumberCount: 0
+// CHECK:       Checksum: 0x0
+// CHECK:       Number: 2
+// CHECK:       Selection: 0x0
+// CHECK:       Unused: (00 00 00)
+// CHECK:     }
+// CHECK:   }
+// CHECK:   Symbol {
+// CHECK:     Name:                      _main
+// CHECK:     Value:                     0
+// CHECK:     Section:                   .text
+// CHECK:     BaseType:                  Null
+// CHECK:     ComplexType:               Function
+// CHECK:     StorageClass:              External
+// CHECK:     AuxSymbolCount:            0
+// CHECK:   }
+// CHECK:   Symbol {
+// CHECK:     Name:                      _printf
+// CHECK:     Value:                     0
+// CHECK:     Section:                   (0)
+// CHECK:     BaseType:                  Null
+// CHECK:     ComplexType:               Null
+// CHECK:     StorageClass:              External
+// CHECK:     AuxSymbolCount:            0
+// CHECK:   }
+// CHECK:   Symbol {
+// CHECK:     Name:                      _puts
+// CHECK:     Value:                     0
+// CHECK:     Section:                   (0)
+// CHECK:     BaseType:                  Null
+// CHECK:     ComplexType:               Null
+// CHECK:     StorageClass:              External
+// CHECK:     AuxSymbolCount:            0
+// CHECK:   }
+// CHECK: ]
diff --git a/test/MC/COFF/symbol-fragment-offset.s b/test/MC/COFF/symbol-fragment-offset.s
index 1df8baa..71b1703 100644
--- a/test/MC/COFF/symbol-fragment-offset.s
+++ b/test/MC/COFF/symbol-fragment-offset.s
@@ -1,8 +1,7 @@
 // The purpose of this test is to see if the COFF object writer is emitting the
 // proper relocations for multiple pieces of data in a single data fragment.
 
-// RUN: llvm-mc -filetype=obj -triple i686-pc-win32 %s | coff-dump.py | FileCheck %s
-// I WOULD RUN, BUT THIS FAILS: llvm-mc -filetype=obj -triple x86_64-pc-win32 %s
+// RUN: llvm-mc -filetype=obj -triple i686-pc-win32 %s | llvm-readobj -h -s -sr -sd -t | FileCheck %s
 
 .def	 _main;
 	.scl	2;
@@ -36,152 +35,134 @@
 	.asciz	 "I'm The Last Line."
 
 // CHECK: {
-// CHECK:   MachineType              = IMAGE_FILE_MACHINE_I386 (0x14C)
-// CHECK:   NumberOfSections         = 2
-// CHECK:   TimeDateStamp            = {{[0-9]+}}
-// CHECK:   PointerToSymbolTable     = 0x{{[0-9A-F]+}}
-// CHECK:   NumberOfSymbols          = 7
-// CHECK:   SizeOfOptionalHeader     = 0
-// CHECK:   Characteristics          = 0x0
-// CHECK:   Sections                 = [
-// CHECK:     1 = {
-// CHECK:       Name                     = .text
-// CHECK:       VirtualSize              = 0
-// CHECK:       VirtualAddress           = 0
-// CHECK:       SizeOfRawData            = {{[0-9]+}}
-// CHECK:       PointerToRawData         = 0x{{[0-9A-F]+}}
-// CHECK:       PointerToRelocations     = 0x{{[0-9A-F]+}}
-// CHECK:       PointerToLineNumbers     = 0x0
-// CHECK:       NumberOfRelocations      = 6
-// CHECK:       NumberOfLineNumbers      = 0
-// CHECK:       Charateristics           = 0x60500020
-// CHECK:         IMAGE_SCN_CNT_CODE
-// CHECK:         IMAGE_SCN_ALIGN_16BYTES
-// CHECK:         IMAGE_SCN_MEM_EXECUTE
-// CHECK:         IMAGE_SCN_MEM_READ
-// CHECK:       SectionData              =
-// CHECK:         83 EC 04 C7 04 24 00 00 - 00 00 E8 00 00 00 00 C7 |.....$..........|
-// CHECK:         04 24 07 00 00 00 E8 00 - 00 00 00 C7 04 24 10 00 |.$...........$..|
-// CHECK:         00 00 E8 00 00 00 00 31 - C0 83 C4 04 C3 |.......1.....|
-// CHECK:       Relocations              = [
-// CHECK:         0 = {
-// CHECK:           VirtualAddress           = 0x6
-// CHECK:           SymbolTableIndex         = 2
-// CHECK:           Type                     = IMAGE_REL_I386_DIR32 (6)
-// CHECK:           SymbolName               = .data
-// CHECK:         }
-// CHECK:         1 = {
-// CHECK:           VirtualAddress           = 0xB
-// CHECK:           SymbolTableIndex         = 5
-// CHECK:           Type                     = IMAGE_REL_I386_REL32 (20)
-// CHECK:           SymbolName               = _printf
-// CHECK:         }
-// CHECK:         2 = {
-// CHECK:           VirtualAddress           = 0x12
-// CHECK:           SymbolTableIndex         = 2
-// CHECK:           Type                     = IMAGE_REL_I386_DIR32 (6)
-// CHECK:           SymbolName               = .data
-// CHECK:         }
-// CHECK:         3 = {
-// CHECK:           VirtualAddress           = 0x17
-// CHECK:           SymbolTableIndex         = 6
-// CHECK:           Type                     = IMAGE_REL_I386_REL32 (20)
-// CHECK:           SymbolName               = _puts
-// CHECK:         }
-// CHECK:         4 = {
-// CHECK:           VirtualAddress           = 0x1E
-// CHECK:           SymbolTableIndex         = 2
-// CHECK:           Type                     = IMAGE_REL_I386_DIR32 (6)
-// CHECK:           SymbolName               = .data
-// CHECK:         }
-// CHECK:         5 = {
-// CHECK:           VirtualAddress           = 0x23
-// CHECK:           SymbolTableIndex         = 6
-// CHECK:           Type                     = IMAGE_REL_I386_REL32 (20)
-// CHECK:           SymbolName               = _puts
-// CHECK:         }
-// CHECK:       ]
-// CHECK:     }
-// CHECK:     2 = {
-// CHECK:       Name                     = .data
-// CHECK:       VirtualSize              = 0
-// CHECK:       VirtualAddress           = 0
-// CHECK:       SizeOfRawData            = {{[0-9]+}}
-// CHECK:       PointerToRawData         = 0x{{[0-9A-F]+}}
-// CHECK:       PointerToRelocations     = 0x0
-// CHECK:       PointerToLineNumbers     = 0x0
-// CHECK:       NumberOfRelocations      = 0
-// CHECK:       NumberOfLineNumbers      = 0
-// CHECK:       Charateristics           = 0xC0500040
-// CHECK:         IMAGE_SCN_CNT_INITIALIZED_DATA
-// CHECK:         IMAGE_SCN_ALIGN_16BYTES
-// CHECK:         IMAGE_SCN_MEM_READ
-// CHECK:         IMAGE_SCN_MEM_WRITE
-// CHECK:       SectionData              =
-// CHECK:         48 65 6C 6C 6F 20 00 57 - 6F 72 6C 64 21 00 00 00 |Hello .World!...|
-// CHECK:         49 27 6D 20 54 68 65 20 - 4C 61 73 74 20 4C 69 6E |I'm The Last Lin|
-// CHECK:         65 2E 00                                          |e..|
-// CHECK:       Relocations              = None
-// CHECK:     }
-// CHECK:   ]
-// CHECK:   Symbols                  = [
-// CHECK:     0 = {
-// CHECK:       Name                     = .text
-// CHECK:       Value                    = 0
-// CHECK:       SectionNumber            = 1
-// CHECK:       SimpleType               = IMAGE_SYM_TYPE_NULL (0)
-// CHECK:       ComplexType              = IMAGE_SYM_DTYPE_NULL (0)
-// CHECK:       StorageClass             = IMAGE_SYM_CLASS_STATIC (3)
-// CHECK:       NumberOfAuxSymbols       = 1
-// CHECK:       AuxillaryData            =
-// CHECK:         2D 00 00 00 06 00 00 00 - 00 00 00 00 01 00 00 00 |-...............|
-// CHECK:         00 00                                             |..|
-
-// CHECK:     }
-// CHECK:     2 = {
-// CHECK:       Name                     = .data
-// CHECK:       Value                    = 0
-// CHECK:       SectionNumber            = 2
-// CHECK:       SimpleType               = IMAGE_SYM_TYPE_NULL (0)
-// CHECK:       ComplexType              = IMAGE_SYM_DTYPE_NULL (0)
-// CHECK:       StorageClass             = IMAGE_SYM_CLASS_STATIC (3)
-// CHECK:       NumberOfAuxSymbols       = 1
-// CHECK:       AuxillaryData            =
-// CHECK:         23 00 00 00 00 00 00 00 - 00 00 00 00 02 00 00 00 |#...............|
-// CHECK:         00 00                                             |..|
-
-// CHECK:     }
-// CHECK:     4 = {
-// CHECK:       Name                     = _main
-// CHECK:       Value                    = 0
-// CHECK:       SectionNumber            = 1
-// CHECK:       SimpleType               = IMAGE_SYM_TYPE_NULL (0)
-// CHECK:       ComplexType              = IMAGE_SYM_DTYPE_FUNCTION (2)
-// CHECK:       StorageClass             = IMAGE_SYM_CLASS_EXTERNAL (2)
-// CHECK:       NumberOfAuxSymbols       = 0
-// CHECK:       AuxillaryData            =
-
-// CHECK:     5 = {
-// CHECK:       Name                     = _printf
-// CHECK:       Value                    = 0
-// CHECK:       SectionNumber            = 0
-// CHECK:       SimpleType               = IMAGE_SYM_TYPE_NULL (0)
-// CHECK:       ComplexType              = IMAGE_SYM_DTYPE_NULL (0)
-// CHECK:       StorageClass             = IMAGE_SYM_CLASS_EXTERNAL (2)
-// CHECK:       NumberOfAuxSymbols       = 0
-// CHECK:       AuxillaryData            =
-
-// CHECK:     }
-// CHECK:     6 = {
-// CHECK:       Name                     = _puts
-// CHECK:       Value                    = 0
-// CHECK:       SectionNumber            = 0
-// CHECK:       SimpleType               = IMAGE_SYM_TYPE_NULL (0)
-// CHECK:       ComplexType              = IMAGE_SYM_DTYPE_NULL (0)
-// CHECK:       StorageClass             = IMAGE_SYM_CLASS_EXTERNAL (2)
-// CHECK:       NumberOfAuxSymbols       = 0
-// CHECK:       AuxillaryData            =
-
-// CHECK:     }
+// CHECK:   Machine:                   IMAGE_FILE_MACHINE_I386 (0x14C)
+// CHECK:   SectionCount:              2
+// CHECK:   TimeDateStamp:             {{[0-9]+}}
+// CHECK:   PointerToSymbolTable:      0x{{[0-9A-F]+}}
+// CHECK:   SymbolCount:               7
+// CHECK:   OptionalHeaderSize:        0
+// CHECK:   Characteristics [ (0x0)
 // CHECK:   ]
 // CHECK: }
+// CHECK: Sections [
+// CHECK:   Section {
+// CHECK:     Number:                    1
+// CHECK:     Name:                      .text
+// CHECK:     VirtualSize:               0
+// CHECK:     VirtualAddress:            0
+// CHECK:     RawDataSize:               {{[0-9]+}}
+// CHECK:     PointerToRawData:          0x{{[0-9A-F]+}}
+// CHECK:     PointerToRelocations:      0x{{[0-9A-F]+}}
+// CHECK:     PointerToLineNumbers:      0x0
+// CHECK:     RelocationCount:           6
+// CHECK:     LineNumberCount:           0
+// CHECK:     Characteristics [ (0x60500020)
+// CHECK:       IMAGE_SCN_ALIGN_16BYTES
+// CHECK:       IMAGE_SCN_CNT_CODE
+// CHECK:       IMAGE_SCN_MEM_EXECUTE
+// CHECK:       IMAGE_SCN_MEM_READ
+// CHECK:     ]
+// CHECK:     Relocations [
+// CHECK:       0x6  IMAGE_REL_I386_DIR32 .data
+// CHECK:       0xB  IMAGE_REL_I386_REL32 _printf
+// CHECK:       0x12 IMAGE_REL_I386_DIR32 .data
+// CHECK:       0x17 IMAGE_REL_I386_REL32 _puts
+// CHECK:       0x1E IMAGE_REL_I386_DIR32 .data
+// CHECK:       0x23 IMAGE_REL_I386_REL32 _puts
+// CHECK:     ]
+// CHECK:     SectionData (
+// CHECK:       0000: 83EC04C7 04240000 0000E800 000000C7 |.....$..........|
+// CHECK:       0010: 04240700 0000E800 000000C7 04241000 |.$...........$..|
+// CHECK:       0020: 0000E800 00000031 C083C404 C3       |.......1.....|
+// CHECK:     )
+// CHECK:   }
+// CHECK:   Section {
+// CHECK:     Number:                    2
+// CHECK:     Name:                      .data
+// CHECK:     VirtualSize:               0
+// CHECK:     VirtualAddress:            0
+// CHECK:     RawDataSize:               {{[0-9]+}}
+// CHECK:     PointerToRawData:          0x{{[0-9A-F]+}}
+// CHECK:     PointerToRelocations:      0x0
+// CHECK:     PointerToLineNumbers:      0x0
+// CHECK:     RelocationCount:           0
+// CHECK:     LineNumberCount:           0
+// CHECK:     Characteristics [ (0xC0500040)
+// CHECK:       IMAGE_SCN_ALIGN_16BYTES
+// CHECK:       IMAGE_SCN_CNT_INITIALIZED_DATA
+// CHECK:       IMAGE_SCN_MEM_READ
+// CHECK:       IMAGE_SCN_MEM_WRITE
+// CHECK:     Relocations [
+// CHECK:     ]
+// CHECK:     SectionData (
+// CHECK:       0000: 48656C6C 6F200057 6F726C64 21000000 |Hello .World!...|
+// CHECK:       0010: 49276D20 54686520 4C617374 204C696E |I'm The Last Lin|
+// CHECK:       0020: 652E00                              |e..|
+// CHECK:     )
+// CHECK:   }
+// CHECK: ]
+// CHECK: Symbols [
+// CHECK:   Symbol {
+// CHECK:     Name:                      .text
+// CHECK:     Value:                     0
+// CHECK:     Section:                   .text
+// CHECK:     BaseType:                  Null
+// CHECK:     ComplexType:               Null
+// CHECK:     StorageClass:              Static
+// CHECK:     AuxSymbolCount:            1
+// CHECK:     AuxSectionDef {
+// CHECK:       Length: 45
+// CHECK:       RelocationCount: 6
+// CHECK:       LineNumberCount: 0
+// CHECK:       Checksum: 0x0
+// CHECK:       Number: 1
+// CHECK:       Selection: 0x0
+// CHECK:       Unused: (00 00 00)
+// CHECK:     }
+// CHECK:   }
+// CHECK:   Symbol {
+// CHECK:     Name:                      .data
+// CHECK:     Value:                     0
+// CHECK:     Section:                   .data
+// CHECK:     BaseType:                  Null
+// CHECK:     ComplexType:               Null
+// CHECK:     StorageClass:              Static
+// CHECK:     AuxSymbolCount:            1
+// CHECK:     AuxSectionDef {
+// CHECK:       Length: 35
+// CHECK:       RelocationCount: 0
+// CHECK:       LineNumberCount: 0
+// CHECK:       Checksum: 0x0
+// CHECK:       Number: 2
+// CHECK:       Selection: 0x0
+// CHECK:       Unused: (00 00 00)
+// CHECK:     }
+// CHECK:   }
+// CHECK:   Symbol {
+// CHECK:     Name:                      _main
+// CHECK:     Value:                     0
+// CHECK:     Section:                   .text
+// CHECK:     BaseType:                  Null
+// CHECK:     ComplexType:               Function
+// CHECK:     StorageClass:              External
+// CHECK:     AuxSymbolCount:            0
+// CHECK:   }
+// CHECK:   Symbol {
+// CHECK:     Name:                      _printf
+// CHECK:     Value:                     0
+// CHECK:     Section:                   (0)
+// CHECK:     BaseType:                  Null
+// CHECK:     ComplexType:               Null
+// CHECK:     StorageClass:              External
+// CHECK:     AuxSymbolCount:            0
+// CHECK:   }
+// CHECK:   Symbol {
+// CHECK:     Name:                      _puts
+// CHECK:     Value:                     0
+// CHECK:     Section:                   (0)
+// CHECK:     BaseType:                  Null
+// CHECK:     ComplexType:               Null
+// CHECK:     StorageClass:              External
+// CHECK:     AuxSymbolCount:            0
+// CHECK:   }
+// CHECK: ]
diff --git a/test/MC/COFF/weak-symbol-section-specification.ll b/test/MC/COFF/weak-symbol-section-specification.ll
index 5049372..4772c92 100644
--- a/test/MC/COFF/weak-symbol-section-specification.ll
+++ b/test/MC/COFF/weak-symbol-section-specification.ll
@@ -1,23 +1,25 @@
 ; The purpose of this test is to verify that weak linkage type is not ignored by backend,
 ; if section was specialized.
 
-; RUN: llc -filetype=obj -mtriple i686-pc-win32 %s -o - | coff-dump.py | FileCheck %s
+; RUN: llc -filetype=obj -mtriple i686-pc-win32 %s -o - | llvm-readobj -s -sd | FileCheck %s
 
 @a = weak unnamed_addr constant { i32, i32, i32 } { i32 0, i32 0, i32 0}, section ".data"
 
-; CHECK:           Name                     = .data$a
-; CHECK-NEXT:      VirtualSize              = 0
-; CHECK-NEXT:      VirtualAddress           = 0
-; CHECK-NEXT:      SizeOfRawData            = {{[0-9]+}}
-; CHECK-NEXT:      PointerToRawData         = 0x{{[0-9A-F]+}}
-; CHECK-NEXT:      PointerToRelocations     = 0x0
-; CHECK-NEXT:      PointerToLineNumbers     = 0x0
-; CHECK-NEXT:      NumberOfRelocations      = 0
-; CHECK-NEXT:      NumberOfLineNumbers      = 0
-; CHECK-NEXT:      Charateristics           = 0x40401040
+; CHECK:           Name:                      .data$a
+; CHECK-NEXT:      VirtualSize:               0
+; CHECK-NEXT:      VirtualAddress:            0
+; CHECK-NEXT:      RawDataSize:               {{[0-9]+}}
+; CHECK-NEXT:      PointerToRawData:          0x{{[0-9A-F]+}}
+; CHECK-NEXT:      PointerToRelocations:      0x0
+; CHECK-NEXT:      PointerToLineNumbers:      0x0
+; CHECK-NEXT:      RelocationCount:           0
+; CHECK-NEXT:      LineNumberCount:           0
+; CHECK-NEXT:      Characteristics [ (0x40401040)
+; CHECK-NEXT:        IMAGE_SCN_ALIGN_8BYTES
 ; CHECK-NEXT:        IMAGE_SCN_CNT_INITIALIZED_DATA
 ; CHECK-NEXT:        IMAGE_SCN_LNK_COMDAT
-; CHECK-NEXT:        IMAGE_SCN_ALIGN_8BYTES
 ; CHECK-NEXT:        IMAGE_SCN_MEM_READ
-; CHECK-NEXT:      SectionData              = 
-; CHECK-NEXT:        00 00 00 00 00 00 00 00 - 00 00 00 00 
+; CHECK-NEXT:      ]
+; CHECK-NEXT:      SectionData (
+; CHECK-NEXT:        0000: 00000000 00000000 00000000
+; CHECK-NEXT:      )
diff --git a/test/MC/COFF/weak.s b/test/MC/COFF/weak.s
index 0f99313..14f7c65 100644
--- a/test/MC/COFF/weak.s
+++ b/test/MC/COFF/weak.s
@@ -1,7 +1,8 @@
 // This tests that default-null weak symbols (a GNU extension) are created
 // properly via the .weak directive.
 
-// RUN: llvm-mc -filetype=obj -triple i686-pc-win32 < %s | coff-dump.py | FileCheck %s
+// RUN: llvm-mc -filetype=obj -triple i686-pc-win32 %s | llvm-readobj -t | FileCheck %s
+// RUN: llvm-mc -filetype=obj -triple x86_64-pc-win32 %s | llvm-readobj -t | FileCheck %s
 
     .def    _main;
     .scl    2;
@@ -17,7 +18,7 @@
     testl   %eax, %eax
     je      LBB0_2
 # BB#1:                                 # %if.then
-    calll   _test_weak
+    call    _test_weak
     movl    $1, %eax
     addl    $4, %esp
     ret
@@ -28,24 +29,29 @@
 
     .weak   _test_weak
 
-// CHECK: Symbols = [
+// CHECK: Symbols [
 
-// CHECK:      Name               = _test_weak
-// CHECK-NEXT: Value              = 0
-// CHECK-NEXT: SectionNumber      = 0
-// CHECK-NEXT: SimpleType         = IMAGE_SYM_TYPE_NULL (0)
-// CHECK-NEXT: ComplexType        = IMAGE_SYM_DTYPE_NULL (0)
-// CHECK-NEXT: StorageClass       = IMAGE_SYM_CLASS_WEAK_EXTERNAL (105)
-// CHECK-NEXT: NumberOfAuxSymbols = 1
-// CHECK-NEXT: AuxillaryData      =
-// CHECK-NEXT: 05 00 00 00 02 00 00 00 - 00 00 00 00 00 00 00 00 |................|
-// CHECK-NEXT: 00 00                                             |..|
+// CHECK:      Symbol {
+// CHECK:        Name:           _test_weak
+// CHECK-NEXT:   Value:          0
+// CHECK-NEXT:   Section:        (0)
+// CHECK-NEXT:   BaseType:       Null
+// CHECK-NEXT:   ComplexType:    Null
+// CHECK-NEXT:   StorageClass:   WeakExternal
+// CHECK-NEXT:   AuxSymbolCount: 1
+// CHECK-NEXT:   AuxWeakExternal {
+// CHECK-NEXT:     Linked: .weak._test_weak.default
+// CHECK-NEXT:      Search: Library
+// CHECK-NEXT:      Unused: (00 00 00 00 00 00 00 00 00 00)
+// CHECK-NEXT:   }
+// CHECK-NEXT: }
 
-// CHECK:      Name               = .weak._test_weak.default
-// CHECK-NEXT: Value              = 0
-// CHECK-NEXT: SectionNumber      = 65535
-// CHECK-NEXT: SimpleType         = IMAGE_SYM_TYPE_NULL (0)
-// CHECK-NEXT: ComplexType        = IMAGE_SYM_DTYPE_NULL (0)
-// CHECK-NEXT: StorageClass       = IMAGE_SYM_CLASS_EXTERNAL (2)
-// CHECK-NEXT: NumberOfAuxSymbols = 0
-// CHECK-NEXT: AuxillaryData      =
+// CHECK:      Symbol {
+// CHECK:        Name:                .weak._test_weak.default
+// CHECK-NEXT:   Value:               0
+// CHECK-NEXT:   Section:             (-1)
+// CHECK-NEXT:   BaseType:            Null
+// CHECK-NEXT:   ComplexType:         Null
+// CHECK-NEXT:   StorageClass:        External
+// CHECK-NEXT:   AuxSymbolCount:      0
+// CHECK-NEXT: }