diff --git a/clang/unittests/libclang/CrashTests/LibclangCrashTest.cpp b/clang/unittests/libclang/CrashTests/LibclangCrashTest.cpp index 821ef849ae33..3ccdb16cce4e 100644 --- a/clang/unittests/libclang/CrashTests/LibclangCrashTest.cpp +++ b/clang/unittests/libclang/CrashTests/LibclangCrashTest.cpp @@ -31,6 +31,7 @@ TEST_F(LibclangParseTest, UninstallAbortingLLVMFatalErrorHandler) { std::string Main = "main.h"; WriteFile(Main, "#pragma clang __debug llvm_fatal_error"); - EXPECT_NO_FATAL_FAILURE(clang_parseTranslationUnit( - Index, Main.c_str(), nullptr, 0, nullptr, 0, TUFlags)); + EXPECT_EXIT(clang_parseTranslationUnit( + Index, Main.c_str(), nullptr, 0, nullptr, 0, TUFlags), + ::testing::ExitedWithCode(1), "ERROR"); }