diff options
Diffstat (limited to 'testsuite/synth/issue944/ent.vhdl')
-rw-r--r-- | testsuite/synth/issue944/ent.vhdl | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/testsuite/synth/issue944/ent.vhdl b/testsuite/synth/issue944/ent.vhdl new file mode 100644 index 000000000..88dd4f531 --- /dev/null +++ b/testsuite/synth/issue944/ent.vhdl @@ -0,0 +1,22 @@ +library ieee; +use ieee.std_logic_1164.all; + +entity ent is +end; + +architecture a of ent is + function count_ones(vec : std_logic_vector) return natural is + variable temp : natural := 0; + begin + for i in vec'range loop + if vec(i) then + temp := temp + 1; + end if; + end loop; + + return temp; + end count_ones; + + constant test : natural := count_ones("10101"); +begin +end; |