Skip to content

Commit 160a750

Browse files
committed
[clang-repl][test] Suppress memory lease after llvm#76218
`new` was introduced in this patch, but I don't see `delete` to release the memory.
1 parent 96542c0 commit 160a750

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

clang/unittests/Interpreter/InterpreterTest.cpp

+8
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@ using namespace clang;
3434
#define CLANG_INTERPRETER_NO_SUPPORT_EXEC
3535
#endif
3636

37+
#if LLVM_ADDRESS_SANITIZER_BUILD || LLVM_HWADDRESS_SANITIZER_BUILD
38+
#include <sanitizer/lsan_interface.h>
39+
#else
40+
extern "C" void __lsan_ignore_object(const void *p) {}
41+
#endif
42+
3743
int Global = 42;
3844
// JIT reports symbol not found on Windows without the visibility attribute.
3945
REPL_EXTERNAL_VISIBILITY int getGlobal() { return Global; }
@@ -311,6 +317,8 @@ TEST(IncrementalProcessing, InstantiateTemplate) {
311317
auto fn =
312318
cantFail(Interp->getSymbolAddress(MangledName)).toPtr<TemplateSpecFn>();
313319
EXPECT_EQ(42, fn(NewA.getPtr()));
320+
// FIXME: release the memory.
321+
__lsan_ignore_object(NewA.getPtr());
314322
}
315323

316324
#ifdef CLANG_INTERPRETER_NO_SUPPORT_EXEC

0 commit comments

Comments
 (0)