aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite/gna/bug017/case4.vhdl
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/gna/bug017/case4.vhdl')
-rw-r--r--testsuite/gna/bug017/case4.vhdl34
1 files changed, 34 insertions, 0 deletions
diff --git a/testsuite/gna/bug017/case4.vhdl b/testsuite/gna/bug017/case4.vhdl
new file mode 100644
index 000000000..569638ed6
--- /dev/null
+++ b/testsuite/gna/bug017/case4.vhdl
@@ -0,0 +1,34 @@
+entity case4 is
+end;
+
+architecture behav of case4 is
+ subtype bv4 is bit_vector (1 to 4);
+ type vec2 is array (natural range <>) of bv4;
+ constant vects : vec2 := (x"0", x"3", x"9", x"4", x"a");
+
+ procedure print (msg : string; t : time) is
+ begin
+ report msg;
+ wait for t;
+ end print;
+begin
+ process
+ begin
+ for i in vects'range loop
+ case bv4'(vects (i)) is
+ when "0100" =>
+ print ("value is 4", 4 ns);
+ print ("yes, really 4", 4 ns);
+ when "0011" =>
+ print ("value is 3", 3 ns);
+ when "0101" =>
+ print ("value is 5", 5 ns);
+ when others =>
+ print ("unknown value", 0 ns);
+ end case;
+ end loop;
+ report "SUCCESS";
+ wait;
+ end process;
+
+end behav;