Skip to content

Commit a5fbb1c

Browse files
authored
flambda-backend: Fix tests/backtrace/backtrace_bounds_exn (#2001)
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.
1 parent b50d867 commit a5fbb1c

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

testsuite/tests/backtrace/backtrace_bounds_exn.ml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,8 @@
11
(* TEST
2-
* setup-ocamlc.byte-build-env
3-
** ocamlc.byte
42
flags = "-g"
53
ocamlrunparam += ",b=1"
64
*)
75

8-
(* CR mshinwell: re-enable for native once Flambda 2 fixed to say
9-
"Raised by primitive operation" in backtraces rather than just
10-
"Raised" for bounds check failures *)
11-
126
(* #11436: bad backtrace for out-of-bounds exception *)
137

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

0 commit comments

Comments
 (0)