-
Notifications
You must be signed in to change notification settings - Fork 85
/
Copy pathbacktrace_c_exn.ml
57 lines (42 loc) · 1.17 KB
/
backtrace_c_exn.ml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
(* TEST_BELOW
(* Blank lines added here to preserve locations. *)
*)
(* CR mshinwell: it isn't clear to me why the 5 reference output here
is not worse. It seems to have lost the stack frames on the C side.
(The reference file does match upstream 5.)
*)
(* https://github.com/ocaml-multicore/ocaml-multicore/issues/498 *)
external stubbed_raise : unit -> unit = "caml_498_raise"
let raise_exn () = (failwith [@inlined never]) "exn" [@@inline never]
let () = Callback.register "test_raise_exn" raise_exn
let () =
try
stubbed_raise ()
with
| exn ->
Printexc.to_string exn |> print_endline;
Printexc.print_backtrace stdout
(* TEST
modules = "backtrace_c_exn_.c";
flags = "-g -alert -unsafe_multidomain";
ocamlrunparam += ",b=1";
{
runtime4;
{
reference = "${test_source_directory}/backtrace_c_exn.byte4.reference";
bytecode;
}{
reference = "${test_source_directory}/backtrace_c_exn.opt4.reference";
native;
}
}{
runtime5;
{
reference = "${test_source_directory}/backtrace_c_exn.r5.reference";
bytecode;
}{
reference = "${test_source_directory}/backtrace_c_exn.r5.reference";
native;
}
}
*)