[llvm] r360904 - [llvm-objdump]Split section-filter.test in two to remove X86 dependency

James Henderson via llvm-commits llvm-commits at lists.llvm.org
Thu May 16 07:49:10 PDT 2019


Author: jhenderson
Date: Thu May 16 07:49:10 2019
New Revision: 360904

URL: http://llvm.org/viewvc/llvm-project?rev=360904&view=rev
Log:
[llvm-objdump]Split section-filter.test in two to remove X86 dependency

This allows the generic parts of section-filter.test to be tested on all
targets. The X86-specific parts have been moved to another test.

Added:
    llvm/trunk/test/tools/llvm-objdump/X86/section-filter-disasm.test
Modified:
    llvm/trunk/test/tools/llvm-objdump/section-filter.test

Added: llvm/trunk/test/tools/llvm-objdump/X86/section-filter-disasm.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-objdump/X86/section-filter-disasm.test?rev=360904&view=auto
==============================================================================
--- llvm/trunk/test/tools/llvm-objdump/X86/section-filter-disasm.test (added)
+++ llvm/trunk/test/tools/llvm-objdump/X86/section-filter-disasm.test Thu May 16 07:49:10 2019
@@ -0,0 +1,84 @@
+## Test that --section works correctly for -d with -r.
+## FIXME: Inline relocations are only printed if the relocation section itself is
+##        specified with --section. This test just characterizes the existing behavior.
+##        See https://bugs.llvm.org/show_bug.cgi?id=41886
+# RUN: yaml2obj %s -o %t.o
+
+## Show non-executable sections are not disassembled even if specified,
+## and that only the specified executable sections are disassembled.
+## Also show that no relocation sections are dumped because none are
+## specified.
+## FIXME: This is different behaviour to GNU objdump, which dumps the non-
+##        executable sections if requested explicitly.
+##        See https://bugs.llvm.org/show_bug.cgi?id=41897.
+# RUN: llvm-objdump -d -r %t.o --section=.text --section=.rodata \
+# RUN:   | FileCheck %s --check-prefix=DISASM --implicit-check-not=.text2 \
+# RUN:           --implicit-check-not=.rodata --implicit-check-not=R_X86_64
+
+## Show that only the specified relocation sections that patch the
+## disassembled sections are dumped.
+# RUN: llvm-objdump -d -r %t.o --section=.text \
+# RUN:                         --section=.rela.text --section=.rela.text2 \
+# RUN:   | FileCheck %s --check-prefixes=DISASM,RELOC --implicit-check-not=.text2 \
+# RUN:           --implicit-check-not=R_X86_64
+
+# DISASM:       Disassembly of section .text:
+# DISASM-EMPTY:
+# DISASM-NEXT:  0000000000000400 .text:
+# DISASM-NEXT:  400: e8 00 00 00 00                callq   0 <.text+0x5>
+# RELOC-NEXT:                      00000401:  R_X86_64_PC32        foo+1
+
+--- !ELF
+FileHeader:
+  Class:   ELFCLASS64
+  Data:    ELFDATA2LSB
+  Type:    ET_REL
+  Machine: EM_X86_64
+Sections:
+  - Name:         .text
+    Type:         SHT_PROGBITS
+    Flags:        [SHF_ALLOC, SHF_EXECINSTR]
+    Address:      0x400
+    AddressAlign: 0x10
+    Content:      'e800000000'
+  - Name:         .text2
+    Type:         SHT_PROGBITS
+    Flags:        [SHF_ALLOC, SHF_EXECINSTR]
+    Address:      0x401
+    Content:      '90e800000000'
+  - Name:         .rela.text
+    Type:         SHT_RELA
+    Info:         .text
+    Relocations:
+      - Offset: 1
+        Symbol: foo
+        Addend: 1
+        Type:   R_X86_64_PC32
+  - Name:         .another.rela.text
+    Type:         SHT_RELA
+    Info:         .text
+    Relocations:
+      - Offset: 1
+        Symbol: foo
+        Type:   R_X86_64_GOT32
+  - Name:         .rela.text2
+    Type:         SHT_RELA
+    Info:         .text2
+    Relocations:
+      - Offset: 1
+        Symbol: foo
+        Addend: 2
+        Type:   R_X86_64_PLT32
+  - Name:       .rodata
+    Type:       SHT_PROGBITS
+    Flags:      [SHF_ALLOC]
+    Size:       4
+  - Name:       .rela.rodata
+    Type:       SHT_RELA
+    Info:       .rodata
+    Relocations:
+      - Offset: 0
+        Symbol: foo
+        Type: R_X86_64_NONE
+Symbols:
+  - Name: foo

