diff options
Diffstat (limited to 'test/MC/PowerPC')
-rw-r--r-- | test/MC/PowerPC/ppc64-initial-cfa.ll | 134 | ||||
-rw-r--r-- | test/MC/PowerPC/ppc64-relocs-01.ll | 45 | ||||
-rw-r--r-- | test/MC/PowerPC/ppc64-tls-relocs-01.ll | 21 |
3 files changed, 90 insertions, 110 deletions
diff --git a/test/MC/PowerPC/ppc64-initial-cfa.ll b/test/MC/PowerPC/ppc64-initial-cfa.ll index 16236c9..23a7738 100644 --- a/test/MC/PowerPC/ppc64-initial-cfa.ll +++ b/test/MC/PowerPC/ppc64-initial-cfa.ll @@ -1,7 +1,7 @@ ; RUN: llc -mtriple=powerpc64-unknown-linux-gnu -filetype=obj -relocation-model=static %s -o - | \ -; RUN: elf-dump --dump-section-data | FileCheck %s -check-prefix=STATIC +; RUN: llvm-readobj -s -sr -sd | FileCheck %s -check-prefix=STATIC ; RUN: llc -mtriple=powerpc64-unknown-linux-gnu -filetype=obj -relocation-model=pic %s -o - | \ -; RUN: elf-dump --dump-section-data | FileCheck %s -check-prefix=PIC +; RUN: llvm-readobj -s -sr -sd | FileCheck %s -check-prefix=PIC ; FIXME: this file should be in .s form, change when asm parser is available. @@ -10,69 +10,75 @@ entry: ret void } -; STATIC: ('sh_name', 0x{{.*}}) # '.eh_frame' -; STATIC-NEXT: ('sh_type', 0x00000001) -; STATIC-NEXT: ('sh_flags', 0x0000000000000002) -; STATIC-NEXT: ('sh_addr', 0x{{.*}}) -; STATIC-NEXT: ('sh_offset', 0x{{.*}}) -; STATIC-NEXT: ('sh_size', 0x0000000000000028) -; STATIC-NEXT: ('sh_link', 0x00000000) -; STATIC-NEXT: ('sh_info', 0x00000000) -; STATIC-NEXT: ('sh_addralign', 0x0000000000000008) -; STATIC-NEXT: ('sh_entsize', 0x0000000000000000) -; STATIC-NEXT: ('_section_data', '00000010 00000000 017a5200 01784101 1b0c0100 00000010 00000018 00000000 00000010 00000000') +; STATIC: Section { +; STATIC: Name: .eh_frame +; STATIC-NEXT: Type: SHT_PROGBITS +; STATIC-NEXT: Flags [ (0x2) +; STATIC-NEXT: SHF_ALLOC +; STATIC-NEXT: ] +; STATIC-NEXT: Address: +; STATIC-NEXT: Offset: +; STATIC-NEXT: Size: 40 +; STATIC-NEXT: Link: 0 +; STATIC-NEXT: Info: 0 +; STATIC-NEXT: AddressAlignment: 8 +; STATIC-NEXT: EntrySize: +; STATIC-NEXT: Relocations [ +; STATIC-NEXT: 0x1C R_PPC64_REL32 .text 0x0 +; STATIC-NEXT: ] +; STATIC-NEXT: SectionData ( +; STATIC-NEXT: 0000: 00000010 00000000 017A5200 01784101 +; STATIC-NEXT: 0010: 1B0C0100 00000010 00000018 00000000 +; STATIC-NEXT: 0020: 00000010 00000000 +; STATIC-NEXT: ) +; STATIC-NEXT: } -; STATIC: ('sh_name', 0x{{.*}}) # '.rela.eh_frame' -; STATIC-NEXT: ('sh_type', 0x00000004) -; STATIC-NEXT: ('sh_flags', 0x0000000000000000) -; STATIC-NEXT: ('sh_addr', 0x{{.*}}) -; STATIC-NEXT: ('sh_offset', 0x{{.*}}) -; STATIC-NEXT: ('sh_size', 0x0000000000000018) -; STATIC-NEXT: ('sh_link', 0x{{.*}}) -; STATIC-NEXT: ('sh_info', 0x{{.*}}) -; STATIC-NEXT: ('sh_addralign', 0x0000000000000008) -; STATIC-NEXT: ('sh_entsize', 0x0000000000000018) -; STATIC-NEXT: ('_relocations', [ +; STATIC: Section { +; STATIC: Name: .rela.eh_frame +; STATIC-NEXT: Type: SHT_RELA +; STATIC-NEXT: Flags [ (0x0) +; STATIC-NEXT: ] +; STATIC-NEXT: Address: +; STATIC-NEXT: Offset: +; STATIC-NEXT: Size: 24 +; STATIC-NEXT: Link: +; STATIC-NEXT: Info: +; STATIC-NEXT: AddressAlignment: 8 +; STATIC-NEXT: EntrySize: 24 -; Static build should create R_PPC64_REL32 relocations -; STATIC-NEXT: # Relocation 0 -; STATIC-NEXT: (('r_offset', 0x000000000000001c) -; STATIC-NEXT: ('r_sym', 0x{{.*}}) -; STATIC-NEXT: ('r_type', 0x0000001a) -; STATIC-NEXT: ('r_addend', 0x0000000000000000) -; STATIC-NEXT: ), -; STATIC-NEXT: ]) +; PIC: Section { +; PIC: Name: .eh_frame +; PIC-NEXT: Type: SHT_PROGBITS +; PIC-NEXT: Flags [ (0x2) +; PIC-NEXT: SHF_ALLOC +; PIC-NEXT: ] +; PIC-NEXT: Address: +; PIC-NEXT: Offset: +; PIC-NEXT: Size: 40 +; PIC-NEXT: Link: 0 +; PIC-NEXT: Info: 0 +; PIC-NEXT: AddressAlignment: 8 +; PIC-NEXT: EntrySize: 0 +; PIC-NEXT: Relocations [ +; PIC-NEXT: 0x1C R_PPC64_REL32 .text 0x0 +; PIC-NEXT: ] +; PIC-NEXT: SectionData ( +; PIC-NEXT: 0000: 00000010 00000000 017A5200 01784101 +; PIC-NEXT: 0010: 1B0C0100 00000010 00000018 00000000 +; PIC-NEXT: 0020: 00000010 00000000 +; PIC-NEXT: ) +; PIC-NEXT: } -; PIC: ('sh_name', 0x{{.*}}) # '.eh_frame' -; PIC-NEXT: ('sh_type', 0x00000001) -; PIC-NEXT: ('sh_flags', 0x0000000000000002) -; PIC-NEXT: ('sh_addr', 0x{{.*}}) -; PIC-NEXT: ('sh_offset', 0x{{.*}}) -; PIC-NEXT: ('sh_size', 0x0000000000000028) -; PIC-NEXT: ('sh_link', 0x00000000) -; PIC-NEXT: ('sh_info', 0x00000000) -; PIC-NEXT: ('sh_addralign', 0x0000000000000008) -; PIC-NEXT: ('sh_entsize', 0x0000000000000000) -; PIC-NEXT: ('_section_data', '00000010 00000000 017a5200 01784101 1b0c0100 00000010 00000018 00000000 00000010 00000000') - -; PIC: ('sh_name', 0x{{.*}}) # '.rela.eh_frame' -; PIC-NEXT: ('sh_type', 0x00000004) -; PIC-NEXT: ('sh_flags', 0x0000000000000000) -; PIC-NEXT: ('sh_addr', 0x{{.*}}) -; PIC-NEXT: ('sh_offset', 0x{{.*}}) -; PIC-NEXT: ('sh_size', 0x0000000000000018) -; PIC-NEXT: ('sh_link', 0x{{.*}}) -; PIC-NEXT: ('sh_info', 0x{{.*}}) -; PIC-NEXT: ('sh_addralign', 0x0000000000000008) -; PIC-NEXT: ('sh_entsize', 0x0000000000000018) -; PIC-NEXT: ('_relocations', [ - -; PIC build should create R_PPC64_REL32 relocations -; PIC-NEXT: # Relocation 0 -; PIC-NEXT: (('r_offset', 0x000000000000001c) -; PIC-NEXT: ('r_sym', 0x{{.*}}) -; PIC-NEXT: ('r_type', 0x0000001a) -; PIC-NEXT: ('r_addend', 0x0000000000000000) -; PIC-NEXT: ), -; PIC-NEXT: ]) +; PIC: Section { +; PIC: Name: .rela.eh_frame +; PIC-NEXT: Type: SHT_RELA +; PIC-NEXT: Flags [ (0x0) +; PIC-NEXT: ] +; PIC-NEXT: Address: +; PIC-NEXT: Offset: +; PIC-NEXT: Size: 24 +; PIC-NEXT: Link: +; PIC-NEXT: Info: +; PIC-NEXT: AddressAlignment: 8 +; PIC-NEXT: EntrySize: 24 diff --git a/test/MC/PowerPC/ppc64-relocs-01.ll b/test/MC/PowerPC/ppc64-relocs-01.ll index 4919e91..ac8d303 100644 --- a/test/MC/PowerPC/ppc64-relocs-01.ll +++ b/test/MC/PowerPC/ppc64-relocs-01.ll @@ -1,6 +1,6 @@ ;; RUN: llc -mtriple=powerpc64-unknown-linux-gnu -O3 -code-model=small \ ;; RUN: -filetype=obj %s -o - | \ -;; RUN: elf-dump --dump-section-data | FileCheck %s +;; RUN: llvm-readobj -r | FileCheck %s ;; FIXME: this file need to be in .s form, change when asm parse is done. @@ -22,45 +22,28 @@ entry: ret double %add } +;; CHECK: Relocations [ + ;; The relocations in .rela.text are the 'number64' load using a ;; R_PPC64_TOC16_DS against the .toc and the 'sin' external function ;; address using a R_PPC64_REL24 -;; CHECK: '.rela.text' -;; CHECK: Relocation 0 -;; CHECK-NEXT: 'r_offset', -;; CHECK-NEXT: 'r_sym', 0x00000006 -;; CHECK-NEXT: 'r_type', 0x0000003f -;; CHECK: Relocation 1 -;; CHECK-NEXT: 'r_offset', -;; CHECK-NEXT: 'r_sym', 0x0000000a -;; CHECK-NEXT: 'r_type', 0x0000000a +;; CHECK: Section ({{[0-9]+}}) .text { +;; CHECK-NEXT: 0x{{[0-9,A-F]+}} R_PPC64_TOC16_DS .toc +;; CHECK-NEXT: 0x{{[0-9,A-F]+}} R_PPC64_REL24 sin +;; CHECK-NEXT: } ;; The .opd entry for the 'access_int64' function creates 2 relocations: ;; 1. A R_PPC64_ADDR64 against the .text segment plus addend (the function ; address itself); ;; 2. And a R_PPC64_TOC against no symbol (the linker will replace for the ;; module's TOC base). -;; CHECK: '.rela.opd' -;; CHECK: Relocation 0 -;; CHECK-NEXT: 'r_offset', -;; CHECK-NEXT: 'r_sym', 0x00000002 -;; CHECK-NEXT: 'r_type', 0x00000026 -;; CHECK: Relocation 1 -;; CHECK-NEXT: 'r_offset', -;; CHECK-NEXT: 'r_sym', 0x00000000 -;; CHECK-NEXT: 'r_type', 0x00000033 +;; CHECK: Section ({{[0-9]+}}) .opd { +;; CHECK-NEXT: 0x{{[0-9,A-F]+}} R_PPC64_ADDR64 .text 0x0 +;; CHECK-NEXT: 0x{{[0-9,A-F]+}} R_PPC64_TOC - 0x0 ;; Finally the TOC creates the relocation for the 'number64'. -;; CHECK: '.rela.toc' -;; CHECK: Relocation 0 -;; CHECK-NEXT: 'r_offset', -;; CHECK-NEXT: 'r_sym', 0x00000008 -;; CHECK-NEXT: 'r_type', 0x00000026 +;; CHECK: Section ({{[0-9]+}}) .toc { +;; CHECK-NEXT: 0x{{[0-9,A-F]+}} R_PPC64_ADDR64 number64 0x0 +;; CHECK-NEXT: } -;; Check if the relocation references are for correct symbols. -;; CHECK: Symbol 7 -;; CHECK-NEXT: 'access_int64' -;; CHECK: Symbol 8 -;; CHECK-NEXT: 'number64' -;; CHECK: Symbol 10 -;; CHECK-NEXT: 'sin' +;; CHECK-NEXT: ] diff --git a/test/MC/PowerPC/ppc64-tls-relocs-01.ll b/test/MC/PowerPC/ppc64-tls-relocs-01.ll index 5e37311..4e901e8 100644 --- a/test/MC/PowerPC/ppc64-tls-relocs-01.ll +++ b/test/MC/PowerPC/ppc64-tls-relocs-01.ll @@ -1,5 +1,5 @@ ;; RUN: llc -mtriple=powerpc64-unknown-linux-gnu -filetype=obj %s -o - | \ -;; RUN: elf-dump --dump-section-data | FileCheck %s +;; RUN: llvm-readobj -r | FileCheck %s ;; FIXME: this file should be in .s form, change when asm parser is available. @@ -12,17 +12,8 @@ entry: ;; Check for a pair of R_PPC64_TPREL16_HA / R_PPC64_TPREL16_LO relocs ;; against the thread-local symbol 't'. -;; CHECK: '.rela.text' -;; CHECK: Relocation 0 -;; CHECK-NEXT: 'r_offset', -;; CHECK-NEXT: 'r_sym', 0x00000008 -;; CHECK-NEXT: 'r_type', 0x00000048 -;; CHECK: Relocation 1 -;; CHECK-NEXT: 'r_offset', -;; CHECK-NEXT: 'r_sym', 0x00000008 -;; CHECK-NEXT: 'r_type', 0x00000046 - -;; Check that we got the correct symbol. -;; CHECK: Symbol 8 -;; CHECK-NEXT: 't' - +;; CHECK: Relocations [ +;; CHECK: Section ({{[0-9]+}}) .text { +;; CHECK-NEXT: 0x{{[0-9,A-F]+}} R_PPC64_TPREL16_HA t +;; CHECK-NEXT: 0x{{[0-9,A-F]+}} R_PPC64_TPREL16_LO t +;; CHECK-NEXT: } |