Give embedded metadata its own type instead of relying on EmptyStructTy.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72610 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Nick Lewycky
2009-05-30 05:06:04 +00:00
parent c5ca713b80
commit 7a0370f66a
17 changed files with 220 additions and 93 deletions

View File

@@ -50,7 +50,7 @@ TEST(MDStringTest, PrintingSimple) {
std::ostringstream oss;
s->print(oss);
EXPECT_STREQ("{ } !\"testing 1 2 3\"", oss.str().c_str());
EXPECT_STREQ("metadata !\"testing 1 2 3\"", oss.str().c_str());
}
// Test printing of MDString with non-printable characters.
@@ -59,7 +59,7 @@ TEST(MDStringTest, PrintingComplex) {
MDString *s = MDString::get(str+0, str+5);
std::ostringstream oss;
s->print(oss);
EXPECT_STREQ("{ } !\"\\00\\0A\\22\\5C\\FF\"", oss.str().c_str());
EXPECT_STREQ("metadata !\"\\00\\0A\\22\\5C\\FF\"", oss.str().c_str());
}
// Test the two constructors, and containing other Constants.
@@ -94,8 +94,10 @@ TEST(MDNodeTest, Simple) {
std::ostringstream oss1, oss2;
n1->print(oss1);
n2->print(oss2);
EXPECT_STREQ("{ } !{{ } !\"abc\", i8 0, { } !\"123\"}", oss1.str().c_str());
EXPECT_STREQ("{ } !{{ } !{{ } !\"abc\", i8 0, { } !\"123\"}}",
EXPECT_STREQ("metadata !{metadata !\"abc\", i8 0, metadata !\"123\"}",
oss1.str().c_str());
EXPECT_STREQ("metadata !{metadata !{metadata !\"abc\", i8 0, "
"metadata !\"123\"}}",
oss2.str().c_str());
}
@@ -132,6 +134,6 @@ TEST(MDNodeTest, Delete) {
std::ostringstream oss;
wvh->print(oss);
EXPECT_STREQ("{ } !{null}", oss.str().c_str());
EXPECT_STREQ("metadata !{null}", oss.str().c_str());
}
}