summaryrefslogtreecommitdiffstats
path: root/llvm/test/tools/llvm-objcopy/ELF
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/test/tools/llvm-objcopy/ELF')
-rw-r--r--llvm/test/tools/llvm-objcopy/ELF/invalid-e_phoff.test8
-rw-r--r--llvm/test/tools/llvm-objcopy/ELF/invalid-e_shoff.test8
2 files changed, 10 insertions, 6 deletions
diff --git a/llvm/test/tools/llvm-objcopy/ELF/invalid-e_phoff.test b/llvm/test/tools/llvm-objcopy/ELF/invalid-e_phoff.test
index 5efe2fc3829..f12b1bf318f 100644
--- a/llvm/test/tools/llvm-objcopy/ELF/invalid-e_phoff.test
+++ b/llvm/test/tools/llvm-objcopy/ELF/invalid-e_phoff.test
@@ -13,11 +13,13 @@
## Truncate the file to end before the program header table ends.
# RUN: %python -c "with open('%/t.o', 'r+b') as input: input.truncate(65)"
-# RUN: not llvm-objcopy %t.o 2>&1 | FileCheck %s
+# RUN: not llvm-objcopy %t.o 2>&1 | FileCheck %s --check-prefix=CASE1
+
+# CASE1: error: program headers are longer than binary of size 65: e_phoff = 0x40, e_phnum = 1, e_phentsize = 56
## Set the e_phoff field to a value much larger than the object file size.
# RUN: %python -c "with open('%/t2.o', 'r+b') as input: import struct; bytes = struct.pack('<Q', 0x40000000); input.seek(32); input.write(bytes)"
-# RUN: not llvm-objcopy %t2.o 2>&1 | FileCheck %s
+# RUN: not llvm-objcopy %t2.o 2>&1 | FileCheck %s --check-prefix=CASE2
--- !ELF
FileHeader:
@@ -28,4 +30,4 @@ FileHeader:
ProgramHeaders:
- Type: PT_LOAD
-# CHECK: error: program headers longer than binary
+# CASE2: error: program headers are longer than binary of size 120: e_phoff = 0x40000000, e_phnum = 1, e_phentsize = 56
diff --git a/llvm/test/tools/llvm-objcopy/ELF/invalid-e_shoff.test b/llvm/test/tools/llvm-objcopy/ELF/invalid-e_shoff.test
index 7eecde6b0ab..9ebfc11e3c7 100644
--- a/llvm/test/tools/llvm-objcopy/ELF/invalid-e_shoff.test
+++ b/llvm/test/tools/llvm-objcopy/ELF/invalid-e_shoff.test
@@ -11,11 +11,13 @@
## Truncate the file to end before the section header table ends.
# RUN: %python -c "with open('%/t.o', 'r+b') as input: input.truncate(65)"
-# RUN: not llvm-objcopy %t.o 2>&1 | FileCheck %s -DINPUT=%t.o
+# RUN: not llvm-objcopy %t.o 2>&1 | FileCheck %s -DINPUT=%t.o --check-prefix=CASE1
+
+# CASE1: error: '[[INPUT]]': section header table goes past the end of the file: e_shoff = 0x40
## Set the e_shoff field to a value much larger than the object file size.
# RUN: %python -c "with open('%/t2.o', 'r+b') as input: import struct; bytes = struct.pack('<Q', 0x40000000); input.seek(40); input.write(bytes)"
-# RUN: not llvm-objcopy %t2.o 2>&1 | FileCheck %s -DINPUT=%t2.o
+# RUN: not llvm-objcopy %t2.o 2>&1 | FileCheck %s -DINPUT=%t2.o --check-prefix=CASE2
--- !ELF
FileHeader:
@@ -27,4 +29,4 @@ Sections:
- Name: .foo
Type: SHT_PROGBITS
-# CHECK: error: '[[INPUT]]': section header table goes past the end of the file
+# CASE2: error: '[[INPUT]]': section header table goes past the end of the file: e_shoff = 0x40000000
OpenPOWER on IntegriCloud