summaryrefslogtreecommitdiff
path: root/libgfortran/runtime
diff options
context:
space:
mode:
Diffstat (limited to 'libgfortran/runtime')
-rw-r--r--libgfortran/runtime/stop.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/libgfortran/runtime/stop.c b/libgfortran/runtime/stop.c
index f2a12338175..29f5031b3af 100644
--- a/libgfortran/runtime/stop.c
+++ b/libgfortran/runtime/stop.c
@@ -35,10 +35,29 @@ export_proto(stop_numeric);
void
stop_numeric (GFC_INTEGER_4 code)
{
+ if (code == -1)
+ code = 0;
+ else
+ st_printf ("STOP %d\n", (int)code);
+
+ sys_exit (code);
+}
+
+
+/* A Fortran 2008 numeric STOP statement. */
+
+extern void stop_numeric_f08 (GFC_INTEGER_4)
+ __attribute__ ((noreturn));
+export_proto(stop_numeric_f08);
+
+void
+stop_numeric_f08 (GFC_INTEGER_4 code)
+{
st_printf ("STOP %d\n", (int)code);
sys_exit (code);
}
+
/* A character string or blank STOP statement. */
void
@@ -75,7 +94,8 @@ error_stop_string (const char *string, GFC_INTEGER_4 len)
sys_exit (1);
}
-/* A numeric or blank ERROR STOP statement. */
+
+/* A numeric ERROR STOP statement. */
extern void error_stop_numeric (GFC_INTEGER_4)
__attribute__ ((noreturn));