Endre =?utf-8?q?F=C3=BCl=C3=B6p?= <endre.fu...@sigmatechnology.com>,
Endre =?utf-8?q?F=C3=BCl=C3=B6p?= <endre.fu...@sigmatechnology.com>,
Endre =?utf-8?q?F=C3=BCl=C3=B6p?= <endre.fu...@sigmatechnology.com>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/152...@github.com>


================
@@ -150,4 +152,23 @@ TEST(ExprEngineVisitTest, checkLocationAndBind) {
   EXPECT_TRUE(LocPos > BindPos);
 }
 
+TEST(ExprEngineVisitTest, checkLocationAndBindInitialization) {
+  std::string Diags;
+  EXPECT_TRUE(runCheckerOnCode<addMemAccessChecker>(R"(
+    class MyClass{
+    public:
+      int Value;
+    };
+    extern MyClass MyClassRead;
+    void top() {
+      MyClass MyClassWrite = MyClassRead;
+    }
+  )",
+                                                    Diags));
+
+  // Look for any occurrence of AtDeclInit = true
+  std::size_t BindPos = Diags.find("AtDeclInit = true");
+  EXPECT_NE(BindPos, std::string::npos);
----------------
steakhal wrote:

```suggestion
  EXPECT_TRUE(StringRef(Diags).contains("AtDeclInit = true"));
```

https://github.com/llvm/llvm-project/pull/152137
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to