[flang-commits] [flang] cbff0c7 - [flang] Improve output from a STOP statement
peter klausler via flang-commits
flang-commits at lists.llvm.org
Sat Jul 18 11:34:22 PDT 2020
Author: peter klausler
Date: 2020-07-18T11:33:46-07:00
New Revision: cbff0c75b9ea120bc6ec1ecc2e8d431fd6143236
URL: https://github.com/llvm/llvm-project/commit/cbff0c75b9ea120bc6ec1ecc2e8d431fd6143236
DIFF: https://github.com/llvm/llvm-project/commit/cbff0c75b9ea120bc6ec1ecc2e8d431fd6143236.diff
LOG: [flang] Improve output from a STOP statement
Add a missing newline to IEEE FP flag formatting, and
don't neglect to emit STOP when there's no code number.
Reviewed By: tskeith
Differential Revision: https://reviews.llvm.org/D84060
Added:
Modified:
flang/runtime/stop.cpp
Removed:
################################################################################
diff --git a/flang/runtime/stop.cpp b/flang/runtime/stop.cpp
index 49592b75a2ad..3b8c1385293a 100644
--- a/flang/runtime/stop.cpp
+++ b/flang/runtime/stop.cpp
@@ -40,6 +40,7 @@ static void DescribeIEEESignaledExceptions() {
if (excepts & FE_UNDERFLOW) {
std::fputs(" UNDERFLOW", stderr);
}
+ std::fputc('\n', stderr);
}
}
@@ -52,10 +53,11 @@ static void CloseAllExternalUnits(const char *why) {
int code, bool isErrorStop, bool quiet) {
CloseAllExternalUnits("STOP statement");
if (!quiet) {
+ std::fprintf(stderr, "Fortran %s", isErrorStop ? "ERROR STOP" : "STOP");
if (code != EXIT_SUCCESS) {
- std::fprintf(stderr, "Fortran %s: code %d\n",
- isErrorStop ? "ERROR STOP" : "STOP", code);
+ std::fprintf(stderr, ": code %d\n", code);
}
+ std::fputc('\n', stderr);
DescribeIEEESignaledExceptions();
}
std::exit(code);
More information about the flang-commits
mailing list