@@ -3,6 +3,7 @@ let foo () : unit = raise (Failure "foo")
33let bar () =
44 try foo () with Failure _ as e -> Backtrace. reraise e (Failure " bar" )
55
6+ let baz () = try foo () with exn -> raise exn
67
78let no_backtraces = ref false
89
@@ -22,15 +23,23 @@ let test_v1_with_backtrace () =
2223 Printexc. record_backtrace false ;
2324 try Test_lib.Log. with_thread_associated_old " Backtrace lab" foo () with _ -> ()
2425
26+ let raise_again = ref false
27+
28+ let test_raise_again () =
29+ Printexc. record_backtrace true ;
30+ try Test_lib.Log. with_thread_associated " Backtrace lab" baz () with _ -> ()
31+
2532let usage = Printf. sprintf " %s" Sys. argv.(0 )
2633let speclist = [
2734 (" -no-backtraces" , Arg. Set no_backtraces, " Test no-backtraces" )
2835; (" -reraise" , Arg. Set reraise, " Test reraise" )
2936; (" -v1-with-backtrace" , Arg. Set v1_with_backtrace, " Test v1-with-backtrace" )
37+ ; (" -raise-again" , Arg. Set raise_again, " Test raise-again" )
3038]
3139
3240let () =
3341 Arg. parse speclist (Fun. const () ) usage ;
3442 if ! no_backtraces then test_no_backtraces () ;
3543 if ! reraise then test_reraise () ;
36- if ! v1_with_backtrace then test_v1_with_backtrace ()
44+ if ! v1_with_backtrace then test_v1_with_backtrace () ;
45+ if ! raise_again then test_raise_again ()
0 commit comments