mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-02 00:16:25 +00:00
Add testing for mismatched explicit type on a load instruction when loading from bitcode
llvm-svn: 232424
This commit is contained in:
parent
70e158c635
commit
921ef6c8fc
@ -3648,9 +3648,9 @@ std::error_code BitcodeReader::ParseFunctionBody(Function *F) {
|
||||
return EC;
|
||||
I = new LoadInst(Op, "", Record[OpNum+1], Align);
|
||||
|
||||
(void)Ty;
|
||||
assert((!Ty || Ty == I->getType()) &&
|
||||
"Explicit type doesn't match pointee type of the first operand");
|
||||
if (Ty && Ty != I->getType())
|
||||
return Error("Explicit load type does not match pointee type of "
|
||||
"pointer operand");
|
||||
|
||||
InstructionList.push_back(I);
|
||||
break;
|
||||
|
BIN
test/Bitcode/Inputs/invalid-load-mismatched-explicit-type.bc
Normal file
BIN
test/Bitcode/Inputs/invalid-load-mismatched-explicit-type.bc
Normal file
Binary file not shown.
@ -14,6 +14,8 @@ RUN: not llvm-dis -disable-output %p/Inputs/invalid-align.bc 2>&1 | \
|
||||
RUN: FileCheck --check-prefix=BAD-ALIGN %s
|
||||
RUN: not llvm-dis -disable-output %p/Inputs/invalid-gep-mismatched-explicit-type.bc 2>&1 | \
|
||||
RUN: FileCheck --check-prefix=MISMATCHED-EXPLICIT-GEP %s
|
||||
RUN: not llvm-dis -disable-output %p/Inputs/invalid-load-mismatched-explicit-type.bc 2>&1 | \
|
||||
RUN: FileCheck --check-prefix=MISMATCHED-EXPLICIT-LOAD %s
|
||||
|
||||
INVALID-ENCODING: Invalid encoding
|
||||
BAD-ABBREV: Abbreviation starts with an Array or a Blob
|
||||
@ -23,6 +25,7 @@ BAD-TYPE-TABLE-FORWARD-REF: Invalid TYPE table: Only named structs can be forwar
|
||||
BAD-BITWIDTH: Bitwidth for integer type out of range
|
||||
BAD-ALIGN: Invalid alignment value
|
||||
MISMATCHED-EXPLICIT-GEP: Explicit gep type does not match pointee type of pointer operand
|
||||
MISMATCHED-EXPLICIT-LOAD: Explicit load type does not match pointee type of pointer operand
|
||||
|
||||
RUN: not llvm-dis -disable-output %p/Inputs/invalid-extractval-array-idx.bc 2>&1 | \
|
||||
RUN: FileCheck --check-prefix=EXTRACT-ARRAY %s
|
||||
|
Loading…
Reference in New Issue
Block a user