Skip to content

Commit

Permalink
test: add a repro for ocaml#10582
Browse files Browse the repository at this point in the history
Signed-off-by: Masayuki Takeda <mtakeda@oeconomia.jp>
Co-authored-by: Antonio Nuno Monteiro <anmonteiro@gmail.com>
Co-authored-by: Etienne Millon <me@emillon.org>
  • Loading branch information
3 people committed May 29, 2024
1 parent 72c5505 commit a9b7982
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/blackbox-tests/test-cases/mdx-stanza/dune
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,10 @@
(deps
(package mdx))
(alias all-mdx-tests))

(cram
(applies_to shared-libraries)
(deps
%{bin:gcc}
%{bin:ar}
(package mdx)))
43 changes: 43 additions & 0 deletions test/blackbox-tests/test-cases/mdx-stanza/shared-libraries.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
mdx supports dependencies referencing shared libraries.

See #10582.

$ cat > dune-project << EOF
> (lang dune 3.15)
> (name dune_mdx_test)
> (using mdx 0.4)
> EOF

$ cat > dune << EOF
> (library
> (name public_lib)
> (foreign_archives test))
>
> (rule
> (deps test.c)
> (targets libtest.a dlltest.so)
> (action
> (progn
> (run gcc -c -fPIC test.c -o test.o)
> (run gcc test.o -shared -o dlltest.so)
> (run ar rcs libtest.a test.o))))
>
> (mdx
> (libraries public_lib))
> EOF

$ cat > public_lib.mli << EOF
> val foo : int -> int
> EOF

$ cat > public_lib.ml << EOF
> let foo bar = bar + 1
> EOF

$ cat > test.c << EOF
> int add(int a, int b) {
> return a + b;
> }
> EOF

$ dune runtest

0 comments on commit a9b7982

Please sign in to comment.