mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-26 07:24:25 +00:00
IR: Add isUniqued() and isTemporary()
Change `MDNode::isDistinct()` to only apply to 'distinct' nodes (not temporaries), and introduce `MDNode::isUniqued()` and `MDNode::isTemporary()` for the other two possibilities. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226482 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -274,9 +274,33 @@ TEST_F(MDNodeTest, getDistinct) {
|
||||
ASSERT_EQ(Empty, MDNode::get(Context, None));
|
||||
}
|
||||
|
||||
TEST_F(MDNodeTest, TempIsDistinct) {
|
||||
MDNode *T = MDNode::getTemporary(Context, None);
|
||||
EXPECT_TRUE(T->isDistinct());
|
||||
TEST_F(MDNodeTest, isUniqued) {
|
||||
MDNode *U = MDTuple::get(Context, None);
|
||||
MDNode *D = MDTuple::getDistinct(Context, None);
|
||||
MDNode *T = MDTuple::getTemporary(Context, None);
|
||||
EXPECT_TRUE(U->isUniqued());
|
||||
EXPECT_FALSE(D->isUniqued());
|
||||
EXPECT_FALSE(T->isUniqued());
|
||||
MDNode::deleteTemporary(T);
|
||||
}
|
||||
|
||||
TEST_F(MDNodeTest, isDistinct) {
|
||||
MDNode *U = MDTuple::get(Context, None);
|
||||
MDNode *D = MDTuple::getDistinct(Context, None);
|
||||
MDNode *T = MDTuple::getTemporary(Context, None);
|
||||
EXPECT_FALSE(U->isDistinct());
|
||||
EXPECT_TRUE(D->isDistinct());
|
||||
EXPECT_FALSE(T->isDistinct());
|
||||
MDNode::deleteTemporary(T);
|
||||
}
|
||||
|
||||
TEST_F(MDNodeTest, isTemporary) {
|
||||
MDNode *U = MDTuple::get(Context, None);
|
||||
MDNode *D = MDTuple::getDistinct(Context, None);
|
||||
MDNode *T = MDTuple::getTemporary(Context, None);
|
||||
EXPECT_FALSE(U->isTemporary());
|
||||
EXPECT_FALSE(D->isTemporary());
|
||||
EXPECT_TRUE(T->isTemporary());
|
||||
MDNode::deleteTemporary(T);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user