From 05da50f87b4c922cc8f1b668d9311a741620c01a Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Thu, 16 Apr 2015 12:59:30 +0000 Subject: [PATCH] Don't depend on the order relocations are written to a .o file. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235092 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/MC/ARM/eh-compact-pr0.s | 32 +++--- test/MC/ARM/eh-directive-handlerdata.s | 36 +++---- test/MC/ARM/eh-directive-personality.s | 56 +++++------ test/MC/ARM/eh-directive-personalityindex.s | 97 ++++++++++--------- .../ARM/eh-directive-section-multiple-func.s | 36 +++---- test/MC/ARM/eh-directive-section.s | 56 +++++------ 6 files changed, 162 insertions(+), 151 deletions(-) diff --git a/test/MC/ARM/eh-compact-pr0.s b/test/MC/ARM/eh-compact-pr0.s index ae3d65c18b7..9c0581a722e 100644 --- a/test/MC/ARM/eh-compact-pr0.s +++ b/test/MC/ARM/eh-compact-pr0.s @@ -1,5 +1,7 @@ @ RUN: llvm-mc %s -triple=armv7-unknown-linux-gnueabi -filetype=obj -o - \ -@ RUN: | llvm-readobj -s -sd -sr | FileCheck %s +@ RUN: | llvm-readobj -s -sd -sr > %t +@ RUN: FileCheck %s < %t +@ RUN: FileCheck --check-prefix=RELOC %s < %t @ Check the compact pr0 model @@ -63,13 +65,13 @@ func2: @ another relocation entry for __aeabi_unwind_cpp_pr0, so that the linker @ will keep __aeabi_unwind_cpp_pr0. @------------------------------------------------------------------------------- -@ CHECK: Section { -@ CHECK: Name: .rel.ARM.exidx.TEST1 -@ CHECK: Relocations [ -@ CHECK: 0x0 R_ARM_PREL31 .TEST1 0x0 -@ CHECK: 0x0 R_ARM_NONE __aeabi_unwind_cpp_pr0 0x0 -@ CHECK: ] -@ CHECK: } +@ RELOC: Section { +@ RELOC: Name: .rel.ARM.exidx.TEST1 +@ RELOC: Relocations [ +@ RELOC: 0x0 R_ARM_PREL31 .TEST1 0x0 +@ RELOC: 0x0 R_ARM_NONE __aeabi_unwind_cpp_pr0 0x0 +@ RELOC: ] +@ RELOC: } @------------------------------------------------------------------------------- @@ -100,10 +102,10 @@ func2: @ another relocation entry for __aeabi_unwind_cpp_pr0, so that the linker @ will keep __aeabi_unwind_cpp_pr0. @------------------------------------------------------------------------------- -@ CHECK: Section { -@ CHECK: Name: .rel.ARM.exidx.TEST2 -@ CHECK: Relocations [ -@ CHECK: 0x0 R_ARM_PREL31 .TEST2 0x0 -@ CHECK: 0x0 R_ARM_NONE __aeabi_unwind_cpp_pr0 0x0 -@ CHECK: ] -@ CHECK: } +@ RELOC: Section { +@ RELOC: Name: .rel.ARM.exidx.TEST2 +@ RELOC: Relocations [ +@ RELOC: 0x0 R_ARM_PREL31 .TEST2 0x0 +@ RELOC: 0x0 R_ARM_NONE __aeabi_unwind_cpp_pr0 0x0 +@ RELOC: ] +@ RELOC: } diff --git a/test/MC/ARM/eh-directive-handlerdata.s b/test/MC/ARM/eh-directive-handlerdata.s index f0e0fca54f7..980a5f05676 100644 --- a/test/MC/ARM/eh-directive-handlerdata.s +++ b/test/MC/ARM/eh-directive-handlerdata.s @@ -1,5 +1,7 @@ @ RUN: llvm-mc %s -triple=armv7-unknown-linux-gnueabi -filetype=obj -o - \ -@ RUN: | llvm-readobj -s -sd -sr | FileCheck %s +@ RUN: | llvm-readobj -s -sd -sr > %t +@ RUN: FileCheck %s < %t +@ RUN: FileCheck --check-prefix=RELOC %s < %t @ Check the .handlerdata directive (without .personality directive) @@ -43,14 +45,14 @@ func1: @ We should see a relocation entry to __aeabi_unwind_cpp_pr0, so that the @ linker can keep __aeabi_unwind_cpp_pr0. @------------------------------------------------------------------------------- -@ CHECK: Section { -@ CHECK: Name: .rel.ARM.exidx.TEST1 -@ CHECK: Relocations [ -@ CHECK: 0x0 R_ARM_PREL31 .TEST1 0x0 -@ CHECK: 0x0 R_ARM_NONE __aeabi_unwind_cpp_pr0 0x0 -@ CHECK: 0x4 R_ARM_PREL31 .ARM.extab.TEST1 0x0 -@ CHECK: ] -@ CHECK: } +@ RELOC: Section { +@ RELOC: Name: .rel.ARM.exidx.TEST1 +@ RELOC: Relocations [ +@ RELOC: 0x0 R_ARM_PREL31 .TEST1 0x0 +@ RELOC: 0x0 R_ARM_NONE __aeabi_unwind_cpp_pr0 0x0 +@ RELOC: 0x4 R_ARM_PREL31 .ARM.extab.TEST1 0x0 +@ RELOC: ] +@ RELOC: } @@ -103,11 +105,11 @@ func2: @ We should see a relocation entry to __aeabi_unwind_cpp_pr0, so that the @ linker can keep __aeabi_unwind_cpp_pr0. @------------------------------------------------------------------------------- -@ CHECK: Section { -@ CHECK: Name: .rel.ARM.exidx.TEST2 -@ CHECK: Relocations [ -@ CHECK: 0x0 R_ARM_PREL31 .TEST2 0x0 -@ CHECK: 0x0 R_ARM_NONE __aeabi_unwind_cpp_pr1 0x0 -@ CHECK: 0x4 R_ARM_PREL31 .ARM.extab.TEST2 0x0 -@ CHECK: ] -@ CHECK: } +@ RELOC: Section { +@ RELOC: Name: .rel.ARM.exidx.TEST2 +@ RELOC: Relocations [ +@ RELOC: 0x0 R_ARM_PREL31 .TEST2 0x0 +@ RELOC: 0x0 R_ARM_NONE __aeabi_unwind_cpp_pr1 0x0 +@ RELOC: 0x4 R_ARM_PREL31 .ARM.extab.TEST2 0x0 +@ RELOC: ] +@ RELOC: } diff --git a/test/MC/ARM/eh-directive-personality.s b/test/MC/ARM/eh-directive-personality.s index bbc5a6eb9e4..84e62bdfd68 100644 --- a/test/MC/ARM/eh-directive-personality.s +++ b/test/MC/ARM/eh-directive-personality.s @@ -1,5 +1,7 @@ @ RUN: llvm-mc %s -triple=armv7-unknown-linux-gnueabi -filetype=obj -o - \ -@ RUN: | llvm-readobj -s -sd -sr | FileCheck %s +@ RUN: | llvm-readobj -s -sd -sr > %t +@ RUN: FileCheck %s < %t +@ RUN: FileCheck --check-prefix=RELOC %s < %t @ Check the .personality directive. @@ -33,12 +35,12 @@ func1: @ CHECK: ) @ CHECK: } -@ CHECK: Section { -@ CHECK: Name: .rel.ARM.extab.TEST1 -@ CHECK: Relocations [ -@ CHECK: 0x0 R_ARM_PREL31 __gxx_personality_v0 0x0 -@ CHECK: ] -@ CHECK: } +@ RELOC: Section { +@ RELOC: Name: .rel.ARM.extab.TEST1 +@ RELOC: Relocations [ +@ RELOC: 0x0 R_ARM_PREL31 __gxx_personality_v0 0x0 +@ RELOC: ] +@ RELOC: } @ CHECK: Section { @ CHECK: Name: .ARM.exidx.TEST1 @@ -47,13 +49,13 @@ func1: @ CHECK: ) @ CHECK: } -@ CHECK: Section { -@ CHECK: Name: .rel.ARM.exidx.TEST1 -@ CHECK: Relocations [ -@ CHECK: 0x0 R_ARM_PREL31 .TEST1 0x0 -@ CHECK: 0x4 R_ARM_PREL31 .ARM.extab.TEST1 0x0 -@ CHECK: ] -@ CHECK: } +@ RELOC: Section { +@ RELOC: Name: .rel.ARM.exidx.TEST1 +@ RELOC: Relocations [ +@ RELOC: 0x0 R_ARM_PREL31 .TEST1 0x0 +@ RELOC: 0x4 R_ARM_PREL31 .ARM.extab.TEST1 0x0 +@ RELOC: ] +@ RELOC: } @------------------------------------------------------------------------------- @@ -84,12 +86,12 @@ func2: @ CHECK: ) @ CHECK: } -@ CHECK: Section { -@ CHECK: Name: .rel.ARM.extab.TEST2 -@ CHECK: Relocations [ -@ CHECK: 0x0 R_ARM_PREL31 __gxx_personality_v0 0x0 -@ CHECK: ] -@ CHECK: } +@ RELOC: Section { +@ RELOC: Name: .rel.ARM.extab.TEST2 +@ RELOC: Relocations [ +@ RELOC: 0x0 R_ARM_PREL31 __gxx_personality_v0 0x0 +@ RELOC: ] +@ RELOC: } @ CHECK: Section { @ CHECK: Name: .ARM.exidx.TEST2 @@ -98,10 +100,10 @@ func2: @ CHECK: ) @ CHECK: } -@ CHECK: Section { -@ CHECK: Name: .rel.ARM.exidx.TEST2 -@ CHECK: Relocations [ -@ CHECK: 0x0 R_ARM_PREL31 .TEST2 0x0 -@ CHECK: 0x4 R_ARM_PREL31 .ARM.extab.TEST2 0x0 -@ CHECK: ] -@ CHECK: } +@ RELOC: Section { +@ RELOC: Name: .rel.ARM.exidx.TEST2 +@ RELOC: Relocations [ +@ RELOC: 0x0 R_ARM_PREL31 .TEST2 0x0 +@ RELOC: 0x4 R_ARM_PREL31 .ARM.extab.TEST2 0x0 +@ RELOC: ] +@ RELOC: } diff --git a/test/MC/ARM/eh-directive-personalityindex.s b/test/MC/ARM/eh-directive-personalityindex.s index 55172275093..6db942503c6 100644 --- a/test/MC/ARM/eh-directive-personalityindex.s +++ b/test/MC/ARM/eh-directive-personalityindex.s @@ -1,5 +1,7 @@ @ RUN: llvm-mc -triple armv7-linux-eabi -filetype obj -o - %s \ -@ RUN: | llvm-readobj -s -sd -sr | FileCheck %s +@ RUN: | llvm-readobj -s -sd -sr > %t +@ RUN: FileCheck %s < %t +@ RUN: FileCheck --check-prefix=RELOC %s < %t .syntax unified .thumb @@ -23,13 +25,13 @@ pr0: @ CHECK: ) @ CHECK: } -@ CHECK: Section { -@ CHECK: Name: .rel.ARM.exidx.pr0 -@ CHECK: Relocations [ -@ CHECK: 0x0 R_ARM_PREL31 .pr0 0x0 -@ CHECK: 0x0 R_ARM_NONE __aeabi_unwind_cpp_pr0 0x0 -@ CHECK: ] -@ CHECK: } +@ RELOC: Section { +@ RELOC: Name: .rel.ARM.exidx.pr0 +@ RELOC: Relocations [ +@ RELOC: 0x0 R_ARM_PREL31 .pr0 0x0 +@ RELOC: 0x0 R_ARM_NONE __aeabi_unwind_cpp_pr0 0x0 +@ RELOC: ] +@ RELOC: } .section .pr0.nontrivial @@ -52,13 +54,13 @@ pr0_nontrivial: @ CHECK: ) @ CHECK: } -@ CHECK: Section { -@ CHECK: Name: .rel.ARM.exidx.pr0.nontrivial -@ CHECK: Relocations [ -@ CHECK: 0x0 R_ARM_PREL31 .pr0.nontrivial 0x0 -@ CHECK: 0x0 R_ARM_NONE __aeabi_unwind_cpp_pr0 0x0 -@ CHECK: ] -@ CHECK: } +@ RELOC: Section { +@ RELOC: Name: .rel.ARM.exidx.pr0.nontrivial +@ RELOC: Relocations [ +@ RELOC: 0x0 R_ARM_PREL31 .pr0.nontrivial 0x0 +@ RELOC: 0x0 R_ARM_NONE __aeabi_unwind_cpp_pr0 0x0 +@ RELOC: ] +@ RELOC: } .section .pr1 @@ -85,14 +87,14 @@ pr1: @ CHECK: ) @ CHECK: } -@ CHECK: Section { -@ CHECK: Name: .rel.ARM.exidx.pr1 -@ CHECK: Relocations [ -@ CHECK: 0x0 R_ARM_PREL31 .pr1 0x0 -@ CHECK: 0x0 R_ARM_NONE __aeabi_unwind_cpp_pr1 0x0 -@ CHECK: 0x4 R_ARM_PREL31 .ARM.extab.pr1 0x0 -@ CHECK: ] -@ CHECK: } +@ RELOC: Section { +@ RELOC: Name: .rel.ARM.exidx.pr1 +@ RELOC: Relocations [ +@ RELOC: 0x0 R_ARM_PREL31 .pr1 0x0 +@ RELOC: 0x0 R_ARM_NONE __aeabi_unwind_cpp_pr1 0x0 +@ RELOC: 0x4 R_ARM_PREL31 .ARM.extab.pr1 0x0 +@ RELOC: ] +@ RELOC: } .section .pr1.nontrivial @@ -122,14 +124,14 @@ pr1_nontrivial: @ CHECK: ) @ CHECK: } -@ CHECK: Section { -@ CHECK: Name: .rel.ARM.exidx.pr1.nontrivial -@ CHECK: Relocations [ -@ CHECK: 0x0 R_ARM_PREL31 .pr1.nontrivial 0x0 -@ CHECK: 0x0 R_ARM_NONE __aeabi_unwind_cpp_pr1 0x0 -@ CHECK: 0x4 R_ARM_PREL31 .ARM.extab.pr1.nontrivial 0x0 -@ CHECK: ] -@ CHECK: } +@ RELOC: Section { +@ RELOC: Name: .rel.ARM.exidx.pr1.nontrivial +@ RELOC: Relocations [ +@ RELOC: 0x0 R_ARM_PREL31 .pr1.nontrivial 0x0 +@ RELOC: 0x0 R_ARM_NONE __aeabi_unwind_cpp_pr1 0x0 +@ RELOC: 0x4 R_ARM_PREL31 .ARM.extab.pr1.nontrivial 0x0 +@ RELOC: ] +@ RELOC: } .section .pr2 @@ -156,14 +158,14 @@ pr2: @ CHECK: ) @ CHECK: } -@ CHECK: Section { -@ CHECK: Name: .rel.ARM.exidx.pr2 -@ CHECK: Relocations [ -@ CHECK: 0x0 R_ARM_PREL31 .pr2 0x0 -@ CHECK: 0x0 R_ARM_NONE __aeabi_unwind_cpp_pr2 0x0 -@ CHECK: 0x4 R_ARM_PREL31 .ARM.extab.pr2 0x0 -@ CHECK: ] -@ CHECK: } +@ RELOC: Section { +@ RELOC: Name: .rel.ARM.exidx.pr2 +@ RELOC: Relocations [ +@ RELOC: 0x0 R_ARM_PREL31 .pr2 0x0 +@ RELOC: 0x0 R_ARM_NONE __aeabi_unwind_cpp_pr2 0x0 +@ RELOC: 0x4 R_ARM_PREL31 .ARM.extab.pr2 0x0 +@ RELOC: ] +@ RELOC: } .section .pr2.nontrivial .type pr2_nontrivial,%function @@ -191,12 +193,11 @@ pr2_nontrivial: @ CHECK: ) @ CHECK: } -@ CHECK: Section { -@ CHECK: Name: .rel.ARM.exidx.pr2.nontrivial -@ CHECK: Relocations [ -@ CHECK: 0x0 R_ARM_PREL31 .pr2.nontrivial 0x0 -@ CHECK: 0x0 R_ARM_NONE __aeabi_unwind_cpp_pr2 0x0 -@ CHECK: 0x4 R_ARM_PREL31 .ARM.extab.pr2.nontrivial 0x0 -@ CHECK: ] -@ CHECK: } - +@ RELOC: Section { +@ RELOC: Name: .rel.ARM.exidx.pr2.nontrivial +@ RELOC: Relocations [ +@ RELOC: 0x0 R_ARM_PREL31 .pr2.nontrivial 0x0 +@ RELOC: 0x0 R_ARM_NONE __aeabi_unwind_cpp_pr2 0x0 +@ RELOC: 0x4 R_ARM_PREL31 .ARM.extab.pr2.nontrivial 0x0 +@ RELOC: ] +@ RELOC: } diff --git a/test/MC/ARM/eh-directive-section-multiple-func.s b/test/MC/ARM/eh-directive-section-multiple-func.s index 425cbd7d015..e7198a4aecb 100644 --- a/test/MC/ARM/eh-directive-section-multiple-func.s +++ b/test/MC/ARM/eh-directive-section-multiple-func.s @@ -1,5 +1,7 @@ @ RUN: llvm-mc %s -triple=armv7-unknown-linux-gnueabi -filetype=obj -o - \ -@ RUN: | llvm-readobj -s -sd -sr -t | FileCheck %s +@ RUN: | llvm-readobj -s -sd -sr -t > %t +@ RUN: FileCheck %s < %t +@ RUN: FileCheck --check-prefix=RELOC %s < %t @ Check whether the section is switched back properly. @@ -70,13 +72,13 @@ func2: @ CHECK: ) @ CHECK: } -@ CHECK: Section { -@ CHECK: Name: .rel.ARM.extab.TEST1 -@ CHECK: Relocations [ -@ CHECK: 0x0 R_ARM_PREL31 __gxx_personality_v0 0x0 -@ CHECK: 0x8 R_ARM_PREL31 __gxx_personality_v0 0x0 -@ CHECK: ] -@ CHECK: } +@ RELOC: Section { +@ RELOC: Name: .rel.ARM.extab.TEST1 +@ RELOC: Relocations [ +@ RELOC: 0x0 R_ARM_PREL31 __gxx_personality_v0 0x0 +@ RELOC: 0x8 R_ARM_PREL31 __gxx_personality_v0 0x0 +@ RELOC: ] +@ RELOC: } @------------------------------------------------------------------------------- @@ -99,15 +101,15 @@ func2: @ .ARM.extab.TESET1 section. @------------------------------------------------------------------------------- -@ CHECK: Section { -@ CHECK: Name: .rel.ARM.exidx.TEST1 -@ CHECK: Relocations [ -@ CHECK: 0x0 R_ARM_PREL31 .TEST1 0x0 -@ CHECK: 0x4 R_ARM_PREL31 .ARM.extab.TEST1 0x0 -@ CHECK: 0x8 R_ARM_PREL31 .TEST1 0x0 -@ CHECK: 0xC R_ARM_PREL31 .ARM.extab.TEST1 0x0 -@ CHECK: ] -@ CHECK: } +@ RELOC: Section { +@ RELOC: Name: .rel.ARM.exidx.TEST1 +@ RELOC: Relocations [ +@ RELOC: 0x0 R_ARM_PREL31 .TEST1 0x0 +@ RELOC: 0x4 R_ARM_PREL31 .ARM.extab.TEST1 0x0 +@ RELOC: 0x8 R_ARM_PREL31 .TEST1 0x0 +@ RELOC: 0xC R_ARM_PREL31 .ARM.extab.TEST1 0x0 +@ RELOC: ] +@ RELOC: } @------------------------------------------------------------------------------- diff --git a/test/MC/ARM/eh-directive-section.s b/test/MC/ARM/eh-directive-section.s index 309067a080f..671d10679d1 100644 --- a/test/MC/ARM/eh-directive-section.s +++ b/test/MC/ARM/eh-directive-section.s @@ -1,5 +1,7 @@ @ RUN: llvm-mc %s -triple=armv7-unknown-linux-gnueabi -filetype=obj -o - \ -@ RUN: | llvm-readobj -s -sd -sr -t | FileCheck %s +@ RUN: | llvm-readobj -s -sd -sr -t > %t +@ RUN: FileCheck %s < %t +@ RUN: FileCheck --check-prefix=RELOC %s < %t @ Check the combination of .section, .fnstart, and .fnend directives. @@ -65,12 +67,12 @@ func2: @ CHECK: ) @ CHECK: } -@ CHECK: Section { -@ CHECK: Name: .rel.ARM.extab.TEST1 -@ CHECK: Relocations [ -@ CHECK: 0x0 R_ARM_PREL31 __gxx_personality_v0 0x0 -@ CHECK: ] -@ CHECK: } +@ RELOC: Section { +@ RELOC: Name: .rel.ARM.extab.TEST1 +@ RELOC: Relocations [ +@ RELOC: 0x0 R_ARM_PREL31 __gxx_personality_v0 0x0 +@ RELOC: ] +@ RELOC: } @------------------------------------------------------------------------------- @@ -94,13 +96,13 @@ func2: @ CHECK: ) @ CHECK: } -@ CHECK: Section { -@ CHECK: Name: .rel.ARM.exidx.TEST1 -@ CHECK: Relocations [ -@ CHECK: 0x0 R_ARM_PREL31 .TEST1 0x0 -@ CHECK: 0x4 R_ARM_PREL31 .ARM.extab.TEST1 0x0 -@ CHECK: ] -@ CHECK: } +@ RELOC: Section { +@ RELOC: Name: .rel.ARM.exidx.TEST1 +@ RELOC: Relocations [ +@ RELOC: 0x0 R_ARM_PREL31 .TEST1 0x0 +@ RELOC: 0x4 R_ARM_PREL31 .ARM.extab.TEST1 0x0 +@ RELOC: ] +@ RELOC: } @------------------------------------------------------------------------------- @@ -124,12 +126,12 @@ func2: @ CHECK: ) @ CHECK: } -@ CHECK: Section { -@ CHECK: Name: .rel.ARM.extabTEST2 -@ CHECK: Relocations [ -@ CHECK: 0x0 R_ARM_PREL31 __gxx_personality_v0 0x0 -@ CHECK: ] -@ CHECK: } +@ RELOC: Section { +@ RELOC: Name: .rel.ARM.extabTEST2 +@ RELOC: Relocations [ +@ RELOC: 0x0 R_ARM_PREL31 __gxx_personality_v0 0x0 +@ RELOC: ] +@ RELOC: } @------------------------------------------------------------------------------- @@ -153,13 +155,13 @@ func2: @ CHECK: ) @ CHECK: } -@ CHECK: Section { -@ CHECK: Name: .rel.ARM.exidxTEST2 -@ CHECK: Relocations [ -@ CHECK: 0x0 R_ARM_PREL31 TEST2 0x0 -@ CHECK: 0x4 R_ARM_PREL31 .ARM.extabTEST2 0x0 -@ CHECK: ] -@ CHECK: } +@ RELOC: Section { +@ RELOC: Name: .rel.ARM.exidxTEST2 +@ RELOC: Relocations [ +@ RELOC: 0x0 R_ARM_PREL31 TEST2 0x0 +@ RELOC: 0x4 R_ARM_PREL31 .ARM.extabTEST2 0x0 +@ RELOC: ] +@ RELOC: }