aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2020-04-18 16:19:05 +0200
committerTristan Gingold <tgingold@free.fr>2020-04-18 16:19:05 +0200
commitea367247d8a57e899eaea5f8507149e83e41a56f (patch)
tree84d28f440965701e128814eb380ad6c8a99f188e /testsuite
parent49bcc683d35a606cb5d1d3629c512ded052dd442 (diff)
downloadghdl-ea367247d8a57e899eaea5f8507149e83e41a56f.tar.gz
ghdl-ea367247d8a57e899eaea5f8507149e83e41a56f.tar.bz2
ghdl-ea367247d8a57e899eaea5f8507149e83e41a56f.zip
testsuite/synth: complete test for #1240
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/synth/issue1240/tb_issue3.vhdl31
-rwxr-xr-xtestsuite/synth/issue1240/testsuite.sh2
2 files changed, 33 insertions, 0 deletions
diff --git a/testsuite/synth/issue1240/tb_issue3.vhdl b/testsuite/synth/issue1240/tb_issue3.vhdl
new file mode 100644
index 000000000..1725a3c6b
--- /dev/null
+++ b/testsuite/synth/issue1240/tb_issue3.vhdl
@@ -0,0 +1,31 @@
+entity tb_issue3 is
+end tb_issue3;
+
+library ieee;
+use ieee.std_logic_1164.all;
+use ieee.numeric_std.all;
+
+architecture behav of tb_issue3 is
+ signal i : integer := 0;
+ signal o : signed (3 downto 0);
+begin
+ dut: entity work.issue3
+ port map (i, o);
+
+ process
+ begin
+ i <= 0;
+ wait for 1 ns;
+ assert o = "0010" severity failure;
+
+ i <= 1;
+ wait for 1 ns;
+ assert o = "0011" severity failure;
+
+ i <= -1;
+ wait for 1 ns;
+ assert o = "0001" severity failure;
+
+ wait;
+ end process;
+end behav;
diff --git a/testsuite/synth/issue1240/testsuite.sh b/testsuite/synth/issue1240/testsuite.sh
index f63808fcc..f1e668a8b 100755
--- a/testsuite/synth/issue1240/testsuite.sh
+++ b/testsuite/synth/issue1240/testsuite.sh
@@ -5,6 +5,8 @@
synth_failure issue1.vhdl -e
synth_failure issue2.vhdl -e
+synth_tb issue3
+
clean
echo "Test successful"