diff options
Diffstat (limited to 'testsuite/tests/backtrace')
26 files changed, 355 insertions, 154 deletions
diff --git a/testsuite/tests/backtrace/backtrace.ml b/testsuite/tests/backtrace/backtrace.ml index 5f41e8631a..598d69d0ad 100644 --- a/testsuite/tests/backtrace/backtrace.ml +++ b/testsuite/tests/backtrace/backtrace.ml @@ -21,6 +21,6 @@ let _ = ignore (g Sys.argv.(1)) (* TEST - flags = "-g" - ocamlrunparam += ",b=1" + flags = "-g"; + ocamlrunparam += ",b=1"; *) diff --git a/testsuite/tests/backtrace/backtrace2.ml b/testsuite/tests/backtrace/backtrace2.ml index 747969a48f..d4b18e446d 100644 --- a/testsuite/tests/backtrace/backtrace2.ml +++ b/testsuite/tests/backtrace/backtrace2.ml @@ -1,6 +1,6 @@ -(* TEST - flags = "-g" - ocamlrunparam += ",b=1" +(* TEST_BELOW +(* Blank lines added here to preserve locations. *) + *) (* A test for stack backtraces *) @@ -76,3 +76,8 @@ let _ = run test_lazy [| () |]; run test_lazy [| () |]; () + +(* TEST + flags = "-g"; + ocamlrunparam += ",b=1"; +*) diff --git a/testsuite/tests/backtrace/backtrace3.ml b/testsuite/tests/backtrace/backtrace3.ml index c91f0a030d..3a41f2cfa5 100644 --- a/testsuite/tests/backtrace/backtrace3.ml +++ b/testsuite/tests/backtrace/backtrace3.ml @@ -1,6 +1,6 @@ -(* TEST - flags = "-g" - ocamlrunparam += ",b=1" +(* TEST_BELOW +(* Blank lines added here to preserve locations. *) + *) (* A test for stack backtraces *) @@ -61,3 +61,8 @@ let _ = run [| "g" |]; run [| "h" |]; run [| |] + +(* TEST + flags = "-g"; + ocamlrunparam += ",b=1"; +*) diff --git a/testsuite/tests/backtrace/backtrace_bounds_exn.ml b/testsuite/tests/backtrace/backtrace_bounds_exn.ml index 5eb0975388..1c08933f96 100644 --- a/testsuite/tests/backtrace/backtrace_bounds_exn.ml +++ b/testsuite/tests/backtrace/backtrace_bounds_exn.ml @@ -1,6 +1,6 @@ -(* TEST - flags = "-g" - ocamlrunparam += ",b=1" +(* TEST_BELOW +(* Blank lines added here to preserve locations. *) + *) (* #11436: bad backtrace for out-of-bounds exception *) @@ -18,3 +18,8 @@ let _ = Printexc.print_backtrace stdout; print_endline "OK" + +(* TEST + flags = "-g"; + ocamlrunparam += ",b=1"; +*) diff --git a/testsuite/tests/backtrace/backtrace_c_exn.ml b/testsuite/tests/backtrace/backtrace_c_exn.ml index 9b0077d509..2f4ccea1b6 100644 --- a/testsuite/tests/backtrace/backtrace_c_exn.ml +++ b/testsuite/tests/backtrace/backtrace_c_exn.ml @@ -1,7 +1,7 @@ -(* TEST - modules = "backtrace_c_exn_.c" - flags = "-g" - ocamlrunparam += ",b=1" +(* TEST_BELOW +(* Blank lines added here to preserve locations. *) + + *) (* https://github.com/ocaml-multicore/ocaml-multicore/issues/498 *) @@ -18,3 +18,9 @@ let () = | exn -> Printexc.to_string exn |> print_endline; Printexc.print_backtrace stdout + +(* TEST + modules = "backtrace_c_exn_.c"; + flags = "-g"; + ocamlrunparam += ",b=1"; +*) diff --git a/testsuite/tests/backtrace/backtrace_deprecated.ml b/testsuite/tests/backtrace/backtrace_deprecated.ml index 41b3c4be6b..750446a64b 100644 --- a/testsuite/tests/backtrace/backtrace_deprecated.ml +++ b/testsuite/tests/backtrace/backtrace_deprecated.ml @@ -1,6 +1,6 @@ -(* TEST - flags = "-g" - ocamlrunparam += ",b=1" +(* TEST_BELOW +(* Blank lines added here to preserve locations. *) + *) (* A test for stack backtraces *) @@ -40,3 +40,8 @@ let _ = run [| "c" |]; run [| "d" |]; run [| |] + +(* TEST + flags = "-g"; + ocamlrunparam += ",b=1"; +*) diff --git a/testsuite/tests/backtrace/backtrace_dynlink.flambda.reference b/testsuite/tests/backtrace/backtrace_dynlink.flambda.reference index 37960f371f..0db2568b05 100644 --- a/testsuite/tests/backtrace/backtrace_dynlink.flambda.reference +++ b/testsuite/tests/backtrace/backtrace_dynlink.flambda.reference @@ -2,19 +2,24 @@ Raised by primitive operation at Backtrace_dynlink_plugin in file "backtrace_dyn Called from Dynlink.Native.run.(fun) in file "otherlibs/dynlink/native/dynlink.ml", line 87, characters 12-29 Called from Stdlib__List.iter in file "list.ml" (inlined), line 112, characters 12-15 Called from Dynlink.Native.run in file "otherlibs/dynlink/native/dynlink.ml", line 86, characters 4-273 -Called from Dynlink_common.Make.load.(fun) in file "otherlibs/dynlink/dynlink_common.ml", line 363, characters 13-56 +Called from Dynlink_common.Make.load.(fun) in file "otherlibs/dynlink/dynlink_common.ml", line 361, characters 11-54 Called from Stdlib__List.iter in file "list.ml" (inlined), line 112, characters 12-15 -Called from Dynlink_common.Make.load in file "otherlibs/dynlink/dynlink_common.ml", line 359, characters 8-392 -Called from Dynlink_common.Make.loadfile in file "otherlibs/dynlink/dynlink_common.ml" (inlined), line 374, characters 26-45 +Called from Dynlink_common.Make.load.(fun) in file "otherlibs/dynlink/dynlink_common.ml" (inlined), line 357, characters 6-372 +Called from Stdlib__Fun.protect in file "fun.ml" (inlined), line 33, characters 8-15 +Called from Dynlink_common.Make.load in file "otherlibs/dynlink/dynlink_common.ml", line 350, characters 4-662 +Called from Dynlink_common.Make.loadfile in file "otherlibs/dynlink/dynlink_common.ml" (inlined), line 369, characters 26-45 Called from Backtrace_dynlink in file "backtrace_dynlink.ml", line 39, characters 4-52 execution of module initializers in the shared library failed: Failure("SUCCESS") Raised by primitive operation at Dynlink.Native.run.(fun) in file "otherlibs/dynlink/native/dynlink.ml", line 87, characters 12-29 Re-raised at Dynlink.Native.run.(fun) in file "otherlibs/dynlink/native/dynlink.ml", line 89, characters 10-149 Called from Stdlib__List.iter in file "list.ml" (inlined), line 112, characters 12-15 Called from Dynlink.Native.run in file "otherlibs/dynlink/native/dynlink.ml", line 86, characters 4-273 -Called from Dynlink_common.Make.load.(fun) in file "otherlibs/dynlink/dynlink_common.ml", line 363, characters 13-56 +Called from Dynlink_common.Make.load.(fun) in file "otherlibs/dynlink/dynlink_common.ml", line 361, characters 11-54 Called from Stdlib__List.iter in file "list.ml" (inlined), line 112, characters 12-15 -Called from Dynlink_common.Make.load in file "otherlibs/dynlink/dynlink_common.ml", line 359, characters 8-392 -Re-raised at Dynlink_common.Make.load in file "otherlibs/dynlink/dynlink_common.ml", line 372, characters 8-17 -Called from Dynlink_common.Make.loadfile in file "otherlibs/dynlink/dynlink_common.ml" (inlined), line 374, characters 26-45 +Called from Dynlink_common.Make.load.(fun) in file "otherlibs/dynlink/dynlink_common.ml" (inlined), line 357, characters 6-372 +Called from Stdlib__Fun.protect in file "fun.ml" (inlined), line 33, characters 8-15 +Called from Dynlink_common.Make.load in file "otherlibs/dynlink/dynlink_common.ml", line 350, characters 4-662 +Re-raised at Stdlib__Fun.protect in file "fun.ml" (inlined), line 38, characters 6-52 +Called from Dynlink_common.Make.load in file "otherlibs/dynlink/dynlink_common.ml", line 350, characters 4-662 +Called from Dynlink_common.Make.loadfile in file "otherlibs/dynlink/dynlink_common.ml" (inlined), line 369, characters 26-45 Called from Backtrace_dynlink in file "backtrace_dynlink.ml", line 39, characters 4-52 diff --git a/testsuite/tests/backtrace/backtrace_dynlink.ml b/testsuite/tests/backtrace/backtrace_dynlink.ml index 3252f53f67..7caf291801 100644 --- a/testsuite/tests/backtrace/backtrace_dynlink.ml +++ b/testsuite/tests/backtrace/backtrace_dynlink.ml @@ -1,32 +1,32 @@ -(* TEST +(* TEST_BELOW +(* Blank lines added here to preserve locations. *) + + + + + + + + + + + + + + + + + + + + + + + + + + -include dynlink - -readonly_files = "backtrace_dynlink_plugin.ml" - -libraries = "" - -* shared-libraries -** native-dynlink -*** setup-ocamlopt.byte-build-env -**** ocamlopt.byte -module = "backtrace_dynlink.ml" -flags = "-g" -**** ocamlopt.byte -program = "backtrace_dynlink_plugin.cmxs" -flags = "-shared -g" -all_modules = "backtrace_dynlink_plugin.ml" -**** ocamlopt.byte -program = "${test_build_directory}/main.exe" -libraries = "dynlink" -all_modules = "backtrace_dynlink.cmx" -***** run -ocamlrunparam += ",b=1" -****** no-flambda -******* check-program-output -****** flambda -reference = "${test_source_directory}/backtrace_dynlink.flambda.reference" -******* check-program-output *) (* test for backtrace and stack unwinding with dynlink. *) @@ -44,3 +44,37 @@ let () = | exn -> Printexc.to_string exn |> print_endline; print_endline "ERROR" + +(* TEST + include dynlink; + readonly_files = "backtrace_dynlink_plugin.ml"; + libraries = ""; + shared-libraries; + native-dynlink; + setup-ocamlopt.byte-build-env; + { + module = "backtrace_dynlink.ml"; + flags = "-g"; + ocamlopt.byte; + }{ + program = "backtrace_dynlink_plugin.cmxs"; + flags = "-shared -g"; + all_modules = "backtrace_dynlink_plugin.ml"; + ocamlopt.byte; + }{ + program = "${test_build_directory}/main.exe"; + libraries = "dynlink"; + all_modules = "backtrace_dynlink.cmx"; + ocamlopt.byte; + ocamlrunparam += ",b=1"; + run; + { + no-flambda; + check-program-output; + }{ + reference = "${test_source_directory}/backtrace_dynlink.flambda.reference"; + flambda; + check-program-output; + } + } +*) diff --git a/testsuite/tests/backtrace/backtrace_dynlink.reference b/testsuite/tests/backtrace/backtrace_dynlink.reference index 3f4fa74593..a0f23ec5b9 100644 --- a/testsuite/tests/backtrace/backtrace_dynlink.reference +++ b/testsuite/tests/backtrace/backtrace_dynlink.reference @@ -1,18 +1,18 @@ Raised by primitive operation at Backtrace_dynlink_plugin in file "backtrace_dynlink_plugin.ml", line 6, characters 13-38 Called from Dynlink.Native.run.(fun) in file "otherlibs/dynlink/native/dynlink.ml", line 87, characters 12-29 Called from Stdlib__List.iter in file "list.ml", line 112, characters 12-15 -Called from Dynlink_common.Make.load.(fun) in file "otherlibs/dynlink/dynlink_common.ml", line 363, characters 13-56 +Called from Dynlink_common.Make.load.(fun) in file "otherlibs/dynlink/dynlink_common.ml", line 361, characters 11-54 Called from Stdlib__List.iter in file "list.ml", line 112, characters 12-15 -Called from Dynlink_common.Make.load in file "otherlibs/dynlink/dynlink_common.ml", line 359, characters 8-392 -Called from Dynlink_common.Make.loadfile in file "otherlibs/dynlink/dynlink_common.ml" (inlined), line 374, characters 26-45 +Called from Stdlib__Fun.protect in file "fun.ml", line 33, characters 8-15 +Called from Dynlink_common.Make.loadfile in file "otherlibs/dynlink/dynlink_common.ml" (inlined), line 369, characters 26-45 Called from Backtrace_dynlink in file "backtrace_dynlink.ml", line 39, characters 4-52 execution of module initializers in the shared library failed: Failure("SUCCESS") Raised by primitive operation at Dynlink.Native.run.(fun) in file "otherlibs/dynlink/native/dynlink.ml", line 87, characters 12-29 Re-raised at Dynlink.Native.run.(fun) in file "otherlibs/dynlink/native/dynlink.ml", line 89, characters 10-149 Called from Stdlib__List.iter in file "list.ml", line 112, characters 12-15 -Called from Dynlink_common.Make.load.(fun) in file "otherlibs/dynlink/dynlink_common.ml", line 363, characters 13-56 +Called from Dynlink_common.Make.load.(fun) in file "otherlibs/dynlink/dynlink_common.ml", line 361, characters 11-54 Called from Stdlib__List.iter in file "list.ml", line 112, characters 12-15 -Called from Dynlink_common.Make.load in file "otherlibs/dynlink/dynlink_common.ml", line 359, characters 8-392 -Re-raised at Dynlink_common.Make.load in file "otherlibs/dynlink/dynlink_common.ml", line 372, characters 8-17 -Called from Dynlink_common.Make.loadfile in file "otherlibs/dynlink/dynlink_common.ml" (inlined), line 374, characters 26-45 +Called from Stdlib__Fun.protect in file "fun.ml", line 33, characters 8-15 +Re-raised at Stdlib__Fun.protect in file "fun.ml", line 38, characters 6-52 +Called from Dynlink_common.Make.loadfile in file "otherlibs/dynlink/dynlink_common.ml" (inlined), line 369, characters 26-45 Called from Backtrace_dynlink in file "backtrace_dynlink.ml", line 39, characters 4-52 diff --git a/testsuite/tests/backtrace/backtrace_effects.ml b/testsuite/tests/backtrace/backtrace_effects.ml index 352b32cbd7..762e27549e 100644 --- a/testsuite/tests/backtrace/backtrace_effects.ml +++ b/testsuite/tests/backtrace/backtrace_effects.ml @@ -1,7 +1,7 @@ -(* TEST - flags = "-g" - ocamlrunparam += ",b=1" - exit_status = "2" +(* TEST_BELOW +(* Blank lines added here to preserve locations. *) + + *) open Effect @@ -39,3 +39,9 @@ let baz () = | _ -> None } let _ = baz () + +(* TEST + flags = "-g"; + ocamlrunparam += ",b=1"; + exit_status = "2"; +*) diff --git a/testsuite/tests/backtrace/backtrace_effects_nested.ml b/testsuite/tests/backtrace/backtrace_effects_nested.ml index 37638a200a..e9da62ab51 100644 --- a/testsuite/tests/backtrace/backtrace_effects_nested.ml +++ b/testsuite/tests/backtrace/backtrace_effects_nested.ml @@ -1,12 +1,12 @@ -(* TEST +(* TEST_BELOW +(* Blank lines added here to preserve locations. *) + + + + + + -flags = "-g" -* bytecode -* no-flambda -** native -* flambda -reference = "${test_source_directory}/backtrace_effects_nested.flambda.reference" -** native *) @@ -43,3 +43,17 @@ let f () = | _ -> None } let () = f () + +(* TEST + flags = "-g"; + { + bytecode; + }{ + no-flambda; + native; + }{ + reference = "${test_source_directory}/backtrace_effects_nested.flambda.reference"; + flambda; + native; + } +*) diff --git a/testsuite/tests/backtrace/backtrace_or_exception.ml b/testsuite/tests/backtrace/backtrace_or_exception.ml index dc8f53c077..6f9fc0af44 100644 --- a/testsuite/tests/backtrace/backtrace_or_exception.ml +++ b/testsuite/tests/backtrace/backtrace_or_exception.ml @@ -1,6 +1,6 @@ -(* TEST - flags = "-g" - ocamlrunparam += ",b=1" +(* TEST_BELOW +(* Blank lines added here to preserve locations. *) + *) exception Exn @@ -46,3 +46,8 @@ let _ = run without_reraise; run with_reraise; run trickier + +(* TEST + flags = "-g"; + ocamlrunparam += ",b=1"; +*) diff --git a/testsuite/tests/backtrace/backtrace_slots.ml b/testsuite/tests/backtrace/backtrace_slots.ml index d6b95a0d4e..22e3e9a13c 100644 --- a/testsuite/tests/backtrace/backtrace_slots.ml +++ b/testsuite/tests/backtrace/backtrace_slots.ml @@ -1,6 +1,6 @@ -(* TEST - flags = "-g" - ocamlrunparam += ",b=1" +(* TEST_BELOW +(* Blank lines added here to preserve locations. *) + *) (* A test for stack backtraces *) @@ -62,3 +62,8 @@ let _ = run [| "c" |]; run [| "d" |]; run [| |] + +(* TEST + flags = "-g"; + ocamlrunparam += ",b=1"; +*) diff --git a/testsuite/tests/backtrace/backtrace_systhreads.ml b/testsuite/tests/backtrace/backtrace_systhreads.ml index 1b6b158cef..e6e7bd97c4 100644 --- a/testsuite/tests/backtrace/backtrace_systhreads.ml +++ b/testsuite/tests/backtrace/backtrace_systhreads.ml @@ -1,10 +1,10 @@ -(* TEST -flags = "-g" -ocamlrunparam += ",b=1" -* hassysthreads -include systhreads -** bytecode -** native +(* TEST_BELOW +(* Blank lines added here to preserve locations. *) + + + + + *) let throw_exn msg = failwith msg [@@inline never] @@ -38,3 +38,15 @@ let () = List.iter Thread.join threads; Condition.signal cond; Thread.join backtrace_thread + +(* TEST + flags = "-g"; + ocamlrunparam += ",b=1"; + include systhreads; + hassysthreads; + { + bytecode; + }{ + native; + } +*) diff --git a/testsuite/tests/backtrace/backtraces_and_finalizers.ml b/testsuite/tests/backtrace/backtraces_and_finalizers.ml index 60c02f48ea..a204b9affc 100644 --- a/testsuite/tests/backtrace/backtraces_and_finalizers.ml +++ b/testsuite/tests/backtrace/backtraces_and_finalizers.ml @@ -1,7 +1,7 @@ (* TEST - flags = "-g -inline 0" - ocamlrunparam += ",b=1" - * native + flags = "-g -inline 0"; + ocamlrunparam += ",b=1"; + native; *) let finaliser _ = try raise Exit with _ -> () diff --git a/testsuite/tests/backtrace/callstack.ml b/testsuite/tests/backtrace/callstack.ml index 5c33816e06..4c115351e1 100644 --- a/testsuite/tests/backtrace/callstack.ml +++ b/testsuite/tests/backtrace/callstack.ml @@ -1,10 +1,10 @@ -(* TEST - flags = "-g" - * hassysthreads - include systhreads - ** no-flambda - *** native - *** bytecode +(* TEST_BELOW +(* Blank lines added here to preserve locations. *) + + + + + *) let[@inline never] f0 () = @@ -29,3 +29,15 @@ let () = the callstack, which breaks the test. *) let () = Printf.printf "new thread:\n" let () = Thread.join (Thread.create f3 ()) + +(* TEST + flags = "-g"; + include systhreads; + hassysthreads; + no-flambda; + { + native; + }{ + bytecode; + } +*) diff --git a/testsuite/tests/backtrace/event_after_prim.ml b/testsuite/tests/backtrace/event_after_prim.ml index 6af09a5fa4..f8f54c4f40 100644 --- a/testsuite/tests/backtrace/event_after_prim.ml +++ b/testsuite/tests/backtrace/event_after_prim.ml @@ -1,5 +1,5 @@ -(* TEST - flags = "-g" +(* TEST_BELOW +(* Blank lines added here to preserve locations. *) *) let f n b = @@ -12,3 +12,7 @@ let () = | _ -> assert false | exception _ -> Printexc.print_backtrace stdout + +(* TEST + flags = "-g"; +*) diff --git a/testsuite/tests/backtrace/inline_test.ml b/testsuite/tests/backtrace/inline_test.ml index f8ffe38f7e..1c3b024d5a 100644 --- a/testsuite/tests/backtrace/inline_test.ml +++ b/testsuite/tests/backtrace/inline_test.ml @@ -1,11 +1,11 @@ -(* TEST - flags = "-g" - ocamlrunparam += ",b=1" - * bytecode - * native - * native - ocamlopt_flags = "-O3" - compiler_directory_suffix = ".O3" +(* TEST_BELOW +(* Blank lines added here to preserve locations. *) + + + + + + *) (* A test for inlined stack backtraces *) @@ -24,3 +24,17 @@ let i x = let () = i () + +(* TEST + flags = "-g"; + ocamlrunparam += ",b=1"; + { + bytecode; + }{ + native; + }{ + ocamlopt_flags = "-O3"; + compiler_directory_suffix = ".O3"; + native; + } +*) diff --git a/testsuite/tests/backtrace/inline_traversal_test.ml b/testsuite/tests/backtrace/inline_traversal_test.ml index d70c7fc52e..8fa5803b88 100644 --- a/testsuite/tests/backtrace/inline_traversal_test.ml +++ b/testsuite/tests/backtrace/inline_traversal_test.ml @@ -1,11 +1,11 @@ -(* TEST - flags = "-g" - ocamlrunparam += ",b=1" - * bytecode - * native - * native - ocamlopt_flags = "-O3" - compiler_directory_suffix = ".O3" +(* TEST_BELOW +(* Blank lines added here to preserve locations. *) + + + + + + *) (* A test for inlined stack backtraces *) @@ -52,3 +52,17 @@ let () = Printf.printf "Frame %d\n" i; print_slots (Some slot) done + +(* TEST + flags = "-g"; + ocamlrunparam += ",b=1"; + { + bytecode; + }{ + native; + }{ + ocamlopt_flags = "-O3"; + compiler_directory_suffix = ".O3"; + native; + } +*) diff --git a/testsuite/tests/backtrace/lazy.ml b/testsuite/tests/backtrace/lazy.ml index c6a0626b42..362539a9f7 100644 --- a/testsuite/tests/backtrace/lazy.ml +++ b/testsuite/tests/backtrace/lazy.ml @@ -24,12 +24,13 @@ let () = (* TEST - -flags = "-g" -* no-flambda -** native -* flambda -reference = "${test_source_directory}/lazy.flambda.reference" -** native - + flags = "-g"; + { + no-flambda; + native; + }{ + reference = "${test_source_directory}/lazy.flambda.reference"; + flambda; + native; + } *) diff --git a/testsuite/tests/backtrace/methods.ml b/testsuite/tests/backtrace/methods.ml index f016fb51c9..7a449c4a27 100644 --- a/testsuite/tests/backtrace/methods.ml +++ b/testsuite/tests/backtrace/methods.ml @@ -1,5 +1,5 @@ -(* TEST - flags = "-g" +(* TEST_BELOW +(* Blank lines added here to preserve locations. *) *) let[@inline never] id x = Sys.opaque_identity x @@ -26,3 +26,7 @@ let () = | _ -> assert false | exception Exit -> Printexc.print_backtrace stdout + +(* TEST + flags = "-g"; +*) diff --git a/testsuite/tests/backtrace/names.ml b/testsuite/tests/backtrace/names.ml index 06fc9ddffd..89952926b3 100644 --- a/testsuite/tests/backtrace/names.ml +++ b/testsuite/tests/backtrace/names.ml @@ -1,6 +1,6 @@ -(* TEST - flags = "-g" - *) +(* TEST_BELOW +(* Blank lines added here to preserve locations. *) +*) let id x = Sys.opaque_identity x @@ -121,3 +121,7 @@ let () = | _ -> assert false | exception Exit -> Printexc.print_backtrace stdout + +(* TEST + flags = "-g"; +*) diff --git a/testsuite/tests/backtrace/pr2195.ml b/testsuite/tests/backtrace/pr2195.ml index e0442a3405..e45ea55d90 100644 --- a/testsuite/tests/backtrace/pr2195.ml +++ b/testsuite/tests/backtrace/pr2195.ml @@ -1,18 +1,18 @@ -(* TEST - flags += "-g" - exit_status = "2" - * bytecode - ocamlrunparam += ",b=0" - reference = "${test_source_directory}/pr2195-nolocs.byte.reference" - * bytecode - ocamlrunparam += ",b=1" - reference = "${test_source_directory}/pr2195-nolocs.byte.reference" - * bytecode - ocamlrunparam += ",b=2" - reference = "${test_source_directory}/pr2195-locs.byte.reference" - * native - reference = "${test_source_directory}/pr2195.opt.reference" - compare_programs = "false" +(* TEST_BELOW +(* Blank lines added here to preserve locations. *) + + + + + + + + + + + + + *) let () = @@ -27,3 +27,25 @@ let () = (* The message is platform-specific, so convert the exception to Exit *) let bt = Printexc.get_raw_backtrace () in Printexc.raise_with_backtrace Exit bt + +(* TEST + flags += "-g"; + exit_status = "2"; + { + ocamlrunparam += ",b=0"; + reference = "${test_source_directory}/pr2195-nolocs.byte.reference"; + bytecode; + }{ + ocamlrunparam += ",b=1"; + reference = "${test_source_directory}/pr2195-nolocs.byte.reference"; + bytecode; + }{ + ocamlrunparam += ",b=2"; + reference = "${test_source_directory}/pr2195-locs.byte.reference"; + bytecode; + }{ + reference = "${test_source_directory}/pr2195.opt.reference"; + compare_programs = "false"; + native; + } +*) diff --git a/testsuite/tests/backtrace/pr6920_why_at.ml b/testsuite/tests/backtrace/pr6920_why_at.ml index 1a0583a62f..9101066b11 100644 --- a/testsuite/tests/backtrace/pr6920_why_at.ml +++ b/testsuite/tests/backtrace/pr6920_why_at.ml @@ -1,8 +1,8 @@ -(* TEST - flags = "-g" - ocamlrunparam += ",b=1" - ocamlopt_flags = "-inline 0" - exit_status = "2" +(* TEST_BELOW +(* Blank lines added here to preserve locations. *) + + + *) let why : unit -> unit = fun () -> raise Exit [@@inline never] @@ -13,3 +13,10 @@ let f () = let () = f () + +(* TEST + flags = "-g"; + ocamlrunparam += ",b=1"; + ocamlopt_flags = "-inline 0"; + exit_status = "2"; +*) diff --git a/testsuite/tests/backtrace/pr6920_why_swallow.ml b/testsuite/tests/backtrace/pr6920_why_swallow.ml index b1e5d60f16..05c8188583 100644 --- a/testsuite/tests/backtrace/pr6920_why_swallow.ml +++ b/testsuite/tests/backtrace/pr6920_why_swallow.ml @@ -1,8 +1,8 @@ -(* TEST - flags = "-g" - ocamlrunparam += ",b=1" - ocamlopt_flags = "-inline 0" - exit_status = "2" +(* TEST_BELOW +(* Blank lines added here to preserve locations. *) + + + *) let why : unit -> unit = fun () -> raise Exit [@@inline never] @@ -15,3 +15,10 @@ let f () = let () = f () + +(* TEST + flags = "-g"; + ocamlrunparam += ",b=1"; + ocamlopt_flags = "-inline 0"; + exit_status = "2"; +*) diff --git a/testsuite/tests/backtrace/raw_backtrace.ml b/testsuite/tests/backtrace/raw_backtrace.ml index a685133a7b..44d9ce5b3a 100644 --- a/testsuite/tests/backtrace/raw_backtrace.ml +++ b/testsuite/tests/backtrace/raw_backtrace.ml @@ -1,6 +1,6 @@ -(* TEST - flags = "-g" - ocamlrunparam += ",b=1" +(* TEST_BELOW +(* Blank lines added here to preserve locations. *) + *) (* A test for stack backtraces *) @@ -60,3 +60,8 @@ let _ = run [| "e" |]; run [| "f" |]; run [| |] + +(* TEST + flags = "-g"; + ocamlrunparam += ",b=1"; +*) |