aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite/gna
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2021-08-03 03:51:03 +0200
committerTristan Gingold <tgingold@free.fr>2021-08-03 03:51:03 +0200
commitc3899842144d9408c571751326b449e60d41f94b (patch)
treeee2e4f0aceb34bbe3c722eaff49b56e773ede3a9 /testsuite/gna
parentdb7e1aa8644ec803d3de1ac6acef8e9beaf50e96 (diff)
downloadghdl-c3899842144d9408c571751326b449e60d41f94b.tar.gz
ghdl-c3899842144d9408c571751326b449e60d41f94b.tar.bz2
ghdl-c3899842144d9408c571751326b449e60d41f94b.zip
testsuite/gna: add testcase for #1055
Diffstat (limited to 'testsuite/gna')
-rw-r--r--testsuite/gna/issue1055/crash.vhdl12
-rw-r--r--testsuite/gna/issue1055/crash_tb.vhdl7
-rw-r--r--testsuite/gna/issue1055/repro.vhdl11
-rw-r--r--testsuite/gna/issue1055/repro1.vhdl11
-rw-r--r--testsuite/gna/issue1055/repro2.vhdl11
-rwxr-xr-xtestsuite/gna/issue1055/testsuite.sh18
6 files changed, 70 insertions, 0 deletions
diff --git a/testsuite/gna/issue1055/crash.vhdl b/testsuite/gna/issue1055/crash.vhdl
new file mode 100644
index 000000000..22e6b9292
--- /dev/null
+++ b/testsuite/gna/issue1055/crash.vhdl
@@ -0,0 +1,12 @@
+package crash_pkg is
+
+ type vec_t is array (natural range <>) of real;
+ constant null_vec_t : vec_t(0 downto 1) := (others=>0.0);
+
+ type arr_t is array (natural range <>, natural range <>) of real;
+ constant null_arr_t : arr_t(0 downto 1, 0 downto 1) := (others=>(others=>(0.0)));
+
+ type arg_t is array (natural range <>) of arr_t;
+ constant null_arg_t: arg_t(0 downto 1) := (others=>null_arr_t);
+
+end crash_pkg;
diff --git a/testsuite/gna/issue1055/crash_tb.vhdl b/testsuite/gna/issue1055/crash_tb.vhdl
new file mode 100644
index 000000000..e6c770fec
--- /dev/null
+++ b/testsuite/gna/issue1055/crash_tb.vhdl
@@ -0,0 +1,7 @@
+entity crash_Tb is
+end;
+
+use work.crash_pkg.all;
+architecture behav of crash_tb is
+begin
+end behav;
diff --git a/testsuite/gna/issue1055/repro.vhdl b/testsuite/gna/issue1055/repro.vhdl
new file mode 100644
index 000000000..dc270601d
--- /dev/null
+++ b/testsuite/gna/issue1055/repro.vhdl
@@ -0,0 +1,11 @@
+entity repro is
+end;
+
+architecture behav of repro is
+ constant nbv : bit_vector(1 downto 0) := "01";
+
+ type arg_t is array (natural range <>) of bit_vector;
+ constant null_arg_t: arg_t(0 downto 1) := (others=>null_arr_t);
+begin
+end;
+
diff --git a/testsuite/gna/issue1055/repro1.vhdl b/testsuite/gna/issue1055/repro1.vhdl
new file mode 100644
index 000000000..47f059508
--- /dev/null
+++ b/testsuite/gna/issue1055/repro1.vhdl
@@ -0,0 +1,11 @@
+entity repro1 is
+end;
+
+architecture behav of repro1 is
+ constant nbv : bit_vector(1 downto 0) := "01";
+
+ type arg_t is array (natural range <>) of bit_vector;
+ constant null_arg_t: arg_t(0 downto 1) := (others=>nbv);
+begin
+end;
+
diff --git a/testsuite/gna/issue1055/repro2.vhdl b/testsuite/gna/issue1055/repro2.vhdl
new file mode 100644
index 000000000..f7b29f8a7
--- /dev/null
+++ b/testsuite/gna/issue1055/repro2.vhdl
@@ -0,0 +1,11 @@
+entity repro2 is
+end;
+
+architecture behav of repro2 is
+ constant nbv : bit_vector(1 downto 0) := "01";
+
+ type arg_t is array (natural range <>) of bit_vector;
+ constant null_arg_t: arg_t(1 downto 0) := (others=>nbv);
+begin
+end;
+
diff --git a/testsuite/gna/issue1055/testsuite.sh b/testsuite/gna/issue1055/testsuite.sh
new file mode 100755
index 000000000..2886f742d
--- /dev/null
+++ b/testsuite/gna/issue1055/testsuite.sh
@@ -0,0 +1,18 @@
+#! /bin/sh
+
+. ../../testenv.sh
+
+export GHDL_STD_FLAGS=--std=08
+
+analyze repro1.vhdl
+elab_simulate repro1
+
+analyze repro2.vhdl
+elab_simulate repro2
+
+analyze crash.vhdl crash_tb.vhdl
+elab_simulate crash_tb
+
+clean
+
+echo "Test successful"