aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite/gna
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2021-05-25 08:05:02 +0200
committerTristan Gingold <tgingold@free.fr>2021-05-25 08:05:02 +0200
commit48695e579a7746fe52eda777b14ec10d918e7e4b (patch)
tree9a636be85d979c697ce3ca3823414464cea3b555 /testsuite/gna
parente9352e8ec0caaddd97d747ee1ca72cefc56edbde (diff)
downloadghdl-48695e579a7746fe52eda777b14ec10d918e7e4b.tar.gz
ghdl-48695e579a7746fe52eda777b14ec10d918e7e4b.tar.bz2
ghdl-48695e579a7746fe52eda777b14ec10d918e7e4b.zip
testsuite/gna: add tests for #1772
Diffstat (limited to 'testsuite/gna')
-rw-r--r--testsuite/gna/issue1772/repro.vhdl23
-rw-r--r--testsuite/gna/issue1772/repro2.vhdl26
-rw-r--r--testsuite/gna/issue1772/repro3.vhdl16
-rwxr-xr-xtestsuite/gna/issue1772/testsuite.sh14
4 files changed, 79 insertions, 0 deletions
diff --git a/testsuite/gna/issue1772/repro.vhdl b/testsuite/gna/issue1772/repro.vhdl
new file mode 100644
index 000000000..a427681f6
--- /dev/null
+++ b/testsuite/gna/issue1772/repro.vhdl
@@ -0,0 +1,23 @@
+entity repro is
+end;
+
+architecture behav of repro is
+ type arr_el_t is array(0 to 3) of string;
+ type arr_t is array(integer range <>) of arr_el_t;
+
+ constant cst : arr_t :=
+ (1 => (" ","A0 ","VAL2","ELEMENT_VALUE_3"),
+ 2 => (" ","10 ","VAL2","ELEMENT_VALUE_3"));
+begin
+ process
+ begin
+ for i in cst'range loop
+ report "cst(" & to_string(i) & "):";
+ for j in cst(i)'range loop
+ report cst(i)(j);
+ end loop;
+ end loop;
+ wait;
+ end process;
+end behav;
+
diff --git a/testsuite/gna/issue1772/repro2.vhdl b/testsuite/gna/issue1772/repro2.vhdl
new file mode 100644
index 000000000..07c28646f
--- /dev/null
+++ b/testsuite/gna/issue1772/repro2.vhdl
@@ -0,0 +1,26 @@
+entity repro2 is
+end;
+
+architecture behav of repro2 is
+ type arr_el_t is array(0 to 1) of string (1 to 4);
+ type arr_t is array(integer range <>) of arr_el_t;
+
+ constant cst : arr_t := (1 => ("abcd", "efgh"),
+ 2 => ("ijkl", "mnop"));
+begin
+ process
+ begin
+ for k in arr_el_t'range loop
+ null;
+ end loop;
+
+ for i in cst'range loop
+ report "cst(" & to_string(i) & "):";
+ for j in cst'element'range loop
+ report cst(i)(j);
+ end loop;
+ end loop;
+ wait;
+ end process;
+end behav;
+
diff --git a/testsuite/gna/issue1772/repro3.vhdl b/testsuite/gna/issue1772/repro3.vhdl
new file mode 100644
index 000000000..8355aab51
--- /dev/null
+++ b/testsuite/gna/issue1772/repro3.vhdl
@@ -0,0 +1,16 @@
+entity repro3 is
+end;
+
+architecture behav of repro3 is
+ type arr_el_t is array(0 to 1) of string (1 to 4);
+begin
+ process
+ begin
+ for k in arr_el_t'range loop
+ report natural'image (k);
+ null;
+ end loop;
+ wait;
+ end process;
+end behav;
+
diff --git a/testsuite/gna/issue1772/testsuite.sh b/testsuite/gna/issue1772/testsuite.sh
new file mode 100755
index 000000000..8690b18bf
--- /dev/null
+++ b/testsuite/gna/issue1772/testsuite.sh
@@ -0,0 +1,14 @@
+#! /bin/sh
+
+. ../../testenv.sh
+
+export GHDL_STD_FLAGS=--std=08
+analyze repro2.vhdl
+elab_simulate repro2
+
+analyze repro3.vhdl
+elab_simulate repro3
+
+clean
+
+echo "Test successful"