aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite/synth/issue944
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2019-09-27 06:05:04 +0200
committerTristan Gingold <tgingold@free.fr>2019-09-27 06:05:04 +0200
commit2f63cd0262c65185a7179031e8c3297233206e0b (patch)
tree73a652e463c45e69000f6902a4f4ff95941ca49f /testsuite/synth/issue944
parent58f73d250fc5165f94678738b8d9dffe6bcf3c68 (diff)
downloadghdl-2f63cd0262c65185a7179031e8c3297233206e0b.tar.gz
ghdl-2f63cd0262c65185a7179031e8c3297233206e0b.tar.bz2
ghdl-2f63cd0262c65185a7179031e8c3297233206e0b.zip
testsuite/synth: add testcase for #944
Diffstat (limited to 'testsuite/synth/issue944')
-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"