Skip to content

Commit

Permalink
Add test case for the begin_region / end_region stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
ccasin committed May 27, 2024
1 parent 99d56d3 commit 02b6630
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,11 @@
(action
(progn
(run %{bin:ocamlopt.opt} -c -validate cse.mli cse.ml))))

(rule
(alias runtest)
(enabled_if (= %{context_name} "main"))
(deps region_elim.ml region_elim.mli)
(action
(progn
(run %{bin:ocamlopt.opt} -c -validate region_elim.mli region_elim.ml))))
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
(* This gets compiled to a program with a begin_region / end_region pair creating a region
that is never allocated in. We had to add a special case for this, as does flambda2.
See [Normalize.remove_corresponding_end_region] and its interactions with the
[Can_delete_if_unused] case of [step_let] (which fires for [Begin_region] *)

let trim () =
let _ = ref 0 in
()

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
val trim : unit -> unit

0 comments on commit 02b6630

Please sign in to comment.