[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

llvm-svn: 335498
This commit is contained in:
Fangrui Song 2018-06-25 17:07:40 +00:00
parent b725c69f12
commit 5ea154402e
10 changed files with 37 additions and 37 deletions

View File

@ -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

View File

@ -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

View File

@ -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.

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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;

View File

@ -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

View File

@ -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 {

View File

@ -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