aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2021-03-08 22:28:07 +0100
committerTristan Gingold <tgingold@free.fr>2021-03-08 22:28:07 +0100
commit1b0d3fdfca67a3ac8adf1b98fddefc0eeacad56c (patch)
tree0232618a1a66790bffa1112963989c67af5006c1 /testsuite
parent86e924834a11200167f0a38a3193cbdaa4f2dbe1 (diff)
downloadghdl-1b0d3fdfca67a3ac8adf1b98fddefc0eeacad56c.tar.gz
ghdl-1b0d3fdfca67a3ac8adf1b98fddefc0eeacad56c.tar.bz2
ghdl-1b0d3fdfca67a3ac8adf1b98fddefc0eeacad56c.zip
testsuite/gna: add a test for #1677
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/gna/issue1677/ent.vhdl50
-rw-r--r--testsuite/gna/issue1677/repro.vhdl20
-rwxr-xr-xtestsuite/gna/issue1677/testsuite.sh10
3 files changed, 80 insertions, 0 deletions
diff --git a/testsuite/gna/issue1677/ent.vhdl b/testsuite/gna/issue1677/ent.vhdl
new file mode 100644
index 000000000..613f4f889
--- /dev/null
+++ b/testsuite/gna/issue1677/ent.vhdl
@@ -0,0 +1,50 @@
+library IEEE;
+use IEEE.std_logic_1164.all;
+use IEEE.numeric_std.all;
+
+entity saturatingadd is
+ port(
+ result : out unsigned(7 downto 0)
+ );
+end saturatingadd;
+
+architecture synth of saturatingadd is
+
+begin
+
+ process is
+ begin
+ result <= "00000000";
+ end process;
+
+end;
+
+library IEEE;
+use IEEE.std_logic_1164.all;
+use IEEE.numeric_std.all;
+use std.textio.all;
+
+entity ent is
+end ent;
+
+architecture test of ent is
+
+ component saturatingadd is
+ port(
+ result : out unsigned(7 downto 0)
+ );
+ end component;
+
+ signal result : unsigned(7 downto 0);
+
+begin
+
+ dut : saturatingadd port map(result);
+
+ process is
+ begin
+ wait for 10 ns;
+ write (output, "TEST PASSED." & LF);
+ wait;
+ end process;
+end test;
diff --git a/testsuite/gna/issue1677/repro.vhdl b/testsuite/gna/issue1677/repro.vhdl
new file mode 100644
index 000000000..adf891471
--- /dev/null
+++ b/testsuite/gna/issue1677/repro.vhdl
@@ -0,0 +1,20 @@
+library IEEE;
+use IEEE.std_logic_1164.all;
+use IEEE.numeric_std.all;
+
+entity saturatingadd is
+ port(
+ result : out unsigned(7 downto 0)
+ );
+end saturatingadd;
+
+architecture synth of saturatingadd is
+
+begin
+
+ process is
+ begin
+ result <= "00000000";
+ end process;
+
+end;
diff --git a/testsuite/gna/issue1677/testsuite.sh b/testsuite/gna/issue1677/testsuite.sh
new file mode 100755
index 000000000..cca0a99d8
--- /dev/null
+++ b/testsuite/gna/issue1677/testsuite.sh
@@ -0,0 +1,10 @@
+#! /bin/sh
+
+. ../../testenv.sh
+
+analyze_failure -Werror repro.vhdl
+analyze repro.vhdl
+
+clean
+
+echo "Test successful"