From 94e28ad1d197fff0ebb6cc52576d094645110e56 Mon Sep 17 00:00:00 2001 From: Masayuki Takeda Date: Sat, 25 May 2024 17:14:44 +0800 Subject: [PATCH] add minimal reproduction of issue Signed-off-by: Masayuki Takeda --- .../mdx-stanza/shared-libraries.t/dune | 16 ++++++++++++++++ .../mdx-stanza/shared-libraries.t/dune-project | 5 +++++ .../mdx-stanza/shared-libraries.t/public_lib.ml | 1 + .../mdx-stanza/shared-libraries.t/public_lib.mli | 1 + .../mdx-stanza/shared-libraries.t/run.t | 10 ++++++++++ .../mdx-stanza/shared-libraries.t/test.c | 3 +++ 6 files changed, 36 insertions(+) create mode 100644 test/blackbox-tests/test-cases/mdx-stanza/shared-libraries.t/dune create mode 100644 test/blackbox-tests/test-cases/mdx-stanza/shared-libraries.t/dune-project create mode 100644 test/blackbox-tests/test-cases/mdx-stanza/shared-libraries.t/public_lib.ml create mode 100644 test/blackbox-tests/test-cases/mdx-stanza/shared-libraries.t/public_lib.mli create mode 100644 test/blackbox-tests/test-cases/mdx-stanza/shared-libraries.t/run.t create mode 100644 test/blackbox-tests/test-cases/mdx-stanza/shared-libraries.t/test.c diff --git a/test/blackbox-tests/test-cases/mdx-stanza/shared-libraries.t/dune b/test/blackbox-tests/test-cases/mdx-stanza/shared-libraries.t/dune new file mode 100644 index 00000000000..bb683c94dfd --- /dev/null +++ b/test/blackbox-tests/test-cases/mdx-stanza/shared-libraries.t/dune @@ -0,0 +1,16 @@ +(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 + (files :standard - *.mli) + (libraries public_lib)) diff --git a/test/blackbox-tests/test-cases/mdx-stanza/shared-libraries.t/dune-project b/test/blackbox-tests/test-cases/mdx-stanza/shared-libraries.t/dune-project new file mode 100644 index 00000000000..a6de497e3e5 --- /dev/null +++ b/test/blackbox-tests/test-cases/mdx-stanza/shared-libraries.t/dune-project @@ -0,0 +1,5 @@ +(lang dune 3.15) + +(name dune_mdx_test) + +(using mdx 0.4) diff --git a/test/blackbox-tests/test-cases/mdx-stanza/shared-libraries.t/public_lib.ml b/test/blackbox-tests/test-cases/mdx-stanza/shared-libraries.t/public_lib.ml new file mode 100644 index 00000000000..1d7266ad044 --- /dev/null +++ b/test/blackbox-tests/test-cases/mdx-stanza/shared-libraries.t/public_lib.ml @@ -0,0 +1 @@ +let foo bar = bar + 1 \ No newline at end of file diff --git a/test/blackbox-tests/test-cases/mdx-stanza/shared-libraries.t/public_lib.mli b/test/blackbox-tests/test-cases/mdx-stanza/shared-libraries.t/public_lib.mli new file mode 100644 index 00000000000..d54f151d556 --- /dev/null +++ b/test/blackbox-tests/test-cases/mdx-stanza/shared-libraries.t/public_lib.mli @@ -0,0 +1 @@ +val foo : int -> int \ No newline at end of file diff --git a/test/blackbox-tests/test-cases/mdx-stanza/shared-libraries.t/run.t b/test/blackbox-tests/test-cases/mdx-stanza/shared-libraries.t/run.t new file mode 100644 index 00000000000..a9987797bb4 --- /dev/null +++ b/test/blackbox-tests/test-cases/mdx-stanza/shared-libraries.t/run.t @@ -0,0 +1,10 @@ +mdx supports dependencies referencing shared libraries. + + $ dune runtest + File "dune", lines 14-16, characters 0-56: + 14 | (mdx + 15 | (files :standard - *.mli) + 16 | (libraries public_lib)) + Fatal error: cannot load shared library dlltest + Reason: dlltest.so: cannot open shared object file: No such file or directory + [1] diff --git a/test/blackbox-tests/test-cases/mdx-stanza/shared-libraries.t/test.c b/test/blackbox-tests/test-cases/mdx-stanza/shared-libraries.t/test.c new file mode 100644 index 00000000000..082fc1e6fe0 --- /dev/null +++ b/test/blackbox-tests/test-cases/mdx-stanza/shared-libraries.t/test.c @@ -0,0 +1,3 @@ +int add(int a, int b) { + return a + b; +} \ No newline at end of file