diff options
author | Vitaly Buka <vitalybuka@google.com> | 2024-01-18 13:06:30 -0800 |
---|---|---|
committer | Vitaly Buka <vitalybuka@google.com> | 2024-01-18 13:09:13 -0800 |
commit | 160a750e63256e58fc171f1b6cccf8b61bb05f42 (patch) | |
tree | 348e738edba041602149d587d78e0ae77aee2c92 /clang/unittests/Interpreter/InterpreterTest.cpp | |
parent | 96542c018f75b54b35aa3e08f184a4909f8c0c04 (diff) | |
download | llvm-160a750e63256e58fc171f1b6cccf8b61bb05f42.zip llvm-160a750e63256e58fc171f1b6cccf8b61bb05f42.tar.gz llvm-160a750e63256e58fc171f1b6cccf8b61bb05f42.tar.bz2 |
[clang-repl][test] Suppress memory lease after #76218
`new` was introduced in this patch, but I don't see `delete` to release
the memory.
Diffstat (limited to 'clang/unittests/Interpreter/InterpreterTest.cpp')
-rw-r--r-- | clang/unittests/Interpreter/InterpreterTest.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/unittests/Interpreter/InterpreterTest.cpp b/clang/unittests/Interpreter/InterpreterTest.cpp index 1e0854b..d6eb068 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 |