================
@@ -379,6 +379,20 @@ TEST_F(SourceManagerTest, getInvalidBOM) {
             "UTF-32 (LE)");
 }
 
+TEST_F(SourceManagerTest, sourceRangeWorksWithDenseSet) {
+  llvm::DenseSet<SourceRange> Set;
+  SourceRange TestRange = {SourceLocation::getFromRawEncoding(10),
+                           SourceLocation::getFromRawEncoding(11)};
+  ASSERT_EQ(Set.size(), 0U);
+  Set.insert(TestRange);
+  ASSERT_EQ(Set.size(), 1U);
+  ASSERT_TRUE(Set.contains(TestRange));
+  ASSERT_FALSE(Set.contains({SourceLocation::getFromRawEncoding(10),
+                             SourceLocation::getFromRawEncoding(10)}));
+  Set.erase(TestRange);
+  ASSERT_EQ(Set.size(), 0U);
----------------
kuhar wrote:

also here

https://github.com/llvm/llvm-project/pull/174524
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to