aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--testsuite/synth/issue1475/e.vhdl11
-rw-r--r--testsuite/synth/issue1475/e1.vhdl12
-rw-r--r--testsuite/synth/issue1475/e2.vhdl15
-rwxr-xr-xtestsuite/synth/issue1475/testsuite.sh10
4 files changed, 48 insertions, 0 deletions
diff --git a/testsuite/synth/issue1475/e.vhdl b/testsuite/synth/issue1475/e.vhdl
new file mode 100644
index 000000000..e4e6497af
--- /dev/null
+++ b/testsuite/synth/issue1475/e.vhdl
@@ -0,0 +1,11 @@
+library ieee;
+use ieee.numeric_std.all;
+
+entity e is
+end entity;
+
+architecture a of e is
+ signal s : unsigned(31 downto 0);
+begin
+ assert s = -3;
+end architecture;
diff --git a/testsuite/synth/issue1475/e1.vhdl b/testsuite/synth/issue1475/e1.vhdl
new file mode 100644
index 000000000..c1523bf4f
--- /dev/null
+++ b/testsuite/synth/issue1475/e1.vhdl
@@ -0,0 +1,12 @@
+library ieee;
+use ieee.numeric_std.all;
+use ieee.std_logic_1164.all;
+
+entity e1 is
+end entity;
+
+architecture a of e1 is
+ signal s : unsigned(31 downto 0) := (others => '0');
+begin
+ assert s = -3;
+end architecture;
diff --git a/testsuite/synth/issue1475/e2.vhdl b/testsuite/synth/issue1475/e2.vhdl
new file mode 100644
index 000000000..88b83c94d
--- /dev/null
+++ b/testsuite/synth/issue1475/e2.vhdl
@@ -0,0 +1,15 @@
+entity e2 is
+end;
+
+architecture behav of e2 is
+ type my_type is (lit1, lit2);
+
+ function "+" (l : my_type; r : natural) return my_type is
+ begin
+ return lit2;
+ end "+";
+
+ signal s : my_type := lit1;
+begin
+ assert s + (-1) = lit2;
+end behav;
diff --git a/testsuite/synth/issue1475/testsuite.sh b/testsuite/synth/issue1475/testsuite.sh
new file mode 100755
index 000000000..495223cad
--- /dev/null
+++ b/testsuite/synth/issue1475/testsuite.sh
@@ -0,0 +1,10 @@
+#! /bin/sh
+
+. ../../testenv.sh
+
+for t in e2 e1 e; do
+ synth_failure $t
+done
+clean
+
+echo "Test successful"