aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite/synth
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2022-06-27 07:50:01 +0200
committerTristan Gingold <tgingold@free.fr>2022-06-27 07:50:01 +0200
commite5e2caa620846928bb85ccc5206375c2b7321a66 (patch)
tree3341bfa45906c722efb33df4dc36f9a648e04278 /testsuite/synth
parent928588eca00ad47ce0eee614c4f655ed109bf964 (diff)
downloadghdl-e5e2caa620846928bb85ccc5206375c2b7321a66.tar.gz
ghdl-e5e2caa620846928bb85ccc5206375c2b7321a66.tar.bz2
ghdl-e5e2caa620846928bb85ccc5206375c2b7321a66.zip
testsuite/synth: add a test for #2109
Diffstat (limited to 'testsuite/synth')
-rw-r--r--testsuite/synth/issue2109/bug.vhdl17
-rwxr-xr-xtestsuite/synth/issue2109/testsuite.sh11
2 files changed, 28 insertions, 0 deletions
diff --git a/testsuite/synth/issue2109/bug.vhdl b/testsuite/synth/issue2109/bug.vhdl
new file mode 100644
index 000000000..c514c6f99
--- /dev/null
+++ b/testsuite/synth/issue2109/bug.vhdl
@@ -0,0 +1,17 @@
+library IEEE;
+use IEEE.std_logic_1164.all;
+use IEEE.numeric_std.all;
+
+entity bug is
+generic(
+ tmp : std_ulogic_vector(0 downto 1) := ""
+);
+port(
+ val : out std_ulogic_vector(0 downto 1)
+);
+end entity;
+
+architecture rtl of bug is
+begin
+ val <= tmp;
+end architecture;
diff --git a/testsuite/synth/issue2109/testsuite.sh b/testsuite/synth/issue2109/testsuite.sh
new file mode 100755
index 000000000..1361b7a0a
--- /dev/null
+++ b/testsuite/synth/issue2109/testsuite.sh
@@ -0,0 +1,11 @@
+#! /bin/sh
+
+. ../../testenv.sh
+
+synth --out=verilog bug.vhdl -e > syn_bug.v
+
+if grep val syn_bug.v; then
+ exit 1
+fi
+
+echo "Test successful"