[PATCH] D84060: [flang] Improve output from a STOP statement

Peter Klausler via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 17 11:20:16 PDT 2020


klausler created this revision.
klausler added reviewers: sscalpone, tskeith, schweitz.
klausler added a project: Flang.
Herald added a reviewer: jdoerfert.
Herald added a reviewer: DavidTruby.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Add a missing newline to IEEE FP flag formatting, and
don't neglect to emit STOP when there's no code number.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D84060

Files:
  flang/runtime/stop.cpp


Index: flang/runtime/stop.cpp
===================================================================
--- flang/runtime/stop.cpp
+++ flang/runtime/stop.cpp
@@ -40,6 +40,7 @@
     if (excepts & FE_UNDERFLOW) {
       std::fputs(" UNDERFLOW", stderr);
     }
+    std::fputc('\n', stderr);
   }
 }
 
@@ -52,10 +53,11 @@
     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);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D84060.278858.patch
Type: text/x-patch
Size: 793 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200717/1adeecf4/attachment.bin>


More information about the llvm-commits mailing list