Author: Vitaly Buka
Date: 2024-01-18T13:09:13-08:00
New Revision: 160a750e63256e58fc171f1b6cccf8b61bb05f42

URL: 
https://github.com/llvm/llvm-project/commit/160a750e63256e58fc171f1b6cccf8b61bb05f42
DIFF: 
https://github.com/llvm/llvm-project/commit/160a750e63256e58fc171f1b6cccf8b61bb05f42.diff

LOG: [clang-repl][test] Suppress memory lease after #76218

`new` was introduced in this patch, but I don't see `delete` to release
the memory.

Added: 
    

Modified: 
    clang/unittests/Interpreter/InterpreterTest.cpp

Removed: 
    


################################################################################
diff  --git a/clang/unittests/Interpreter/InterpreterTest.cpp 
b/clang/unittests/Interpreter/InterpreterTest.cpp
index 1e0854b3c4af46..d6eb0684ba49d8 100644
--- a/clang/unittests/Interpreter/InterpreterTest.cpp
+++ b/clang/unittests/Interpreter/InterpreterTest.cpp
@@ -34,6 +34,12 @@ using namespace clang;
 #define CLANG_INTERPRETER_NO_SUPPORT_EXEC
 #endif
 
+#if LLVM_ADDRESS_SANITIZER_BUILD || LLVM_HWADDRESS_SANITIZER_BUILD
+#include <sanitizer/lsan_interface.h>
+#else
+extern "C" void __lsan_ignore_object(const void *p) {}
+#endif
+
 int Global = 42;
 // JIT reports symbol not found on Windows without the visibility attribute.
 REPL_EXTERNAL_VISIBILITY int getGlobal() { return Global; }
@@ -311,6 +317,8 @@ TEST(IncrementalProcessing, InstantiateTemplate) {
   auto fn =
       cantFail(Interp->getSymbolAddress(MangledName)).toPtr<TemplateSpecFn>();
   EXPECT_EQ(42, fn(NewA.getPtr()));
+  // FIXME: release the memory.
+  __lsan_ignore_object(NewA.getPtr());
 }
 
 #ifdef CLANG_INTERPRETER_NO_SUPPORT_EXEC


        
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to