This commit is contained in:
parent
aa2ff7b2f0
commit
2f3113f55d
11742 changed files with 1223940 additions and 0 deletions
|
|
@ -0,0 +1,2 @@
|
|||
(library
|
||||
(name x))
|
||||
|
|
@ -0,0 +1 @@
|
|||
(lang dune 2.8)
|
||||
|
|
@ -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!
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
(library
|
||||
(name z)
|
||||
(foreign_stubs
|
||||
(language c)
|
||||
(names z_stubs)))
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
external hello : unit -> unit = "ml_hello"
|
||||
|
||||
let f () =
|
||||
hello ()
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
#include <caml/mlvalues.h>
|
||||
#include <stdio.h>
|
||||
|
||||
value ml_hello(value vunit)
|
||||
{
|
||||
printf("Hello!\n");
|
||||
fflush(stdout);
|
||||
return Val_unit;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue