mirror of
https://github.com/RPCSX/llvm.git
synced 2024-12-03 17:31:50 +00:00
Add a unit test for r259973.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260111 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
b21e2903ef
commit
c44fb84ad0
@ -2073,6 +2073,26 @@ TEST_F(ValueAsMetadataTest, UpdatesOnRAUW) {
|
||||
EXPECT_TRUE(MD->getValue() == GV1.get());
|
||||
}
|
||||
|
||||
TEST_F(ValueAsMetadataTest, TempTempReplacement) {
|
||||
// Create a constant.
|
||||
ConstantAsMetadata *CI = ConstantAsMetadata::get(
|
||||
ConstantInt::get(getGlobalContext(), APInt(8, 0)));
|
||||
|
||||
Metadata *Ops1[] = {CI};
|
||||
auto Temp1 = MDTuple::getTemporary(Context, None);
|
||||
auto Temp2 = MDTuple::getTemporary(Context, Ops1);
|
||||
|
||||
Metadata *Ops2[] = {Temp1.get()};
|
||||
auto *N = MDTuple::get(Context, Ops2);
|
||||
|
||||
// Test replacing a temporary node with another temporary node.
|
||||
Temp1->replaceAllUsesWith(Temp2.get());
|
||||
EXPECT_EQ(N->getOperand(0), Temp2.get());
|
||||
|
||||
// Clean up Temp2 for teardown.
|
||||
Temp2->replaceAllUsesWith(nullptr);
|
||||
}
|
||||
|
||||
TEST_F(ValueAsMetadataTest, CollidingDoubleUpdates) {
|
||||
// Create a constant.
|
||||
ConstantAsMetadata *CI = ConstantAsMetadata::get(
|
||||
|
Loading…
Reference in New Issue
Block a user