diff options
| author | 2017-01-24 08:32:59 +0000 | |
|---|---|---|
| committer | 2017-01-24 08:32:59 +0000 | |
| commit | 53d771aafdbe5b919f264f53cba3788e2c4cffd2 (patch) | |
| tree | 7eca39498be0ff1e3a6daf583cd9ca5886bb2636 /gnu/llvm/unittests/ADT/SmallPtrSetTest.cpp | |
| parent | In preparation of compiling our kernels with -ffreestanding, explicitly map (diff) | |
| download | wireguard-openbsd-53d771aafdbe5b919f264f53cba3788e2c4cffd2.tar.xz wireguard-openbsd-53d771aafdbe5b919f264f53cba3788e2c4cffd2.zip | |
Import LLVM 4.0.0 rc1 including clang and lld to help the current
development effort on OpenBSD/arm64.
Diffstat (limited to 'gnu/llvm/unittests/ADT/SmallPtrSetTest.cpp')
| -rw-r--r-- | gnu/llvm/unittests/ADT/SmallPtrSetTest.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/gnu/llvm/unittests/ADT/SmallPtrSetTest.cpp b/gnu/llvm/unittests/ADT/SmallPtrSetTest.cpp index d8d07b16cfe..d4d963fdc5b 100644 --- a/gnu/llvm/unittests/ADT/SmallPtrSetTest.cpp +++ b/gnu/llvm/unittests/ADT/SmallPtrSetTest.cpp @@ -21,10 +21,7 @@ TEST(SmallPtrSetTest, Assignment) { for (int i = 0; i < 8; ++i) buf[i] = 0; - SmallPtrSet<int *, 4> s1; - s1.insert(&buf[0]); - s1.insert(&buf[1]); - + SmallPtrSet<int *, 4> s1 = {&buf[0], &buf[1]}; SmallPtrSet<int *, 4> s2; (s2 = s1).insert(&buf[2]); @@ -38,6 +35,15 @@ TEST(SmallPtrSetTest, Assignment) { EXPECT_TRUE(s1.count(&buf[i])); else EXPECT_FALSE(s1.count(&buf[i])); + + // Assign and insert with initializer lists, and ones that contain both + // duplicates and out-of-order elements. + (s2 = {&buf[6], &buf[7], &buf[6]}).insert({&buf[5], &buf[4]}); + for (int i = 0; i < 8; ++i) + if (i < 4) + EXPECT_FALSE(s2.count(&buf[i])); + else + EXPECT_TRUE(s2.count(&buf[i])); } TEST(SmallPtrSetTest, GrowthTest) { |
