mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-24 23:28:41 +00:00
Make getModRefInfo(Instruction *) not crash on certain types of instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236023 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -81,6 +81,13 @@ TEST_F(AliasAnalysisTest, getModRefInfo) {
|
||||
auto *Store1 = new StoreInst(Value, Addr, BB);
|
||||
auto *Load1 = new LoadInst(Addr, "load", BB);
|
||||
auto *Add1 = BinaryOperator::CreateAdd(Value, Value, "add", BB);
|
||||
auto *VAArg1 = new VAArgInst(Addr, PtrType, "vaarg", BB);
|
||||
auto *CmpXChg1 = new AtomicCmpXchgInst(Addr, ConstantInt::get(IntType, 0),
|
||||
ConstantInt::get(IntType, 1),
|
||||
Monotonic, Monotonic, CrossThread, BB);
|
||||
auto *AtomicRMW =
|
||||
new AtomicRMWInst(AtomicRMWInst::Xchg, Addr, ConstantInt::get(IntType, 1),
|
||||
Monotonic, CrossThread, BB);
|
||||
|
||||
ReturnInst::Create(C, nullptr, BB);
|
||||
|
||||
@@ -88,6 +95,9 @@ TEST_F(AliasAnalysisTest, getModRefInfo) {
|
||||
CheckModRef(Store1, AliasAnalysis::ModRefResult::Mod);
|
||||
CheckModRef(Load1, AliasAnalysis::ModRefResult::Ref);
|
||||
CheckModRef(Add1, AliasAnalysis::ModRefResult::NoModRef);
|
||||
CheckModRef(VAArg1, AliasAnalysis::ModRefResult::ModRef);
|
||||
CheckModRef(CmpXChg1, AliasAnalysis::ModRefResult::ModRef);
|
||||
CheckModRef(AtomicRMW, AliasAnalysis::ModRefResult::ModRef);
|
||||
}
|
||||
|
||||
} // end anonymous namspace
|
||||
|
Reference in New Issue
Block a user