diff --git a/flang/unittests/RuntimeGTest/CMakeLists.txt b/flang/unittests/RuntimeGTest/CMakeLists.txt --- a/flang/unittests/RuntimeGTest/CMakeLists.txt +++ b/flang/unittests/RuntimeGTest/CMakeLists.txt @@ -9,7 +9,14 @@ RuntimeCrashTest.cpp ) +if (LLVM_LINK_LLVM_DYLIB) + set(llvm_libs LLVM) +else() + llvm_map_components_to_libnames(llvm_libs Support) +endif() + target_link_libraries(FlangRuntimeTests PRIVATE FortranRuntime + ${llvm_libs} ) diff --git a/flang/unittests/RuntimeGTest/CrashHandlerFixture.cpp b/flang/unittests/RuntimeGTest/CrashHandlerFixture.cpp --- a/flang/unittests/RuntimeGTest/CrashHandlerFixture.cpp +++ b/flang/unittests/RuntimeGTest/CrashHandlerFixture.cpp @@ -28,7 +28,7 @@ // Register the crash handler above when creating each unit test in this suite void CrashHandlerFixture::SetUp() { static bool isCrashHanlderRegistered{false}; - if (not isCrashHanlderRegistered) + if (!isCrashHanlderRegistered) Fortran::runtime::Terminator::RegisterCrashHandler(CatchCrash); isCrashHanlderRegistered = true; }