invalid.test 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. RUN: not llvm-dis -disable-output %p/Inputs/invalid-pr20485.bc 2>&1 | \
  2. RUN: FileCheck --check-prefix=INVALID-ENCODING %s
  3. RUN: not llvm-dis -disable-output %p/Inputs/invalid-abbrev.bc 2>&1 | \
  4. RUN: FileCheck --check-prefix=BAD-ABBREV %s
  5. RUN: not llvm-dis -disable-output %p/Inputs/invalid-unexpected-eof.bc 2>&1 | \
  6. RUN: FileCheck --check-prefix=UNEXPECTED-EOF %s
  7. RUN: not llvm-dis -disable-output %p/Inputs/invalid-bad-abbrev-number.bc 2>&1 | \
  8. RUN: FileCheck --check-prefix=BAD-ABBREV-NUMBER %s
  9. RUN: not llvm-dis -disable-output %p/Inputs/invalid-type-table-forward-ref.bc 2>&1 | \
  10. RUN: FileCheck --check-prefix=BAD-TYPE-TABLE-FORWARD-REF %s
  11. RUN: not llvm-dis -disable-output %p/Inputs/invalid-bitwidth.bc 2>&1 | \
  12. RUN: FileCheck --check-prefix=BAD-BITWIDTH %s
  13. RUN: not llvm-dis -disable-output %p/Inputs/invalid-align.bc 2>&1 | \
  14. RUN: FileCheck --check-prefix=BAD-ALIGN %s
  15. RUN: not llvm-dis -disable-output %p/Inputs/invalid-gep-mismatched-explicit-type.bc 2>&1 | \
  16. RUN: FileCheck --check-prefix=MISMATCHED-EXPLICIT-GEP %s
  17. RUN: not llvm-dis -disable-output %p/Inputs/invalid-load-mismatched-explicit-type.bc 2>&1 | \
  18. RUN: FileCheck --check-prefix=MISMATCHED-EXPLICIT-LOAD %s
  19. RUN: not llvm-dis -disable-output %p/Inputs/invalid-gep-operator-mismatched-explicit-type.bc 2>&1 | \
  20. RUN: FileCheck --check-prefix=MISMATCHED-EXPLICIT-GEP-OPERATOR %s
  21. RUN: not llvm-dis -disable-output %p/Inputs/invalid-call-mismatched-explicit-type.bc 2>&1 | \
  22. RUN: FileCheck --check-prefix=MISMATCHED-EXPLICIT-CALL %s
  23. RUN: not llvm-dis -disable-output %p/Inputs/invalid-call-non-function-explicit-type.bc 2>&1 | \
  24. RUN: FileCheck --check-prefix=NON-FUNCTION-EXPLICIT-CALL %s
  25. RUN: not llvm-dis -disable-output %p/Inputs/invalid-invoke-mismatched-explicit-type.bc 2>&1 | \
  26. RUN: FileCheck --check-prefix=MISMATCHED-EXPLICIT-INVOKE %s
  27. RUN: not llvm-dis -disable-output %p/Inputs/invalid-invoke-non-function-explicit-type.bc 2>&1 | \
  28. RUN: FileCheck --check-prefix=NON-FUNCTION-EXPLICIT-INVOKE %s
  29. INVALID-ENCODING: Invalid encoding
  30. BAD-ABBREV: Abbreviation starts with an Array or a Blob
  31. UNEXPECTED-EOF: Unexpected end of file
  32. BAD-ABBREV-NUMBER: Invalid abbrev number
  33. BAD-TYPE-TABLE-FORWARD-REF: Invalid TYPE table: Only named structs can be forward referenced
  34. BAD-BITWIDTH: Bitwidth for integer type out of range
  35. BAD-ALIGN: Invalid alignment value
  36. MISMATCHED-EXPLICIT-GEP: Explicit gep type does not match pointee type of pointer operand
  37. MISMATCHED-EXPLICIT-LOAD: Explicit load/store type does not match pointee type of pointer operand
  38. MISMATCHED-EXPLICIT-GEP-OPERATOR: Explicit gep operator type does not match pointee type of pointer operand
  39. MISMATCHED-EXPLICIT-CALL: Explicit call type does not match pointee type of callee operand
  40. NON-FUNCTION-EXPLICIT-CALL: Explicit call type is not a function type
  41. MISMATCHED-EXPLICIT-INVOKE: Explicit invoke type does not match pointee type of callee operand
  42. NON-FUNCTION-EXPLICIT-INVOKE: Explicit invoke type is not a function type
  43. RUN: not llvm-dis -disable-output %p/Inputs/invalid-extractval-array-idx.bc 2>&1 | \
  44. RUN: FileCheck --check-prefix=EXTRACT-ARRAY %s
  45. RUN: not llvm-dis -disable-output %p/Inputs/invalid-extractval-struct-idx.bc 2>&1 | \
  46. RUN: FileCheck --check-prefix=EXTRACT-STRUCT %s
  47. RUN: not llvm-dis -disable-output %p/Inputs/invalid-extractval-too-many-idxs.bc 2>&1 | \
  48. RUN: FileCheck --check-prefix=EXTRACT-IDXS %s
  49. RUN: not llvm-dis -disable-output %p/Inputs/invalid-insertval-array-idx.bc 2>&1 | \
  50. RUN: FileCheck --check-prefix=INSERT-ARRAY %s
  51. RUN: not llvm-dis -disable-output %p/Inputs/invalid-insertval-struct-idx.bc 2>&1 | \
  52. RUN: FileCheck --check-prefix=INSERT-STRUCT %s
  53. RUN: not llvm-dis -disable-output %p/Inputs/invalid-insertval-too-many-idxs.bc 2>&1 | \
  54. RUN: FileCheck --check-prefix=INSERT-IDXS %s
  55. EXTRACT-ARRAY: EXTRACTVAL: Invalid array index
  56. EXTRACT-STRUCT: EXTRACTVAL: Invalid struct index
  57. EXTRACT-IDXS: EXTRACTVAL: Invalid type
  58. INSERT-ARRAY: INSERTVAL: Invalid array index
  59. INSERT-STRUCT: INSERTVAL: Invalid struct index
  60. INSERT-IDXS: INSERTVAL: Invalid type
  61. RUN: not llvm-dis -disable-output %p/Inputs/invalid-no-proper-module.bc 2>&1 | \
  62. RUN: FileCheck --check-prefix=NO-MODULE %s
  63. NO-MODULE: Malformed IR file
  64. RUN: not llvm-dis -disable-output %p/Inputs/invalid-fp-shift.bc 2>&1 | \
  65. RUN: FileCheck --check-prefix=FP-SHIFT %s
  66. FP-SHIFT: Invalid record
  67. RUN: not llvm-dis -disable-output %p/Inputs/invalid-abbrev-vbr-size-too-big.bc 2>&1 | \
  68. RUN: FileCheck --check-prefix=HUGE-ABBREV-OP %s
  69. RUN: not llvm-dis -disable-output %p/Inputs/invalid-abbrev-fixed-size-too-big.bc 2>&1 | \
  70. RUN: FileCheck --check-prefix=HUGE-ABBREV-OP %s
  71. HUGE-ABBREV-OP: Fixed or VBR abbrev record with size > MaxChunkData
  72. RUN: not llvm-dis -disable-output %p/Inputs/invalid-array-type.bc 2>&1 | \
  73. RUN: FileCheck --check-prefix=ARRAY-TYPE %s
  74. ARRAY-TYPE: Array element type can't be an Array or a Blob
  75. RUN: not llvm-dis -disable-output %p/Inputs/invalid-non-vector-extractelement.bc 2>&1 | \
  76. RUN: FileCheck --check-prefix=INVALID-TYPE %s
  77. RUN: not llvm-dis -disable-output %p/Inputs/invalid-non-vector-insertelement.bc 2>&1 | \
  78. RUN: FileCheck --check-prefix=INVALID-TYPE %s
  79. RUN: not llvm-dis -disable-output %p/Inputs/invalid-non-vector-shufflevector.bc 2>&1 | \
  80. RUN: FileCheck --check-prefix=INVALID-TYPE %s
  81. INVALID-TYPE: Invalid type for value
  82. RUN: not llvm-dis -disable-output %p/Inputs/invalid-fwdref-type-mismatch.bc 2>&1 | \
  83. RUN: FileCheck --check-prefix=FWDREF-TYPE %s
  84. FWDREF-TYPE: Invalid record
  85. RUN: not llvm-dis -disable-output %p/Inputs/invalid-fwdref-type-mismatch-2.bc 2>&1 | \
  86. RUN: FileCheck --check-prefix=FWDREF-TYPE-MISMATCH %s
  87. FWDREF-TYPE-MISMATCH: Type mismatch in constant table!
  88. RUN: not llvm-dis -disable-output %p/Inputs/invalid-array-element-type.bc 2>&1 | \
  89. RUN: FileCheck --check-prefix=ELEMENT-TYPE %s
  90. RUN: not llvm-dis -disable-output %p/Inputs/invalid-vector-element-type.bc 2>&1 | \
  91. RUN: FileCheck --check-prefix=ELEMENT-TYPE %s
  92. RUN: not llvm-dis -disable-output %p/Inputs/invalid-pointer-element-type.bc 2>&1 | \
  93. RUN: FileCheck --check-prefix=ELEMENT-TYPE %s
  94. ELEMENT-TYPE: Invalid type
  95. RUN: not llvm-dis -disable-output %p/Inputs/invalid-array-op-not-2nd-to-last.bc 2>&1 | \
  96. RUN: FileCheck --check-prefix=ARRAY-NOT-2LAST %s
  97. ARRAY-NOT-2LAST: Array op not second to last
  98. RUN: not llvm-dis -disable-output %p/Inputs/invalid-too-big-fwdref.bc 2>&1 | \
  99. RUN: FileCheck --check-prefix=HUGE-FWDREF %s
  100. HUGE-FWDREF: Invalid record
  101. RUN: not llvm-dis -disable-output %p/Inputs/invalid-load-pointer-type.bc 2>&1 | \
  102. RUN: FileCheck --check-prefix=LOAD-BAD-TYPE %s
  103. LOAD-BAD-TYPE: Load/Store operand is not a pointer type
  104. RUN: not llvm-dis -disable-output %p/Inputs/invalid-GCTable-overflow.bc 2>&1 | \
  105. RUN: FileCheck --check-prefix=GCTABLE-OFLOW %s
  106. GCTABLE-OFLOW: Invalid ID
  107. RUN: not llvm-dis -disable-output %p/Inputs/invalid-insert-0-indices.bc 2>&1 | \
  108. RUN: FileCheck --check-prefix=INSERT-0-IDXS %s
  109. INSERT-0-IDXS: INSERTVAL: Invalid instruction with 0 indices
  110. RUN: not llvm-dis -disable-output %p/Inputs/invalid-extract-0-indices.bc 2>&1 | \
  111. RUN: FileCheck --check-prefix=EXTRACT-0-IDXS %s
  112. EXTRACT-0-IDXS: EXTRACTVAL: Invalid instruction with 0 indices
  113. RUN: not llvm-dis -disable-output %p/Inputs/invalid-load-ptr-type.bc 2>&1 | \
  114. RUN: FileCheck --check-prefix=BAD-LOAD-PTR-TYPE %s
  115. BAD-LOAD-PTR-TYPE: Cannot load/store from pointer
  116. RUN: not llvm-dis -disable-output %p/Inputs/invalid-inserted-value-type-mismatch.bc 2>&1 | \
  117. RUN: FileCheck --check-prefix=INSERT-TYPE-MISMATCH %s
  118. INSERT-TYPE-MISMATCH: Inserted value type doesn't match aggregate type
  119. RUN: not llvm-dis -disable-output %p/Inputs/invalid-code-len-width.bc 2>&1 | \
  120. RUN: FileCheck --check-prefix=INVALID-CODELENWIDTH %s
  121. INVALID-CODELENWIDTH: Malformed block
  122. RUN: not llvm-dis -disable-output %p/Inputs/invalid-function-argument-type.bc 2>&1 | \
  123. RUN: FileCheck --check-prefix=INVALID-ARGUMENT-TYPE %s
  124. INVALID-ARGUMENT-TYPE: Invalid function argument type
  125. RUN: not llvm-dis -disable-output %p/Inputs/invalid-fixme-streaming-blob.bc 2>&1 | \
  126. RUN: FileCheck --check-prefix=STREAMING-BLOB %s
  127. STREAMING-BLOB: getPointer in streaming memory objects not allowed
  128. RUN: not llvm-dis -disable-output %p/Inputs/invalid-function-comdat-id.bc 2>&1 | \
  129. RUN: FileCheck --check-prefix=INVALID-FCOMDAT-ID %s
  130. INVALID-FCOMDAT-ID: Invalid function comdat ID
  131. RUN: not llvm-dis -disable-output %p/Inputs/invalid-global-var-comdat-id.bc 2>&1 | \
  132. RUN: FileCheck --check-prefix=INVALID-GVCOMDAT-ID %s
  133. INVALID-GVCOMDAT-ID: Invalid global variable comdat ID
  134. RUN: not llvm-dis -disable-output %p/Inputs/invalid-abbrev-no-operands.bc 2>&1 | \
  135. RUN: FileCheck --check-prefix=ABBREV-NO-OPS %s
  136. ABBREV-NO-OPS: Abbrev record with no operands
  137. RUN: not llvm-dis -disable-output %p/Inputs/invalid-array-operand-encoding.bc 2>&1 | \
  138. RUN: FileCheck --check-prefix=ARRAY-OP-ENC %s
  139. ARRAY-OP-ENC: Array element type has to be an encoding of a type
  140. RUN: not llvm-dis -disable-output %p/Inputs/invalid-metadata-not-followed-named-node.bc 2>&1 | \
  141. RUN: FileCheck --check-prefix=META-NOT-FOLLOWED-BY-NAMED-META %s
  142. META-NOT-FOLLOWED-BY-NAMED-META: METADATA_NAME not followed by METADATA_NAMED_NODE
  143. RUN: not llvm-dis -disable-output %p/Inputs/invalid-vector-length.bc 2>&1 | \
  144. RUN: FileCheck --check-prefix=VECTOR-LENGTH %s
  145. VECTOR-LENGTH: Invalid vector length
  146. RUN: not llvm-dis -disable-output %p/Inputs/invalid-alias-type-mismatch.bc 2>&1 | \
  147. RUN: FileCheck --check-prefix=ALIAS-TYPE-MISMATCH %s
  148. ALIAS-TYPE-MISMATCH: Alias and aliasee types don't match