Skip to content

Commit 9f49a22

Browse files
committed
[DenseMapTest] Fix test
1 parent c1d2731 commit 9f49a22

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

llvm/unittests/ADT/DenseMapTest.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -668,9 +668,14 @@ TEST(DenseMapCustomTest, LookupOr) {
668668

669669
EXPECT_EQ(M.lookup_or(0, 4u), 3u);
670670
EXPECT_EQ(M.lookup_or(1, 4u), 0u);
671+
EXPECT_EQ(M.lookup_or(2, 4u), 4u);
672+
}
671673

672-
NonDefaultConstructible DefaultV = M.lookup_or(2, 4u);
673-
EXPECT_EQ(DefaultV, 4u);
674+
TEST(DenseMapCustomTest, LookupOrConstness) {
675+
DenseMap<int, unsigned *> M;
676+
unsigned Default = 3u;
677+
unsigned *Ret = M.lookup_or(0, &Default);
678+
EXPECT_EQ(Ret, &Default);
674679
}
675680

676681
// Key traits that allows lookup with either an unsigned or char* key;

0 commit comments

Comments
 (0)