1 RUN: not llvm-dis -disable-output %p/Inputs/invalid-empty.bc 2>&1 | \
2 RUN: FileCheck --check-prefix=INVALID-EMPTY %s
3 RUN: not --crash llvm-dis -disable-output %p/Inputs/invalid-pr20485.bc 2>&1 | \
4 RUN: FileCheck --check-prefix=INVALID-ENCODING %s
5 RUN: not llvm-dis -disable-output %p/Inputs/invalid-abbrev.bc 2>&1 | \
6 RUN: FileCheck --check-prefix=BAD-ABBREV %s
7 RUN: not llvm-dis -disable-output %p/Inputs/invalid-unexpected-eof.bc 2>&1 | \
8 RUN: FileCheck --check-prefix=UNEXPECTED-EOF %s
9 RUN: not llvm-dis -disable-output %p/Inputs/invalid-bad-abbrev-number.bc 2>&1 | \
10 RUN: FileCheck --check-prefix=BAD-ABBREV-NUMBER %s
11 RUN: not llvm-dis -disable-output %p/Inputs/invalid-type-table-forward-ref.bc 2>&1 | \
12 RUN: FileCheck --check-prefix=BAD-TYPE-TABLE-FORWARD-REF %s
13 RUN: not llvm-dis -disable-output %p/Inputs/invalid-bitwidth.bc 2>&1 | \
14 RUN: FileCheck --check-prefix=BAD-BITWIDTH %s
15 RUN: not llvm-dis -disable-output %p/Inputs/invalid-align.bc 2>&1 | \
16 RUN: FileCheck --check-prefix=BAD-ALIGN %s
17 RUN: not llvm-dis -disable-output %p/Inputs/invalid-gep-mismatched-explicit-type.bc 2>&1 | \
18 RUN: FileCheck --check-prefix=MISMATCHED-EXPLICIT-GEP %s
19 RUN: not llvm-dis -disable-output %p/Inputs/invalid-load-mismatched-explicit-type.bc 2>&1 | \
20 RUN: FileCheck --check-prefix=MISMATCHED-EXPLICIT-LOAD %s
21 RUN: not llvm-dis -disable-output %p/Inputs/invalid-gep-operator-mismatched-explicit-type.bc 2>&1 | \
22 RUN: FileCheck --check-prefix=MISMATCHED-EXPLICIT-GEP-OPERATOR %s
23 RUN: not llvm-dis -disable-output %p/Inputs/invalid-call-mismatched-explicit-type.bc 2>&1 | \
24 RUN: FileCheck --check-prefix=MISMATCHED-EXPLICIT-CALL %s
25 RUN: not llvm-dis -disable-output %p/Inputs/invalid-call-non-function-explicit-type.bc 2>&1 | \
26 RUN: FileCheck --check-prefix=NON-FUNCTION-EXPLICIT-CALL %s
27 RUN: not llvm-dis -disable-output %p/Inputs/invalid-invoke-mismatched-explicit-type.bc 2>&1 | \
28 RUN: FileCheck --check-prefix=MISMATCHED-EXPLICIT-INVOKE %s
29 RUN: not llvm-dis -disable-output %p/Inputs/invalid-invoke-non-function-explicit-type.bc 2>&1 | \
30 RUN: FileCheck --check-prefix=NON-FUNCTION-EXPLICIT-INVOKE %s
32 INVALID-EMPTY: error: file too small to contain bitcode header
33 INVALID-ENCODING: Invalid encoding
34 BAD-ABBREV: error: can't skip to bit
35 UNEXPECTED-EOF: error: can't skip to bit
36 BAD-ABBREV-NUMBER: error: can't skip to bit
37 BAD-TYPE-TABLE-FORWARD-REF: Invalid TYPE table: Only named structs can be forward referenced
38 BAD-BITWIDTH: error: can't skip to bit
39 BAD-ALIGN: Invalid alignment value
40 MISMATCHED-EXPLICIT-GEP: Explicit gep type does not match pointee type of pointer operand
41 MISMATCHED-EXPLICIT-LOAD: Explicit load/store type does not match pointee type of pointer operand
42 MISMATCHED-EXPLICIT-GEP-OPERATOR: Explicit gep operator type does not match pointee type of pointer operand
43 MISMATCHED-EXPLICIT-CALL: Explicit call type does not match pointee type of callee operand
44 NON-FUNCTION-EXPLICIT-CALL: Explicit call type is not a function type
45 MISMATCHED-EXPLICIT-INVOKE: Explicit invoke type does not match pointee type of callee operand
46 NON-FUNCTION-EXPLICIT-INVOKE: Explicit invoke type is not a function type
48 RUN: not llvm-dis -disable-output %p/Inputs/invalid-extractval-array-idx.bc 2>&1 | \
49 RUN: FileCheck --check-prefix=EXTRACT-ARRAY %s
50 RUN: not llvm-dis -disable-output %p/Inputs/invalid-extractval-struct-idx.bc 2>&1 | \
51 RUN: FileCheck --check-prefix=EXTRACT-STRUCT %s
52 RUN: not llvm-dis -disable-output %p/Inputs/invalid-extractval-too-many-idxs.bc 2>&1 | \
53 RUN: FileCheck --check-prefix=EXTRACT-IDXS %s
54 RUN: not llvm-dis -disable-output %p/Inputs/invalid-insertval-array-idx.bc 2>&1 | \
55 RUN: FileCheck --check-prefix=INSERT-ARRAY %s
56 RUN: not llvm-dis -disable-output %p/Inputs/invalid-insertval-struct-idx.bc 2>&1 | \
57 RUN: FileCheck --check-prefix=INSERT-STRUCT %s
58 RUN: not llvm-dis -disable-output %p/Inputs/invalid-insertval-too-many-idxs.bc 2>&1 | \
59 RUN: FileCheck --check-prefix=INSERT-IDXS %s
62 EXTRACT-ARRAY: EXTRACTVAL: Invalid array index
63 EXTRACT-STRUCT: EXTRACTVAL: Invalid struct index
64 EXTRACT-IDXS: EXTRACTVAL: Invalid type
65 INSERT-ARRAY: INSERTVAL: Invalid array index
66 INSERT-STRUCT: INSERTVAL: Invalid struct index
67 INSERT-IDXS: INSERTVAL: Invalid type
69 RUN: not llvm-dis -disable-output %p/Inputs/invalid-fp-shift.bc 2>&1 | \
70 RUN: FileCheck --check-prefix=FP-SHIFT %s
72 FP-SHIFT: Invalid record
74 RUN: not --crash llvm-dis -disable-output %p/Inputs/invalid-abbrev-vbr-size-too-big.bc 2>&1 | \
75 RUN: FileCheck --check-prefix=HUGE-ABBREV-OP %s
76 RUN: not --crash llvm-dis -disable-output %p/Inputs/invalid-abbrev-fixed-size-too-big.bc 2>&1 | \
77 RUN: FileCheck --check-prefix=HUGE-ABBREV-OP %s
79 HUGE-ABBREV-OP: Fixed or VBR abbrev record with size > MaxChunkData
81 RUN: not --crash llvm-dis -disable-output %p/Inputs/invalid-array-type.bc 2>&1 | \
82 RUN: FileCheck --check-prefix=ARRAY-TYPE %s
84 ARRAY-TYPE: Array element type can't be an Array or a Blob
86 RUN: not llvm-dis -disable-output %p/Inputs/invalid-non-vector-extractelement.bc 2>&1 | \
87 RUN: FileCheck --check-prefix=INVALID-TYPE %s
88 RUN: not llvm-dis -disable-output %p/Inputs/invalid-non-vector-insertelement.bc 2>&1 | \
89 RUN: FileCheck --check-prefix=INVALID-TYPE %s
90 RUN: not llvm-dis -disable-output %p/Inputs/invalid-non-vector-shufflevector.bc 2>&1 | \
91 RUN: FileCheck --check-prefix=INVALID-TYPE %s
93 INVALID-TYPE: Invalid type for value
95 RUN: not llvm-dis -disable-output %p/Inputs/invalid-fwdref-type-mismatch.bc 2>&1 | \
96 RUN: FileCheck --check-prefix=FWDREF-TYPE %s
98 FWDREF-TYPE: Invalid record
100 RUN: not llvm-dis -disable-output %p/Inputs/invalid-fwdref-type-mismatch-2.bc 2>&1 | \
101 RUN: FileCheck --check-prefix=FWDREF-TYPE-MISMATCH %s
103 FWDREF-TYPE-MISMATCH: Malformed block
105 RUN: not llvm-dis -disable-output %p/Inputs/invalid-array-element-type.bc 2>&1 | \
106 RUN: FileCheck --check-prefix=ELEMENT-TYPE %s
107 RUN: not llvm-dis -disable-output %p/Inputs/invalid-vector-element-type.bc 2>&1 | \
108 RUN: FileCheck --check-prefix=ELEMENT-TYPE %s
109 RUN: not llvm-dis -disable-output %p/Inputs/invalid-pointer-element-type.bc 2>&1 | \
110 RUN: FileCheck --check-prefix=ELEMENT-TYPE %s
112 ELEMENT-TYPE: Invalid type
114 RUN: not llvm-dis -disable-output %p/Inputs/invalid-cast.bc 2>&1 | \
115 RUN: FileCheck --check-prefix=INVALID-CAST %s
117 INVALID-CAST: Invalid cast
119 RUN: not --crash llvm-dis -disable-output %p/Inputs/invalid-array-op-not-2nd-to-last.bc 2>&1 | \
120 RUN: FileCheck --check-prefix=ARRAY-NOT-2LAST %s
122 ARRAY-NOT-2LAST: Array op not second to last
124 RUN: not llvm-dis -disable-output %p/Inputs/invalid-too-big-fwdref.bc 2>&1 | \
125 RUN: FileCheck --check-prefix=HUGE-FWDREF %s
127 HUGE-FWDREF: Invalid record
129 RUN: not llvm-dis -disable-output %p/Inputs/invalid-load-pointer-type.bc 2>&1 | \
130 RUN: FileCheck --check-prefix=LOAD-BAD-TYPE %s
132 LOAD-BAD-TYPE: Load operand is not a pointer type
134 RUN: not llvm-dis -disable-output %p/Inputs/invalid-GCTable-overflow.bc 2>&1 | \
135 RUN: FileCheck --check-prefix=GCTABLE-OFLOW %s
137 GCTABLE-OFLOW: Invalid ID
139 RUN: not llvm-dis -disable-output %p/Inputs/invalid-insert-0-indices.bc 2>&1 | \
140 RUN: FileCheck --check-prefix=INSERT-0-IDXS %s
142 INSERT-0-IDXS: INSERTVAL: Invalid instruction with 0 indices
144 RUN: not llvm-dis -disable-output %p/Inputs/invalid-extract-0-indices.bc 2>&1 | \
145 RUN: FileCheck --check-prefix=EXTRACT-0-IDXS %s
147 EXTRACT-0-IDXS: EXTRACTVAL: Invalid instruction with 0 indices
149 RUN: not llvm-dis -disable-output %p/Inputs/invalid-load-ptr-type.bc 2>&1 | \
150 RUN: FileCheck --check-prefix=BAD-LOAD-PTR-TYPE %s
152 BAD-LOAD-PTR-TYPE: error: can't skip to bit
154 RUN: not llvm-dis -disable-output %p/Inputs/invalid-inserted-value-type-mismatch.bc 2>&1 | \
155 RUN: FileCheck --check-prefix=INSERT-TYPE-MISMATCH %s
157 INSERT-TYPE-MISMATCH: Inserted value type doesn't match aggregate type
159 RUN: not llvm-dis -disable-output %p/Inputs/invalid-code-len-width.bc 2>&1 | \
160 RUN: FileCheck --check-prefix=INVALID-CODELENWIDTH %s
162 INVALID-CODELENWIDTH: error: can't skip to bit
164 RUN: not llvm-dis -disable-output %p/Inputs/invalid-function-argument-type.bc 2>&1 | \
165 RUN: FileCheck --check-prefix=INVALID-ARGUMENT-TYPE %s
167 INVALID-ARGUMENT-TYPE: Invalid function argument type
169 RUN: not llvm-dis -disable-output %p/Inputs/invalid-function-comdat-id.bc 2>&1 | \
170 RUN: FileCheck --check-prefix=INVALID-FCOMDAT-ID %s
172 INVALID-FCOMDAT-ID: Malformed block
174 RUN: not llvm-dis -disable-output %p/Inputs/invalid-global-var-comdat-id.bc 2>&1 | \
175 RUN: FileCheck --check-prefix=INVALID-GVCOMDAT-ID %s
177 INVALID-GVCOMDAT-ID: Invalid global variable comdat ID
179 RUN: not --crash llvm-dis -disable-output %p/Inputs/invalid-abbrev-no-operands.bc 2>&1 | \
180 RUN: FileCheck --check-prefix=ABBREV-NO-OPS %s
182 ABBREV-NO-OPS: Abbrev record with no operands
184 RUN: not llvm-dis -disable-output %p/Inputs/invalid-array-operand-encoding.bc 2>&1 | \
185 RUN: FileCheck --check-prefix=ARRAY-OP-ENC %s
187 ARRAY-OP-ENC: Malformed block
189 RUN: not llvm-dis -disable-output %p/Inputs/invalid-metadata-not-followed-named-node.bc 2>&1 | \
190 RUN: FileCheck --check-prefix=META-NOT-FOLLOWED-BY-NAMED-META %s
192 META-NOT-FOLLOWED-BY-NAMED-META: Malformed block
194 RUN: not llvm-dis -disable-output %p/Inputs/invalid-vector-length.bc 2>&1 | \
195 RUN: FileCheck --check-prefix=VECTOR-LENGTH %s
197 VECTOR-LENGTH: Invalid vector length
199 RUN: not llvm-dis -disable-output %p/Inputs/invalid-alias-type-mismatch.bc 2>&1 | \
200 RUN: FileCheck --check-prefix=ALIAS-TYPE-MISMATCH %s
202 ALIAS-TYPE-MISMATCH: Alias and aliasee types don't match
204 RUN: not llvm-dis -disable-output %p/Inputs/invalid-no-function-block.bc 2>&1 | \
205 RUN: FileCheck --check-prefix=NO-FUNCTION-BLOCK %s
207 NO-FUNCTION-BLOCK: Trying to materialize functions before seeing function blocks (Producer: 'LLVM3.8.0git' Reader: 'LLVM
209 RUN: not llvm-dis -disable-output %p/Inputs/invalid-name-with-0-byte.bc 2>&1 | \
210 RUN: FileCheck --check-prefix=NAME-WITH-0 %s
212 NAME-WITH-0: Malformed block
214 RUN: not llvm-dis -disable-output %p/Inputs/invalid-void-constant.bc 2>&1 | \
215 RUN: FileCheck --check-prefix=VOID-CONSTANT-TYPE %s
217 VOID-CONSTANT-TYPE: Invalid constant type
219 RUN: not llvm-dis -disable-output %p/Inputs/invalid-gep-no-operands.bc 2>&1 | \
220 RUN: FileCheck --check-prefix=GEP-NO-OPERANDS %s
222 GEP-NO-OPERANDS: Invalid gep with no operands
224 RUN: not llvm-dis -disable-output %p/Inputs/invalid-nonpointer-storeatomic.bc 2>&1 | \
225 RUN: FileCheck --check-prefix=NONPOINTER-STOREATOMIC %s
227 NONPOINTER-STOREATOMIC: Invalid record
229 RUN: not llvm-dis -disable-output %p/Inputs/invalid-nonpointer-atomicrmw.bc 2>&1 | \
230 RUN: FileCheck --check-prefix=NONPOINTER-ATOMICRMW %s
232 NONPOINTER-ATOMICRMW: Invalid record
234 RUN: not llvm-dis -disable-output %p/Inputs/invalid-fcmp-opnum.bc 2>&1 | \
235 RUN: FileCheck --check-prefix=INVALID-FCMP-OPNUM %s
237 INVALID-FCMP-OPNUM: Invalid record: operand number exceeded available operands
239 RUN: not llvm-dis -disable-output %p/Inputs/invalid-cmpxchg-ordering.bc 2>&1 | \
240 RUN: FileCheck --check-prefix=CMPXCHG-ORDERING %s
241 RUN: not llvm-dis -disable-output %p/Inputs/invalid-cmpxchg-ordering-2.bc 2>&1 | \
242 RUN: FileCheck --check-prefix=CMPXCHG-ORDERING %s
243 RUN: not llvm-dis -disable-output %p/Inputs/invalid-cmpxchg-ordering-3.bc 2>&1 | \
244 RUN: FileCheck --check-prefix=CMPXCHG-ORDERING %s
245 RUN: not llvm-dis -disable-output %p/Inputs/invalid-cmpxchg-ordering-4.bc 2>&1 | \
246 RUN: FileCheck --check-prefix=CMPXCHG-ORDERING %s
248 CMPXCHG-ORDERING: Invalid cmpxchg {{failure|success}} ordering