From: James Henderson Date: Thu, 16 May 2019 15:20:08 +0000 (+0000) Subject: [llvm-objdump]Move test code missed in r360904 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=98fef15a46e8df43c1cc5c615f82370c0bbb1e3f;p=llvm [llvm-objdump]Move test code missed in r360904 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360909 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/tools/llvm-objdump/X86/section-filter-disasm.test b/test/tools/llvm-objdump/X86/section-filter-relocs.test similarity index 77% rename from test/tools/llvm-objdump/X86/section-filter-disasm.test rename to test/tools/llvm-objdump/X86/section-filter-relocs.test index 219bb55ec76..f36627e4c9a 100644 --- a/test/tools/llvm-objdump/X86/section-filter-disasm.test +++ b/test/tools/llvm-objdump/X86/section-filter-relocs.test @@ -82,3 +82,22 @@ Sections: Type: R_X86_64_NONE Symbols: - Name: foo + +## Test that --section works when dumping relocation sections. +# RUN: llvm-objdump -r %t.o --section=.another.rela.text --section=.rela.rodata \ +# RUN: | FileCheck %s --check-prefix=DUMP-RELOCS --implicit-check-not=R_X86_64 \ +# RUN: --implicit-check-not="RELOCATION RECORDS" + +# DUMP-RELOCS: RELOCATION RECORDS FOR [.text]: +# DUMP-RELOCS: 00000001 R_X86_64_GOT32 foo +# DUMP-RELOCS: RELOCATION RECORDS FOR [.rodata]: +# DUMP-RELOCS: 00000000 R_X86_64_NONE foo + +## Test that --section works with --full-contents. +# RUN: llvm-objdump -s %t.o --section=.text --section=.rela.text2 \ +# RUN: | FileCheck %s --check-prefix=CONTENTS \ +# RUN: --implicit-check-not=.text \ +# RUN: --implicit-check-not=.rodata + +# CONTENTS: Contents of section .text: +# CONTENTS: Contents of section .rela.text2: diff --git a/test/tools/llvm-objdump/section-filter.test b/test/tools/llvm-objdump/section-filter.test index 9094c2263e7..0c1cd7eccce 100644 --- a/test/tools/llvm-objdump/section-filter.test +++ b/test/tools/llvm-objdump/section-filter.test @@ -57,30 +57,11 @@ ProgramHeaders: Sections: - Section: .bss -## Test that --section works when dumping relocation sections. -# RUN: llvm-objdump -r %t.o --section=.another.rela.text --section=.rela.rodata \ -# RUN: | FileCheck %s --check-prefix=DUMP-RELOCS --implicit-check-not=R_X86_64 \ -# RUN: --implicit-check-not="RELOCATION RECORDS" - -# DUMP-RELOCS: RELOCATION RECORDS FOR [.text]: -# DUMP-RELOCS: 00000001 R_X86_64_GOT32 foo -# DUMP-RELOCS: RELOCATION RECORDS FOR [.rodata]: -# DUMP-RELOCS: 00000000 R_X86_64_NONE foo - -## Test that --section works with --full-contents. -# RUN: llvm-objdump -s %t.o --section=.text --section=.rela.text2 \ -# RUN: | FileCheck %s --check-prefix=CONTENTS \ -# RUN: --implicit-check-not=.text \ -# RUN: --implicit-check-not=.rodata - -# CONTENTS: Contents of section .text: -# CONTENTS: Contents of section .rela.text2: - ## Test that --section works with --fault-map-section. -# RUN: yaml2obj %s --docnum=2 -o %t2.o -# RUN: llvm-objdump %t2.o --fault-map-section -j __clangast \ +# RUN: yaml2obj %s --docnum=2 -o %t.o +# RUN: llvm-objdump %t.o --fault-map-section -j __clangast \ # RUN: | FileCheck %s --check-prefixes=FAULTMAP,NO-FAULTMAP -# RUN: llvm-objdump %t2.o --fault-map-section -j .llvm_faultmaps \ +# RUN: llvm-objdump %t.o --fault-map-section -j .llvm_faultmaps \ # RUN: | FileCheck %s --check-prefixes=FAULTMAP,WITH-FAULTMAP # FAULTMAP: FaultMap table: @@ -89,9 +70,9 @@ ProgramHeaders: # WITH-FAULTMAP-NEXT: NumFunctions: 0 ## Test that --section works with --raw-clang-ast. -# RUN: llvm-objdump %t2.o --raw-clang-ast -j .llvm_faultmaps \ +# RUN: llvm-objdump %t.o --raw-clang-ast -j .llvm_faultmaps \ # RUN: | FileCheck %s --check-prefix=NO-AST --allow-empty -# RUN: llvm-objdump %t2.o --raw-clang-ast -j __clangast \ +# RUN: llvm-objdump %t.o --raw-clang-ast -j __clangast \ # RUN: | FileCheck %s --check-prefix=CLANG-AST # NO-AST-NOT: {{.}}