diff options
author | Peter Collingbourne <peter@pcc.me.uk> | 2016-11-02 00:39:11 +0000 |
---|---|---|
committer | Peter Collingbourne <peter@pcc.me.uk> | 2016-11-02 00:39:11 +0000 |
commit | ff2c2ec6b225c690234056a16fd1bc07e203ca0e (patch) | |
tree | 755f334515b281fb98066e3bbf6dbdd58a01dc87 /llvm/test/Bitcode | |
parent | 07b83767a041cbe3dcb5b1ae6144c551e45b33b1 (diff) | |
download | bcm5719-llvm-ff2c2ec6b225c690234056a16fd1bc07e203ca0e.tar.gz bcm5719-llvm-ff2c2ec6b225c690234056a16fd1bc07e203ca0e.zip |
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.
llvm-svn: 285777
Diffstat (limited to 'llvm/test/Bitcode')
-rw-r--r-- | llvm/test/Bitcode/Inputs/invalid-empty.bc | 0 | ||||
-rw-r--r-- | llvm/test/Bitcode/invalid.test | 3 |
2 files changed, 3 insertions, 0 deletions
diff --git a/llvm/test/Bitcode/Inputs/invalid-empty.bc b/llvm/test/Bitcode/Inputs/invalid-empty.bc new file mode 100644 index 00000000000..e69de29bb2d --- /dev/null +++ b/llvm/test/Bitcode/Inputs/invalid-empty.bc diff --git a/llvm/test/Bitcode/invalid.test b/llvm/test/Bitcode/invalid.test index e7e78b3af5a..d9381b7729c 100644 --- a/llvm/test/Bitcode/invalid.test +++ b/llvm/test/Bitcode/invalid.test @@ -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 |