[lld] r335498 - [ELF] Change test files for style consistency. NFC

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 25 10:07:40 PDT 2018


Author: maskray
Date: Mon Jun 25 10:07:40 2018
New Revision: 335498

URL: http://llvm.org/viewvc/llvm-project?rev=335498&view=rev
Log:
[ELF] Change test files for style consistency. NFC

* Move `REQUIRES:` line to the top
* llvm-mc ... -o %t -> llvm-mc ... -o %t.o
* Don't check "TEXT" "DATA" columns (they are bfd-style names that do
not fit into llvm well) in llvm-objdump output

Modified:
    lld/trunk/test/ELF/arm-exidx-sentinel-orphan.s
    lld/trunk/test/ELF/arm-plt-reloc.s
    lld/trunk/test/ELF/linkerscript/non-alloc.s
    lld/trunk/test/ELF/linkerscript/sections-keep.s
    lld/trunk/test/ELF/linkerscript/sections-sort.s
    lld/trunk/test/ELF/linkerscript/sort-non-script.s
    lld/trunk/test/ELF/linkerscript/synthetic-symbols4.test
    lld/trunk/test/ELF/sort-norosegment.s
    lld/trunk/test/ELF/visibility.s
    lld/trunk/test/ELF/x86-64-reloc-error.s

Modified: lld/trunk/test/ELF/arm-exidx-sentinel-orphan.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/arm-exidx-sentinel-orphan.s?rev=335498&r1=335497&r2=335498&view=diff
==============================================================================
--- lld/trunk/test/ELF/arm-exidx-sentinel-orphan.s (original)
+++ lld/trunk/test/ELF/arm-exidx-sentinel-orphan.s Mon Jun 25 10:07:40 2018
@@ -1,3 +1,4 @@
+// REQUIRES: arm
 // RUN: llvm-mc -filetype=obj -triple=armv7a-none-linux-gnueabi %s -o %t
 // Use Linker script without .ARM.exidx Output Section so it is treated as
 // an orphan. We must still add the sentinel table entry
@@ -6,7 +7,6 @@
 // RUN:          } " > %t.script
 // RUN: ld.lld --no-merge-exidx-entries --script %t.script %t -o %t2
 // RUN: llvm-objdump -s -triple=armv7a-none-linux-gnueabi %t2 | FileCheck %s
-// REQUIRES: arm
 
  .syntax unified
  .text

Modified: lld/trunk/test/ELF/arm-plt-reloc.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/arm-plt-reloc.s?rev=335498&r1=335497&r2=335498&view=diff
==============================================================================
--- lld/trunk/test/ELF/arm-plt-reloc.s (original)
+++ lld/trunk/test/ELF/arm-plt-reloc.s Mon Jun 25 10:07:40 2018
@@ -96,7 +96,7 @@ _start:
 // DSOREL-NEXT:    AddressAlignment: 4
 // DSOREL-NEXT:    EntrySize:
 // DSOREL:  Relocations [
-// DSOREL-NEXT:  Section (4) .rel.plt {
+// DSOREL-NEXT:  Section {{.*}} .rel.plt {
 // DSOREL-NEXT:    0x200C R_ARM_JUMP_SLOT func1 0x0
 // DSOREL-NEXT:    0x2010 R_ARM_JUMP_SLOT func2 0x0
 // DSOREL-NEXT:    0x2014 R_ARM_JUMP_SLOT func3 0x0
@@ -162,7 +162,7 @@ _start:
 // DSORELHIGH-NEXT:     ]
 // DSORELHIGH-NEXT:     Address: 0x1100000
 // DSORELHIGH: Relocations [
-// DSORELHIGH-NEXT:   Section (6) .rel.plt {
+// DSORELHIGH-NEXT:   Section {{.*}} .rel.plt {
 // DSORELHIGH-NEXT:     0x110000C R_ARM_JUMP_SLOT func1 0x0
 // DSORELHIGH-NEXT:     0x1100010 R_ARM_JUMP_SLOT func2 0x0
 // DSORELHIGH-NEXT:     0x1100014 R_ARM_JUMP_SLOT func3 0x0
@@ -227,7 +227,7 @@ _start:
 // DSORELLONG-NEXT:     ]
 // DSORELLONG-NEXT:     Address: 0x11111100
 // DSORELLONG: Relocations [
