Skip to content

Commit 8d5addd

Browse files
committed
Test: test shapes with 5.3
1 parent 68cc910 commit 8d5addd

File tree

2 files changed

+18
-7
lines changed

2 files changed

+18
-7
lines changed

compiler/tests-full/dune

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@
4242
(rule
4343
(targets shapes.cma.js)
4444
(enabled_if
45-
(= %{ocaml_version} "5.2.0"))
45+
(and
46+
(>= %{ocaml_version} "5.3")
47+
(< %{ocaml_version} "5.4")))
4648
(action
4749
(run
4850
%{bin:js_of_ocaml}
@@ -55,7 +57,9 @@
5557
(rule
5658
(targets shapes.cma.output.js)
5759
(enabled_if
58-
(= %{ocaml_version} "5.2.0"))
60+
(and
61+
(>= %{ocaml_version} "5.3")
62+
(< %{ocaml_version} "5.4")))
5963
(action
6064
(with-stdout-to
6165
%{targets}
@@ -64,7 +68,9 @@
6468
(rule
6569
(alias runtest)
6670
(enabled_if
67-
(= %{ocaml_version} "5.2.0"))
71+
(and
72+
(>= %{ocaml_version} "5.3")
73+
(< %{ocaml_version} "5.4")))
6874
(action
6975
(diff shapes.cma.expected.js shapes.cma.output.js)))
7076

compiler/tests-full/shapes.cma.expected.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
(globalThis){
1717
"use strict";
1818
var runtime = globalThis.jsoo_runtime;
19-
function f(_a_, param){
19+
function f(a, param){
2020
/*<<compiler/tests-full/m1.ml:1:14>>*/ return 0;
2121
/*<<compiler/tests-full/m1.ml:1:16>>*/ }
2222
var Shapes_M1 = /*<<?>>*/ [0, f];
@@ -62,6 +62,11 @@
6262
? f(a0)
6363
: runtime.caml_call_gen(f, [a0]);
6464
}
65+
function caml_call2(f, a0, a1){
66+
return (f.l >= 0 ? f.l : f.l = f.length) === 2
67+
? f(a0, a1)
68+
: runtime.caml_call_gen(f, [a0, a1]);
69+
}
6570
var
6671
global_data = runtime.caml_get_global_data(),
6772
Shapes_M2 = global_data.Shapes__M2,
@@ -72,14 +77,14 @@
7277
< caml_call1(Stdlib_Random[5], 2)
7378
? Shapes_M1[1]
7479
: function
75-
(_a_, param){
80+
(a, param){
7681
/*<<compiler/tests-full/m3.ml:1:59>>*/ return Shapes_M2[1].call
7782
(null, 0) /*<<compiler/tests-full/m3.ml:1:66>>*/ ;
7883
};
7984
}
8085
var
81-
x = /*<<compiler/tests-full/m3.ml:4:8>>*/ f(0)(0, 0),
82-
Shapes_M3 = /*<<compiler/tests-full/m3.ml:4:18>>*/ [0, f, x];
86+
x = /*<<compiler/tests-full/m3.ml:3:8>>*/ caml_call2(f(0), 0, 0),
87+
Shapes_M3 = /*<<compiler/tests-full/m3.ml:3:18>>*/ [0, f, x];
8388
runtime.caml_register_global(3, Shapes_M3, "Shapes__M3");
8489
return;
8590
/*<<?>>*/ }

0 commit comments

Comments
 (0)