aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite/gna/issue1206
diff options
context:
space:
mode:
authorumarcor <38422348+umarcor@users.noreply.github.com>2020-04-12 10:29:56 +0200
committerGitHub <noreply@github.com>2020-04-12 10:29:56 +0200
commit1421145c299fbfa272b58f3a82f0142793fab3b1 (patch)
tree0acdca1b845c885ee7bd55209c850179ab9e5130 /testsuite/gna/issue1206
parent948e23fcc54c0c0116c260fc86aae0ba583172dd (diff)
downloadghdl-1421145c299fbfa272b58f3a82f0142793fab3b1.tar.gz
ghdl-1421145c299fbfa272b58f3a82f0142793fab3b1.tar.bz2
ghdl-1421145c299fbfa272b58f3a82f0142793fab3b1.zip
grt: handle argc=0 and argv/=null in ghdl_main (#1206) (#1215)
Diffstat (limited to 'testsuite/gna/issue1206')
-rw-r--r--testsuite/gna/issue1206/main_notnull.c8
-rwxr-xr-xtestsuite/gna/issue1206/testsuite.sh14
2 files changed, 19 insertions, 3 deletions
diff --git a/testsuite/gna/issue1206/main_notnull.c b/testsuite/gna/issue1206/main_notnull.c
new file mode 100644
index 000000000..9ff996f6f
--- /dev/null
+++ b/testsuite/gna/issue1206/main_notnull.c
@@ -0,0 +1,8 @@
+#include <stdio.h>
+
+extern int ghdl_main(int argc, char** argv);
+
+int main(int argc, char** argv) {
+ printf("ghdl_main: %d\n", ghdl_main(argc, argv));
+ return 0;
+}
diff --git a/testsuite/gna/issue1206/testsuite.sh b/testsuite/gna/issue1206/testsuite.sh
index bd0773227..09532b329 100755
--- a/testsuite/gna/issue1206/testsuite.sh
+++ b/testsuite/gna/issue1206/testsuite.sh
@@ -1,15 +1,23 @@
#! /bin/sh
+cd $(dirname "$0")
+
. ../../testenv.sh
if $GHDL --help | grep -q -e --link; then
if [ -z $CC ]; then
- CC="gcc"
+ CC="gcc"
fi
- $CC -c main.c
analyze hello.vhdl
- elab -Wl,main.o hello
+ elab -Wl,main.c hello
+ run ./hello
+
+ clean
+ rm -f main.o
+
+ analyze hello.vhdl
+ elab -Wl,main_notnull.c hello
run ./hello
clean