-// DSORELLONG-NEXT:   Section (6) .rel.plt {
+// DSORELLONG-NEXT:   Section {{.*}} .rel.plt {
 // DSORELLONG-NEXT:     0x1111110C R_ARM_JUMP_SLOT func1 0x0
 // DSORELLONG-NEXT:     0x11111110 R_ARM_JUMP_SLOT func2 0x0
 // DSORELLONG-NEXT:     0x11111114 R_ARM_JUMP_SLOT func3 0x0
@@ -292,7 +292,7 @@ _start:
 // DSORELMIX-NEXT:       SHF_WRITE
 // DSORELMIX-NEXT:     ]
 // DSORELMIX-NEXT:     Address: 0x8002020
-// DSORELMIX:   Section (6) .rel.plt {
+// DSORELMIX:   Section {{.*}} .rel.plt {
 // DSORELMIX-NEXT:     0x800202C R_ARM_JUMP_SLOT func1 0x0
 // DSORELMIX-NEXT:     0x8002030 R_ARM_JUMP_SLOT func2 0x0
 // DSORELMIX-NEXT:     0x8002034 R_ARM_JUMP_SLOT func3 0x0

Modified: lld/trunk/test/ELF/linkerscript/non-alloc.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/linkerscript/non-alloc.s?rev=335498&r1=335497&r2=335498&view=diff
==============================================================================
--- lld/trunk/test/ELF/linkerscript/non-alloc.s (original)
+++ lld/trunk/test/ELF/linkerscript/non-alloc.s Mon Jun 25 10:07:40 2018
@@ -1,9 +1,9 @@
 # REQUIRES: x86
-# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t
+# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
 
 # RUN: echo "SECTIONS { .foo 0 : {*(foo)} }" > %t.script
-# RUN: ld.lld --hash-style=sysv -o %t1 --script %t.script %t -shared
-# RUN: llvm-readelf -s -l %t1 | FileCheck %s
+# RUN: ld.lld --hash-style=sysv -o %t --script %t.script %t.o -shared
+# RUN: llvm-readelf -s -l %t | FileCheck %s
 
 # Test that we create all necessary PT_LOAD. We use to stop at the first
 # non-alloc, causing us to not create PT_LOAD for linker generated sections.

Modified: lld/trunk/test/ELF/linkerscript/sections-keep.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/linkerscript/sections-keep.s?rev=335498&r1=335497&r2=335498&view=diff
==============================================================================
--- lld/trunk/test/ELF/linkerscript/sections-keep.s (original)
+++ lld/trunk/test/ELF/linkerscript/sections-keep.s Mon Jun 25 10:07:40 2018
@@ -1,14 +1,14 @@
 # REQUIRES: x86
-# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t
-# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %p/Inputs/keep.s -o %t2.o
+# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o
+# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %p/Inputs/keep.s -o %t1.o
 
 ## First check that section "keep" is garbage collected without using KEEP
 # RUN: echo "SECTIONS { \
 # RUN:  .text : { *(.text) } \
 # RUN:  .keep : { *(.keep) } \
 # RUN:  .temp : { *(.temp) }}" > %t.script
-# RUN: ld.lld --gc-sections -o %t1 --script %t.script %t
-# RUN: llvm-objdump -section-headers %t1 | \
+# RUN: ld.lld --gc-sections -o %t --script %t.script %t.o
+# RUN: llvm-objdump -section-headers %t | \
 # RUN:   FileCheck -check-prefix=SECGC %s
 # SECGC:      Sections:
 # SECGC-NEXT: Idx Name          Size
@@ -21,8 +21,8 @@
 # RUN:  .text : { *(.text) } \
 # RUN:  .keep : { KEEP(*(.keep)) } \
 # RUN:  .temp : { *(.temp) }}" > %t.script
-# RUN: ld.lld --gc-sections -o %t1 --script %t.script %t
-# RUN: llvm-objdump -section-headers %t1 | \
+# RUN: ld.lld --gc-sections -o %t --script %t.script %t.o
+# RUN: llvm-objdump -section-headers %t | \
 # RUN:   FileCheck -check-prefix=SECNOGC %s
 # SECNOGC:      Sections:
 # SECNOGC-NEXT: Idx Name          Size
@@ -38,14 +38,14 @@
 # RUN:  . = SIZEOF_HEADERS; \
 # RUN:  .keep : { KEEP(*(.keep)) } \
 # RUN:  .nokeep : { *(.keep) }}" > %t.script
