[llvm] r364903 - [Object/invalid.test] - Convert 3 more sub-tests to YAML
George Rimar via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 2 03:30:06 PDT 2019
Author: grimar
Date: Tue Jul 2 03:30:06 2019
New Revision: 364903
URL: http://llvm.org/viewvc/llvm-project?rev=364903&view=rev
Log:
[Object/invalid.test] - Convert 3 more sub-tests to YAML
This allows to remove 3 more precompiled binaries from the inputs.
Differential revision: https://reviews.llvm.org/D63880
Removed:
llvm/trunk/test/Object/Inputs/invalid-relocation-sec-sh_offset.elf-i386
llvm/trunk/test/Object/Inputs/invalid-relocation-sec-sh_offset.elf-x86-64
llvm/trunk/test/Object/Inputs/invalid-section-size2.elf
Modified:
llvm/trunk/test/Object/invalid.test
Removed: llvm/trunk/test/Object/Inputs/invalid-relocation-sec-sh_offset.elf-i386
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Object/Inputs/invalid-relocation-sec-sh_offset.elf-i386?rev=364902&view=auto
==============================================================================
Binary file - no diff available.
Removed: llvm/trunk/test/Object/Inputs/invalid-relocation-sec-sh_offset.elf-x86-64
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Object/Inputs/invalid-relocation-sec-sh_offset.elf-x86-64?rev=364902&view=auto
==============================================================================
Binary file - no diff available.
Removed: llvm/trunk/test/Object/Inputs/invalid-section-size2.elf
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Object/Inputs/invalid-section-size2.elf?rev=364902&view=auto
==============================================================================
Binary file - no diff available.
Modified: llvm/trunk/test/Object/invalid.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Object/invalid.test?rev=364903&r1=364902&r2=364903&view=diff
==============================================================================
--- llvm/trunk/test/Object/invalid.test (original)
+++ llvm/trunk/test/Object/invalid.test Tue Jul 2 03:30:06 2019
@@ -240,26 +240,59 @@ Sections:
## Check that llvm-readobj reports an error if a relocation section
## has a broken sh_offset (past the end of the file).
-# RUN: not llvm-readobj -r %p/Inputs/invalid-relocation-sec-sh_offset.elf-i386 2>&1 | \
-# RUN: FileCheck --check-prefix=INVALID-RELOC-SH-OFFSET %s
-# RUN: not llvm-readobj -r %p/Inputs/invalid-relocation-sec-sh_offset.elf-x86-64 2>&1 | \
-# RUN: FileCheck --check-prefix=INVALID-RELOC-SH-OFFSET %s
+# RUN: yaml2obj %s --docnum=12 -o %t12
+# RUN: yaml2obj %s --docnum=13 -o %t12
+# RUN: not llvm-readobj -r %t12 2>&1 | FileCheck --check-prefix=INVALID-RELOC-SH-OFFSET %s
+# RUN: not llvm-readobj -r %t13 2>&1 | FileCheck --check-prefix=INVALID-RELOC-SH-OFFSET %s
# INVALID-RELOC-SH-OFFSET: invalid section offset
+--- !ELF
+FileHeader:
+ Class: ELFCLASS64
+ Data: ELFDATA2LSB
+ Type: ET_REL
+ Machine: EM_386
+Sections:
+ - Name: .rel
+ Type: SHT_REL
+ ShOffset: 0x10000
+
+--- !ELF
+FileHeader:
+ Class: ELFCLASS64
+ Data: ELFDATA2LSB
+ Type: ET_REL
+ Machine: EM_X86_64
+Sections:
+ - Name: .rela
+ Type: SHT_RELA
+ ShOffset: 0x10000
+
## Check that llvm-objdump reports an error when .shstrtab has a broken sh_offset
## so large that sh_offset + sh_size overflows the platform address size type.
-# RUN: not llvm-readobj --symbols %p/Inputs/invalid-section-size2.elf 2>&1 | \
-# RUN: FileCheck --check-prefix=INVALID-SECTION-SIZE2 %s
+# RUN: yaml2obj %s --docnum=14 -o %t14
+# RUN: not llvm-readobj --symbols %t14 2>&1 | FileCheck --check-prefix=INVALID-SECTION-SIZE2 %s
# INVALID-SECTION-SIZE2: invalid section offset
+--- !ELF
+FileHeader:
+ Class: ELFCLASS64
+ Data: ELFDATA2LSB
+ Type: ET_REL
+ Machine: EM_386
+Sections:
+ - Name: .shstrtab
+ Type: SHT_STRTAB
+ ShOffset: 0xFFFFFFFF
+
## Check that llvm-readobj reports an error when trying to dump sections
## when the e_shnum field is broken (is greater than the actual number of sections).
-# RUN: yaml2obj %s --docnum=12 -o %t12
-# RUN: not llvm-readobj -S %t12 2>&1 | FileCheck --check-prefix=INVALID-SECTION-NUM %s
+# RUN: yaml2obj %s --docnum=15 -o %t15
+# RUN: not llvm-readobj -S %t15 2>&1 | FileCheck --check-prefix=INVALID-SECTION-NUM %s
# INVALID-SECTION-NUM: section table goes past the end of file
@@ -274,8 +307,8 @@ FileHeader:
## Check that llvm-readobj reports an error if a relocation contains an
## incorrect (too large) symbol index.
-# RUN: yaml2obj %s --docnum=13 -o %t13
-# RUN: not llvm-readobj -r %t13 2>&1 | FileCheck --check-prefix=INVALID-REL-SYM %s
+# RUN: yaml2obj %s --docnum=16 -o %t16
+# RUN: not llvm-readobj -r %t16 2>&1 | FileCheck --check-prefix=INVALID-REL-SYM %s
# INVALID-REL-SYM: invalid section offset
More information about the llvm-commits
mailing list