[flang] Skip `Fortran STOP:` before message when NO_STOP_MESSAGE is set
authorJean Perier <jperier@nvidia.com>
Thu, 18 Nov 2021 17:06:19 +0000 (18:06 +0100)
committerJean Perier <jperier@nvidia.com>
Thu, 18 Nov 2021 17:08:06 +0000 (18:08 +0100)
commit7796d81ae8204289c6ea07f19e538cf287d3213f
treed29f34ca8e1c0ab85770a8d036f8975686ec811b
parent180625fcb478877bfada337705ec4e2e1ecb8d7e
[flang] Skip `Fortran STOP:` before message when NO_STOP_MESSAGE is set

In 'STOP bye bye', do not print 'Fortran STOP:` before 'bye bye' when
NO_STOP_MESSAGE environment variable is set at runtime.

Also only exit with code 1 in StopStatementText if this is an ERROR STOP.
This matches other compiler behaviors.

Move STOP related unit tests in their own test file and add new tests to
cover this change.

Differential Revision: https://reviews.llvm.org/D114152
flang/runtime/stop.cpp
flang/unittests/Runtime/CMakeLists.txt
flang/unittests/Runtime/RuntimeCrashTest.cpp
flang/unittests/Runtime/Stop.cpp [new file with mode: 0644]