Add a testcase for an invalid file.
authorRafael Espindola <rafael.espindola@gmail.com>
Mon, 29 Jun 2015 14:12:14 +0000 (14:12 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Mon, 29 Jun 2015 14:12:14 +0000 (14:12 +0000)
We were already checking this, but had no tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240945 91177308-0d34-0410-b5e6-96231b3b80d8

test/Object/Inputs/invalid-strtab-non-null.elf [new file with mode: 0644]
test/Object/invalid.test

diff --git a/test/Object/Inputs/invalid-strtab-non-null.elf b/test/Object/Inputs/invalid-strtab-non-null.elf
new file mode 100644 (file)
index 0000000..f52c0a1
Binary files /dev/null and b/test/Object/Inputs/invalid-strtab-non-null.elf differ
index 2e2c924dfaeff0ddfb669a79bcbc26756bda79a9..17cbb30c9c25490d8bb21657b309d63e2e995d99 100644 (file)
@@ -1,3 +1,6 @@
 RUN: not llvm-dwarfdump %p/Inputs/invalid-bad-rel-type.elf 2>&1 | FileCheck %s
 RUN: not llvm-objdump -s %p/Inputs/invalid-strtab-type.elf 2>&1 | FileCheck %s
 CHECK: Invalid data was encountered while parsing the file
 RUN: not llvm-dwarfdump %p/Inputs/invalid-bad-rel-type.elf 2>&1 | FileCheck %s
 RUN: not llvm-objdump -s %p/Inputs/invalid-strtab-type.elf 2>&1 | FileCheck %s
 CHECK: Invalid data was encountered while parsing the file
+
+RUN: not llvm-objdump -s %p/Inputs/invalid-strtab-non-null.elf 2>&1 | FileCheck --check-prefix=NON-NULL %s
+NON-NULL: String table must end with a null terminator