aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2020-01-06 07:50:04 +0100
committerTristan Gingold <tgingold@free.fr>2020-01-06 18:20:28 +0100
commit77346985875ba5eb0699d9bc6881250766ffa6fc (patch)
treeba2af14d8d3c796b38f4582ca318028d2d34de23
parent7186f0bd324c80a466384849f9b9033121d79a29 (diff)
downloadghdl-77346985875ba5eb0699d9bc6881250766ffa6fc.tar.gz
ghdl-77346985875ba5eb0699d9bc6881250766ffa6fc.tar.bz2
ghdl-77346985875ba5eb0699d9bc6881250766ffa6fc.zip
testsuite: add more tests for #1038
-rw-r--r--testsuite/gna/issue1038/repro2.vhdl23
-rw-r--r--testsuite/gna/issue1038/repro3.vhdl25
-rw-r--r--testsuite/gna/issue1038/repro4.vhdl26
-rw-r--r--testsuite/gna/issue1038/repro5.vhdl26
-rwxr-xr-xtestsuite/gna/issue1038/testsuite.sh6
5 files changed, 106 insertions, 0 deletions
diff --git a/testsuite/gna/issue1038/repro2.vhdl b/testsuite/gna/issue1038/repro2.vhdl
new file mode 100644
index 000000000..8b340b813
--- /dev/null
+++ b/testsuite/gna/issue1038/repro2.vhdl
@@ -0,0 +1,23 @@
+entity repro2 is
+end;
+
+architecture behav of repro2 is
+ type bv_array is array (natural range <>) of bit_vector;
+ subtype byte_array is bv_array(open)(7 downto 0);
+
+ type mrec is record
+ b : boolean;
+ data : byte_array;
+ end record;
+
+ signal s : mrec (data(0 to 3));
+begin
+ process
+ variable a : mrec (data(1 to 4));
+ begin
+ s <= a; -- after 1 ns;
+ wait for 2 ns;
+ s <= s;
+ wait;
+ end process;
+end behav;
diff --git a/testsuite/gna/issue1038/repro3.vhdl b/testsuite/gna/issue1038/repro3.vhdl
new file mode 100644
index 000000000..152c9b48f
--- /dev/null
+++ b/testsuite/gna/issue1038/repro3.vhdl
@@ -0,0 +1,25 @@
+entity repro3 is
+end;
+
+architecture behav of repro3 is
+ type bv_array is array (natural range <>) of bit_vector;
+ subtype byte_array is bv_array(open)(7 downto 0);
+
+ type mrec is record
+ b : boolean;
+ data : byte_array;
+ end record;
+
+ signal s : mrec (data(0 to 3));
+ procedure assign (signal sig : out mrec) is
+ variable a : mrec (data(1 to 4));
+ begin
+ sig <= a;
+ end assign;
+begin
+ process
+ begin
+ assign (s);
+ wait;
+ end process;
+end behav;
diff --git a/testsuite/gna/issue1038/repro4.vhdl b/testsuite/gna/issue1038/repro4.vhdl
new file mode 100644
index 000000000..0addf4c67
--- /dev/null
+++ b/testsuite/gna/issue1038/repro4.vhdl
@@ -0,0 +1,26 @@
+entity repro4 is
+end;
+
+architecture behav of repro4 is
+ type bv_array is array (natural range <>) of bit_vector;
+ subtype byte_array is bv_array(open)(7 downto 0);
+
+ type mrec is record
+ b : boolean;
+ data : byte_array;
+ end record;
+
+ signal s : mrec (data(0 to 3));
+
+ function get_val return mrec is
+ variable a : mrec (data(1 to 4));
+ begin
+ return a;
+ end get_val;
+begin
+ process
+ begin
+ s <= get_val;
+ wait;
+ end process;
+end behav;
diff --git a/testsuite/gna/issue1038/repro5.vhdl b/testsuite/gna/issue1038/repro5.vhdl
new file mode 100644
index 000000000..d205df452
--- /dev/null
+++ b/testsuite/gna/issue1038/repro5.vhdl
@@ -0,0 +1,26 @@
+entity repro5 is
+end;
+
+architecture behav of repro5 is
+ type bv_array is array (natural range <>) of bit_vector;
+ subtype byte_array is bv_array(open)(7 downto 0);
+
+ type mrec is record
+ b : boolean;
+ data : byte_array;
+ d2 : bit_vector;
+ end record;
+
+ procedure assign (signal s : out mrec; v : mrec) is
+ begin
+ s <= v;
+ end assign;
+ signal s : mrec (data(0 to 3), d2(0 to 7));
+begin
+ process
+ variable a : mrec (data(1 to 4), d2 (1 to 8));
+ begin
+ assign (s, a);
+ wait;
+ end process;
+end behav;
diff --git a/testsuite/gna/issue1038/testsuite.sh b/testsuite/gna/issue1038/testsuite.sh
index 8d22a2073..1cc5808aa 100755
--- a/testsuite/gna/issue1038/testsuite.sh
+++ b/testsuite/gna/issue1038/testsuite.sh
@@ -6,6 +6,12 @@ export GHDL_STD_FLAGS=--std=08
analyze repro.vhdl
elab_simulate repro
+analyze repro2.vhdl
+elab_simulate repro2
+
+analyze repro4.vhdl
+elab_simulate repro4
+
clean
echo "Test successful"