summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRobert Norton2019-06-19 14:35:18 +0100
committerRobert Norton2019-06-19 14:35:18 +0100
commitb024aa981ddc3411d9b9d22e169a9d9a924f7124 (patch)
tree2f0cd437f9cc33d86494629e01618804da466476 /src
parent31276a1d9d8bcb713495695c027050e6b63ed5f1 (diff)
Make default ocaml main exit with non-zero exit code in case of uncaught exception. This is ensures test failures are detected.
Diffstat (limited to 'src')
-rw-r--r--src/ocaml_backend.ml2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/ocaml_backend.ml b/src/ocaml_backend.ml
index 28ce43d3..618de5e6 100644
--- a/src/ocaml_backend.ml
+++ b/src/ocaml_backend.ml
@@ -965,7 +965,7 @@ let ocaml_main spec sail_dir =
@ [ " zinitializze_registers ();";
if !opt_trace_ocaml then " Sail_lib.opt_trace := true;" else " ();";
" Printexc.record_backtrace true;";
- " try zmain () with exn -> prerr_endline(\"Exiting due to uncaught exception:\\n\" ^ Printexc.to_string exn)\n";])
+ " try zmain () with exn -> (prerr_endline(\"Exiting due to uncaught exception:\\n\" ^ Printexc.to_string exn); exit 1)\n";])
|> String.concat "\n"
let ocaml_pp_defs f defs generator_types =