summaryrefslogtreecommitdiff
path: root/testsuite/gna/ticket40/generic_when.vhdl
diff options
context:
space:
mode:
authorTristan Gingold2015-03-14 07:27:00 +0100
committerTristan Gingold2015-03-14 07:27:00 +0100
commitcf2ab2cf781a5c689739d57097d6da7ea6e710a0 (patch)
tree250447e93cb38e3bca1f766bf255c2cbfa1393f6 /testsuite/gna/ticket40/generic_when.vhdl
parentfb10c3db8616f63ed33ba3d2d0f62bc0514ac536 (diff)
downloadghdl-cf2ab2cf781a5c689739d57097d6da7ea6e710a0.tar.gz
ghdl-cf2ab2cf781a5c689739d57097d6da7ea6e710a0.tar.bz2
ghdl-cf2ab2cf781a5c689739d57097d6da7ea6e710a0.zip
Add reproducer for ticket40.
Diffstat (limited to 'testsuite/gna/ticket40/generic_when.vhdl')
-rw-r--r--testsuite/gna/ticket40/generic_when.vhdl26
1 files changed, 26 insertions, 0 deletions
diff --git a/testsuite/gna/ticket40/generic_when.vhdl b/testsuite/gna/ticket40/generic_when.vhdl
new file mode 100644
index 0000000..46a9cfa
--- /dev/null
+++ b/testsuite/gna/ticket40/generic_when.vhdl
@@ -0,0 +1,26 @@
+library ieee;
+use ieee.std_logic_1164.all;
+use ieee.numeric_std.all;
+use std.textio.all;
+
+entity GENERIC_WHEN is
+ generic( FOO : std_logic_vector(1 downto 0) );
+ port( IN1 : in std_logic_vector(1 downto 0);
+ OUT1 : out std_logic_vector(1 downto 0) );
+end GENERIC_WHEN;
+
+architecture BEHAVIOUR of GENERIC_WHEN is
+begin
+ PR1:
+ process( IN1 )
+ variable l : line;
+ begin
+ case IN1 is
+ when FOO => OUT1 <= FOO; write(l, string'("FOO")); writeline(output, l);
+ --when "00" => write(l, string'("00")); writeline(output, l);
+ when "01" => write(l, string'("01")); writeline(output, l);
+ when others => write(l, string'("other")); writeline(output, l);
+ end case;
+ end process PR1;
+end BEHAVIOUR;
+