summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTristan Gingold2013-12-29 12:14:52 +0100
committerTristan Gingold2013-12-29 12:14:52 +0100
commitcb9f13404bcc6d8d26838bc0fb2f236952deaaed (patch)
treed4094b799c9700a5a154c94eef052645443ace50
parente532264e3161e6715ea3447f1bb8490eea7b124e (diff)
downloadghdl-cb9f13404bcc6d8d26838bc0fb2f236952deaaed.tar.gz
ghdl-cb9f13404bcc6d8d26838bc0fb2f236952deaaed.tar.bz2
ghdl-cb9f13404bcc6d8d26838bc0fb2f236952deaaed.zip
Add bug16096.
-rw-r--r--testsuite/gna/bug16096/module.vhd31
-rwxr-xr-xtestsuite/gna/bug16096/testsuite.sh9
2 files changed, 40 insertions, 0 deletions
diff --git a/testsuite/gna/bug16096/module.vhd b/testsuite/gna/bug16096/module.vhd
new file mode 100644
index 0000000..870c42d
--- /dev/null
+++ b/testsuite/gna/bug16096/module.vhd
@@ -0,0 +1,31 @@
+entity module is end entity;
+architecture arch of module is
+ function func(a:natural) return natural is
+ begin
+ if a=32 then return 2;
+ elsif a=16 then return 1;
+ else return 0;
+ end if;
+ end function;
+ constant DATAPATH :natural := 32;
+ constant LSLICES :natural := func(DATAPATH);
+-- constant LSLICES :natural := 2;
+ signal a :bit;
+ signal s :bit_vector(LSLICES-1 downto 0);
+begin
+ DATA8: if DATAPATH=8 generate
+ a <= '0';
+ end generate;
+-- DATA16: if DATAPATH=16 generate
+-- with s select a <=
+-- '1' when "0",
+-- '0' when others;
+-- end generate;
+ DATA32: if DATAPATH=32 generate
+ with s select a <=
+ '1' when "00",
+ '0' when "01",
+ '1' when "10",
+ '0' when others;
+ end generate;
+end architecture;
diff --git a/testsuite/gna/bug16096/testsuite.sh b/testsuite/gna/bug16096/testsuite.sh
new file mode 100755
index 0000000..a4d7ae3
--- /dev/null
+++ b/testsuite/gna/bug16096/testsuite.sh
@@ -0,0 +1,9 @@
+#! /bin/sh
+
+. ../../testenv.sh
+
+analyze_failure module.vhd
+
+clean
+
+echo "Test successful"