summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/Support/AllocatorTest.cpp
diff options
context:
space:
mode:
authorNick Kledzik <kledzik@apple.com>2014-02-05 22:22:56 +0000
committerNick Kledzik <kledzik@apple.com>2014-02-05 22:22:56 +0000
commit4d6d981297d265341eef6ef6ff89dabfe8ca4a78 (patch)
treebafe74bd82dae7d91318f2cc62528022c2a8e21f /llvm/unittests/Support/AllocatorTest.cpp
parent2cb4a78f9394359e3bb74060774e2245bcb9f4b7 (diff)
downloadbcm5719-llvm-4d6d981297d265341eef6ef6ff89dabfe8ca4a78.tar.gz
bcm5719-llvm-4d6d981297d265341eef6ef6ff89dabfe8ca4a78.zip
Fix layering StringRef copy using BumpPtrAllocator.
Now to copy a string into a BumpPtrAllocator and get a StringRef to the copy: StringRef myCopy = myStr.copy(myAllocator); llvm-svn: 200885
Diffstat (limited to 'llvm/unittests/Support/AllocatorTest.cpp')
-rw-r--r--llvm/unittests/Support/AllocatorTest.cpp28
1 files changed, 0 insertions, 28 deletions
diff --git a/llvm/unittests/Support/AllocatorTest.cpp b/llvm/unittests/Support/AllocatorTest.cpp
index 43ce0c86bee..cb9fa430369 100644
--- a/llvm/unittests/Support/AllocatorTest.cpp
+++ b/llvm/unittests/Support/AllocatorTest.cpp
@@ -147,32 +147,4 @@ TEST(AllocatorTest, TestBigAlignment) {
EXPECT_LE(Ptr + 3000, ((uintptr_t)Slab) + Slab->Size);
}
-TEST(AllocatorTest, CopyStringRef) {
- BumpPtrAllocator Alloc;
- StringRef Str1 = "hello";
- StringRef Str2 = "bye";
- StringRef Str1c = Alloc.allocateCopy(Str1);
- StringRef Str2c = Alloc.allocateCopy(Str2);
- EXPECT_TRUE(Str1.equals(Str1c));
- EXPECT_NE(Str1.data(), Str1c.data());
- EXPECT_TRUE(Str2.equals(Str2c));
- EXPECT_NE(Str2.data(), Str2c.data());
-}
-
-TEST(AllocatorTest, CopyArrayRef) {
- BumpPtrAllocator Alloc;
- static const uint16_t Words1[] = { 1, 4, 200, 37 };
- ArrayRef<uint16_t> Array1 = makeArrayRef(Words1, 4);
- static const uint16_t Words2[] = { 11, 4003, 67, 64000, 13 };
- ArrayRef<uint16_t> Array2 = makeArrayRef(Words2, 5);
- ArrayRef<uint16_t> Array1c = Alloc.allocateCopy(Array1);
- ArrayRef<uint16_t> Array2c = Alloc.allocateCopy(Array2);
- EXPECT_TRUE(Array1.equals(Array1c));
- EXPECT_NE(Array1.data(), Array1c.data());
- EXPECT_TRUE(Array2.equals(Array2c));
- EXPECT_NE(Array2.data(), Array2c.data());
-}
-
-
-
} // anonymous namespace
OpenPOWER on IntegriCloud