Derive MDNode from MetadataBase instead of Constant. Emit MDNodes into METADATA_BLOCK in bitcode file.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76834 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Devang Patel
2009-07-23 01:07:34 +00:00
parent 0aaf4e91c2
commit 104cf9e02b
17 changed files with 109 additions and 154 deletions

View File

@@ -101,25 +101,6 @@ TEST(MDNodeTest, Simple) {
oss2.str().c_str());
}
TEST(MDNodeTest, RAUW) {
Constant *C = getGlobalContext().getConstantInt(Type::Int32Ty, 1);
Instruction *I = new BitCastInst(C, Type::Int32Ty);
Value *const V1 = I;
MDNode *n1 = getGlobalContext().getMDNode(&V1, 1);
WeakVH wn1 = n1;
Value *const V2 = C;
MDNode *n2 = getGlobalContext().getMDNode(&V2, 1);
WeakVH wn2 = n2;
EXPECT_NE(wn1, wn2);
I->replaceAllUsesWith(C);
EXPECT_EQ(wn1, wn2);
}
TEST(MDNodeTest, Delete) {
Constant *C = getGlobalContext().getConstantInt(Type::Int32Ty, 1);
Instruction *I = new BitCastInst(C, Type::Int32Ty);