mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-05 13:26:55 +00:00
Fix ptr vector inconsistency in CreatePointerCast
One form would accept a vector of pointers, and the other did not. Make both accept vectors of pointers, and add an assertion for the number of elements. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187464 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -197,6 +197,17 @@ TEST(InstructionsTest, CastInst) {
|
||||
EXPECT_TRUE(CastInst::isBitCastable(V2Int32PtrTy, V2Int64PtrTy));
|
||||
EXPECT_FALSE(CastInst::isBitCastable(V2Int32Ty, V2Int64Ty));
|
||||
EXPECT_FALSE(CastInst::isBitCastable(V2Int64Ty, V2Int32Ty));
|
||||
|
||||
|
||||
// Check that assertion is not hit when creating a cast with a vector of
|
||||
// pointers
|
||||
// First form
|
||||
BasicBlock *BB = BasicBlock::Create(C);
|
||||
Constant *NullV2I32Ptr = Constant::getNullValue(V2Int32PtrTy);
|
||||
CastInst::CreatePointerCast(NullV2I32Ptr, V2Int32Ty, "foo", BB);
|
||||
|
||||
// Second form
|
||||
CastInst::CreatePointerCast(NullV2I32Ptr, V2Int32Ty);
|
||||
}
|
||||
|
||||
TEST(InstructionsTest, VectorGep) {
|
||||
|
Reference in New Issue
Block a user