Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gretay-js committed Jun 26, 2024
1 parent 2b9b65f commit 3e0ac24
Show file tree
Hide file tree
Showing 4 changed files with 238 additions and 315 deletions.
16 changes: 5 additions & 11 deletions ocaml/testsuite/tests/functors/functors.compilers.reference
Original file line number Diff line number Diff line change
@@ -1,34 +1,30 @@
(setglobal Functors!
(let
(O =
(function {nlocal = 0} X is_a_functor always_inline
ignore assert all zero_alloc never_loop
(function {nlocal = 0} X is_a_functor always_inline never_loop
(let
(cow =
(function {nlocal = 0} x[int] : int (apply (field_imm 0 X) x))
sheep = (function {nlocal = 0} x[int] : int (+ 1 (apply cow x))))
(makeblock 0 cow sheep)))
F =
(function {nlocal = 0} X Y is_a_functor always_inline
ignore assert all zero_alloc never_loop
(function {nlocal = 0} X Y is_a_functor always_inline never_loop
(let
(cow =
(function {nlocal = 0} x[int] : int
(apply (field_imm 0 Y) (apply (field_imm 0 X) x)))
sheep = (function {nlocal = 0} x[int] : int (+ 1 (apply cow x))))
(makeblock 0 cow sheep)))
F1 =
(function {nlocal = 0} X Y is_a_functor always_inline
ignore assert all zero_alloc never_loop
(function {nlocal = 0} X Y is_a_functor always_inline never_loop
(let
(cow =
(function {nlocal = 0} x[int] : int
(apply (field_imm 0 Y) (apply (field_imm 0 X) x)))
sheep = (function {nlocal = 0} x[int] : int (+ 1 (apply cow x))))
(makeblock 0 sheep)))
F2 =
(function {nlocal = 0} X Y is_a_functor always_inline
ignore assert all zero_alloc never_loop
(function {nlocal = 0} X Y is_a_functor always_inline never_loop
(let
(X =a (makeblock 0 (field_imm 1 X))
Y =a (makeblock 0 (field_imm 1 Y))
Expand All @@ -40,8 +36,7 @@
M =
(let
(F =
(function {nlocal = 0} X Y is_a_functor always_inline
ignore assert all zero_alloc never_loop
(function {nlocal = 0} X Y is_a_functor always_inline never_loop
(let
(cow =
(function {nlocal = 0} x[int] : int
Expand All @@ -51,7 +46,6 @@
(makeblock 0 cow sheep))))
(makeblock 0
(function {nlocal = 0} funarg funarg is_a_functor stub
ignore assert all zero_alloc
(let
(let =
(apply F (makeblock 0 (field_imm 1 funarg))
Expand Down
56 changes: 20 additions & 36 deletions ocaml/testsuite/tests/translprim/array_spec.stack.flat.reference
Original file line number Diff line number Diff line change
Expand Up @@ -27,80 +27,64 @@
(array.unsafe_set[gen indexed by int] a 0 x))
(let
(eta_gen_len =
(function {nlocal = 0} prim[genarray] stub
ignore assert all zero_alloc : int (array.length[gen] prim))
(function {nlocal = 0} prim[genarray] stub : int
(array.length[gen] prim))
eta_gen_safe_get =
(function {nlocal = 0} prim[genarray] prim[int] stub
ignore assert all zero_alloc
(array.get[gen indexed by int] prim prim))
eta_gen_unsafe_get =
(function {nlocal = 0} prim[genarray] prim[int] stub
ignore assert all zero_alloc
(array.unsafe_get[gen indexed by int] prim prim))
eta_gen_safe_set =
(function {nlocal = 0} prim[genarray] prim[int] prim stub
ignore assert all zero_alloc : int
(function {nlocal = 0} prim[genarray] prim[int] prim stub : int
(array.set[gen indexed by int] prim prim prim))
eta_gen_unsafe_set =
(function {nlocal = 0} prim[genarray] prim[int] prim stub
ignore assert all zero_alloc : int
(function {nlocal = 0} prim[genarray] prim[int] prim stub : int
(array.unsafe_set[gen indexed by int] prim prim prim))
eta_int_len =
(function {nlocal = 0} prim[intarray] stub
ignore assert all zero_alloc : int (array.length[int] prim))
(function {nlocal = 0} prim[intarray] stub : int
(array.length[int] prim))
eta_int_safe_get =
(function {nlocal = 0} prim[intarray] prim[int] stub
ignore assert all zero_alloc : int
(function {nlocal = 0} prim[intarray] prim[int] stub : int
(array.get[int indexed by int] prim prim))
eta_int_unsafe_get =
(function {nlocal = 0} prim[intarray] prim[int] stub
ignore assert all zero_alloc : int
(function {nlocal = 0} prim[intarray] prim[int] stub : int
(array.unsafe_get[int indexed by int] prim prim))
eta_int_safe_set =
(function {nlocal = 0} prim[intarray] prim[int] prim[int] stub
ignore assert all zero_alloc : int
(array.set[int indexed by int] prim prim prim))
: int (array.set[int indexed by int] prim prim prim))
eta_int_unsafe_set =
(function {nlocal = 0} prim[intarray] prim[int] prim[int] stub
ignore assert all zero_alloc : int
(array.unsafe_set[int indexed by int] prim prim prim))
: int (array.unsafe_set[int indexed by int] prim prim prim))
eta_float_len =
(function {nlocal = 0} prim[floatarray] stub
ignore assert all zero_alloc : int (array.length[float] prim))
(function {nlocal = 0} prim[floatarray] stub : int
(array.length[float] prim))
eta_float_safe_get =
(function {nlocal = 0} prim[floatarray] prim[int] stub
ignore assert all zero_alloc : float
(function {nlocal = 0} prim[floatarray] prim[int] stub : float
(array.get[float indexed by int] prim prim))
eta_float_unsafe_get =
(function {nlocal = 0} prim[floatarray] prim[int] stub
ignore assert all zero_alloc : float
(function {nlocal = 0} prim[floatarray] prim[int] stub : float
(array.unsafe_get[float indexed by int] prim prim))
eta_float_safe_set =
(function {nlocal = 0} prim[floatarray] prim[int] prim[float] stub
ignore assert all zero_alloc : int
(array.set[float indexed by int] prim prim prim))
: int (array.set[float indexed by int] prim prim prim))
eta_float_unsafe_set =
(function {nlocal = 0} prim[floatarray] prim[int] prim[float] stub
ignore assert all zero_alloc : int
(array.unsafe_set[float indexed by int] prim prim prim))
: int (array.unsafe_set[float indexed by int] prim prim prim))
eta_addr_len =
(function {nlocal = 0} prim[addrarray] stub
ignore assert all zero_alloc : int (array.length[addr] prim))
(function {nlocal = 0} prim[addrarray] stub : int
(array.length[addr] prim))
eta_addr_safe_get =
(function {nlocal = 0} prim[addrarray] prim[int] stub
ignore assert all zero_alloc
(array.get[addr indexed by int] prim prim))
eta_addr_unsafe_get =
(function {nlocal = 0} prim[addrarray] prim[int] stub
ignore assert all zero_alloc
(array.unsafe_get[addr indexed by int] prim prim))
eta_addr_safe_set =
(function {nlocal = 0} prim[addrarray] prim[int] prim stub
ignore assert all zero_alloc : int
(function {nlocal = 0} prim[addrarray] prim[int] prim stub : int
(array.set[addr indexed by int] prim prim prim))
eta_addr_unsafe_set =
(function {nlocal = 0} prim[addrarray] prim[int] prim stub
ignore assert all zero_alloc : int
(function {nlocal = 0} prim[addrarray] prim[int] prim stub : int
(array.unsafe_set[addr indexed by int] prim prim prim)))
(makeblock 0 int_a float_a addr_a eta_gen_len eta_gen_safe_get
eta_gen_unsafe_get eta_gen_safe_set eta_gen_unsafe_set eta_int_len
Expand Down
Loading

0 comments on commit 3e0ac24

Please sign in to comment.