aboutsummaryrefslogtreecommitdiff
path: root/clang/unittests
diff options
context:
space:
mode:
authorSunho Kim <ksunhokim123@gmail.com>2022-06-26 19:02:19 +0900
committerSunho Kim <ksunhokim123@gmail.com>2022-06-26 19:02:19 +0900
commit9de8b05bfe0de2915d2443d06159396c5f9d389f (patch)
tree97fba64aedd6ac38c737ea4a904c3e88c522535a /clang/unittests
parentec1922313101f94ffa0f3fe8c721220b83ebcb32 (diff)
downloadllvm-9de8b05bfe0de2915d2443d06159396c5f9d389f.zip
llvm-9de8b05bfe0de2915d2443d06159396c5f9d389f.tar.gz
llvm-9de8b05bfe0de2915d2443d06159396c5f9d389f.tar.bz2
[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
Diffstat (limited to 'clang/unittests')
-rw-r--r--clang/unittests/Interpreter/ExceptionTests/InterpreterExceptionTest.cpp3
1 files changed, 1 insertions, 2 deletions
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