summaryrefslogtreecommitdiffstats
path: root/llvm/test/Bitcode
diff options
context:
space:
mode:
authorFilipe Cabecinhas <me@filcab.net>2015-10-06 12:37:54 +0000
committerFilipe Cabecinhas <me@filcab.net>2015-10-06 12:37:54 +0000
commitb70fd8719e04209827e0ea115965e10225e98f5c (patch)
tree9701a05459d6cb54e0c1690ac4492e3af472ba63 /llvm/test/Bitcode
parent4c33a1af5d727d2810baf5b6878c3badaf5f05e1 (diff)
downloadbcm5719-llvm-b70fd8719e04209827e0ea115965e10225e98f5c.tar.gz
bcm5719-llvm-b70fd8719e04209827e0ea115965e10225e98f5c.zip
Make sure the CastInst is valid before trying to create it
Bug found with afl-fuzz. llvm-svn: 249396
Diffstat (limited to 'llvm/test/Bitcode')
-rw-r--r--llvm/test/Bitcode/Inputs/invalid-cast.bcbin0 -> 1236 bytes
-rw-r--r--llvm/test/Bitcode/invalid.test5
2 files changed, 5 insertions, 0 deletions
diff --git a/llvm/test/Bitcode/Inputs/invalid-cast.bc b/llvm/test/Bitcode/Inputs/invalid-cast.bc
new file mode 100644
index 00000000000..a8b82f3e286
--- /dev/null
+++ b/llvm/test/Bitcode/Inputs/invalid-cast.bc
Binary files differ
diff --git a/llvm/test/Bitcode/invalid.test b/llvm/test/Bitcode/invalid.test
index 0aab553bb61..69104046df2 100644
--- a/llvm/test/Bitcode/invalid.test
+++ b/llvm/test/Bitcode/invalid.test
@@ -113,6 +113,11 @@ RUN: FileCheck --check-prefix=ELEMENT-TYPE %s
ELEMENT-TYPE: Invalid type
+RUN: not llvm-dis -disable-output %p/Inputs/invalid-cast.bc 2>&1 | \
+RUN: FileCheck --check-prefix=INVALID-CAST %s
+
+INVALID-CAST: Invalid cast
+
RUN: not llvm-dis -disable-output %p/Inputs/invalid-array-op-not-2nd-to-last.bc 2>&1 | \
RUN: FileCheck --check-prefix=ARRAY-NOT-2LAST %s
OpenPOWER on IntegriCloud