Skip to content

Commit

Permalink
[clang-repl][test] Suppress memory lease after #76218
Browse files Browse the repository at this point in the history
`new` was introduced in this patch, but I don't see `delete` to release
the memory.
  • Loading branch information
vitalybuka committed Jan 18, 2024
1 parent 96542c0 commit 160a750
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions clang/unittests/Interpreter/InterpreterTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 160a750

Please sign in to comment.