aboutsummaryrefslogtreecommitdiff
path: root/test/MC/COFF
diff options
context:
space:
mode:
authorMichael J. Spencer <bigcheesegs@gmail.com>2010-09-27 08:58:26 +0000
committerMichael J. Spencer <bigcheesegs@gmail.com>2010-09-27 08:58:26 +0000
commita72d87899bc1bfdb17744aae2545a21b3630d3c1 (patch)
tree548fc9c941102b26c7cc744a869bb427d480b02e /test/MC/COFF
parent295646274276c6814d970bed86d3b4ff76ba3ee3 (diff)
MC-COFF: Drop empty sections, and label symbols. Convert relocations
targeted at symbols into relocations relative to the containing section. Patch by Nathan Jeffords! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114823 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/MC/COFF')
-rw-r--r--test/MC/COFF/basic-coff.ll38
-rw-r--r--test/MC/COFF/symbol-fragment-offset.ll56
2 files changed, 33 insertions, 61 deletions
diff --git a/test/MC/COFF/basic-coff.ll b/test/MC/COFF/basic-coff.ll
index f2ffc168ac..1452934c5d 100644
--- a/test/MC/COFF/basic-coff.ll
+++ b/test/MC/COFF/basic-coff.ll
@@ -19,8 +19,8 @@ declare i32 @printf(i8* nocapture, ...) nounwind
; CHECK: MachineType = IMAGE_FILE_MACHINE_I386 (0x14C)
; CHECK: NumberOfSections = 2
; CHECK: TimeDateStamp = {{[0-9]+}}
-; CHECK: PointerToSymbolTable = 0x99
-; CHECK: NumberOfSymbols = 7
+; CHECK: PointerToSymbolTable = 0x{{[0-9A-F]+}}
+; CHECK: NumberOfSymbols = 6
; CHECK: SizeOfOptionalHeader = 0
; CHECK: Characteristics = 0x0
; CHECK: Sections = [
@@ -28,9 +28,9 @@ declare i32 @printf(i8* nocapture, ...) nounwind
; CHECK: Name = .text
; CHECK: VirtualSize = 0
; CHECK: VirtualAddress = 0
-; CHECK: SizeOfRawData = 21
-; CHECK: PointerToRawData = 0x64
-; CHECK: PointerToRelocations = 0x79
+; 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
@@ -40,20 +40,18 @@ declare i32 @printf(i8* nocapture, ...) nounwind
; 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 31 |.....$.........1|
-; CHECK: C0 83 C4 04 C3 |.....|
; CHECK: Relocations = [
; CHECK: 0 = {
-; CHECK: VirtualAddress = 0x6
-; CHECK: SymbolTableIndex = 5
+; CHECK: VirtualAddress = 0x{{[0-9A-F]+}}
+; CHECK: SymbolTableIndex = 2
; CHECK: Type = IMAGE_REL_I386_DIR32 (6)
-; CHECK: SymbolName = _main
+; CHECK: SymbolName =
; CHECK: }
; CHECK: 1 = {
-; CHECK: VirtualAddress = 0xB
-; CHECK: SymbolTableIndex = 6
+; CHECK: VirtualAddress = 0x{{[0-9A-F]+}}
+; CHECK: SymbolTableIndex = 5
; CHECK: Type = IMAGE_REL_I386_REL32 (20)
-; CHECK: SymbolName = L_.str
+; CHECK: SymbolName = _main
; CHECK: }
; CHECK: ]
; CHECK: }
@@ -61,8 +59,8 @@ declare i32 @printf(i8* nocapture, ...) nounwind
; CHECK: Name = .data
; CHECK: VirtualSize = 0
; CHECK: VirtualAddress = 0
-; CHECK: SizeOfRawData = 12
-; CHECK: PointerToRawData = 0x8D
+; CHECK: SizeOfRawData = {{[0-9]+}}
+; CHECK: PointerToRawData = 0x{{[0-9A-F]+}}
; CHECK: PointerToRelocations = 0x0
; CHECK: PointerToLineNumbers = 0x0
; CHECK: NumberOfRelocations = 0
@@ -113,16 +111,6 @@ declare i32 @printf(i8* nocapture, ...) nounwind
; CHECK: AuxillaryData =
; CHECK: }
; CHECK: 3 = {
-; CHECK: Name = L_.str
-; 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 = 0
-; CHECK: AuxillaryData =
-; CHECK: }
-; CHECK: 4 = {
; CHECK: Name = _printf
; CHECK: Value = 0
; CHECK: SectionNumber = 0
diff --git a/test/MC/COFF/symbol-fragment-offset.ll b/test/MC/COFF/symbol-fragment-offset.ll
index 4281903f25..f1f31a94cf 100644
--- a/test/MC/COFF/symbol-fragment-offset.ll
+++ b/test/MC/COFF/symbol-fragment-offset.ll
@@ -23,8 +23,8 @@ declare i32 @puts(i8* nocapture) nounwind
; CHECK: MachineType = IMAGE_FILE_MACHINE_I386 (0x14C)
; CHECK: NumberOfSections = 2
; CHECK: TimeDateStamp = {{[0-9]+}}
-; CHECK: PointerToSymbolTable = 0xBB
-; CHECK: NumberOfSymbols = 9
+; CHECK: PointerToSymbolTable = 0x{{[0-9A-F]+}}
+; CHECK: NumberOfSymbols = 8
; CHECK: SizeOfOptionalHeader = 0
; CHECK: Characteristics = 0x0
; CHECK: Sections = [
@@ -32,9 +32,9 @@ declare i32 @puts(i8* nocapture) nounwind
; CHECK: Name = .text
; CHECK: VirtualSize = 0
; CHECK: VirtualAddress = 0
-; CHECK: SizeOfRawData = 33
-; CHECK: PointerToRawData = 0x64
-; CHECK: PointerToRelocations = 0x85
+; CHECK: SizeOfRawData = {{[0-9]+}}
+; CHECK: PointerToRawData = 0x{{[0-9A-F]+}}
+; CHECK: PointerToRelocations = 0x{{[0-9A-F]+}}
; CHECK: PointerToLineNumbers = 0x0
; CHECK: NumberOfRelocations = 4
; CHECK: NumberOfLineNumbers = 0
@@ -44,32 +44,28 @@ declare i32 @puts(i8* nocapture) nounwind
; 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 00 00 00 00 E8 00 - 00 00 00 31 C0 83 C4 04 |.$.........1....|
-; CHECK: C3 |.|
-
; CHECK: Relocations = [
; CHECK: 0 = {
-; CHECK: VirtualAddress = 0x6
-; CHECK: SymbolTableIndex = 5
+; CHECK: VirtualAddress = 0x{{[0-9A-F]+}}
+; CHECK: SymbolTableIndex = 2
; CHECK: Type = IMAGE_REL_I386_DIR32 (6)
-; CHECK: SymbolName = _main
+; CHECK: SymbolName =
; CHECK: }
; CHECK: 1 = {
-; CHECK: VirtualAddress = 0xB
-; CHECK: SymbolTableIndex = 6
+; CHECK: VirtualAddress = 0x{{[0-9A-F]+}}
+; CHECK: SymbolTableIndex = 5
; CHECK: Type = IMAGE_REL_I386_REL32 (20)
-; CHECK: SymbolName = L_.str
+; CHECK: SymbolName = _main
; CHECK: }
; CHECK: 2 = {
-; CHECK: VirtualAddress = 0x12
-; CHECK: SymbolTableIndex = 7
+; CHECK: VirtualAddress = 0x{{[0-9A-F]+}}
+; CHECK: SymbolTableIndex = 6
; CHECK: Type = IMAGE_REL_I386_DIR32 (6)
; CHECK: SymbolName = _printf
; CHECK: }
; CHECK: 3 = {
-; CHECK: VirtualAddress = 0x17
-; CHECK: SymbolTableIndex = 8
+; CHECK: VirtualAddress = 0x{{[0-9A-F]+}}
+; CHECK: SymbolTableIndex = 7
; CHECK: Type = IMAGE_REL_I386_REL32 (20)
; CHECK: SymbolName = _str
; CHECK: }
@@ -79,8 +75,8 @@ declare i32 @puts(i8* nocapture) nounwind
; CHECK: Name = .data
; CHECK: VirtualSize = 0
; CHECK: VirtualAddress = 0
-; CHECK: SizeOfRawData = 14
-; CHECK: PointerToRawData = 0xAD
+; CHECK: SizeOfRawData = {{[0-9]+}}
+; CHECK: PointerToRawData = 0x{{[0-9A-F]+}}
; CHECK: PointerToRelocations = 0x0
; CHECK: PointerToLineNumbers = 0x0
; CHECK: NumberOfRelocations = 0
@@ -133,19 +129,7 @@ declare i32 @puts(i8* nocapture) nounwind
; CHECK: NumberOfAuxSymbols = 0
; CHECK: AuxillaryData =
-; CHECK: }
; CHECK: 3 = {
-; CHECK: Name = L_.str
-; 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 = 0
-; CHECK: AuxillaryData =
-
-; CHECK: }
-; CHECK: 4 = {
; CHECK: Name = _printf
; CHECK: Value = 0
; CHECK: SectionNumber = 0
@@ -156,18 +140,18 @@ declare i32 @puts(i8* nocapture) nounwind
; CHECK: AuxillaryData =
; CHECK: }
-; CHECK: 5 = {
+; CHECK: 4 = {
; CHECK: Name = _str
; CHECK: Value = 7
; 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: StorageClass = IMAGE_SYM_CLASS_LABEL (6)
; CHECK: NumberOfAuxSymbols = 0
; CHECK: AuxillaryData =
; CHECK: }
-; CHECK: 6 = {
+; CHECK: 5 = {
; CHECK: Name = _puts
; CHECK: Value = 0
; CHECK: SectionNumber = 0