aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/synth/issue944/ent.vhdl22
-rwxr-xr-xtestsuite/synth/issue944/testsuite.sh11
2 files changed, 33 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;
diff --git a/testsuite/synth/issue944/testsuite.sh b/testsuite/synth/issue944/testsuite.sh
new file mode 100755
index 000000000..a240e36c7
--- /dev/null
+++ b/testsuite/synth/issue944/testsuite.sh
@@ -0,0 +1,11 @@
+#! /bin/sh
+
+. ../../testenv.sh
+
+for f in ent; do
+ synth --std=08 $f.vhdl -e $f > syn_$f.vhdl
+ analyze syn_$f.vhdl
+done
+clean
+
+echo "Test successful"