Skip to content

Commit

Permalink
Add test for #829 (#831)
Browse files Browse the repository at this point in the history
  • Loading branch information
lpw25 authored Sep 14, 2022
1 parent 406751c commit 1d28ac0
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions ocaml/testsuite/tests/typing-local/comballoc.ml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,22 @@ let () =
print_endline "ok"


external opaque_local : local_ 'a -> local_ 'a = "%opaque"

let[@inline never] g (local_ a) =
let local_ z = (a, a) in
Gc.minor ();
let _ = opaque_local z in
()

let[@inline always] dead (local_ x) =
let _ = opaque_local (x, x, x, x, x, x, x, x) in
()

let[@inline never] f (local_ x) =
dead x;
let r = (x, x) in
g r;
()

let () = f 1

0 comments on commit 1d28ac0

Please sign in to comment.