From 93d01c6d4abd22e8e0fd46a13727034de97ae783 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Sat, 11 Apr 2020 08:12:39 +0200 Subject: testsuite/gna: add a test for #1206 --- testsuite/gna/issue1206/hello.vhdl | 7 +++++++ testsuite/gna/issue1206/main.c | 8 ++++++++ testsuite/gna/issue1206/testsuite.sh | 21 +++++++++++++++++++++ 3 files changed, 36 insertions(+) create mode 100644 testsuite/gna/issue1206/hello.vhdl create mode 100644 testsuite/gna/issue1206/main.c create mode 100755 testsuite/gna/issue1206/testsuite.sh (limited to 'testsuite/gna') diff --git a/testsuite/gna/issue1206/hello.vhdl b/testsuite/gna/issue1206/hello.vhdl new file mode 100644 index 000000000..792aae2bd --- /dev/null +++ b/testsuite/gna/issue1206/hello.vhdl @@ -0,0 +1,7 @@ +entity hello is +end hello; + +architecture behav of hello is +begin + assert false report "Hello VHDL world" severity note; +end behav; diff --git a/testsuite/gna/issue1206/main.c b/testsuite/gna/issue1206/main.c new file mode 100644 index 000000000..ede4b2354 --- /dev/null +++ b/testsuite/gna/issue1206/main.c @@ -0,0 +1,8 @@ +#include + +extern int ghdl_main(int argc, char** argv); + +int main(int argc, char** argv) { + printf("ghdl_main: %d\n", ghdl_main(0, NULL)); + return 0; +} diff --git a/testsuite/gna/issue1206/testsuite.sh b/testsuite/gna/issue1206/testsuite.sh new file mode 100755 index 000000000..bd0773227 --- /dev/null +++ b/testsuite/gna/issue1206/testsuite.sh @@ -0,0 +1,21 @@ +#! /bin/sh + +. ../../testenv.sh + +if $GHDL --help | grep -q -e --link; then + if [ -z $CC ]; then + CC="gcc" + fi + + $CC -c main.c + analyze hello.vhdl + elab -Wl,main.o hello + run ./hello + + clean + rm -f main.o +else + echo "Test not supported by the configuration" +fi + +echo "Test successful" -- cgit v1.2.3