diff options
Diffstat (limited to 'llvm/unittests/IR/MetadataTest.cpp')
-rw-r--r-- | llvm/unittests/IR/MetadataTest.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/llvm/unittests/IR/MetadataTest.cpp b/llvm/unittests/IR/MetadataTest.cpp index b2ffb80b15e..3f744cd5e6d 100644 --- a/llvm/unittests/IR/MetadataTest.cpp +++ b/llvm/unittests/IR/MetadataTest.cpp @@ -147,11 +147,9 @@ TEST_F(MDStringTest, CreateSame) { // Test that MDString prints out the string we fed it. TEST_F(MDStringTest, PrintingSimple) { - char *str = new char[13]; - strncpy(str, "testing 1 2 3", 13); - MDString *s = MDString::get(Context, StringRef(str, 13)); - strncpy(str, "aaaaaaaaaaaaa", 13); - delete[] str; + char str[14] = "testing 1 2 3"; + MDString *s = MDString::get(Context, StringRef(&str[0], 13)); + strncpy(str, "aaaaaaaaaaaaa", 14); std::string Str; raw_string_ostream oss(Str); |