-# RUN: ld.lld --gc-sections -o %t1 --script %t.script %t
-# RUN: llvm-objdump -section-headers %t1 | FileCheck -check-prefix=MIXED1 %s
+# RUN: ld.lld --gc-sections -o %t --script %t.script %t.o
+# RUN: llvm-objdump -section-headers %t | FileCheck -check-prefix=MIXED1 %s
 # MIXED1:      Sections:
 # MIXED1-NEXT: Idx Name          Size
 # MIXED1-NEXT:   0               00000000
 # MIXED1-NEXT:   1 .keep         00000004
-# MIXED1-NEXT:   2 .text         00000007 00000000000000ec TEXT
-# MIXED1-NEXT:   3 .temp         00000004 00000000000000f3 DATA
+# MIXED1-NEXT:   2 .text         00000007 00000000000000ec
+# MIXED1-NEXT:   3 .temp         00000004 00000000000000f3
 # MIXED1-NEXT:   4 .comment      00000008 0000000000000000
 # MIXED1-NEXT:   5 .symtab       00000060 0000000000000000
 # MIXED1-NEXT:   6 .shstrtab     00000036 0000000000000000
@@ -59,14 +59,14 @@
 # RUN:  . = SIZEOF_HEADERS; \
 # RUN:  .nokeep : { *(.keep) } \
 # RUN:  .keep : { KEEP(*(.keep)) }}" > %t.script
-# RUN: ld.lld --gc-sections -o %t1 --script %t.script %t
-# RUN: llvm-objdump -section-headers %t1 | FileCheck -check-prefix=MIXED2 %s
+# RUN: ld.lld --gc-sections -o %t --script %t.script %t.o
+# RUN: llvm-objdump -section-headers %t | FileCheck -check-prefix=MIXED2 %s
 # MIXED2:      Sections:
 # MIXED2-NEXT: Idx Name          Size
 # MIXED2-NEXT:   0               00000000
-# MIXED2-NEXT:   1 .nokeep       00000004 00000000000000e8 DATA
-# MIXED2-NEXT:   2 .text         00000007 00000000000000ec TEXT
-# MIXED2-NEXT:   3 .temp         00000004 00000000000000f3 DATA
+# MIXED2-NEXT:   1 .nokeep       00000004 00000000000000e8
+# MIXED2-NEXT:   2 .text         00000007 00000000000000ec
+# MIXED2-NEXT:   3 .temp         00000004 00000000000000f3
 # MIXED2-NEXT:   4 .comment      00000008 0000000000000000
 # MIXED2-NEXT:   5 .symtab       00000060 0000000000000000
 # MIXED2-NEXT:   6 .shstrtab     00000038 0000000000000000
@@ -75,10 +75,10 @@
 # Check file pattern for kept sections.
 # RUN: echo "SECTIONS { \
 # RUN:  . = SIZEOF_HEADERS; \
-# RUN:  .keep : { KEEP(*2.o(.keep)) } \
+# RUN:  .keep : { KEEP(*1.o(.keep)) } \
 # RUN:  }" > %t.script
-# RUN: ld.lld --gc-sections -o %t1 --script %t.script %t2.o %t
-# RUN: llvm-objdump -s %t1 | FileCheck -check-prefix=FILEMATCH %s
+# RUN: ld.lld --gc-sections -o %t --script %t.script %t1.o %t.o
+# RUN: llvm-objdump -s %t | FileCheck -check-prefix=FILEMATCH %s
 # FILEMATCH:        Contents of section .keep:
 # FILEMATCH-NEXT:   00e8 41414141  AAAA
 

Modified: lld/trunk/test/ELF/linkerscript/sections-sort.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/linkerscript/sections-sort.s?rev=335498&r1=335497&r2=335498&view=diff
==============================================================================
--- lld/trunk/test/ELF/linkerscript/sections-sort.s (original)
+++ lld/trunk/test/ELF/linkerscript/sections-sort.s Mon Jun 25 10:07:40 2018
@@ -13,7 +13,7 @@ nop
 .section foo, "a"
 .byte 0
 
-# CHECK: Id
+# CHECK: Idx
 # CHECK-NEXT: 0
 # CHECK-NEXT: 1 .dynsym
 # CHECK-NEXT: 2 .dynstr

