aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--testsuite/synth/issue2123/bug.vhdl16
-rwxr-xr-xtestsuite/synth/issue2123/testsuite.sh11
2 files changed, 27 insertions, 0 deletions
diff --git a/testsuite/synth/issue2123/bug.vhdl b/testsuite/synth/issue2123/bug.vhdl
new file mode 100644
index 000000000..d20de9214
--- /dev/null
+++ b/testsuite/synth/issue2123/bug.vhdl
@@ -0,0 +1,16 @@
+library IEEE;
+use IEEE.std_logic_1164.all;
+use IEEE.numeric_std.all;
+
+entity bug is
+ port (
+ a : in unsigned(8-1 downto 0);
+ b : in unsigned(8-1 downto 0);
+ d : out signed(8 downto 0)
+ );
+end bug;
+
+architecture behav of bug is
+begin
+ d <= (abs(signed('0' & a) - signed('0' & b)));
+end behav;
diff --git a/testsuite/synth/issue2123/testsuite.sh b/testsuite/synth/issue2123/testsuite.sh
new file mode 100755
index 000000000..502695e50
--- /dev/null
+++ b/testsuite/synth/issue2123/testsuite.sh
@@ -0,0 +1,11 @@
+#! /bin/sh
+
+. ../../testenv.sh
+
+synth --out=verilog bug.vhdl -e > syn_bug.v
+
+if grep abs syn_bug.v; then
+ exit 1
+fi
+
+echo "Test successful"