diff options
author | Tristan Gingold | 2015-09-10 20:21:39 +0200 |
---|---|---|
committer | Tristan Gingold | 2015-09-10 20:21:39 +0200 |
commit | 0e257fe7341a44f097ea282c0cbabda42f4ecc41 (patch) | |
tree | 9bcb968c918a0308b9e00255ac3a69c3653bfd18 /testsuite/gna/bug017 | |
parent | ade2729c338050c7b248ff1b0ac7e7118083597c (diff) | |
download | ghdl-0e257fe7341a44f097ea282c0cbabda42f4ecc41.tar.gz ghdl-0e257fe7341a44f097ea282c0cbabda42f4ecc41.tar.bz2 ghdl-0e257fe7341a44f097ea282c0cbabda42f4ecc41.zip |
Add bug017 test cases.
Diffstat (limited to 'testsuite/gna/bug017')
-rw-r--r-- | testsuite/gna/bug017/call10.vhdl | 22 | ||||
-rw-r--r-- | testsuite/gna/bug017/case1.vhdl | 31 | ||||
-rw-r--r-- | testsuite/gna/bug017/case2.vhdl | 28 | ||||
-rw-r--r-- | testsuite/gna/bug017/case3.vhdl | 29 | ||||
-rw-r--r-- | testsuite/gna/bug017/case4.vhdl | 34 |
5 files changed, 144 insertions, 0 deletions
diff --git a/testsuite/gna/bug017/call10.vhdl b/testsuite/gna/bug017/call10.vhdl new file mode 100644 index 0000000..a115b05 --- /dev/null +++ b/testsuite/gna/bug017/call10.vhdl @@ -0,0 +1,22 @@ +entity call10 is +end; + +architecture behav of call10 is + procedure check2 (msg : string) is + begin + assert msg = "checking: abcedfghijklmnopqrstuvwxyz" + severity failure; + report "SUCCESS" severity note; + end check2; + + procedure check1 (msg : string) is + begin + check2 ("checking: " & msg); + end check1; +begin + process + begin + check1 ("abcedfghijklmnopqrstuvwxyz"); + wait; + end process; +end behav; diff --git a/testsuite/gna/bug017/case1.vhdl b/testsuite/gna/bug017/case1.vhdl new file mode 100644 index 0000000..214cbf7 --- /dev/null +++ b/testsuite/gna/bug017/case1.vhdl @@ -0,0 +1,31 @@ +entity case1 is +end; + +architecture behav of case1 is +begin + process + begin + for i in 1 to 10 loop + case i is + when 1 => + report "one"; + wait for 1 ns; + when 2 => + report "two"; + wait for 2 ns; + when 3 => + report "three"; + wait for 3 ns; + when 4 to 9 => + report "a big digit"; + wait for 5 ns; + when others => + report "a number"; -- including 0. + wait for 10 ns; + end case; + end loop; + report "SUCCESS"; + wait; + end process; + +end behav; diff --git a/testsuite/gna/bug017/case2.vhdl b/testsuite/gna/bug017/case2.vhdl new file mode 100644 index 0000000..eff79c5 --- /dev/null +++ b/testsuite/gna/bug017/case2.vhdl @@ -0,0 +1,28 @@ +entity case1 is +end; + +architecture behav of case1 is + type vec2 is array (natural range <>) of bit_vector (1 to 4); + constant vects : vec2 := (x"0", x"4", x"9", x"3", x"a"); +begin + process + variable i : natural := 0; + begin + for i in vects'range loop + case vects (i) is + when "0100" => + report "value is 4"; + wait for 4 ns; + when "0011" => + report "value is 3"; + wait for 3 ns; + when others => + report "unknown value"; + wait for 1 ns; + end case; + end loop; + report "SUCCESS"; + wait; + end process; + +end behav; diff --git a/testsuite/gna/bug017/case3.vhdl b/testsuite/gna/bug017/case3.vhdl new file mode 100644 index 0000000..8c8dc17 --- /dev/null +++ b/testsuite/gna/bug017/case3.vhdl @@ -0,0 +1,29 @@ +entity case3 is +end; + +architecture behav of case3 is + subtype bv4 is bit_vector (1 to 4); + type vec2 is array (natural range <>) of bv4; + constant vects : vec2 := (x"0", x"4", x"9", x"3", x"a"); +begin + process + variable i : natural := 0; + begin + for i in vects'range loop + case bv4'(vects (i)) is + when "0100" => + report "value is 4"; + wait for 4 ns; + when "0011" => + report "value is 3"; + wait for 3 ns; + when others => + report "unknown value"; + wait for 1 ns; + end case; + end loop; + report "SUCCESS"; + wait; + end process; + +end behav; diff --git a/testsuite/gna/bug017/case4.vhdl b/testsuite/gna/bug017/case4.vhdl new file mode 100644 index 0000000..569638e --- /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; |