From c3899842144d9408c571751326b449e60d41f94b Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Tue, 3 Aug 2021 03:51:03 +0200 Subject: testsuite/gna: add testcase for #1055 --- testsuite/gna/issue1055/crash.vhdl | 12 ++++++++++++ testsuite/gna/issue1055/crash_tb.vhdl | 7 +++++++ testsuite/gna/issue1055/repro.vhdl | 11 +++++++++++ testsuite/gna/issue1055/repro1.vhdl | 11 +++++++++++ testsuite/gna/issue1055/repro2.vhdl | 11 +++++++++++ testsuite/gna/issue1055/testsuite.sh | 18 ++++++++++++++++++ 6 files changed, 70 insertions(+) create mode 100644 testsuite/gna/issue1055/crash.vhdl create mode 100644 testsuite/gna/issue1055/crash_tb.vhdl create mode 100644 testsuite/gna/issue1055/repro.vhdl create mode 100644 testsuite/gna/issue1055/repro1.vhdl create mode 100644 testsuite/gna/issue1055/repro2.vhdl create mode 100755 testsuite/gna/issue1055/testsuite.sh 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" -- cgit v1.2.3