This commit is contained in:
parent
aa2ff7b2f0
commit
2f3113f55d
11742 changed files with 1223940 additions and 0 deletions
1
unikernel/duniverse/ocaml-gmp/test/dummy.ml
Normal file
1
unikernel/duniverse/ocaml-gmp/test/dummy.ml
Normal file
|
|
@ -0,0 +1 @@
|
|||
external compute : unit -> unit = "caml_compute"
|
||||
18
unikernel/duniverse/ocaml-gmp/test/dummy_stubs.c
Normal file
18
unikernel/duniverse/ocaml-gmp/test/dummy_stubs.c
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
#include <caml/mlvalues.h>
|
||||
#include <stdio.h>
|
||||
#include <gmp.h>
|
||||
|
||||
value caml_compute(value unit) {
|
||||
mpz_t n;
|
||||
mpz_init(n);
|
||||
mpz_set_str(n,"100", 10);
|
||||
mpz_mul(n,n,n);
|
||||
|
||||
printf("MPZ: ");
|
||||
mpz_out_str(stdout, 10, n);
|
||||
printf("\n");
|
||||
|
||||
mpz_clear(n);
|
||||
|
||||
return unit;
|
||||
}
|
||||
23
unikernel/duniverse/ocaml-gmp/test/dune
Normal file
23
unikernel/duniverse/ocaml-gmp/test/dune
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
(library
|
||||
(name dummy)
|
||||
(foreign_stubs
|
||||
(language c)
|
||||
(include_dirs
|
||||
(lib gmp)))
|
||||
(libraries gmp)
|
||||
(modules dummy))
|
||||
|
||||
(executable
|
||||
(name test)
|
||||
(libraries dummy)
|
||||
(modules test))
|
||||
|
||||
(rule
|
||||
(with-stdout-to
|
||||
test.output
|
||||
(run ./test.exe)))
|
||||
|
||||
(rule
|
||||
(alias runtest)
|
||||
(action
|
||||
(diff test.expected test.output)))
|
||||
1
unikernel/duniverse/ocaml-gmp/test/test.expected
Normal file
1
unikernel/duniverse/ocaml-gmp/test/test.expected
Normal file
|
|
@ -0,0 +1 @@
|
|||
MPZ: 10000
|
||||
1
unikernel/duniverse/ocaml-gmp/test/test.ml
Normal file
1
unikernel/duniverse/ocaml-gmp/test/test.ml
Normal file
|
|
@ -0,0 +1 @@
|
|||
let () = Dummy.compute ();;
|
||||
Loading…
Add table
Add a link
Reference in a new issue