Modified: llvm/trunk/test/tools/llvm-objdump/section-filter.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-objdump/section-filter.test?rev=360904&r1=360903&r2=360904&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-objdump/section-filter.test (original)
+++ llvm/trunk/test/tools/llvm-objdump/section-filter.test Thu May 16 07:49:10 2019
@@ -1,4 +1,3 @@
-# REQUIRES: x86-registered-target
 ## Test that --section works correctly for -h.
 ## We test the LMA here too, because the code at the time of writing uses the 
 ## value of --section when looking up section LMAs.
@@ -58,91 +57,6 @@ ProgramHeaders:
     Sections:
       - Section: .bss
 
-## Test that --section works correctly for -d with -r.
-## FIXME: Inline relocations are only printed if the relocation section itself is
-##        specified with --section. This test just characterizes the existing behavior.
-##        See https://bugs.llvm.org/show_bug.cgi?id=41886
-# RUN: yaml2obj %s --docnum=2 -o %t.o
-
-## Show non-executable sections are not disassembled even if specified,
-## and that only the specified executable sections are disassembled.
-## Also show that no relocation sections are dumped because none are
-## specified.
-## FIXME: This is different behaviour to GNU objdump, which dumps the non-
-##        executable sections if requested explicitly.
-##        See https://bugs.llvm.org/show_bug.cgi?id=41897.
-# RUN: llvm-objdump -d -r %t.o --section=.text --section=.rodata \
-# RUN:   | FileCheck %s --check-prefix=DISASM --implicit-check-not=.text2 \
-# RUN:           --implicit-check-not=.rodata --implicit-check-not=R_X86_64
-
-## Show that only the specified relocation sections that patch the
-## disassembled sections are dumped.
-# RUN: llvm-objdump -d -r %t.o --section=.text \
-# RUN:                         --section=.rela.text --section=.rela.text2 \
-# RUN:   | FileCheck %s --check-prefixes=DISASM,RELOC --implicit-check-not=.text2 \
-# RUN:           --implicit-check-not=R_X86_64
-
-# DISASM:       Disassembly of section .text:
-# DISASM-EMPTY:
-# DISASM-NEXT:  0000000000000400 .text:
-# DISASM-NEXT:  400: e8 00 00 00 00                callq   0 <.text+0x5>
-# RELOC-NEXT:                      00000401:  R_X86_64_PC32        foo+1
-
---- !ELF
-FileHeader:
-  Class:   ELFCLASS64
-  Data:    ELFDATA2LSB
-  Type:    ET_REL
-  Machine: EM_X86_64
-Sections:
-  - Name:         .text
-    Type:         SHT_PROGBITS
-    Flags:        [SHF_ALLOC, SHF_EXECINSTR]
-    Address:      0x400
-    AddressAlign: 0x10
-    Content:      'e800000000'
-  - Name:         .text2
-    Type:         SHT_PROGBITS
-    Flags:        [SHF_ALLOC, SHF_EXECINSTR]
-    Address:      0x401
-    Content:      '90e800000000'
-  - Name:         .rela.text
-    Type:         SHT_RELA
-    Info:         .text
-    Relocations:
-      - Offset: 1
-        Symbol: foo
-        Addend: 1
-        Type:   R_X86_64_PC32
-  - Name:         .another.rela.text
-    Type:         SHT_RELA
-    Info:         .text
-    Relocations:
-      - Offset: 1
-        Symbol: foo
-        Type:   R_X86_64_GOT32
-  - Name:         .rela.text2
-    Type:         SHT_RELA
-    Info:         .text2
-    Relocations:
-      - Offset: 1
-        Symbol: foo
-        Addend: 2
-        Type:   R_X86_64_PLT32
-  - Name:       .rodata
-    Type:       SHT_PROGBITS
-    Flags:      [SHF_ALLOC]
-    Size:       4
-  - Name:       .rela.rodata
-    Type:       SHT_RELA
-    Info:       .rodata
-    Relocations:
-      - Offset: 0
-        Symbol: foo
-        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 \
@@ -163,7 +77,7 @@ Symbols:
 # CONTENTS: Contents of section .rela.text2:
 
 ## Test that --section works with --fault-map-section.
-# RUN: yaml2obj %s --docnum=3 -o %t2.o
+# RUN: yaml2obj %s --docnum=2 -o %t2.o
 # RUN: llvm-objdump %t2.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 \




More information about the llvm-commits mailing list