summaryrefslogtreecommitdiff
path: root/testsuite/tests/basic-more/pr2719.ml
blob: cb69aeae342ec8673d145e7ba7bafae27cb9ceb0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
(* TEST
   include testing
*)

open Printf

let bug () =
  let mat = [| [|false|] |]
  and test = ref false in
    printf "Value of test at the beginning : %B\n" !test; flush stdout;
    (try let _ = mat.(0).(-1) in
       (test := true;
        printf "Am I going through this block of instructions ?\n";
        flush stdout)
     with Invalid_argument _ -> printf "Value of test now : %B\n" !test
    );
    (try if mat.(0).(-1) then ()
     with Invalid_argument _ -> ()
    )

let () = bug ()