aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite/gna/issue1623/run.sh
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2021-01-29 20:35:37 +0100
committerTristan Gingold <tgingold@free.fr>2021-01-29 20:35:37 +0100
commitdd804ce80852aa583308b02330dd93a94d5fc423 (patch)
tree42a5fc4d533c9ba12b170dc6274a8dd6673586a4 /testsuite/gna/issue1623/run.sh
parent45dc90330d619d6445d178483a36fef7673b51fe (diff)
downloadghdl-dd804ce80852aa583308b02330dd93a94d5fc423.tar.gz
ghdl-dd804ce80852aa583308b02330dd93a94d5fc423.tar.bz2
ghdl-dd804ce80852aa583308b02330dd93a94d5fc423.zip
testsuite/gna: file testcase for #1623
Diffstat (limited to 'testsuite/gna/issue1623/run.sh')
-rwxr-xr-xtestsuite/gna/issue1623/run.sh38
1 files changed, 38 insertions, 0 deletions
diff --git a/testsuite/gna/issue1623/run.sh b/testsuite/gna/issue1623/run.sh
new file mode 100755
index 000000000..164b68422
--- /dev/null
+++ b/testsuite/gna/issue1623/run.sh
@@ -0,0 +1,38 @@
+#!/usr/bin/env sh
+
+set -e
+
+cd $(dirname "$0")
+
+_ext='so'
+case "$(uname)" in
+ MINGW*) _ext='dll';;
+ Darwin*) _ext='dylib';;
+esac
+
+gcc load.c -o load -ldl
+
+for std in '08' '93'; do
+
+ echo "> [$std] Analyze tb.vhd"
+ $GHDL -a --std="$std" tb.vhd
+
+ echo ""
+
+ for item in 'pass' 'fail'; do
+ echo "> [$std] Build tb-${item}.${_ext}"
+ $GHDL -e --std="$std" -shared -Wl,-fPIC -Wl,main.c tb ${item}
+ echo ""
+
+ echo "> [$std] C load and run tb-${item}.${_ext}"
+ ./load "./tb-${item}.${_ext}"
+ echo ""
+
+ echo "> [$std] Python load and run tb-${item}.${_ext}"
+ python3 -c 'from pyaux import run; run("./tb-'"${item}.${_ext}"'", 0, None)'
+ echo ""
+ done
+
+done
+
+rm -rf *.o *."${_ext}" *.cf