================
@@ -0,0 +1,141 @@
+//===- unittests/Analysis/Scalable/EntityIdTableTest.cpp -----------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM 
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include "clang/Analysis/Scalable/Model/EntityIdTable.h"
+#include "clang/Analysis/Scalable/Model/BuildNamespace.h"
+#include "clang/Analysis/Scalable/Model/EntityId.h"
+#include "clang/Analysis/Scalable/Model/EntityName.h"
+#include "gtest/gtest.h"
+
+namespace clang {
+namespace ssaf {
+namespace {
+
+TEST(EntityIdTableTest, CreateNewEntity) {
+  EntityIdTable Table;
+
+  EntityName Entity("c:@F@foo", "", {});
+  Table.getId(Entity);
+
+  EXPECT_TRUE(Table.exists(Entity));
+}
+
+TEST(EntityIdTableTest, Idempotency) {
----------------
ymand wrote:

maybe add a variant that uses 2 different copies of the same name? this 
guarantees that the implementation isn't tied to the identity of the name 
object.

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

Reply via email to