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 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-no-proper-module.bc 2>&1 | \
70 RUN: FileCheck --check-prefix=NO-MODULE %s
72 NO-MODULE: Expected a single module
74 RUN: not llvm-dis -disable-output %p/Inputs/invalid-fp-shift.bc 2>&1 | \
75 RUN: FileCheck --check-prefix=FP-SHIFT %s
77 FP-SHIFT: Invalid record
79 RUN: not llvm-dis -disable-output %p/Inputs/invalid-abbrev-vbr-size-too-big.bc 2>&1 | \
80 RUN: FileCheck --check-prefix=HUGE-ABBREV-OP %s
81 RUN: not llvm-dis -disable-output %p/Inputs/invalid-abbrev-fixed-size-too-big.bc 2>&1 | \
82 RUN: FileCheck --check-prefix=HUGE-ABBREV-OP %s
84 HUGE-ABBREV-OP: Fixed or VBR abbrev record with size > MaxChunkData
86 RUN: not llvm-dis -disable-output %p/Inputs/invalid-array-type.bc 2>&1 | \
87 RUN: FileCheck --check-prefix=ARRAY-TYPE %s
89 ARRAY-TYPE: Array element type can't be an Array or a Blob
91 RUN: not llvm-dis -disable-output %p/Inputs/invalid-non-vector-extractelement.bc 2>&1 | \
92 RUN: FileCheck --check-prefix=INVALID-TYPE %s
93 RUN: not llvm-dis -disable-output %p/Inputs/invalid-non-vector-insertelement.bc 2>&1 | \
94 RUN: FileCheck --check-prefix=INVALID-TYPE %s
95 RUN: not llvm-dis -disable-output %p/Inputs/invalid-non-vector-shufflevector.bc 2>&1 | \
96 RUN: FileCheck --check-prefix=INVALID-TYPE %s
98 INVALID-TYPE: Invalid type for value
100 RUN: not llvm-dis -disable-output %p/Inputs/invalid-fwdref-type-mismatch.bc 2>&1 | \
101 RUN: FileCheck --check-prefix=FWDREF-TYPE %s
103 FWDREF-TYPE: Invalid record
105 RUN: not llvm-dis -disable-output %p/Inputs/invalid-fwdref-type-mismatch-2.bc 2>&1 | \
106 RUN: FileCheck --check-prefix=FWDREF-TYPE-MISMATCH %s
108 FWDREF-TYPE-MISMATCH: Malformed block
110 RUN: not llvm-dis -disable-output %p/Inputs/invalid-array-element-type.bc 2>&1 | \
111 RUN: FileCheck --check-prefix=ELEMENT-TYPE %s
112 RUN: not llvm-dis -disable-output %p/Inputs/invalid-vector-element-type.bc 2>&1 | \
113 RUN: FileCheck --check-prefix=ELEMENT-TYPE %s
114 RUN: not llvm-dis -disable-output %p/Inputs/invalid-pointer-element-type.bc 2>&1 | \
115 RUN: FileCheck --check-prefix=ELEMENT-TYPE %s
117 ELEMENT-TYPE: Invalid type
119 RUN: not llvm-dis -disable-output %p/Inputs/invalid-cast.bc 2>&1 | \
120 RUN: FileCheck --check-prefix=INVALID-CAST %s
122 INVALID-CAST: Invalid cast
124 RUN: not llvm-dis -disable-output %p/Inputs/invalid-array-op-not-2nd-to-last.bc 2>&1 | \
125 RUN: FileCheck --check-prefix=ARRAY-NOT-2LAST %s
127 ARRAY-NOT-2LAST: Array op not second to last
129 RUN: not llvm-dis -disable-output %p/Inputs/invalid-too-big-fwdref.bc 2>&1 | \
130 RUN: FileCheck --check-prefix=HUGE-FWDREF %s
132 HUGE-FWDREF: Invalid record
134 RUN: not llvm-dis -disable-output %p/Inputs/invalid-load-pointer-type.bc 2>&1 | \
135 RUN: FileCheck --check-prefix=LOAD-BAD-TYPE %s
137 LOAD-BAD-TYPE: Load operand is not a pointer type
139 RUN: not llvm-dis -disable-output %p/Inputs/invalid-GCTable-overflow.bc 2>&1 | \
140 RUN: FileCheck --check-prefix=GCTABLE-OFLOW %s
142 GCTABLE-OFLOW: Invalid ID
144 RUN: not llvm-dis -disable-output %p/Inputs/invalid-insert-0-indices.bc 2>&1 | \
145 RUN: FileCheck --check-prefix=INSERT-0-IDXS %s
147 INSERT-0-IDXS: INSERTVAL: Invalid instruction with 0 indices
149 RUN: not llvm-dis -disable-output %p/Inputs/invalid-extract-0-indices.bc 2>&1 | \
150 RUN: FileCheck --check-prefix=EXTRACT-0-IDXS %s
152 EXTRACT-0-IDXS: EXTRACTVAL: Invalid instruction with 0 indices
154 RUN: not llvm-dis -disable-output %p/Inputs/invalid-load-ptr-type.bc 2>&1 | \
155 RUN: FileCheck --check-prefix=BAD-LOAD-PTR-TYPE %s
157 BAD-LOAD-PTR-TYPE: error: can't skip to bit
159 RUN: not llvm-dis -disable-output %p/Inputs/invalid-inserted-value-type-mismatch.bc 2>&1 | \
160 RUN: FileCheck --check-prefix=INSERT-TYPE-MISMATCH %s
162 INSERT-TYPE-MISMATCH: Inserted value type doesn't match aggregate type
164 RUN: not llvm-dis -disable-output %p/Inputs/invalid-code-len-width.bc 2>&1 | \
165 RUN: FileCheck --check-prefix=INVALID-CODELENWIDTH %s
167 INVALID-CODELENWIDTH: error: can't skip to bit
169 RUN: not llvm-dis -disable-output %p/Inputs/invalid-function-argument-type.bc 2>&1 | \
170 RUN: FileCheck --check-prefix=INVALID-ARGUMENT-TYPE %s
172 INVALID-ARGUMENT-TYPE: Invalid function argument type
174 RUN: not llvm-dis -disable-output %p/Inputs/invalid-function-comdat-id.bc 2>&1 | \
175 RUN: FileCheck --check-prefix=INVALID-FCOMDAT-ID %s
177 INVALID-FCOMDAT-ID: Malformed block
179 RUN: not llvm-dis -disable-output %p/Inputs/invalid-global-var-comdat-id.bc 2>&1 | \
180 RUN: FileCheck --check-prefix=INVALID-GVCOMDAT-ID %s
182 INVALID-GVCOMDAT-ID: Invalid global variable comdat ID
184 RUN: not llvm-dis -disable-output %p/Inputs/invalid-abbrev-no-operands.bc 2>&1 | \
185 RUN: FileCheck --check-prefix=ABBREV-NO-OPS %s
187 ABBREV-NO-OPS: Abbrev record with no operands
189 RUN: not llvm-dis -disable-output %p/Inputs/invalid-array-operand-encoding.bc 2>&1 | \
190 RUN: FileCheck --check-prefix=ARRAY-OP-ENC %s
192 ARRAY-OP-ENC: Malformed block
194 RUN: not llvm-dis -disable-output %p/Inputs/invalid-metadata-not-followed-named-node.bc 2>&1 | \
195 RUN: FileCheck --check-prefix=META-NOT-FOLLOWED-BY-NAMED-META %s
197 META-NOT-FOLLOWED-BY-NAMED-META: Malformed block
199 RUN: not llvm-dis -disable-output %p/Inputs/invalid-vector-length.bc 2>&1 | \
200 RUN: FileCheck --check-prefix=VECTOR-LENGTH %s
202 VECTOR-LENGTH: Invalid vector length
204 RUN: not llvm-dis -disable-output %p/Inputs/invalid-alias-type-mismatch.bc 2>&1 | \
205 RUN: FileCheck --check-prefix=ALIAS-TYPE-MISMATCH %s
207 ALIAS-TYPE-MISMATCH: Alias and aliasee types don't match
209 RUN: not llvm-dis -disable-output %p/Inputs/invalid-no-function-block.bc 2>&1 | \
210 RUN: FileCheck --check-prefix=NO-FUNCTION-BLOCK %s
212 NO-FUNCTION-BLOCK: Trying to materialize functions before seeing function blocks (Producer: 'LLVM3.8.0git' Reader: 'LLVM
214 RUN: not llvm-dis -disable-output %p/Inputs/invalid-name-with-0-byte.bc 2>&1 | \
215 RUN: FileCheck --check-prefix=NAME-WITH-0 %s
217 NAME-WITH-0: Malformed block
219 RUN: not llvm-dis -disable-output %p/Inputs/invalid-void-constant.bc 2>&1 | \
220 RUN: FileCheck --check-prefix=VOID-CONSTANT-TYPE %s
222 VOID-CONSTANT-TYPE: Invalid constant type
224 RUN: not llvm-dis -disable-output %p/Inputs/invalid-gep-no-operands.bc 2>&1 | \
225 RUN: FileCheck --check-prefix=GEP-NO-OPERANDS %s
227 GEP-NO-OPERANDS: Invalid gep with no operands
229 RUN: not llvm-dis -disable-output %p/Inputs/invalid-nonpointer-storeatomic.bc 2>&1 | \
230 RUN: FileCheck --check-prefix=NONPOINTER-STOREATOMIC %s
232 NONPOINTER-STOREATOMIC: Invalid record
234 RUN: not llvm-dis -disable-output %p/Inputs/invalid-nonpointer-atomicrmw.bc 2>&1 | \
235 RUN: FileCheck --check-prefix=NONPOINTER-ATOMICRMW %s
237 NONPOINTER-ATOMICRMW: Invalid record
239 RUN: not llvm-dis -disable-output %p/Inputs/invalid-fcmp-opnum.bc 2>&1 | \
240 RUN: FileCheck --check-prefix=INVALID-FCMP-OPNUM %s
242 INVALID-FCMP-OPNUM: Invalid record: operand number exceeded available operands