aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/gna/issue2005/test.c9
-rwxr-xr-xtestsuite/gna/issue2005/testsuite.sh21
2 files changed, 30 insertions, 0 deletions
diff --git a/testsuite/gna/issue2005/test.c b/testsuite/gna/issue2005/test.c
new file mode 100644
index 000000000..d958faff7
--- /dev/null
+++ b/testsuite/gna/issue2005/test.c
@@ -0,0 +1,9 @@
+#include <string.h>
+#include <ghdl/synth_gates.h>
+
+void libghdl_init(); // dummy, just to see if finding the library/linking works
+
+int main()
+{
+ libghdl_init();
+}
diff --git a/testsuite/gna/issue2005/testsuite.sh b/testsuite/gna/issue2005/testsuite.sh
new file mode 100755
index 000000000..5cd784bc6
--- /dev/null
+++ b/testsuite/gna/issue2005/testsuite.sh
@@ -0,0 +1,21 @@
+#! /bin/sh
+
+. ../../testenv.sh
+
+set -x
+
+if c_compiler_is_available; then
+ lib=$("$GHDL" --libghdl-name)
+ lib=${lib#lib} # strip "lib" prefix
+ lib=${lib%.*} # strip .so/.dll suffix
+ lib_path="$("$GHDL" --libghdl-library-path)"
+
+ libdir="$(dirname "$lib_path")"
+ incdir="$("$GHDL" --libghdl-include-dir)"
+
+ $CC -I"$incdir" test.c "$("$GHDL" --libghdl-library-path)"
+ $CC -I"$incdir" -L"$libdir" test.c -l"$lib"
+ rm -f a.out
+fi
+
+echo "Test successful"