aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2019-04-30 06:54:05 +0200
committerTristan Gingold <tgingold@free.fr>2019-05-02 04:10:02 +0200
commit33861bcc4a3bdd3253a5f7f8532823deb16c7287 (patch)
tree06714cb53f936b8df72405f204e6d99c58e6c12d
parente016397ff27e9fe5ee04693c903fcad9144a110e (diff)
downloadghdl-33861bcc4a3bdd3253a5f7f8532823deb16c7287.tar.gz
ghdl-33861bcc4a3bdd3253a5f7f8532823deb16c7287.tar.bz2
ghdl-33861bcc4a3bdd3253a5f7f8532823deb16c7287.zip
Add a testcase about visibility.
-rw-r--r--testsuite/gna/bug098/loopy.vhdl26
-rwxr-xr-xtestsuite/gna/bug098/testsuite.sh9
2 files changed, 35 insertions, 0 deletions
diff --git a/testsuite/gna/bug098/loopy.vhdl b/testsuite/gna/bug098/loopy.vhdl
new file mode 100644
index 000000000..16d3c1af3
--- /dev/null
+++ b/testsuite/gna/bug098/loopy.vhdl
@@ -0,0 +1,26 @@
+library ieee;
+use ieee.std_logic_1164.all;
+use ieee.numeric_std.all;
+
+entity loopy is
+end loopy;
+
+architecture foo of loopy is
+ constant R: integer := 4;
+ constant L: integer := 16;
+ constant W: integer := 16;
+ constant M: integer := 4;
+ type t_reg_x is array ( 0 to L-1 ) of signed( W-1 downto 0 );
+ signal reg_x : t_reg_x := ( others => ( others => '0' ) );
+ type t_mux_in_x is array ( 0 to L - 1 ) of signed( W - 1 downto 0 );
+ signal mux_in_x: t_mux_in_x := ( others => ( others => '0') );
+begin
+ process (reg_x)
+ begin
+ for r in 0 to R-1 loop
+ for m in 0 to M-1 loop
+ mux_in_x(r * M + m) <= reg_x(m * R + r);
+ end loop;
+ end loop;
+ end process;
+end architecture;
diff --git a/testsuite/gna/bug098/testsuite.sh b/testsuite/gna/bug098/testsuite.sh
new file mode 100755
index 000000000..b8c1c32a8
--- /dev/null
+++ b/testsuite/gna/bug098/testsuite.sh
@@ -0,0 +1,9 @@
+#! /bin/sh
+
+. ../../testenv.sh
+
+analyze_failure loopy.vhdl
+
+clean
+
+echo "Test successful"