Debian Codegraph @

test/instrument/control/match.t

raw
1 Instrumentation of cases.
2
3 $ bash ../test.sh <<'EOF'
4 > let _ =
5 > match true with
6 > | true -> ()
7 > | false -> ()
8 > EOF
9 let _ =
10 match true with
11 | true ->
12 ___bisect_visit___ 0;
13 ()
14 | false ->
15 ___bisect_visit___ 1;
16 ()
17
18
19 Recursive instrumentation of cases.
20
21 $ bash ../test.sh <<'EOF'
22 > let _ =
23 > match
24 > match () with
25 > | () -> ()
26 > with
27 > | () ->
28 > match () with
29 > | () -> ()
30 > EOF
31 let _ =
32 match
33 match () with
34 | () ->
35 ___bisect_visit___ 2;
36 ()
37 with
38 | () -> (
39 ___bisect_visit___ 1;
40 match () with
41 | () ->
42 ___bisect_visit___ 0;
43 ())
44
45
46 Expressions in selector don't need their out-edge instrumented. Expressions in
47 cases are in tail position iff the match expression is in tail position.
48
49 $ bash ../test.sh <<'EOF'
50 > let _ =
51 > match print_endline "foo" with () -> print_endline "bar"
52 > let _ = fun () ->
53 > match print_endline "foo" with () -> print_endline "bar"
54 > EOF
55 let _ =
56 match print_endline "foo" with
57 | () ->
58 ___bisect_visit___ 1;
59 ___bisect_post_visit___ 0 (print_endline "bar")
60
61 let _ =
62 fun () ->
63 ___bisect_visit___ 3;
64 match print_endline "foo" with
65 | () ->
66 ___bisect_visit___ 2;
67 print_endline "bar"