summaryrefslogtreecommitdiff
path: root/testsuite/tests/backtrace/backtrace_effects_nested.ml
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/backtrace/backtrace_effects_nested.ml')
-rw-r--r--testsuite/tests/backtrace/backtrace_effects_nested.ml24
1 files changed, 24 insertions, 0 deletions
diff --git a/testsuite/tests/backtrace/backtrace_effects_nested.ml b/testsuite/tests/backtrace/backtrace_effects_nested.ml
new file mode 100644
index 0000000000..e92b827714
--- /dev/null
+++ b/testsuite/tests/backtrace/backtrace_effects_nested.ml
@@ -0,0 +1,24 @@
+effect E : unit
+effect Inc : unit
+
+let blorp () =
+ perform Inc;
+ perform E;
+ 42
+
+
+let baz () =
+ match
+ blorp ()
+ with
+ | x -> x
+ | effect Inc k -> 1 + continue k ()
+
+let f () =
+ match baz () with
+ | x -> Printf.printf "%d\n" x
+ | effect E k ->
+ Printexc.(get_continuation_callstack k 100 |> raw_backtrace_to_string |> print_string);
+ continue k ()
+
+let () = f ()