From 9de8b05bfe0de2915d2443d06159396c5f9d389f Mon Sep 17 00:00:00 2001 From: Sunho Kim Date: Sun, 26 Jun 2022 19:02:19 +0900 Subject: [clang-repl] Support destructors of global objects. Supports destructors of global objects by properly calling jitdylib deinitialize which calls the global dtors of ir modules. This supersedes https://reviews.llvm.org/D127945. There was an issue when calling deinitialize on windows but it got fixed by https://reviews.llvm.org/D128037. Reviewed By: v.g.vassilev Differential Revision: https://reviews.llvm.org/D128589 --- .../unittests/Interpreter/ExceptionTests/InterpreterExceptionTest.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'clang/unittests/Interpreter/ExceptionTests/InterpreterExceptionTest.cpp') diff --git a/clang/unittests/Interpreter/ExceptionTests/InterpreterExceptionTest.cpp b/clang/unittests/Interpreter/ExceptionTests/InterpreterExceptionTest.cpp index 75928d9..73f7a01 100644 --- a/clang/unittests/Interpreter/ExceptionTests/InterpreterExceptionTest.cpp +++ b/clang/unittests/Interpreter/ExceptionTests/InterpreterExceptionTest.cpp @@ -48,6 +48,7 @@ createInterpreter(const Args &ExtraArgs = {}, TEST(InterpreterTest, CatchException) { llvm::InitializeNativeTarget(); llvm::InitializeNativeTargetAsmPrinter(); + llvm::llvm_shutdown_obj Y; // Call llvm_shutdown() on exit. { auto J = llvm::orc::LLJITBuilder().create(); @@ -131,8 +132,6 @@ extern "C" int throw_exception() { EXPECT_ANY_THROW(ThrowException()); std::string CapturedStdOut = testing::internal::GetCapturedStdout(); EXPECT_EQ(CapturedStdOut, "Caught: 'To be caught in JIT'\n"); - - llvm::llvm_shutdown(); } } // end anonymous namespace -- cgit v1.1