As per Steve Scalpone's suggestion, I've renamed the runtime routine to
better evoke its purpose.
I implemented a routine called "Crash" and added a test.
Differential Revision: https://reviews.llvm.org/D118703
// Crash with an error message when the program dynamically violates a Fortran
// constraint.
-NORETURN void RTNAME(Crash)(const char *message, const char *source, int line);
+NORETURN void RTNAME(ReportFatalUserError)(
+ const char *message, const char *source, int line);
FORTRAN_EXTERN_C_END
[[noreturn]] void RTNAME(Abort)() { std::abort(); }
-[[noreturn]] void RTNAME(Crash)(
+[[noreturn]] void RTNAME(ReportFatalUserError)(
const char *message, const char *source, int line) {
Fortran::runtime::Terminator{source, line}.Crash(message);
}
static const std::string tailMessage{":343\\): "};
static const std::string fullMessage{
headMessage + fileName + tailMessage + crashMessage};
- EXPECT_DEATH(RTNAME(Crash)(crashMessage.c_str(), fileName.c_str(), 343),
+ EXPECT_DEATH(
+ RTNAME(ReportFatalUserError)(crashMessage.c_str(), fileName.c_str(), 343),
fullMessage.c_str());
}