Bitcode: Check file size before reading bitcode header.

Should unbreak ocaml binding tests.

Also added an llvm-dis test that checks for the same thing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285777 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Peter Collingbourne
2016-11-02 00:39:11 +00:00
parent 4ac35e8272
commit 772d912885
3 changed files with 5 additions and 1 deletions
+3
View File
@@ -1,3 +1,5 @@
RUN: not llvm-dis -disable-output %p/Inputs/invalid-empty.bc 2>&1 | \
RUN: FileCheck --check-prefix=INVALID-EMPTY %s
RUN: not llvm-dis -disable-output %p/Inputs/invalid-pr20485.bc 2>&1 | \
RUN: FileCheck --check-prefix=INVALID-ENCODING %s
RUN: not llvm-dis -disable-output %p/Inputs/invalid-abbrev.bc 2>&1 | \
@@ -27,6 +29,7 @@ RUN: FileCheck --check-prefix=MISMATCHED-EXPLICIT-INVOKE %s
RUN: not llvm-dis -disable-output %p/Inputs/invalid-invoke-non-function-explicit-type.bc 2>&1 | \
RUN: FileCheck --check-prefix=NON-FUNCTION-EXPLICIT-INVOKE %s
INVALID-EMPTY: Invalid bitcode signature
INVALID-ENCODING: Invalid encoding
BAD-ABBREV: Abbreviation starts with an Array or a Blob
UNEXPECTED-EOF: Unexpected end of file