diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2013-04-11 02:52:29 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2013-04-11 02:52:29 +0000 |
commit | fb1b6fddbe3f84c0454dd42134741a33042dadf3 (patch) | |
tree | 6b7cb3c273ce44e26eac58c0d38e04678361370a /test/tools | |
parent | 8bf80061ba44af16b4597627ca7d6d7fc1bed64e (diff) |
Add MachO-x86-64 tests.
The object was already checked in, but was not being tested.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179256 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/tools')
-rw-r--r-- | test/tools/llvm-readobj/relocations.test | 28 | ||||
-rw-r--r-- | test/tools/llvm-readobj/sections-ext.test | 160 | ||||
-rw-r--r-- | test/tools/llvm-readobj/sections.test | 112 |
3 files changed, 213 insertions, 87 deletions
diff --git a/test/tools/llvm-readobj/relocations.test b/test/tools/llvm-readobj/relocations.test index 0608565373..b4b876a70b 100644 --- a/test/tools/llvm-readobj/relocations.test +++ b/test/tools/llvm-readobj/relocations.test @@ -3,7 +3,9 @@ RUN: | FileCheck %s -check-prefix COFF RUN: llvm-readobj -r %p/Inputs/trivial.obj.elf-i386 \ RUN: | FileCheck %s -check-prefix ELF RUN: llvm-readobj -r %p/Inputs/trivial.obj.macho-i386 \ -RUN: | FileCheck %s -check-prefix MACHO +RUN: | FileCheck %s -check-prefix MACHO-I386 +RUN: llvm-readobj -r %p/Inputs/trivial.obj.macho-x86-64 \ +RUN: | FileCheck %s -check-prefix MACHO-X86-64 COFF: Relocations [ COFF-NEXT: Section (1) .text { @@ -22,11 +24,19 @@ ELF-NEXT: 0x1F R_386_PLT32 SomeOtherFunction 0x0 ELF-NEXT: } ELF-NEXT: ] -MACHO: Relocations [ -MACHO-NEXT: Section __text { -MACHO-NEXT: 0x18 GENERIC_RELOC_VANILLA _SomeOtherFunction 0x0 -MACHO-NEXT: 0x13 GENERIC_RELOC_VANILLA _puts 0x0 -MACHO-NEXT: 0xB GENERIC_RELOC_LOCAL_SECTDIFF _main 0x{{[0-9A-F]+}} -MACHO-NEXT: 0x0 GENERIC_RELOC_PAIR _main 0x{{[0-9A-F]+}} -MACHO-NEXT: } -MACHO-NEXT: ] +MACHO-I386: Relocations [ +MACHO-I386-NEXT: Section __text { +MACHO-I386-NEXT: 0x18 GENERIC_RELOC_VANILLA _SomeOtherFunction 0x0 +MACHO-I386-NEXT: 0x13 GENERIC_RELOC_VANILLA _puts 0x0 +MACHO-I386-NEXT: 0xB GENERIC_RELOC_LOCAL_SECTDIFF _main 0x{{[0-9A-F]+}} +MACHO-I386-NEXT: 0x0 GENERIC_RELOC_PAIR _main 0x{{[0-9A-F]+}} +MACHO-I386-NEXT: } +MACHO-I386-NEXT: ] + +MACHO-X86-64: Relocations [ +MACHO-X86-64-NEXT: Section __text { +MACHO-X86-64-NEXT: 0xE X86_64_RELOC_BRANCH _SomeOtherFunction 0x0 +MACHO-X86-64-NEXT: 0x9 X86_64_RELOC_BRANCH _puts 0x0 +MACHO-X86-64-NEXT: 0x4 X86_64_RELOC_SIGNED L_.str 0x0 +MACHO-X86-64-NEXT: } +MACHO-X86-64-NEXT:] diff --git a/test/tools/llvm-readobj/sections-ext.test b/test/tools/llvm-readobj/sections-ext.test index a972c9ab51..a16bca2b19 100644 --- a/test/tools/llvm-readobj/sections-ext.test +++ b/test/tools/llvm-readobj/sections-ext.test @@ -3,7 +3,9 @@ RUN: | FileCheck %s -check-prefix COFF RUN: llvm-readobj -s -st -sr -sd %p/Inputs/trivial.obj.elf-i386 \ RUN: | FileCheck %s -check-prefix ELF RUN: llvm-readobj -s -st -sr -sd %p/Inputs/trivial.obj.macho-i386 \ -RUN: | FileCheck %s -check-prefix MACHO +RUN: | FileCheck %s -check-prefix MACHO-I386 +RUN: llvm-readobj -s -st -sr -sd %p/Inputs/trivial.obj.macho-x86-64 \ +RUN: | FileCheck %s -check-prefix MACHO-X86-64 COFF: Sections [ COFF-NEXT: Section { @@ -132,44 +134,118 @@ ELF-NEXT: 0020: FFFFFF31 C083C408 5BC3 |...1....[.| ELF-NEXT: ) ELF-NEXT: } -MACHO: Sections [ -MACHO-NEXT: Section { -MACHO-NEXT: Index: 0 -MACHO-NEXT: Name: __text (5F 5F 74 65 78 74 00 00 00 00 00 00 00 00 00 00) -MACHO-NEXT: Segment: __TEXT (5F 5F 54 45 58 54 00 00 00 00 00 00 00 00 00 00) -MACHO-NEXT: Address: 0x0 -MACHO-NEXT: Size: 0x22 -MACHO-NEXT: Offset: 324 -MACHO-NEXT: Alignment: 4 -MACHO-NEXT: RelocationOffset: 0x174 -MACHO-NEXT: RelocationCount: 4 -MACHO-NEXT: Type: 0x0 -MACHO-NEXT: Attributes [ (0x800004) -MACHO-NEXT: PureInstructions (0x800000) -MACHO-NEXT: SomeInstructions (0x4) -MACHO-NEXT: ] -MACHO-NEXT: Reserved1: 0x0 -MACHO-NEXT: Reserved2: 0x0 -MACHO-NEXT: Relocations [ -MACHO-NEXT: 0x18 GENERIC_RELOC_VANILLA _SomeOtherFunction 0x0 -MACHO-NEXT: 0x13 GENERIC_RELOC_VANILLA _puts 0x0 -MACHO-NEXT: 0xB GENERIC_RELOC_LOCAL_SECTDIFF _main 0x{{[0-9A-F]+}} -MACHO-NEXT: 0x0 GENERIC_RELOC_PAIR _main 0x{{[0-9A-F]+}} -MACHO-NEXT: ] -MACHO-NEXT: Symbols [ -MACHO-NEXT: Symbol { -MACHO-NEXT: Name: _main (1) -MACHO-NEXT: Type: 0xF -MACHO-NEXT: Section: __text (0x1) -MACHO-NEXT: RefType: UndefinedNonLazy (0x0) -MACHO-NEXT: Flags [ (0x0) -MACHO-NEXT: ] -MACHO-NEXT: Value: 0x0 -MACHO-NEXT: } -MACHO-NEXT: ] -MACHO-NEXT: SectionData ( -MACHO-NEXT: 0000: 83EC0CE8 00000000 588D801A 00000089 |........X.......| -MACHO-NEXT: 0010: 0424E8E9 FFFFFFE8 E4FFFFFF 31C083C4 |.$..........1...| -MACHO-NEXT: 0020: 0CC3 |..| -MACHO-NEXT: ) -MACHO-NEXT: } +MACHO-I386: Sections [ +MACHO-I386-NEXT: Section { +MACHO-I386-NEXT: Index: 0 +MACHO-I386-NEXT: Name: __text (5F 5F 74 65 78 74 00 00 00 00 00 00 00 00 00 00) +MACHO-I386-NEXT: Segment: __TEXT (5F 5F 54 45 58 54 00 00 00 00 00 00 00 00 00 00) +MACHO-I386-NEXT: Address: 0x0 +MACHO-I386-NEXT: Size: 0x22 +MACHO-I386-NEXT: Offset: 324 +MACHO-I386-NEXT: Alignment: 4 +MACHO-I386-NEXT: RelocationOffset: 0x174 +MACHO-I386-NEXT: RelocationCount: 4 +MACHO-I386-NEXT: Type: 0x0 +MACHO-I386-NEXT: Attributes [ (0x800004) +MACHO-I386-NEXT: PureInstructions (0x800000) +MACHO-I386-NEXT: SomeInstructions (0x4) +MACHO-I386-NEXT: ] +MACHO-I386-NEXT: Reserved1: 0x0 +MACHO-I386-NEXT: Reserved2: 0x0 +MACHO-I386-NEXT: Relocations [ +MACHO-I386-NEXT: 0x18 GENERIC_RELOC_VANILLA _SomeOtherFunction 0x0 +MACHO-I386-NEXT: 0x13 GENERIC_RELOC_VANILLA _puts 0x0 +MACHO-I386-NEXT: 0xB GENERIC_RELOC_LOCAL_SECTDIFF _main 0x{{[0-9A-F]+}} +MACHO-I386-NEXT: 0x0 GENERIC_RELOC_PAIR _main 0x{{[0-9A-F]+}} +MACHO-I386-NEXT: ] +MACHO-I386-NEXT: Symbols [ +MACHO-I386-NEXT: Symbol { +MACHO-I386-NEXT: Name: _main (1) +MACHO-I386-NEXT: Type: 0xF +MACHO-I386-NEXT: Section: __text (0x1) +MACHO-I386-NEXT: RefType: UndefinedNonLazy (0x0) +MACHO-I386-NEXT: Flags [ (0x0) +MACHO-I386-NEXT: ] +MACHO-I386-NEXT: Value: 0x0 +MACHO-I386-NEXT: } +MACHO-I386-NEXT: ] +MACHO-I386-NEXT: SectionData ( +MACHO-I386-NEXT: 0000: 83EC0CE8 00000000 588D801A 00000089 |........X.......| +MACHO-I386-NEXT: 0010: 0424E8E9 FFFFFFE8 E4FFFFFF 31C083C4 |.$..........1...| +MACHO-I386-NEXT: 0020: 0CC3 |..| +MACHO-I386-NEXT: ) +MACHO-I386-NEXT: } + + +MACHO-X86-64: Sections [ +MACHO-X86-64-NEXT: Section { +MACHO-X86-64-NEXT: Index: 0 +MACHO-X86-64-NEXT: Name: __text (5F 5F 74 65 78 74 00 00 00 00 00 00 00 00 00 00) +MACHO-X86-64-NEXT: Segment: __TEXT (5F 5F 54 45 58 54 00 00 00 00 00 00 00 00 00 00) +MACHO-X86-64-NEXT: Address: 0x0 +MACHO-X86-64-NEXT: Size: 0x16 +MACHO-X86-64-NEXT: Offset: 368 +MACHO-X86-64-NEXT: Alignment: 4 +MACHO-X86-64-NEXT: RelocationOffset: 0x194 +MACHO-X86-64-NEXT: RelocationCount: 3 +MACHO-X86-64-NEXT: Type: 0x0 +MACHO-X86-64-NEXT: Attributes [ (0x800004) +MACHO-X86-64-NEXT: PureInstructions (0x800000) +MACHO-X86-64-NEXT: SomeInstructions (0x4) +MACHO-X86-64-NEXT: ] +MACHO-X86-64-NEXT: Reserved1: 0x0 +MACHO-X86-64-NEXT: Reserved2: 0x0 +MACHO-X86-64-NEXT: Relocations [ +MACHO-X86-64-NEXT: 0xE X86_64_RELOC_BRANCH _SomeOtherFunction 0x0 +MACHO-X86-64-NEXT: 0x9 X86_64_RELOC_BRANCH _puts 0x0 +MACHO-X86-64-NEXT: 0x4 X86_64_RELOC_SIGNED L_.str 0x0 +MACHO-X86-64-NEXT: ] +MACHO-X86-64-NEXT: Symbols [ +MACHO-X86-64-NEXT: Symbol { +MACHO-X86-64-NEXT: Name: _main (1) +MACHO-X86-64-NEXT: Type: 0xF +MACHO-X86-64-NEXT: Section: __text (0x1) +MACHO-X86-64-NEXT: RefType: UndefinedNonLazy (0x0) +MACHO-X86-64-NEXT: Flags [ (0x0) +MACHO-X86-64-NEXT: ] +MACHO-X86-64-NEXT: Value: 0x0 +MACHO-X86-64-NEXT: } +MACHO-X86-64-NEXT: ] +MACHO-X86-64-NEXT: SectionData ( +MACHO-X86-64-NEXT: 0000: 50488D3D 00000000 E8000000 00E80000 |PH.=............| +MACHO-X86-64-NEXT: 0010: 000031C0 5AC3 |..1.Z.| +MACHO-X86-64-NEXT: ) +MACHO-X86-64-NEXT: } +MACHO-X86-64-NEXT: Section { +MACHO-X86-64-NEXT: Index: 1 +MACHO-X86-64-NEXT: Name: __cstring (5F 5F 63 73 74 72 69 6E 67 00 00 00 00 00 00 00) +MACHO-X86-64-NEXT: Segment: __TEXT (5F 5F 54 45 58 54 00 00 00 00 00 00 00 00 00 00) +MACHO-X86-64-NEXT: Address: 0x16 +MACHO-X86-64-NEXT: Size: 0xD +MACHO-X86-64-NEXT: Offset: 390 +MACHO-X86-64-NEXT: Alignment: 0 +MACHO-X86-64-NEXT: RelocationOffset: 0x0 +MACHO-X86-64-NEXT: RelocationCount: 0 +MACHO-X86-64-NEXT: Type: ExtReloc (0x2) +MACHO-X86-64-NEXT: Attributes [ (0x0) +MACHO-X86-64-NEXT: ] +MACHO-X86-64-NEXT: Reserved1: 0x0 +MACHO-X86-64-NEXT: Reserved2: 0x0 +MACHO-X86-64-NEXT: Relocations [ +MACHO-X86-64-NEXT: ] +MACHO-X86-64-NEXT: Symbols [ +MACHO-X86-64-NEXT: Symbol { +MACHO-X86-64-NEXT: Name: L_.str (32) +MACHO-X86-64-NEXT: Type: Section (0xE) +MACHO-X86-64-NEXT: Section: __cstring (0x2) +MACHO-X86-64-NEXT: RefType: UndefinedNonLazy (0x0) +MACHO-X86-64-NEXT: Flags [ (0x0) +MACHO-X86-64-NEXT: ] +MACHO-X86-64-NEXT: Value: 0x16 +MACHO-X86-64-NEXT: } +MACHO-X86-64-NEXT: ] +MACHO-X86-64-NEXT: SectionData ( +MACHO-X86-64-NEXT: 0000: 48656C6C 6F20576F 726C640A 00 |Hello World..| +MACHO-X86-64-NEXT: ) +MACHO-X86-64-NEXT: } +MACHO-X86-64-NEXT:] diff --git a/test/tools/llvm-readobj/sections.test b/test/tools/llvm-readobj/sections.test index 84154d759c..f4da9e3c39 100644 --- a/test/tools/llvm-readobj/sections.test +++ b/test/tools/llvm-readobj/sections.test @@ -3,7 +3,9 @@ RUN: | FileCheck %s -check-prefix COFF RUN: llvm-readobj -s %p/Inputs/trivial.obj.elf-i386 \ RUN: | FileCheck %s -check-prefix ELF RUN: llvm-readobj -s %p/Inputs/trivial.obj.macho-i386 \ -RUN: | FileCheck %s -check-prefix MACHO +RUN: | FileCheck %s -check-prefix MACHO-I386 +RUN: llvm-readobj -s %p/Inputs/trivial.obj.macho-x86-64 \ +RUN: | FileCheck %s -check-prefix MACHO-X86-64 COFF: Sections [ COFF-NEXT: Section { @@ -76,38 +78,76 @@ ELF-NEXT: AddressAlignment: 16 ELF-NEXT: EntrySize: 0 ELF-NEXT: } -MACHO: Sections [ -MACHO-NEXT: Section { -MACHO-NEXT: Index: 0 -MACHO-NEXT: Name: __text (5F 5F 74 65 78 74 00 00 00 00 00 00 00 00 00 00) -MACHO-NEXT: Segment: __TEXT (5F 5F 54 45 58 54 00 00 00 00 00 00 00 00 00 00) -MACHO-NEXT: Address: 0x0 -MACHO-NEXT: Size: 0x22 -MACHO-NEXT: Offset: 324 -MACHO-NEXT: Alignment: 4 -MACHO-NEXT: RelocationOffset: 0x174 -MACHO-NEXT: RelocationCount: 4 -MACHO-NEXT: Type: 0x0 -MACHO-NEXT: Attributes [ (0x800004) -MACHO-NEXT: PureInstructions (0x800000) -MACHO-NEXT: SomeInstructions (0x4) -MACHO-NEXT: ] -MACHO-NEXT: Reserved1: 0x0 -MACHO-NEXT: Reserved2: 0x0 -MACHO-NEXT: } -MACHO-NEXT: Section { -MACHO-NEXT: Index: 1 -MACHO-NEXT: Name: __cstring (5F 5F 63 73 74 72 69 6E 67 00 00 00 00 00 00 00) -MACHO-NEXT: Segment: __TEXT (5F 5F 54 45 58 54 00 00 00 00 00 00 00 00 00 00) -MACHO-NEXT: Address: 0x22 -MACHO-NEXT: Size: 0xD -MACHO-NEXT: Offset: 358 -MACHO-NEXT: Alignment: 0 -MACHO-NEXT: RelocationOffset: 0x0 -MACHO-NEXT: RelocationCount: 0 -MACHO-NEXT: Type: ExtReloc (0x2) -MACHO-NEXT: Attributes [ (0x0) -MACHO-NEXT: ] -MACHO-NEXT: Reserved1: 0x0 -MACHO-NEXT: Reserved2: 0x0 -MACHO-NEXT: } +MACHO-I386: Sections [ +MACHO-I386-NEXT: Section { +MACHO-I386-NEXT: Index: 0 +MACHO-I386-NEXT: Name: __text (5F 5F 74 65 78 74 00 00 00 00 00 00 00 00 00 00) +MACHO-I386-NEXT: Segment: __TEXT (5F 5F 54 45 58 54 00 00 00 00 00 00 00 00 00 00) +MACHO-I386-NEXT: Address: 0x0 +MACHO-I386-NEXT: Size: 0x22 +MACHO-I386-NEXT: Offset: 324 +MACHO-I386-NEXT: Alignment: 4 +MACHO-I386-NEXT: RelocationOffset: 0x174 +MACHO-I386-NEXT: RelocationCount: 4 +MACHO-I386-NEXT: Type: 0x0 +MACHO-I386-NEXT: Attributes [ (0x800004) +MACHO-I386-NEXT: PureInstructions (0x800000) +MACHO-I386-NEXT: SomeInstructions (0x4) +MACHO-I386-NEXT: ] +MACHO-I386-NEXT: Reserved1: 0x0 +MACHO-I386-NEXT: Reserved2: 0x0 +MACHO-I386-NEXT: } +MACHO-I386-NEXT: Section { +MACHO-I386-NEXT: Index: 1 +MACHO-I386-NEXT: Name: __cstring (5F 5F 63 73 74 72 69 6E 67 00 00 00 00 00 00 00) +MACHO-I386-NEXT: Segment: __TEXT (5F 5F 54 45 58 54 00 00 00 00 00 00 00 00 00 00) +MACHO-I386-NEXT: Address: 0x22 +MACHO-I386-NEXT: Size: 0xD +MACHO-I386-NEXT: Offset: 358 +MACHO-I386-NEXT: Alignment: 0 +MACHO-I386-NEXT: RelocationOffset: 0x0 +MACHO-I386-NEXT: RelocationCount: 0 +MACHO-I386-NEXT: Type: ExtReloc (0x2) +MACHO-I386-NEXT: Attributes [ (0x0) +MACHO-I386-NEXT: ] +MACHO-I386-NEXT: Reserved1: 0x0 +MACHO-I386-NEXT: Reserved2: 0x0 +MACHO-I386-NEXT: } + + +MACHO-X86-64: Sections [ +MACHO-X86-64-NEXT: Section { +MACHO-X86-64-NEXT: Index: 0 +MACHO-X86-64-NEXT: Name: __text (5F 5F 74 65 78 74 00 00 00 00 00 00 00 00 00 00) +MACHO-X86-64-NEXT: Segment: __TEXT (5F 5F 54 45 58 54 00 00 00 00 00 00 00 00 00 00) +MACHO-X86-64-NEXT: Address: 0x0 +MACHO-X86-64-NEXT: Size: 0x16 +MACHO-X86-64-NEXT: Offset: 368 +MACHO-X86-64-NEXT: Alignment: 4 +MACHO-X86-64-NEXT: RelocationOffset: 0x194 +MACHO-X86-64-NEXT: RelocationCount: 3 +MACHO-X86-64-NEXT: Type: 0x0 +MACHO-X86-64-NEXT: Attributes [ (0x800004) +MACHO-X86-64-NEXT: PureInstructions (0x800000) +MACHO-X86-64-NEXT: SomeInstructions (0x4) +MACHO-X86-64-NEXT: ] +MACHO-X86-64-NEXT: Reserved1: 0x0 +MACHO-X86-64-NEXT: Reserved2: 0x0 +MACHO-X86-64-NEXT: } +MACHO-X86-64-NEXT: Section { +MACHO-X86-64-NEXT: Index: 1 +MACHO-X86-64-NEXT: Name: __cstring (5F 5F 63 73 74 72 69 6E 67 00 00 00 00 00 00 00) +MACHO-X86-64-NEXT: Segment: __TEXT (5F 5F 54 45 58 54 00 00 00 00 00 00 00 00 00 00) +MACHO-X86-64-NEXT: Address: 0x16 +MACHO-X86-64-NEXT: Size: 0xD +MACHO-X86-64-NEXT: Offset: 390 +MACHO-X86-64-NEXT: Alignment: 0 +MACHO-X86-64-NEXT: RelocationOffset: 0x0 +MACHO-X86-64-NEXT: RelocationCount: 0 +MACHO-X86-64-NEXT: Type: ExtReloc (0x2) +MACHO-X86-64-NEXT: Attributes [ (0x0) +MACHO-X86-64-NEXT: ] +MACHO-X86-64-NEXT: Reserved1: 0x0 +MACHO-X86-64-NEXT: Reserved2: 0x0 +MACHO-X86-64-NEXT: } +MACHO-X86-64-NEXT:] |