Modified: lld/trunk/test/ELF/linkerscript/sort-non-script.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/linkerscript/sort-non-script.s?rev=335498&r1=335497&r2=335498&view=diff
==============================================================================
--- lld/trunk/test/ELF/linkerscript/sort-non-script.s (original)
+++ lld/trunk/test/ELF/linkerscript/sort-non-script.s Mon Jun 25 10:07:40 2018
@@ -1,8 +1,8 @@
 # REQUIRES: x86
-# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t
+# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
 
 # RUN: echo "SECTIONS { foo : {*(foo)} }" > %t.script
-# RUN: ld.lld --hash-style=sysv -o %t1 --script %t.script %t -shared
+# RUN: ld.lld --hash-style=sysv -o %t --script %t.script %t.o -shared
 # RUN: llvm-readelf -s %t1 | FileCheck %s
 
 # CHECK:      .dynsym  {{.*}}   A

Modified: lld/trunk/test/ELF/linkerscript/synthetic-symbols4.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/linkerscript/synthetic-symbols4.test?rev=335498&r1=335497&r2=335498&view=diff
==============================================================================
--- lld/trunk/test/ELF/linkerscript/synthetic-symbols4.test (original)
+++ lld/trunk/test/ELF/linkerscript/synthetic-symbols4.test Mon Jun 25 10:07:40 2018
@@ -1,7 +1,7 @@
 # REQUIRES: x86
-# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %p/Inputs/synthetic-symbols.s -o %t
-# RUN: ld.lld -o %t.exe --eh-frame-hdr --script %s %t
-# RUN: llvm-objdump -t %t.exe | FileCheck %s
+# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %p/Inputs/synthetic-symbols.s -o %t.o
+# RUN: ld.lld -o %t --eh-frame-hdr --script %s %t.o
+# RUN: llvm-objdump -t %t | FileCheck %s
 
 SECTIONS {
   . = 0x201000;

Modified: lld/trunk/test/ELF/sort-norosegment.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/sort-norosegment.s?rev=335498&r1=335497&r2=335498&view=diff
==============================================================================
--- lld/trunk/test/ELF/sort-norosegment.s (original)
+++ lld/trunk/test/ELF/sort-norosegment.s Mon Jun 25 10:07:40 2018
@@ -1,8 +1,8 @@
 # REQUIRES: x86
-# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t
+# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
 
-# RUN: ld.lld --hash-style=sysv -no-rosegment -o %t1  %t -shared
-# RUN: llvm-readelf -s %t1 | FileCheck %s
+# RUN: ld.lld --hash-style=sysv -no-rosegment -o %t %t.o -shared
+# RUN: llvm-readelf -s %t | FileCheck %s
 
 # CHECK:      .dynsym  {{.*}}   A
 # CHECK-NEXT: .dynstr  {{.*}}   A

Modified: lld/trunk/test/ELF/visibility.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/visibility.s?rev=335498&r1=335497&r2=335498&view=diff
==============================================================================
--- lld/trunk/test/ELF/visibility.s (original)
+++ lld/trunk/test/ELF/visibility.s Mon Jun 25 10:07:40 2018
@@ -1,8 +1,8 @@
+// REQUIRES: x86
 // RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t
 // RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %p/Inputs/visibility.s -o %t2
 // RUN: ld.lld -shared %t %t2 -o %t3
 // RUN: llvm-readobj -t -dyn-symbols %t3 | FileCheck %s
-// REQUIRES: x86
 
 // CHECK:      Symbols [
 // CHECK-NEXT:   Symbol {

Modified: lld/trunk/test/ELF/x86-64-reloc-error.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/x86-64-reloc-error.s?rev=335498&r1=335497&r2=335498&view=diff
==============================================================================
--- lld/trunk/test/ELF/x86-64-reloc-error.s (original)
+++ lld/trunk/test/ELF/x86-64-reloc-error.s Mon Jun 25 10:07:40 2018
@@ -1,7 +1,7 @@
+// REQUIRES: x86
 // RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %S/Inputs/x86-64-reloc-error.s -o %tabs
 // RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t
 // RUN: not ld.lld -shared %tabs %t -o %t2 2>&1 | FileCheck %s
-// REQUIRES: x86
 
   movl $big, %edx
   movq $foo - 0x1000000000000, %rdx




More information about the llvm-commits mailing list