aboutsummaryrefslogtreecommitdiffstats
path: root/unittests
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-07-25 06:02:13 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-07-25 06:02:13 +0000
commit92ccf70ad448eb02f9f273d2c70ae4708b3bd0f2 (patch)
tree79e29e5f8e24b6c70ff964e42d9b438c3b11eddf /unittests
parent8b5ee823c2393d15c74e2dda0c46f8a2c6f40dc8 (diff)
downloadexternal_llvm-92ccf70ad448eb02f9f273d2c70ae4708b3bd0f2.zip
external_llvm-92ccf70ad448eb02f9f273d2c70ae4708b3bd0f2.tar.gz
external_llvm-92ccf70ad448eb02f9f273d2c70ae4708b3bd0f2.tar.bz2
Finish migrating VMCore to StringRef/Twine based APIs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77051 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests')
-rw-r--r--unittests/VMCore/MetadataTest.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/unittests/VMCore/MetadataTest.cpp b/unittests/VMCore/MetadataTest.cpp
index 5da1328..560a31d 100644
--- a/unittests/VMCore/MetadataTest.cpp
+++ b/unittests/VMCore/MetadataTest.cpp
@@ -23,9 +23,9 @@ namespace {
// MDString objects, even with the same string pointer and nulls in the string.
TEST(MDStringTest, CreateDifferent) {
char x[3] = { 'f', 0, 'A' };
- MDString *s1 = getGlobalContext().getMDString(&x[0], 3);
+ MDString *s1 = getGlobalContext().getMDString(StringRef(&x[0], 3));
x[2] = 'B';
- MDString *s2 = getGlobalContext().getMDString(&x[0], 3);
+ MDString *s2 = getGlobalContext().getMDString(StringRef(&x[0], 3));
EXPECT_NE(s1, s2);
}
@@ -35,8 +35,8 @@ TEST(MDStringTest, CreateSame) {
char x[4] = { 'a', 'b', 'c', 'X' };
char y[4] = { 'a', 'b', 'c', 'Y' };
- MDString *s1 = getGlobalContext().getMDString(&x[0], 3);
- MDString *s2 = getGlobalContext().getMDString(&y[0], 3);
+ MDString *s1 = getGlobalContext().getMDString(StringRef(&x[0], 3));
+ MDString *s2 = getGlobalContext().getMDString(StringRef(&y[0], 3));
EXPECT_EQ(s1, s2);
}
@@ -44,7 +44,7 @@ TEST(MDStringTest, CreateSame) {
TEST(MDStringTest, PrintingSimple) {
char *str = new char[13];
strncpy(str, "testing 1 2 3", 13);
- MDString *s = getGlobalContext().getMDString(str, 13);
+ MDString *s = getGlobalContext().getMDString(StringRef(str, 13));
strncpy(str, "aaaaaaaaaaaaa", 13);
delete[] str;
@@ -56,7 +56,7 @@ TEST(MDStringTest, PrintingSimple) {
// Test printing of MDString with non-printable characters.
TEST(MDStringTest, PrintingComplex) {
char str[5] = {0, '\n', '"', '\\', -1};
- MDString *s = getGlobalContext().getMDString(str+0, 5);
+ MDString *s = getGlobalContext().getMDString(StringRef(str+0, 5));
std::ostringstream oss;
s->print(oss);
EXPECT_STREQ("metadata !\"\\00\\0A\\22\\5C\\FF\"", oss.str().c_str());
@@ -67,8 +67,8 @@ TEST(MDNodeTest, Simple) {
char x[3] = { 'a', 'b', 'c' };
char y[3] = { '1', '2', '3' };
- MDString *s1 = getGlobalContext().getMDString(&x[0], 3);
- MDString *s2 = getGlobalContext().getMDString(&y[0], 3);
+ MDString *s1 = getGlobalContext().getMDString(StringRef(&x[0], 3));
+ MDString *s2 = getGlobalContext().getMDString(StringRef(&y[0], 3));
ConstantInt *CI = ConstantInt::get(getGlobalContext(), APInt(8, 0));
std::vector<Value *> V;