Skip to content

Commit

Permalink
Misc: switch to ocaml.5.01 (#1506)
Browse files Browse the repository at this point in the history
* Misc: switch to ocaml.5.01

* Misc: update CI

* Tests: make tests more robust wrt module offset

* Tests: enable testing of ppx_deriving for OCaml ge 5.1 only

* Tests: make toplevel tests more robust wrt newlines

* Tests: make toplevel tests more robust wrt newlines
  • Loading branch information
hhugo authored Sep 26, 2023
1 parent d352ae6 commit 35dcf07
Show file tree
Hide file tree
Showing 13 changed files with 203 additions and 178 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ jobs:
- 4.11.x
- 4.12.x
- 4.13.x
- 5.0.x
skip-test:
- true
skip-doc:
Expand All @@ -46,17 +47,17 @@ jobs:
skip-test: false
skip-doc: true
- os: ubuntu-latest
ocaml-compiler: 5.0.x
ocaml-compiler: 5.1.x
skip-effects: false
skip-test: false
skip-doc: false
- os: macos-latest
ocaml-compiler: 5.0.x
ocaml-compiler: 5.1.x
skip-effects: true
skip-test: false
skip-doc: true
- os: windows-latest
ocaml-compiler: ocaml.5.0.0,ocaml-option-mingw
ocaml-compiler: ocaml.5.1.0,ocaml-option-mingw
skip-effects: false
skip-test: false
skip-doc: true
Expand Down Expand Up @@ -85,7 +86,7 @@ jobs:
with:
ocaml-compiler: ${{ matrix.ocaml-compiler }}
opam-repositories: |
dra27: https://github.com/dra27/opam-repository.git#windows-5.0
dra27: https://github.com/hhugo/opam-repository.git#for-jsoo-ci-windows
default: https://github.com/ocaml-opam/opam-repository-mingw.git#sunset
opam: https://github.com/ocaml/opam-repository.git
dune-cache: true
Expand Down
5 changes: 0 additions & 5 deletions compiler/tests-check-prim/main.output5
Original file line number Diff line number Diff line change
Expand Up @@ -155,13 +155,9 @@ caml_obj_set_tag
caml_obj_truncate

From +runtime_events.js:
caml_custom_event_index
caml_runtime_events_create_cursor
caml_runtime_events_free_cursor
caml_runtime_events_read_poll
caml_runtime_events_user_register
caml_runtime_events_user_resolve
caml_runtime_events_user_write

From +stdlib.js:
caml_build_symbols
Expand All @@ -187,7 +183,6 @@ caml_set_static_env
caml_spacetime_enabled
caml_spacetime_only_works_for_native_code
caml_sys_const_naked_pointers_checked
caml_sys_is_regular_file

From +unix.js:
caml_unix_cleanup
Expand Down
5 changes: 0 additions & 5 deletions compiler/tests-check-prim/unix-unix.output5
Original file line number Diff line number Diff line change
Expand Up @@ -264,13 +264,9 @@ caml_obj_set_tag
caml_obj_truncate

From +runtime_events.js:
caml_custom_event_index
caml_runtime_events_create_cursor
caml_runtime_events_free_cursor
caml_runtime_events_read_poll
caml_runtime_events_user_register
caml_runtime_events_user_resolve
caml_runtime_events_user_write

From +stdlib.js:
caml_build_symbols
Expand All @@ -296,7 +292,6 @@ caml_set_static_env
caml_spacetime_enabled
caml_spacetime_only_works_for_native_code
caml_sys_const_naked_pointers_checked
caml_sys_is_regular_file

From +unix.js:
caml_unix_cleanup
Expand Down
5 changes: 0 additions & 5 deletions compiler/tests-check-prim/unix-win32.output5
Original file line number Diff line number Diff line change
Expand Up @@ -230,13 +230,9 @@ caml_obj_set_tag
caml_obj_truncate

From +runtime_events.js:
caml_custom_event_index
caml_runtime_events_create_cursor
caml_runtime_events_free_cursor
caml_runtime_events_read_poll
caml_runtime_events_user_register
caml_runtime_events_user_resolve
caml_runtime_events_user_write

From +stdlib.js:
caml_build_symbols
Expand All @@ -262,7 +258,6 @@ caml_set_static_env
caml_spacetime_enabled
caml_spacetime_only_works_for_native_code
caml_sys_const_naked_pointers_checked
caml_sys_is_regular_file

From +unix.js:
caml_unix_getpwuid
Expand Down
104 changes: 54 additions & 50 deletions compiler/tests-compiler/effects_continuations.ml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ let%expect_test "test-compiler/lib-effects/test1.ml" =
compile_and_parse
~effects:true
{|

let list_rev = List.rev
(* Avoid to expose the offset of stdlib modules *)
let () = ignore (list_rev [])

let exceptions s =
(* Compiled using 'try ... catch',
and 'throw' within the try block *)
Expand Down Expand Up @@ -78,7 +83,7 @@ let%expect_test "test-compiler/lib-effects/test1.ml" =
done

let loop3 () =
let l = List.rev [1;2;3] in
let l = list_rev [1;2;3] in
let rec f x =
match x with
| [] -> l
Expand All @@ -98,118 +103,117 @@ let%expect_test "test-compiler/lib-effects/test1.ml" =
{|

function exceptions(s, cont){
try{var _C_ = runtime.caml_int_of_string(s), n = _C_;}
catch(_G_){
var _v_ = caml_wrap_exception(_G_);
if(_v_[1] !== Stdlib[7]){
try{var _B_ = runtime.caml_int_of_string(s), n = _B_;}
catch(_F_){
var _u_ = caml_wrap_exception(_F_);
if(_u_[1] !== Stdlib[7]){
var raise$1 = caml_pop_trap();
return raise$1(caml_maybe_attach_backtrace(_v_, 0));
return raise$1(caml_maybe_attach_backtrace(_u_, 0));
}
var n = 0, _w_ = 0;
var n = 0, _v_ = 0;
}
try{
if(caml_string_equal(s, cst$0))
throw caml_maybe_attach_backtrace(Stdlib[8], 1);
var _B_ = 7, m = _B_;
var _A_ = 7, m = _A_;
}
catch(_F_){
var _x_ = caml_wrap_exception(_F_);
if(_x_ !== Stdlib[8]){
catch(_E_){
var _w_ = caml_wrap_exception(_E_);
if(_w_ !== Stdlib[8]){
var raise$0 = caml_pop_trap();
return raise$0(caml_maybe_attach_backtrace(_x_, 0));
return raise$0(caml_maybe_attach_backtrace(_w_, 0));
}
var m = 0, _y_ = 0;
var m = 0, _x_ = 0;
}
runtime.caml_push_trap
(function(_E_){
if(_E_ === Stdlib[8]) return cont(0);
(function(_D_){
if(_D_ === Stdlib[8]) return cont(0);
var raise = caml_pop_trap();
return raise(caml_maybe_attach_backtrace(_E_, 0));
return raise(caml_maybe_attach_backtrace(_D_, 0));
});
if(caml_string_equal(s, cst)){
var _z_ = Stdlib[8], raise = caml_pop_trap();
return raise(caml_maybe_attach_backtrace(_z_, 1));
var _y_ = Stdlib[8], raise = caml_pop_trap();
return raise(caml_maybe_attach_backtrace(_y_, 1));
}
var _A_ = Stdlib[79];
var _z_ = Stdlib[79];
return caml_cps_call2
(_A_,
(_z_,
cst_toto,
function(_D_){caml_pop_trap(); return cont([0, [0, _D_, n, m]]);});
function(_C_){caml_pop_trap(); return cont([0, [0, _C_, n, m]]);});
}
//end
function cond1(b, cont){
function _u_(ic){return cont([0, ic, 7]);}
function _t_(ic){return cont([0, ic, 7]);}
return b
? caml_cps_call2(Stdlib[79], cst_toto$0, _u_)
: caml_cps_call2(Stdlib[79], cst_titi, _u_);
? caml_cps_call2(Stdlib[79], cst_toto$0, _t_)
: caml_cps_call2(Stdlib[79], cst_titi, _t_);
}
//end
function cond2(b, cont){
function _s_(_t_){return cont(7);}
function _r_(_s_){return cont(7);}
return b
? caml_cps_call2(Stdlib_Printf[3], _a_, _s_)
: caml_cps_call2(Stdlib_Printf[3], _b_, _s_);
? caml_cps_call2(Stdlib_Printf[3], _a_, _r_)
: caml_cps_call2(Stdlib_Printf[3], _b_, _r_);
}
//end
function cond3(b, cont){
var x = [0, 0];
function _q_(_r_){return cont(x[1]);}
return b ? (x[1] = 1, _q_(0)) : caml_cps_call2(Stdlib_Printf[3], _c_, _q_);
function _p_(_q_){return cont(x[1]);}
return b ? (x[1] = 1, _p_(0)) : caml_cps_call2(Stdlib_Printf[3], _c_, _p_);
}
//end
function loop1(b, cont){
var _m_ = Stdlib[79];
var _l_ = Stdlib[79];
return caml_cps_call2
(_m_,
(_l_,
cst_static_examples_ml,
function(ic){
function _n_(_p_){
var _o_ = Stdlib[83];
function _m_(_o_){
var _n_ = Stdlib[83];
return caml_cps_call2
(_o_,
(_n_,
ic,
function(line){
return b
? caml_cps_call2(Stdlib[53], line, _n_)
: caml_cps_exact_call1(_n_, 0);
? caml_cps_call2(Stdlib[53], line, _m_)
: caml_cps_exact_call1(_m_, 0);
});
}
return _n_(0);
return _m_(0);
});
}
//end
function loop2(param, cont){
var _h_ = Stdlib[79];
var _g_ = Stdlib[79];
return caml_cps_call2
(_h_,
(_g_,
cst_static_examples_ml$0,
function(ic){
var _i_ = Stdlib_Printf[3];
function _j_(_l_){
var _k_ = Stdlib[83];
var _h_ = Stdlib_Printf[3];
function _i_(_k_){
var _j_ = Stdlib[83];
return caml_cps_call2
(_k_,
(_j_,
ic,
function(line){
return caml_cps_call2(Stdlib[53], line, _j_);
return caml_cps_call2(Stdlib[53], line, _i_);
});
}
return caml_cps_call2(_i_, _d_, _j_);
return caml_cps_call2(_h_, _d_, _i_);
});
}
//end
function loop3(param, cont){
var _f_ = Stdlib_List[9];
return caml_cps_call2
(_f_,
(list_rev,
_e_,
function(l){
function _g_(x){
function _f_(x){
if(! x) return cont(l);
var r = x[2];
return caml_cps_exact_call1(_g_, r);
return caml_cps_exact_call1(_f_, r);
}
return _g_(l);
return _f_(l);
});
}
//end |}]
Loading

0 comments on commit 35dcf07

Please sign in to comment.