Skip to content

Commit

Permalink
flambda-backend: Fix tests/backtrace/backtrace_bounds_exn (#2001)
Browse files Browse the repository at this point in the history
Fix the test by applying the existing backtrace normalizing script before
comparing the backtrace to the reference (and update the reference).
See the comment in the sanitize-backtrace.sh script for more info.
  • Loading branch information
Gbury authored Nov 9, 2023
1 parent b50d867 commit a5fbb1c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
6 changes: 0 additions & 6 deletions testsuite/tests/backtrace/backtrace_bounds_exn.ml
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
(* TEST
* setup-ocamlc.byte-build-env
** ocamlc.byte
flags = "-g"
ocamlrunparam += ",b=1"
*)

(* CR mshinwell: re-enable for native once Flambda 2 fixed to say
"Raised by primitive operation" in backtraces rather than just
"Raised" for bounds check failures *)

(* #11436: bad backtrace for out-of-bounds exception *)

let xs = [| 0; 1; 2 |]
Expand Down
2 changes: 1 addition & 1 deletion testsuite/tests/backtrace/backtrace_bounds_exn.reference
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Uncaught exception Invalid_argument("index out of bounds")
Raised by primitive operation at Backtrace_bounds_exn.bad_bound_fn in file "backtrace_bounds_exn.ml", line 11, characters 7-15
Raised at Backtrace_bounds_exn.bad_bound_fn in file "backtrace_bounds_exn.ml", line 11, characters 7-15
Called from Backtrace_bounds_exn in file "backtrace_bounds_exn.ml", line 15, characters 32-54
OK
3 changes: 3 additions & 0 deletions testsuite/tests/backtrace/backtrace_bounds_exn.run
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh
(${program} 2>&1 || true) 2>&1 | \
${test_source_directory}/sanitize-backtrace.sh > ${output}

0 comments on commit a5fbb1c

Please sign in to comment.