Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 7 additions & 13 deletions .github/workflows/js_of_ocaml.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ jobs:
- "5.0"
- "5.1"
- "5.2"
- "5.3"
skip-test:
- true
skip-doc:
Expand Down Expand Up @@ -59,7 +60,7 @@ jobs:
skip-doc: true
- os: ubuntu-latest
os-name: Ubuntu
ocaml-compiler: "5.3"
ocaml-compiler: "5.4"
skip-effects: false
skip-test: false
skip-doc: false
Expand All @@ -72,31 +73,24 @@ jobs:
# Note this OCaml compiler is bytecode only
- os: ubuntu-latest
os-name: Ubuntu
ocaml-name: "5.3.0+32bit"
ocaml-compiler: "ocaml-variants.5.3.0+options,ocaml-option-32bit"
ocaml-name: "5.4.0+32bit"
ocaml-compiler: "ocaml-variants.5.4.0+options,ocaml-option-32bit"
skip-effects: true # disabled for the same reason than `skip-test`
skip-test: true # the `time_now.0.17` package is pulled and doesn't work in 32 bits :(
skip-doc: true
- os: macos-latest
os-name: MacOS
ocaml-compiler: "5.3"
ocaml-compiler: "5.4"
skip-effects: true
skip-test: false
skip-doc: true
- os: windows-latest
os-name: Windows
ocaml-compiler: "5.3"
ocaml-compiler: "5.4"
skip-effects: false
skip-test: false
skip-doc: true
- os: ubuntu-latest
os-name: Ubuntu
ocaml-name: "5.4-alpha1"
ocaml-compiler: "ocaml-compiler.5.4.0~alpha1"
skip-effects: true
skip-test: true
skip-doc: true


runs-on: ${{ matrix.os }}

name:
Expand Down
14 changes: 11 additions & 3 deletions .github/workflows/wasm_of_ocaml.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ jobs:
- "5.0"
- "5.1"
- "5.2"
- "5.4"
separate_compilation:
- true
jane_street_tests:
Expand Down Expand Up @@ -116,17 +117,24 @@ jobs:
run: |
opam repo add js janestreet/opam-repository
opam install opam-format
opam pin add ppxlib -n 0.35.0
opam exec -- dune exec --root wasm_of_ocaml tools/ci_setup.exe

- name: Pin Jane Street packages
if: ${{ ! matrix.jane_street_tests }}
- name: Pin Jane Street packages (v0.16)
if: contains(fromJson('["4.14","5.0","5.1","5.2"]'), matrix.ocaml-compiler)
run: |
opam pin add -n base.v0.16.1 https://github.com/ocaml-wasm/base.git#wasm
opam pin add -n time_now.v0.16.1 https://github.com/ocaml-wasm/time_now.git#wasm
opam pin add -n ppx_inline_test.v0.16.1 https://github.com/ocaml-wasm/ppx_inline_test.git#wasm
opam pin add -n ppx_expect.v0.16.1 https://github.com/ocaml-wasm/ppx_expect.git#wasm

- name: Pin Jane Street packages (v0.17)
if: ${{ ! (matrix.jane_street_tests || contains(fromJson('["4.14","5.0","5.1","5.2"]'), matrix.ocaml-compiler)) }}
run: |
opam pin add -n base.v0.17.3 https://github.com/ocaml-wasm/base.git#wasm-v0.17
opam pin add -n time_now.v0.17.0 https://github.com/ocaml-wasm/time_now.git#wasm-v0.17
opam pin add -n ppx_inline_test.v0.17.1 https://github.com/ocaml-wasm/ppx_inline_test.git#wasm-v0.17
opam pin add -n ppx_expect.v0.17.3 https://github.com/ocaml-wasm/ppx_expect.git#wasm-v0.17

- name: Install wasm_of_ocaml and its test dependencies
working-directory: ./wasm_of_ocaml
run: |
Expand Down
2 changes: 0 additions & 2 deletions compiler/tests-ocaml/lib-list/test.ml
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,11 @@ let () =
assert (List.take 3 [1; 2; 3; 4; 5] = [1; 2; 3]);
assert (List.take 3 [1; 2] = [1; 2]);
assert (List.take 3 [] = []);
assert ((try List.take (-1) [1; 2] with Invalid_argument _ -> [999]) = [999]);
assert (List.take 0 [1; 2] = []);
assert (List.drop 6 hello_world = world);
assert (List.drop 3 [1; 2; 3; 4; 5] = [4; 5]);
assert (List.drop 3 [1; 2] = []);
assert (List.drop 3 [] = []);
assert ((try List.drop (-1) [1; 2] with Invalid_argument _ -> [999]) = [999]);
assert (List.drop 0 [1; 2] = [1; 2]);
assert (List.take_while (fun x -> x < 3) [1; 2; 3; 4; 1; 2; 3; 4]
= [1; 2]);
Expand Down
4 changes: 2 additions & 2 deletions compiler/tests-toplevel/test_toplevel.expected
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ hello
- : int = 2
Line 4, characters 2-4:
Error: Syntax error
Line 5, characters 0-16:
Error: Unbound module "Missing_module"
Line 5, characters 0-14:
Error: Unbound module Missing_module
val y : float = 0.333333333333333315
11 changes: 7 additions & 4 deletions runtime/wasm/array.wat
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@
(br $fill))))
(local.get $a))))

(func (export "caml_float_array_concat") (param (ref eq)) (result (ref eq))
(func (export "caml_floatarray_concat") (param (ref eq)) (result (ref eq))
(local $i i32) (local $len i32)
(local $l (ref eq)) (local $v (ref eq))
(local $b (ref $block))
Expand All @@ -327,9 +327,12 @@
(local.set $b
(br_on_cast_fail $exit (ref eq) (ref $block) (local.get $l)))
(local.set $v (array.get $block (local.get $b) (i32.const 1)))
(local.set $len
(i32.add (local.get $len)
(array.len (ref.cast (ref $float_array) (local.get $v)))))
(if (ref.test (ref $float_array) (local.get $v))
(then
(local.set $len
(i32.add (local.get $len)
(array.len
(ref.cast (ref $float_array) (local.get $v)))))))
(local.set $l (array.get $block (local.get $b) (i32.const 2)))
(br $compute_length))))
(local.set $fa
Expand Down
Loading