aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite/gna
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2022-03-25 08:10:02 +0100
committerTristan Gingold <tgingold@free.fr>2022-03-25 08:10:02 +0100
commit7ad32b9bb91e29cae2fbba0a71b6e924dfbcaf9c (patch)
tree4b22ee22af0831583ed0df5dc3936cb6fc8704f5 /testsuite/gna
parent3c95998b5580765e1eb6466e3f525bb7f0693475 (diff)
downloadghdl-7ad32b9bb91e29cae2fbba0a71b6e924dfbcaf9c.tar.gz
ghdl-7ad32b9bb91e29cae2fbba0a71b6e924dfbcaf9c.tar.bz2
ghdl-7ad32b9bb91e29cae2fbba0a71b6e924dfbcaf9c.zip
testsuite/gna: add a test for previous commit
Diffstat (limited to 'testsuite/gna')
-rw-r--r--testsuite/gna/bug0128/test2.vhdl34
-rw-r--r--testsuite/gna/bug0128/test3.vhdl35
-rwxr-xr-xtestsuite/gna/bug0128/testsuite.sh11
3 files changed, 80 insertions, 0 deletions
diff --git a/testsuite/gna/bug0128/test2.vhdl b/testsuite/gna/bug0128/test2.vhdl
new file mode 100644
index 000000000..928465e9c
--- /dev/null
+++ b/testsuite/gna/bug0128/test2.vhdl
@@ -0,0 +1,34 @@
+use std.textio.all;
+
+entity test2 is
+end entity;
+
+architecture beh of test2 is
+
+ procedure fun1(
+ variable x: inout line
+ ) is
+ begin
+
+ end procedure;
+
+ procedure fun2(
+ constant x: in string
+ ) is
+ begin
+ report x severity note;
+ end procedure;
+
+begin
+
+ process
+ variable x :line;
+ begin
+ --doing something with x... or leave null....
+ fun1(x);
+
+ --How to check if x is null so that i can put an if statement around this?
+ fun2(x.all);
+ end process;
+
+end architecture;
diff --git a/testsuite/gna/bug0128/test3.vhdl b/testsuite/gna/bug0128/test3.vhdl
new file mode 100644
index 000000000..a7d165dfd
--- /dev/null
+++ b/testsuite/gna/bug0128/test3.vhdl
@@ -0,0 +1,35 @@
+use std.textio.all;
+
+entity test2 is
+end entity;
+
+architecture beh of test2 is
+
+ procedure fun1(
+ variable x: inout line
+ ) is
+ begin
+
+ end procedure;
+
+ procedure fun2(
+ variable x: in string
+ ) is
+ begin
+ report x severity note;
+ end procedure;
+
+begin
+
+ process
+ variable x :line;
+ begin
+ --doing something with x... or leave null....
+ fun1(x);
+
+ --How to check if x is null so that i can put an if statement around this?
+ fun2(x.all);
+
+ end process;
+
+end architecture;
diff --git a/testsuite/gna/bug0128/testsuite.sh b/testsuite/gna/bug0128/testsuite.sh
new file mode 100755
index 000000000..2d8938ecc
--- /dev/null
+++ b/testsuite/gna/bug0128/testsuite.sh
@@ -0,0 +1,11 @@
+#! /bin/sh
+
+. ../../testenv.sh
+
+analyze test2.vhdl
+elab_simulate_failure test2 2>&1 > test2.out
+grep "NULL access" test2.out
+
+clean
+
+echo "Test successful"