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,2 @@
(library
(name x))

View file

@ -0,0 +1 @@
(lang dune 2.8)

View file

@ -0,0 +1,12 @@
Basic check that directives are correctly emitted.
$ dune top
#directory "$TESTCASE_ROOT/_build/default/.x.objs/byte";;
#directory "$TESTCASE_ROOT/_build/default/stubs";;
#directory "$TESTCASE_ROOT/_build/default/stubs/.z.objs/byte";;
#load "$TESTCASE_ROOT/_build/default/x.cma";;
#load "$TESTCASE_ROOT/_build/default/stubs/z.cma";;
Check that C stubs work.
$ (dune top && echo "Z.f ();;") > init.mltop
$ ocaml init.mltop
Hello!

View file

@ -0,0 +1,5 @@
(library
(name z)
(foreign_stubs
(language c)
(names z_stubs)))

View file

@ -0,0 +1,4 @@
external hello : unit -> unit = "ml_hello"
let f () =
hello ()

View file

@ -0,0 +1,9 @@
#include <caml/mlvalues.h>
#include <stdio.h>
value ml_hello(value vunit)
{
printf("Hello!\n");
fflush(stdout);
return Val_unit;
}