This commit is contained in:
swrup 2025-11-11 02:07:51 +01:00
parent aa2ff7b2f0
commit 2f3113f55d
11742 changed files with 1223940 additions and 0 deletions

View file

@ -0,0 +1,6 @@
let name = "bin1"
let hello name = print_endline ("Hi " ^ name)
let () = Library1.hello name
let () = hello Library1.name

View file

@ -0,0 +1,6 @@
let name = "bin2"
let hello name = print_endline ("Hi " ^ name)
let () = Library1.hello name
let () = hello Library1.name

View file

@ -0,0 +1,6 @@
let name = "bin3"
let hello name = print_endline ("Hi " ^ name)
let () = Library1.hello name
let () = hello Library1.name

View file

@ -0,0 +1,23 @@
(executable
(name bin1)
(modules bin1)
(modes js)
(libraries library1)
(js_of_ocaml
(flags (:standard --enable use-js-string))))
(executable
(name bin2)
(modules bin2)
(modes js)
(libraries library1)
(js_of_ocaml
(flags (:standard --disable use-js-string))))
(executable
(name bin3)
(modules bin3)
(modes js)
(libraries library1)
(js_of_ocaml
(flags (:standard --effects=cps))))

View file

@ -0,0 +1,5 @@
(env
(_
(js_of_ocaml
(flags (:standard --quiet))
(compilation_mode separate))))

View file

@ -0,0 +1,6 @@
(library
(name library1)
(js_of_ocaml
;; This will be ignored as the library is compiled once for every effect
;; config and then the version needed by each individual executable is used
(flags (:standard --effects=double-translation))))

View file

@ -0,0 +1,3 @@
let name = "library1"
let hello name = print_endline ("Hello " ^ name)

View file

@ -0,0 +1,13 @@
This tests a js_of_ocaml config of linking the same library with different,
incompatible `--effects` flags
$ dune build bin/bin1.bc.js bin/bin2.bc.js bin/bin3.bc.js
$ node _build/default/bin/bin1.bc.js
Hello bin1
Hi library1
$ node _build/default/bin/bin2.bc.js
Hello bin2
Hi library1
$ node _build/default/bin/bin3.bc.js
Hello bin3
Hi library1