aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite/synth/issue1266
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2020-04-27 06:54:14 +0200
committerTristan Gingold <tgingold@free.fr>2020-04-27 06:54:14 +0200
commitc1093f4ef3120db4a7f5c2840c4b477c1a70b25c (patch)
tree943fc4fd943f441b7d84abff2eb68d51effdb15c /testsuite/synth/issue1266
parent8cf995880c3ccae87526aadb52799f17053b3521 (diff)
downloadghdl-c1093f4ef3120db4a7f5c2840c4b477c1a70b25c.tar.gz
ghdl-c1093f4ef3120db4a7f5c2840c4b477c1a70b25c.tar.bz2
ghdl-c1093f4ef3120db4a7f5c2840c4b477c1a70b25c.zip
testsuite/synth: add test for #1266
Diffstat (limited to 'testsuite/synth/issue1266')
-rw-r--r--testsuite/synth/issue1266/issue.vhdl13
-rw-r--r--testsuite/synth/issue1266/tb_issue.vhdl26
-rwxr-xr-xtestsuite/synth/issue1266/testsuite.sh7
3 files changed, 46 insertions, 0 deletions
diff --git a/testsuite/synth/issue1266/issue.vhdl b/testsuite/synth/issue1266/issue.vhdl
new file mode 100644
index 000000000..7d16bc2db
--- /dev/null
+++ b/testsuite/synth/issue1266/issue.vhdl
@@ -0,0 +1,13 @@
+library ieee;
+use ieee.std_logic_1164.all;
+
+entity issue is
+ generic (constant N : integer := 8);
+ port (foo : in std_logic;
+ bar : out std_logic_vector(8-1 downto 0));
+end issue;
+
+architecture beh of issue is
+begin
+ bar <= (bar'high=>foo, others=>'0');
+end architecture;
diff --git a/testsuite/synth/issue1266/tb_issue.vhdl b/testsuite/synth/issue1266/tb_issue.vhdl
new file mode 100644
index 000000000..a59066af7
--- /dev/null
+++ b/testsuite/synth/issue1266/tb_issue.vhdl
@@ -0,0 +1,26 @@
+entity tb_issue is
+end tb_issue;
+
+library ieee;
+use ieee.std_logic_1164.all;
+
+architecture behav of tb_issue is
+ signal f : std_logic;
+ signal b : std_logic_vector (7 downto 0);
+begin
+ dut: entity work.issue
+ port map (f, b);
+
+ process
+ begin
+ f <= '1';
+ wait for 1 ns;
+ assert b = b"1000_0000" severity failure;
+
+ f <= '0';
+ wait for 1 ns;
+ assert b = b"0000_0000" severity failure;
+
+ wait;
+ end process;
+end behav;
diff --git a/testsuite/synth/issue1266/testsuite.sh b/testsuite/synth/issue1266/testsuite.sh
new file mode 100755
index 000000000..d580d8433
--- /dev/null
+++ b/testsuite/synth/issue1266/testsuite.sh
@@ -0,0 +1,7 @@
+#! /bin/sh
+
+. ../../testenv.sh
+
+synth_tb issue
+
+echo "Test successful"