[llvm] r372809 - [llvm-objcopy][test] Clean up -B tests

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 24 20:41:01 PDT 2019


Author: maskray
Date: Tue Sep 24 20:41:01 2019
New Revision: 372809

URL: http://llvm.org/viewvc/llvm-project?rev=372809&view=rev
Log:
[llvm-objcopy][test] Clean up -B tests

-B is ignored for GNU objcopy compatibility after D67215/r371914.

* Delete mentions of -B from input-output-target.test - we have enough -B tests.
* Merge binary-input-with-arch.test into binary-output-target.test.

Reviewed By: rupprecht

Differential Revision: https://reviews.llvm.org/D67693

Removed:
    llvm/trunk/test/tools/llvm-objcopy/ELF/binary-input-with-arch.test
Modified:
    llvm/trunk/test/tools/llvm-objcopy/ELF/binary-output-target.test
    llvm/trunk/test/tools/llvm-objcopy/ELF/input-output-target.test

Removed: llvm/trunk/test/tools/llvm-objcopy/ELF/binary-input-with-arch.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-objcopy/ELF/binary-input-with-arch.test?rev=372808&view=auto
==============================================================================
--- llvm/trunk/test/tools/llvm-objcopy/ELF/binary-input-with-arch.test (original)
+++ llvm/trunk/test/tools/llvm-objcopy/ELF/binary-input-with-arch.test (removed)
@@ -1,26 +0,0 @@
-# RUN: echo -n abcd > %t.x-txt
-# Preserve input to verify it is not modified.
-# RUN: cp %t.x-txt %t-copy.txt
-# RUN: llvm-objcopy -I binary -B i386 -O elf64-x86-64 %t.x-txt %t.o
-# RUN: llvm-readobj --file-headers %t.o | FileCheck %s --check-prefixes=CHECK,SYSV
-# RUN: cmp %t.x-txt %t-copy.txt
-
-# Many uses of objcopy use no spaces in the flags, make sure that also works.
-# RUN: llvm-objcopy -Ibinary -Bi386 -Oelf64-x86-64 %t.x-txt %t-no-spaces.o
-# RUN: cmp %t.o %t-no-spaces.o
-
-# elf64-x86-64-freebsd sets the OS/ABI field.
-# RUN: llvm-objcopy -I binary -B i386 -O elf64-x86-64-freebsd %t.x-txt %t.freebsd.o
-# RUN: llvm-readobj --file-headers %t.freebsd.o | FileCheck %s --check-prefixes=CHECK,FREEBSD
-
-# CHECK:      Format: ELF64-x86-64
-# CHECK-NEXT: Arch: x86_64
-# CHECK-NEXT: AddressSize: 64bit
-
-# CHECK: Class: 64-bit
-# CHECK: DataEncoding: LittleEndian
-# SYSV:    OS/ABI: SystemV
-# FREEBSD: OS/ABI: FreeBSD
-# CHECK: Machine: EM_X86_64
-# CHECK: HeaderSize: 64
-# CHECK: SectionHeaderEntrySize: 64

Modified: llvm/trunk/test/tools/llvm-objcopy/ELF/binary-output-target.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-objcopy/ELF/binary-output-target.test?rev=372809&r1=372808&r2=372809&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-objcopy/ELF/binary-output-target.test (original)
+++ llvm/trunk/test/tools/llvm-objcopy/ELF/binary-output-target.test Tue Sep 24 20:41:01 2019
@@ -105,3 +105,12 @@
 # CHECK-NEXT:     SectionHeaderCount: 4
 # CHECK-NEXT:     StringTableSectionIndex:
 # CHECK-NEXT:   }
+
+## ELFOSABI_NONE = ELFOSABI_SYSV = 0 is the default.
+## "-freebsd" suffixed target name can change the field to ELFOSABI_FREEBSD.
+
+## Many uses of objcopy use no spaces in the flags, make sure that also works.
+# RUN: llvm-objcopy -Ibinary -O elf64-x86-64-freebsd %t.txt %t.freebsd.o
+# RUN: llvm-readobj --file-headers %t.freebsd.o | FileCheck %s --check-prefixes=FREEBSD
+
+# FREEBSD: OS/ABI: FreeBSD

Modified: llvm/trunk/test/tools/llvm-objcopy/ELF/input-output-target.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-objcopy/ELF/input-output-target.test?rev=372809&r1=372808&r2=372809&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-objcopy/ELF/input-output-target.test (original)
+++ llvm/trunk/test/tools/llvm-objcopy/ELF/input-output-target.test Tue Sep 24 20:41:01 2019
@@ -4,18 +4,18 @@
 # RUN: cp %t.txt %t-copy.txt
 
 # -F <target> is equivalent to -I <target> -O <target>
-# RUN: llvm-objcopy -F binary -B i386:x86-64 %t.txt %t.2.txt
+# RUN: llvm-objcopy -F binary %t.txt %t.2.txt
 # RUN: cmp %t-copy.txt %t.2.txt
 
 # --target <target> is equivalent to --input-target <target> --output-target <target>
-# RUN: llvm-objcopy --target binary -B i386:x86-64 %t.txt %t.3.txt
+# RUN: llvm-objcopy --target binary %t.txt %t.3.txt
 # RUN: cmp %t-copy.txt %t.3.txt
 
 # --target is incompatibile with --input-target/--output-target
-# RUN: not llvm-objcopy --target binary --input-target binary -B i386:x86-64 \
+# RUN: not llvm-objcopy --target binary --input-target binary \
 # RUN:     %t.txt %t.4.txt 2>&1 \
 # RUN:     | FileCheck %s --check-prefix=BAD-FLAG
-# RUN: not llvm-objcopy --target binary --output-target binary -B i386:x86-64 \
+# RUN: not llvm-objcopy --target binary --output-target binary \
 # RUN:     %t.txt %t.4.txt 2>&1 \
 # RUN:     | FileCheck %s --check-prefix=BAD-FLAG
 




More information about the llvm-commits mailing list